removed legacy UI components

This commit is contained in:
Keivan Beigi 2017-02-23 16:56:47 -08:00 committed by Taloth Saldono
parent ab12c51e0f
commit 50d4d7a19d
16 changed files with 8 additions and 332 deletions

View File

@ -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 "{}" \;

View File

@ -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');

View File

@ -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());
});

View File

@ -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/'
}
};

View File

@ -1,10 +0,0 @@
var phantom = false;
process.argv.forEach((val) => {
if (val === '--phantom') {
phantom = true;
}
});
console.log('Phantom:', phantom);
module.exports = phantom;

View File

@ -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());
});

View File

@ -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', () => {

View File

@ -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(`<dt>Age (when grabbed):</dt><dd>${age} ${unit}</dd>`);
});

View File

@ -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();
}
});

View File

@ -1,6 +0,0 @@
var vent = require('vent');
var Marionette = require('marionette');
module.exports = Marionette.ItemView.extend({
template: 'Hotkeys/HotkeysViewTemplate'
});

View File

@ -1,45 +0,0 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-sonarr-close-modal"></i></button>
<h3>Keyboard Shortcuts</h3>
</div>
<div class="modal-body hotkeys-modal">
<div class="row hotkey-group">
<div class="col-md-12">
<div class="row">
<div class="col-md-5 col-md-offset-1">
<h3>Focus Search Box</h3>
</div>
<div class="col-md-3">
<kbd class="hotkey">t</kbd>
</div>
</div>
<div class="row">
<div class="col-md-11 col-md-offset-1">
Pressing 't' puts the cursor in the search box below the navigation links
</div>
</div>
</div>
</div>
<div class="row hotkey-group">
<div class="col-md-12">
<div class="row">
<div class="col-md-5 col-md-offset-1">
<h3>Save Settings</h3>
</div>
<div class="col-md-3">
<kbd class="hotkey">ctrl + s</kbd>
</div>
</div>
<div class="row">
<div class="col-md-11 col-md-offset-1">
Pressing ctrl + 's' saves your settings (only in settings)
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
</div>

View File

@ -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;
}
}
}

View File

@ -12,7 +12,7 @@
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#3a3f51"/>
<meta name="description" content="Sonarr (Phantom)">
<meta name="description" content="Sonarr (Preview)">
<link rel="apple-touch-icon" sizes="180x180" href="/Content/Images/Icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/Content/Images/Icons/favicon-32x32.png">

View File

@ -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');

View File

@ -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);

View File

@ -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/'
}