From 50d4d7a19da52519a84043d271bc704e64d0bdcc Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Thu, 23 Feb 2017 16:56:47 -0800 Subject: [PATCH] removed legacy UI components --- build.sh | 3 - frontend/gulp/gulpFile.js | 2 - frontend/gulp/handlebars.js | 70 ------------------- frontend/gulp/helpers/paths.js | 11 ++- frontend/gulp/helpers/phantom.js | 10 --- frontend/gulp/less.js | 46 ------------ frontend/gulp/stripBom.js | 8 --- .../History/Details/HistoryDetailsAge.js | 21 ------ frontend/src/Hotkeys/Hotkeys.js | 34 --------- frontend/src/Hotkeys/HotkeysView.js | 6 -- frontend/src/Hotkeys/HotkeysViewTemplate.hbs | 45 ------------ frontend/src/Hotkeys/hotkeys.less | 23 ------ frontend/src/index.html | 2 +- frontend/src/vendor.js | 23 ------ .../Configuration/ConfigFileProvider.cs | 4 +- webpack.config.js | 32 --------- 16 files changed, 8 insertions(+), 332 deletions(-) delete mode 100644 frontend/gulp/handlebars.js delete mode 100644 frontend/gulp/helpers/phantom.js delete mode 100644 frontend/gulp/less.js delete mode 100644 frontend/src/Activity/History/Details/HistoryDetailsAge.js delete mode 100644 frontend/src/Hotkeys/Hotkeys.js delete mode 100644 frontend/src/Hotkeys/HotkeysView.js delete mode 100644 frontend/src/Hotkeys/HotkeysViewTemplate.hbs delete mode 100644 frontend/src/Hotkeys/hotkeys.less diff --git a/build.sh b/build.sh index 956cabdda..1ef8a7209 100755 --- a/build.sh +++ b/build.sh @@ -39,9 +39,6 @@ CleanFolder() find $path -name "FluentValidation.resources.dll" -exec rm "{}" \; find $path -name "App.config" -exec rm "{}" \; - echo "Removing .less files" - find $path -name "*.less" -exec rm "{}" \; - echo "Removing vshost files" find $path -name "*.vshost.exe" -exec rm "{}" \; diff --git a/frontend/gulp/gulpFile.js b/frontend/gulp/gulpFile.js index 821935a31..744dd8d7e 100644 --- a/frontend/gulp/gulpFile.js +++ b/frontend/gulp/gulpFile.js @@ -1,9 +1,7 @@ require('./build.js'); require('./clean.js'); require('./copy.js'); -require('./handlebars.js'); require('./imageMin.js'); -require('./less.js'); require('./start.js'); require('./stripBom.js'); require('./watch.js'); diff --git a/frontend/gulp/handlebars.js b/frontend/gulp/handlebars.js deleted file mode 100644 index 679a0b7f6..000000000 --- a/frontend/gulp/handlebars.js +++ /dev/null @@ -1,70 +0,0 @@ -var gulp = require('gulp'); -var handlebars = require('gulp-handlebars'); -var declare = require('gulp-declare'); -var concat = require('gulp-concat'); -var wrap = require('gulp-wrap'); -var livereload = require('gulp-livereload'); -var path = require('path'); -var streamqueue = require('streamqueue'); -var stripbom = require('gulp-stripbom'); -var compliler = require('handlebars'); - -var errorHandler = require('./helpers/errorHandler'); -var paths = require('./helpers/paths.js'); - -console.log('Handlebars (gulp) Version: ', compliler.VERSION); -console.log('Handlebars (gulp) Compiler: ', compliler.COMPILER_REVISION); - -gulp.task('handlebars', () => { - var coreStream = gulp.src([ - paths.src.templates, - '!*/**/*Partial.*' - ]) - .pipe(stripbom({ - showLog: false - })) - .pipe(handlebars({ - handlebars: compliler - })) - .on('error', errorHandler) - .pipe(declare({ - namespace: 'T', - noRedeclare: true, - processName: (filePath) => { - filePath = path.relative(paths.src.root, filePath); - - return filePath.replace(/\\/g, '/') - .toLocaleLowerCase() - .replace('template', '') - .replace('.js', ''); - } - })); - - var partialStream = gulp.src([paths.src.partials]) - .pipe(stripbom({ - showLog: false - })) - .pipe(handlebars({ - handlebars: compliler - })) - .on('error', errorHandler) - .pipe(wrap('Handlebars.template(<%= contents %>)')) - .pipe(wrap('Handlebars.registerPartial(<%= processPartialName(file.relative) %>, <%= contents %>)', {}, { - imports: { - processPartialName: function(fileName) { - return JSON.stringify( - path.basename(fileName, '.js') - ); - } - } - })); - - return streamqueue({ - objectMode: true - }, - partialStream, - coreStream - ).pipe(concat('templates.js')) - .pipe(gulp.dest(paths.dest.root)) - .pipe(livereload()); -}); diff --git a/frontend/gulp/helpers/paths.js b/frontend/gulp/helpers/paths.js index 88498d6f7..b96b5aaeb 100644 --- a/frontend/gulp/helpers/paths.js +++ b/frontend/gulp/helpers/paths.js @@ -3,11 +3,8 @@ const root = './frontend/src/'; const paths = { src: { root, - templates: root + '**/*.hbs', html: root + '*.html', - partials: root + '**/*Partial.hbs', scripts: root + '**/*.js', - less: [root + '**/*.less'], content: root + 'Content/', fonts: root + 'Content/Fonts/', images: root + 'Content/Images/', @@ -16,10 +13,10 @@ const paths = { } }, dest: { - root: './_output/UI.Phantom/', - content: './_output/UI.Phantom/Content/', - fonts: './_output/UI.Phantom/Content/Fonts/', - images: './_output/UI.Phantom/Content/Images/' + root: './_output/UI/', + content: './_output/UI/Content/', + fonts: './_output/UI/Content/Fonts/', + images: './_output/UI/Content/Images/' } }; diff --git a/frontend/gulp/helpers/phantom.js b/frontend/gulp/helpers/phantom.js deleted file mode 100644 index 1d696853a..000000000 --- a/frontend/gulp/helpers/phantom.js +++ /dev/null @@ -1,10 +0,0 @@ -var phantom = false; -process.argv.forEach((val) => { - if (val === '--phantom') { - phantom = true; - } -}); - -console.log('Phantom:', phantom); - -module.exports = phantom; diff --git a/frontend/gulp/less.js b/frontend/gulp/less.js deleted file mode 100644 index 797cb80cf..000000000 --- a/frontend/gulp/less.js +++ /dev/null @@ -1,46 +0,0 @@ -const gulp = require('gulp'); - -const less = require('gulp-less'); -const postcss = require('gulp-postcss'); -const sourcemaps = require('gulp-sourcemaps'); -const autoprefixer = require('autoprefixer'); -const livereload = require('gulp-livereload'); -const path = require('path'); - -const print = require('gulp-print'); -const paths = require('./helpers/paths'); -const errorHandler = require('./helpers/errorHandler'); - -gulp.task('less', () => { - const src = [ - path.join(paths.src.content, 'Bootstrap', 'bootstrap.less'), - path.join(paths.src.content, 'Vendor', 'vendor.less'), - path.join(paths.src.content, 'sonarr.less') - ]; - - return gulp.src(src) - .pipe(print()) - .pipe(sourcemaps.init()) - .pipe(less({ - paths: [paths.src.root], - dumpLineNumbers: 'false', - compress: true, - yuicompress: true, - ieCompat: true, - strictImports: true - })) - .on('error', errorHandler) - .pipe(postcss([autoprefixer({ - browsers: ['last 2 versions'] - })])) - .on('error', errorHandler) - - // not providing a path will cause the source map - // to be embeded. which makes livereload much happier - // since it doesn't reload the whole page to load the map. - // this should be switched to sourcemaps.write('./') for production builds - .pipe(sourcemaps.write()) - .pipe(gulp.dest(paths.dest.content)) - .on('error', errorHandler) - .pipe(livereload()); -}); diff --git a/frontend/gulp/stripBom.js b/frontend/gulp/stripBom.js index 86a20bbe9..080b86dfe 100644 --- a/frontend/gulp/stripBom.js +++ b/frontend/gulp/stripBom.js @@ -6,14 +6,6 @@ function stripBom(dest) { gulp.src([paths.src.scripts, paths.src.exclude.libs]) .pipe(stripbom({ showLog: false })) .pipe(gulp.dest(dest)); - - gulp.src(paths.src.less) - .pipe(stripbom({ showLog: false })) - .pipe(gulp.dest(dest)); - - gulp.src(paths.src.templates) - .pipe(stripbom({ showLog: false })) - .pipe(gulp.dest(dest)); } gulp.task('stripBom', () => { diff --git a/frontend/src/Activity/History/Details/HistoryDetailsAge.js b/frontend/src/Activity/History/Details/HistoryDetailsAge.js deleted file mode 100644 index c702014ce..000000000 --- a/frontend/src/Activity/History/Details/HistoryDetailsAge.js +++ /dev/null @@ -1,21 +0,0 @@ -var Handlebars = require('handlebars'); -var FormatHelpers = require('Shared/FormatHelpers'); - -Handlebars.registerHelper('historyAge', function() { - var age = this.age; - var unit = FormatHelpers.plural(Math.round(age), 'day'); - var ageHours = parseFloat(this.ageHours); - var ageMinutes = this.ageMinutes ? parseFloat(this.ageMinutes) : null; - - if (age < 2) { - age = ageHours.toFixed(1); - unit = FormatHelpers.plural(Math.round(ageHours), 'hour'); - } - - if (age < 2 && ageMinutes) { - age = parseFloat(ageMinutes).toFixed(1); - unit = FormatHelpers.plural(Math.round(ageMinutes), 'minute'); - } - - return new Handlebars.SafeString(`
Age (when grabbed):
${age} ${unit}
`); -}); diff --git a/frontend/src/Hotkeys/Hotkeys.js b/frontend/src/Hotkeys/Hotkeys.js deleted file mode 100644 index 9aa64914b..000000000 --- a/frontend/src/Hotkeys/Hotkeys.js +++ /dev/null @@ -1,34 +0,0 @@ -var $ = require('jquery'); -var vent = require('vent'); -var HotkeysView = require('./HotkeysView'); - -$(document).on('keypress', function(e) { - if ($(e.target).is('input') || $(e.target).is('textarea')) { - return; - } - - if (e.charCode === 63) { - vent.trigger(vent.Commands.OpenFullscreenModal, new HotkeysView()); - } -}); - -$(document).on('keydown', function(e) { - if (e.ctrlKey && e.keyCode === 83) { - vent.trigger(vent.Hotkeys.SaveSettings); - e.preventDefault(); - return; - } - - if ($(e.target).is('input') || $(e.target).is('textarea')) { - return; - } - - if (e.ctrlKey || e.metaKey || e.altKey) { - return; - } - - if (e.keyCode === 84) { - vent.trigger(vent.Hotkeys.NavbarSearch); - e.preventDefault(); - } -}); diff --git a/frontend/src/Hotkeys/HotkeysView.js b/frontend/src/Hotkeys/HotkeysView.js deleted file mode 100644 index 67575c726..000000000 --- a/frontend/src/Hotkeys/HotkeysView.js +++ /dev/null @@ -1,6 +0,0 @@ -var vent = require('vent'); -var Marionette = require('marionette'); - -module.exports = Marionette.ItemView.extend({ - template: 'Hotkeys/HotkeysViewTemplate' -}); diff --git a/frontend/src/Hotkeys/HotkeysViewTemplate.hbs b/frontend/src/Hotkeys/HotkeysViewTemplate.hbs deleted file mode 100644 index b0b181603..000000000 --- a/frontend/src/Hotkeys/HotkeysViewTemplate.hbs +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/frontend/src/Hotkeys/hotkeys.less b/frontend/src/Hotkeys/hotkeys.less deleted file mode 100644 index 3e06b5c18..000000000 --- a/frontend/src/Hotkeys/hotkeys.less +++ /dev/null @@ -1,23 +0,0 @@ -.hotkeys-modal { - h3 { - margin-top: 0px; - margin-botton: 0px; - } - - .hotkey-group { - &:first-of-type { - margin-top: 0px; - } - - &:last-of-type { - margin-bottom: 0px; - } - - margin-top: 25px; - margin-bottom: 25px; - - .hotkey { - font-size: 22px; - } - } -} diff --git a/frontend/src/index.html b/frontend/src/index.html index 99fbfb103..8e13b9452 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -12,7 +12,7 @@ - + diff --git a/frontend/src/vendor.js b/frontend/src/vendor.js index 68394a5f7..2b08817be 100644 --- a/frontend/src/vendor.js +++ b/frontend/src/vendor.js @@ -3,26 +3,3 @@ require('lodash'); require('moment'); // require('signalR'); -// require('jquery-ui'); -// require('jquery.easypiechart'); -// require('jquery.dotdotdot'); -// require('typeahead'); -// require('zero.clipboard'); - -/* Bootstrap */ -// require('bootstrap'); -// require('bootstrap.tagsinput'); - -/* Backbone */ -// require('backbone'); -// require('backbone.deepmodel'); -// require('backbone.paginator'); - -// require('backbone.modelbinder'); -// require('backbone.collectionview'); -// require('backgrid'); -// require('backgrid.paginator'); -// require('backgrid.selectall'); - -// require('marionette'); // this brings in a bunch of our code into this chunk because of template helpers. -// require('vent'); diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 9c2143053..66535daae 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -197,7 +197,9 @@ namespace NzbDrone.Core.Configuration } } - public string UiFolder => GetValue("UiFolder", "UI", false); + // public string UiFolder => GetValue("UiFolder", "UI", false);GetValue("UiFolder", "UI", false); + public string UiFolder => "UI"; + public bool UpdateAutomatically => GetValueBoolean("UpdateAutomatically", false, false); diff --git a/webpack.config.js b/webpack.config.js index 849922f70..e47ff06a8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,38 +16,6 @@ module.exports = { resolve: { root: root, alias: { - 'vent': 'vent', - 'backbone': 'Shims/backbone', - 'moment': 'JsLibraries/moment', - 'filesize': 'JsLibraries/filesize', - 'handlebars': 'Shims/handlebars', - 'handlebars.helpers': 'JsLibraries/handlebars.helpers', - 'bootstrap': 'JsLibraries/bootstrap', - 'backbone.deepmodel': 'Shims/backbone.deep.model', - 'backbone.pageable': 'JsLibraries/backbone.pageable', - 'backbone-pageable': 'JsLibraries/backbone.pageable', - 'backbone.paginator': 'JsLibraries/backbone.paginator', - 'backbone.validation': 'Shims/backbone.validation', - 'backbone.modelbinder': 'JsLibraries/backbone.modelbinder', - 'backbone.collectionview': 'Shims/backbone.collectionview', - 'backgrid': 'Shims/backgrid', - 'backgrid.paginator': 'Shims/backgrid.paginator', - 'backgrid.selectall': 'Shims/backbone.backgrid.selectall', - 'fullcalendar': 'JsLibraries/fullcalendar', - 'backstrech': 'JsLibraries/jquery.backstretch', - 'underscore': 'Shims/underscore', - 'marionette': 'Shims/backbone.marionette', - 'signalR': 'Shims/jquery.signalR', - 'jquery-ui': 'JsLibraries/jquery-ui', - 'jquery.knob': 'JsLibraries/jquery.knob', - 'jquery.easypiechart': 'JsLibraries/jquery.easypiechart', - 'jquery.dotdotdot': 'JsLibraries/jquery.dotdotdot', - 'jquery.lazyload': 'JsLibraries/jquery.lazyload', - 'messenger': 'Shims/messenger', - 'jquery': 'Shims/jquery', - 'typeahead': 'JsLibraries/typeahead', - 'zero.clipboard': 'JsLibraries/zero.clipboard', - 'bootstrap.tagsinput': 'JsLibraries/bootstrap.tagsinput', 'jdu': 'JsLibraries/jdu', 'libs': 'JsLibraries/' }