Removed old UI

This commit is contained in:
Keivan Beigi 2017-02-23 16:31:29 -08:00 committed by Taloth Saldono
parent 5894b4fd95
commit e343f8e35e
860 changed files with 3 additions and 99703 deletions

2
.gitignore vendored
View File

@ -120,7 +120,7 @@ _tests/
setup/Output/
*.~is
UI.Phantom/
UI/
#VS outout folders
bin

View File

@ -95,12 +95,8 @@ RunGulp()
ProgressEnd 'yarn install'
echo "##teamcity[progressStart 'Running gulp']"
CheckExitCode npm run build
CheckExitCode yarn run build --production
echo "##teamcity[progressFinish 'Running gulp']"
echo "##teamcity[progressStart 'Running gulp (phantom)']"
CheckExitCode yarn run build -- --production
echo "##teamcity[progressFinish 'Running gulp (phantom)']"
}
CreateMdbs()

View File

@ -1,18 +0,0 @@
var gulp = require('gulp');
var runSequence = require('run-sequence');
require('./clean');
require('./less');
require('./handlebars');
require('./copy');
gulp.task('build', function() {
return runSequence('clean', [
'webpack',
'less',
'handlebars',
'copyHtml',
'copyContent',
'copyJs'
]);
});

View File

@ -1,8 +0,0 @@
var gulp = require('gulp');
var del = require('del');
var paths = require('./paths');
gulp.task('clean', function() {
return del([paths.dest.root]);
});

View File

@ -1,31 +0,0 @@
var gulp = require('gulp');
var print = require('gulp-print');
var cache = require('gulp-cached');
var livereload = require('gulp-livereload');
var paths = require('./paths.js');
gulp.task('copyJs', function () {
return gulp.src(
[
paths.src.root + 'polyfills.js',
paths.src.root + 'JsLibraries/handlebars.runtime.js'
])
.pipe(cache('copyJs'))
.pipe(print())
.pipe(gulp.dest(paths.dest.root))
.pipe(livereload());
});
gulp.task('copyHtml', function () {
return gulp.src(paths.src.html)
.pipe(cache('copyHtml'))
.pipe(gulp.dest(paths.dest.root))
.pipe(livereload());
});
gulp.task('copyContent', function () {
return gulp.src([paths.src.content + '**/*.*', '!**/*.less', '!**/*.css'])
.pipe(gulp.dest(paths.dest.content))
.pipe(livereload());
});

View File

@ -1,7 +0,0 @@
module.exports = {
onError : function(error) {
//If you want details of the error in the console
console.log(error.toString());
this.emit('end');
}
};

View File

@ -1,10 +0,0 @@
require('./watch.js');
require('./build.js');
require('./clean.js');
require('./handlebars.js');
require('./copy.js');
require('./less.js');
require('./stripBom.js');
require('./imageMin.js');
require('./webpack.js');
require('./start.js');

View File

@ -1,55 +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 paths = require('./paths.js');
gulp.task('handlebars', function() {
var coreStream = gulp.src([
paths.src.templates,
'!*/**/*Partial.*'
])
.pipe(stripbom({ showLog : false }))
.pipe(handlebars())
.pipe(declare({
namespace : 'T',
noRedeclare : true,
processName : function(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())
.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

@ -1,15 +0,0 @@
var gulp = require('gulp');
var print = require('gulp-print');
var paths = require('./paths.js');
gulp.task('imageMin', function() {
var imagemin = require('gulp-imagemin');
return gulp.src(paths.src.images)
.pipe(imagemin({
progressive : false,
optimizationLevel : 4,
svgoPlugins : [{ removeViewBox : false }]
}))
.pipe(print())
.pipe(gulp.dest(paths.src.content + 'Images/'));
});

View File

@ -1,51 +0,0 @@
var gulp = require('gulp');
var less = require('gulp-less');
var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('autoprefixer');
var livereload = require('gulp-livereload');
var cleancss = require('gulp-clean-css');
var print = require('gulp-print');
var paths = require('./paths');
var errorHandler = require('./errorHandler');
gulp.task('less', function() {
var src = [
paths.src.content + 'bootstrap.less',
paths.src.content + 'theme.less',
paths.src.content + 'overrides.less',
paths.src.content + 'bootstrap.toggle-switch.css',
paths.src.content + 'fullcalendar.css',
paths.src.content + 'Messenger/messenger.css',
paths.src.content + 'Messenger/messenger.flat.css',
paths.src.root + 'Series/series.less',
paths.src.root + 'Activity/activity.less',
paths.src.root + 'AddSeries/addSeries.less',
paths.src.root + 'Calendar/calendar.less',
paths.src.root + 'Cells/cells.less',
paths.src.root + 'ManualImport/manualimport.less',
paths.src.root + 'Settings/settings.less',
paths.src.root + 'System/Logs/logs.less',
paths.src.root + 'System/Update/update.less',
paths.src.root + 'System/Info/info.less'
];
return gulp.src(src)
.pipe(print())
.pipe(sourcemaps.init())
.pipe(less({
dumpLineNumbers : 'false',
compress : false,
yuicompress : false,
ieCompat : true,
strictImports : true
}))
.pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }) ]))
.pipe(cleancss())
.on('error', errorHandler.onError)
.pipe(sourcemaps.write(paths.dest.content))
.pipe(gulp.dest(paths.dest.content))
.pipe(livereload());
});

View File

@ -1,21 +0,0 @@
var paths = {
src : {
root : './src/UI/',
templates : './src/UI/**/*.hbs',
html : './src/UI/*.html',
partials : './src/UI/**/*Partial.hbs',
scripts : './src/UI/**/*.js',
less : ['./src/UI/**/*.less'],
content : './src/UI/Content/',
images : './src/UI/Content/Images/**/*',
exclude : {
libs : '!./src/UI/JsLibraries/**'
}
},
dest : {
root : './_output/UI/',
content : './_output/UI/Content/'
}
};
module.exports = paths;

View File

@ -1,112 +0,0 @@
// will download and run sonarr (server) in a non-windows enviroment
// you can use this if you don't care about the server code and just want to work
// with the web code.
var http = require('http');
var gulp = require('gulp');
var fs = require('fs');
var targz = require('tar.gz');
var del = require('del');
var print = require('gulp-print');
var spawn = require('child_process').spawn;
function download(url, dest, cb) {
console.log('Downloading ' + url + ' to ' + dest);
var file = fs.createWriteStream(dest);
var request = http.get(url, function (response) {
response.pipe(file);
file.on('finish', function () {
console.log('Download completed');
file.close(cb);
});
});
}
function getLatest(cb) {
var branch = 'develop';
process.argv.forEach(function (val) {
var branchMatch = /branch=([\S]*)/.exec(val);
if (branchMatch && branchMatch.length > 1) {
branch = branchMatch[1];
}
});
var url = 'http://services.sonarr.tv/v1/update/' + branch + '?os=osx';
console.log('Checking for latest version:', url);
http.get(url, function (res) {
var data = '';
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function () {
var updatePackage = JSON.parse(data).updatePackage;
console.log('Latest version available: ' + updatePackage.version + ' Release Date: ' + updatePackage.releaseDate);
cb(updatePackage);
});
}).on('error', function (e) {
console.log('problem with request: ' + e.message);
});
}
function extract(source, dest, cb) {
console.log('extracting download page to ' + dest);
new targz().extract(source, dest, function (err) {
if (err) {
console.log(err);
}
console.log('Update package extracted.');
cb();
});
}
gulp.task('getSonarr', function () {
//gulp.src('/Users/kayone/git/Sonarr/_start/2.0.0.3288/NzbDrone/*.*')
// .pipe(print())
// .pipe(gulp.dest('./_output
//return;
try {
fs.mkdirSync('./_start/');
} catch (e) {
if (e.code != 'EEXIST') {
throw e;
}
}
getLatest(function (package) {
var packagePath = "./_start/" + package.filename;
var dirName = "./_start/" + package.version;
download(package.url, packagePath, function () {
extract(packagePath, dirName, function () {
// clean old binaries
console.log('Cleaning old binaries');
del.sync(['./_output/*', '!./_output/UI/']);
console.log('copying binaries to target');
gulp.src(dirName + '/NzbDrone/*.*')
.pipe(gulp.dest('./_output/'));
});
});
});
});
gulp.task('startSonarr', function () {
var ls = spawn('mono', ['--debug', './_output/NzbDrone.exe']);
ls.stdout.on('data', function (data) {
process.stdout.write('' + data);
});
ls.stderr.on('data', function (data) {
process.stdout.write('' + data);
});
ls.on('close', function (code) {
console.log('child process exited with code ' + code);
});
});

View File

@ -1,27 +0,0 @@
var gulp = require('gulp');
var paths = require('./paths.js');
var stripbom = require('gulp-stripbom');
var stripBom = function(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', function() {
stripBom(paths.src.root);
});

View File

@ -1,19 +0,0 @@
var gulp = require('gulp');
var livereload = require('gulp-livereload');
var paths = require('./paths.js');
require('./handlebars.js');
require('./less.js');
require('./copy.js');
require('./webpack.js');
gulp.task('watch', ['handlebars', 'less', 'copyHtml', 'copyContent', 'copyJs'], function () {
livereload.listen();
gulp.start('webpackWatch');
gulp.watch([paths.src.scripts, paths.src.exclude.libs], ['copyJs']);
gulp.watch(paths.src.templates, ['handlebars']);
gulp.watch([paths.src.less, paths.src.exclude.libs], ['less']);
gulp.watch([paths.src.html], ['copyHtml']);
gulp.watch([paths.src.content + '**/*.*', '!**/*.less'], ['copyContent']);
});

View File

@ -1,13 +0,0 @@
var gulp = require('gulp');
var webpackStream = require('webpack-stream');
var livereload = require('gulp-livereload');
var webpackConfig = require('../webpack.config');
gulp.task('webpack', function() {
return gulp.src('main.js').pipe(webpackStream(webpackConfig)).pipe(gulp.dest(''));
});
gulp.task('webpackWatch', function() {
webpackConfig.watch = true;
return gulp.src('main.js').pipe(webpackStream(webpackConfig)).pipe(gulp.dest('')).pipe(livereload());
});

View File

@ -1,7 +1 @@
var phantom = require('./frontend/gulp/helpers/phantom');
if (phantom) {
require('./frontend/gulp/gulpFile.js');
} else {
require('./gulp/gulpFile.js');
}
require('./frontend/gulp/gulpFile.js');

View File

@ -1 +0,0 @@
NzbDrone.UI

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jQuery-1.9.1" level="application" />
<orderEntry type="library" name="backbone.backgrid.filter.js" level="project" />
</component>
</module>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="LINE_SEPARATOR" value="&#13;&#10;" />
<option name="RIGHT_MARGIN" value="190" />
<option name="HTML_ATTRIBUTE_WRAP" value="0" />
<option name="HTML_KEEP_LINE_BREAKS" value="false" />
<option name="HTML_KEEP_BLANK_LINES" value="1" />
<option name="HTML_ALIGN_ATTRIBUTES" value="false" />
<option name="HTML_INLINE_ELEMENTS" value="" />
<option name="HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT" value="" />
<CssCodeStyleSettings>
<option name="HEX_COLOR_LOWER_CASE" value="true" />
<option name="HEX_COLOR_LONG_FORMAT" value="true" />
<option name="VALUE_ALIGNMENT" value="1" />
</CssCodeStyleSettings>
<JSCodeStyleSettings>
<option name="SPACE_BEFORE_PROPERTY_COLON" value="true" />
<option name="ALIGN_OBJECT_PROPERTIES" value="2" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="OBJECT_LITERAL_WRAP" value="2" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
</JSCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="true" />
<option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_WRAP" value="2" />
<option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

View File

@ -1,20 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="Keivan">
<words>
<w>deps</w>
<w>mixins</w>
<w>nzbdrone</w>
<w>rootdir</w>
<w>rootfolder</w>
<w>rootfolders</w>
<w>signalr</w>
<w>sonarr</w>
<w>templated</w>
<w>thetvdb</w>
<w>trakt</w>
<w>tvdb</w>
<w>xlarge</w>
<w>yyyy</w>
</words>
</dictionary>
</component>

View File

@ -1,13 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="Keivan.Beigi">
<words>
<w>backgrid</w>
<w>bnzbd</w>
<w>clickable</w>
<w>couldn</w>
<w>mouseenter</w>
<w>mouseleave</w>
<w>navbar</w>
</words>
</dictionary>
</component>

View File

@ -1,3 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="Mark" />
</component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="file://$PROJECT_DIR$/System/Logs/Files/LogFileModel.js" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@ -1,117 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
<inspection_tool class="AssignmentResultUsedJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AssignmentToForLoopParameterJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="AssignmentToFunctionParameterJS" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="BadExpressionStatementJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="BreakStatementJS" enabled="true" level="SERVER PROBLEM" enabled_by_default="true" />
<inspection_tool class="BreakStatementWithLabelJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ChainedEqualityJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CheckEmptyScriptTag" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConditionalExpressionWithIdenticalBranchesJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConstantIfStatementJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConstantOnLHSOfComparisonJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ContinueStatementWithLabelJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="CssMissingSemicolonInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CyclomaticComplexityJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_limit" value="10" />
</inspection_tool>
<inspection_tool class="DefaultNotLastCaseInSwitchJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="DuplicateCaseLabelJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="DuplicateConditionJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="DynamicallyGeneratedCodeJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="EmptyTryBlockJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ExceptionCaughtLocallyJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ForLoopReplaceableByWhileJS" enabled="true" level="INFO" enabled_by_default="true">
<option name="m_ignoreLoopsWithoutConditions" value="false" />
</inspection_tool>
<inspection_tool class="FunctionNamingConventionJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_regex" value="[a-z][A-Za-z]*" />
<option name="m_minLength" value="4" />
<option name="m_maxLength" value="32" />
</inspection_tool>
<inspection_tool class="FunctionWithInconsistentReturnsJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="HtmlFormInputWithoutLabel" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlPresentationalElement" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="2">
<item index="0" class="java.lang.String" itemvalue="name" />
<item index="1" class="java.lang.String" itemvalue="validation-name" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="8">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="icon" />
<item index="7" class="java.lang.String" itemvalue="p" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="IfStatementWithIdenticalBranchesJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="IfStatementWithTooManyBranchesJS" enabled="true" level="ERROR" enabled_by_default="true">
<option name="m_limit" value="3" />
</inspection_tool>
<inspection_tool class="JSDuplicatedDeclaration" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSLastCommaInArrayLiteral" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSPotentiallyInvalidUsageOfThis" enabled="true" level="SERVER PROBLEM" enabled_by_default="true" />
<inspection_tool class="JSUndeclaredVariable" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSUnnecessarySemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSUnresolvedFunction" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JSUnresolvedVariable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JSUnusedGlobalSymbols" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myReportUnusedDefinitions" value="true" />
<option name="myReportUnusedProperties" value="true" />
</inspection_tool>
<inspection_tool class="LabeledStatementJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="LocalVariableNamingConventionJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_regex" value="[a-z][A-Za-z]*" />
<option name="m_minLength" value="1" />
<option name="m_maxLength" value="32" />
</inspection_tool>
<inspection_tool class="NegatedIfStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="NestedAssignmentJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="NestedFunctionCallJS" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="NestedSwitchStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="NestingDepthJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_limit" value="5" />
</inspection_tool>
<inspection_tool class="NonBlockStatementBodyJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ParameterNamingConventionJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_regex" value="[a-z][A-Za-z]*" />
<option name="m_minLength" value="1" />
<option name="m_maxLength" value="32" />
</inspection_tool>
<inspection_tool class="ParametersPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_limit" value="4" />
</inspection_tool>
<inspection_tool class="ReservedWordUsedAsNameJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ReuseOfLocalVariableJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StatementsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_limit" value="30" />
</inspection_tool>
<inspection_tool class="SwitchStatementWithNoDefaultBranchJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="TailRecursionJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ThisExpressionReferencesGlobalObjectJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ThreeNegationsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnterminatedStatementJS" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreSemicolonAtEndOfBlock" value="true" />
</inspection_tool>
</profile>
</component>

View File

@ -1,7 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
</component>
</project>

View File

@ -1,72 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JSHintConfiguration" version="2.6.0" use-config-file="false">
<option asi="false" />
<option bitwise="true" />
<option boss="false" />
<option browser="true" />
<option camelcase="true" />
<option couch="false" />
<option curly="true" />
<option debug="false" />
<option devel="true" />
<option dojo="false" />
<option eqeqeq="true" />
<option eqnull="false" />
<option es3="false" />
<option esnext="false" />
<option evil="false" />
<option expr="false" />
<option forin="true" />
<option freeze="false" />
<option funcscope="false" />
<option gcl="false" />
<option globalstrict="true" />
<option immed="true" />
<option iterator="false" />
<option jquery="false" />
<option lastsemic="false" />
<option latedef="true" />
<option laxbreak="false" />
<option laxcomma="false" />
<option loopfunc="false" />
<option maxdepth="3" />
<option maxerr="50" />
<option mootools="false" />
<option moz="false" />
<option multistr="false" />
<option newcap="true" />
<option noarg="true" />
<option node="true" />
<option noempty="false" />
<option nomen="false" />
<option nonbsp="false" />
<option nonew="true" />
<option nonstandard="false" />
<option notypeof="false" />
<option noyield="false" />
<option onevar="false" />
<option passfail="false" />
<option phantom="false" />
<option plusplus="false" />
<option predef="window, define, require, module" />
<option proto="false" />
<option prototypejs="false" />
<option quotmark="single" />
<option rhino="false" />
<option scripturl="false" />
<option shadow="false" />
<option smarttabs="false" />
<option strict="false" />
<option sub="false" />
<option supernew="false" />
<option trailing="false" />
<option undef="true" />
<option unused="true" />
<option validthis="false" />
<option white="false" />
<option worker="false" />
<option wsh="false" />
<option yui="false" />
</component>
</project>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JSLintConfiguration" html="true" json="true">
<option browser="true" />
<option devel="true" />
<option indent="4" />
<option maxerr="50" />
<option plusplus="true" />
<option todo="true" />
<option white="true" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectKey">
<option name="state" value="git@github.com:NzbDrone/NzbDrone.git" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/NzbDrone.UI.iml" filepath="$PROJECT_DIR$/.idea/NzbDrone.UI.iml" />
</modules>
</component>
</project>

View File

@ -1,23 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Debug - Chrome" type="JavascriptDebugType" factoryName="JavaScript Debug" singleton="true" uri="http://localhost:8989">
<mapping url="http://localhost:8989/Calendar" local-file="$PROJECT_DIR$/Calendar" />
<mapping url="http://localhost:8989/MainMenuView.js" local-file="$PROJECT_DIR$/MainMenuView.js" />
<mapping url="http://localhost:8989/Settings" local-file="$PROJECT_DIR$/Settings" />
<mapping url="http://localhost:8989/Upcoming" local-file="$PROJECT_DIR$/Upcoming" />
<mapping url="http://localhost:8989/app.js" local-file="$PROJECT_DIR$/app.js" />
<mapping url="http://localhost:8989/Mixins" local-file="$PROJECT_DIR$/Mixins" />
<mapping url="http://localhost:8989/Wanted" local-file="$PROJECT_DIR$/Wanted" />
<mapping url="http://localhost:8989/Quality" local-file="$PROJECT_DIR$/Quality" />
<mapping url="http://localhost:8989/Config.js" local-file="$PROJECT_DIR$/Config.js" />
<mapping url="http://localhost:8989/Shared" local-file="$PROJECT_DIR$/Shared" />
<mapping url="http://localhost:8989/AddSeries" local-file="$PROJECT_DIR$/AddSeries" />
<mapping url="http://localhost:8989/HeaderView.js" local-file="$PROJECT_DIR$/HeaderView.js" />
<mapping url="http://localhost:8989" local-file="$PROJECT_DIR$" />
<mapping url="http://localhost:8989/Routing.js" local-file="$PROJECT_DIR$/Routing.js" />
<mapping url="http://localhost:8989/Controller.js" local-file="$PROJECT_DIR$/Controller.js" />
<mapping url="http://localhost:8989/Series" local-file="$PROJECT_DIR$/Series" />
<RunnerSettings RunnerId="JavascriptDebugRunner" />
<ConfigurationWrapper RunnerId="JavascriptDebugRunner" />
<method />
</configuration>
</component>

View File

@ -1,23 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Debug - Firefox" type="JavascriptDebugType" factoryName="JavaScript Debug" singleton="true" engineId="firefox" uri="http://localhost:8989">
<mapping url="http://localhost:8989/Calendar" local-file="$PROJECT_DIR$/Calendar" />
<mapping url="http://localhost:8989/MainMenuView.js" local-file="$PROJECT_DIR$/MainMenuView.js" />
<mapping url="http://localhost:8989/Settings" local-file="$PROJECT_DIR$/Settings" />
<mapping url="http://localhost:8989/Upcoming" local-file="$PROJECT_DIR$/Upcoming" />
<mapping url="http://localhost:8989/app.js" local-file="$PROJECT_DIR$/app.js" />
<mapping url="http://localhost:8989/Mixins" local-file="$PROJECT_DIR$/Mixins" />
<mapping url="http://localhost:8989/Wanted" local-file="$PROJECT_DIR$/Wanted" />
<mapping url="http://localhost:8989/Config.js" local-file="$PROJECT_DIR$/Config.js" />
<mapping url="http://localhost:8989/Quality" local-file="$PROJECT_DIR$/Quality" />
<mapping url="http://localhost:8989/AddSeries" local-file="$PROJECT_DIR$/AddSeries" />
<mapping url="http://localhost:8989/Shared" local-file="$PROJECT_DIR$/Shared" />
<mapping url="http://localhost:8989/HeaderView.js" local-file="$PROJECT_DIR$/HeaderView.js" />
<mapping url="http://localhost:8989" local-file="$PROJECT_DIR$" />
<mapping url="http://localhost:8989/Routing.js" local-file="$PROJECT_DIR$/Routing.js" />
<mapping url="http://localhost:8989/Controller.js" local-file="$PROJECT_DIR$/Controller.js" />
<mapping url="http://localhost:8989/Series" local-file="$PROJECT_DIR$/Series" />
<RunnerSettings RunnerId="JavascriptDebugRunner" />
<ConfigurationWrapper RunnerId="JavascriptDebugRunner" />
<method />
</configuration>
</component>

View File

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="NzbDrone" pattern="!file:JsLibraries//*" />
</component>

View File

@ -1,5 +0,0 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@ -1,19 +0,0 @@
{
"-W030": false,
"-W064": false,
"-W097": false,
"-W100": false,
"undef": true,
"curly": true,
"immed": true,
"eqeqeq": true,
"latedef": true,
"globals": {
"module": true,
"require": true,
"define": true,
"window": true,
"document": true,
"console": true
}
}

View File

@ -1,84 +0,0 @@
var Marionette = require('marionette');
var Backbone = require('backbone');
var Backgrid = require('backgrid');
var HistoryLayout = require('./History/HistoryLayout');
var BlacklistLayout = require('./Blacklist/BlacklistLayout');
var QueueLayout = require('./Queue/QueueLayout');
module.exports = Marionette.Layout.extend({
template : 'Activity/ActivityLayoutTemplate',
regions : {
queueRegion : '#queue',
history : '#history',
blacklist : '#blacklist'
},
ui : {
queueTab : '.x-queue-tab',
historyTab : '.x-history-tab',
blacklistTab : '.x-blacklist-tab'
},
events : {
'click .x-queue-tab' : '_showQueue',
'click .x-history-tab' : '_showHistory',
'click .x-blacklist-tab' : '_showBlacklist'
},
initialize : function(options) {
if (options.action) {
this.action = options.action.toLowerCase();
}
},
onShow : function() {
switch (this.action) {
case 'history':
this._showHistory();
break;
case 'blacklist':
this._showBlacklist();
break;
default:
this._showQueue();
}
},
_navigate : function(route) {
Backbone.history.navigate(route, {
trigger : false,
replace : true
});
},
_showHistory : function(e) {
if (e) {
e.preventDefault();
}
this.history.show(new HistoryLayout());
this.ui.historyTab.tab('show');
this._navigate('/activity/history');
},
_showBlacklist : function(e) {
if (e) {
e.preventDefault();
}
this.blacklist.show(new BlacklistLayout());
this.ui.blacklistTab.tab('show');
this._navigate('/activity/blacklist');
},
_showQueue : function(e) {
if (e) {
e.preventDefault();
}
this.queueRegion.show(new QueueLayout());
this.ui.queueTab.tab('show');
this._navigate('/activity/queue');
}
});

View File

@ -1,11 +0,0 @@
<ul class="nav nav-tabs">
<li><a href="#queue" class="x-queue-tab no-router">Queue</a></li>
<li><a href="#history" class="x-history-tab no-router">History</a></li>
<li><a href="#blacklist" class="x-blacklist-tab no-router">Blacklist</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="queue"></div>
<div class="tab-pane" id="history"></div>
<div class="tab-pane" id="blacklist"></div>
</div>

View File

@ -1,28 +0,0 @@
var vent = require('vent');
var NzbDroneCell = require('../../Cells/NzbDroneCell');
var BlacklistDetailsLayout = require('./Details/BlacklistDetailsLayout');
module.exports = NzbDroneCell.extend({
className : 'blacklist-actions-cell',
events : {
'click .x-details' : '_details',
'click .x-delete' : '_delete'
},
render : function() {
this.$el.empty();
this.$el.html('<i class="icon-sonarr-info x-details"></i>' +
'<i class="icon-sonarr-delete x-delete"></i>');
return this;
},
_details : function() {
vent.trigger(vent.Commands.OpenModalCommand, new BlacklistDetailsLayout({ model : this.model }));
},
_delete : function() {
this.model.destroy();
}
});

View File

@ -1,47 +0,0 @@
var BlacklistModel = require('./BlacklistModel');
var PageableCollection = require('backbone.pageable');
var AsSortedCollection = require('../../Mixins/AsSortedCollection');
var AsPersistedStateCollection = require('../../Mixins/AsPersistedStateCollection');
var Collection = PageableCollection.extend({
url : window.NzbDrone.ApiRoot + '/blacklist',
model : BlacklistModel,
state : {
pageSize : 15,
sortKey : 'date',
order : 1
},
queryParams : {
totalPages : null,
totalRecords : null,
pageSize : 'pageSize',
sortKey : 'sortKey',
order : 'sortDir',
directions : {
'-1' : 'asc',
'1' : 'desc'
}
},
sortMappings : {
'series' : { sortKey : 'series.sortTitle' }
},
parseState : function(resp) {
return { totalRecords : resp.totalRecords };
},
parseRecords : function(resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
Collection = AsSortedCollection.call(Collection);
Collection = AsPersistedStateCollection.call(Collection);
module.exports = Collection;

View File

@ -1,114 +0,0 @@
var vent = require('vent');
var Marionette = require('marionette');
var Backgrid = require('backgrid');
var BlacklistCollection = require('./BlacklistCollection');
var SeriesTitleCell = require('../../Cells/SeriesTitleCell');
var QualityCell = require('../../Cells/QualityCell');
var RelativeDateCell = require('../../Cells/RelativeDateCell');
var BlacklistActionsCell = require('./BlacklistActionsCell');
var GridPager = require('../../Shared/Grid/Pager');
var LoadingView = require('../../Shared/LoadingView');
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
module.exports = Marionette.Layout.extend({
template : 'Activity/Blacklist/BlacklistLayoutTemplate',
regions : {
blacklist : '#x-blacklist',
toolbar : '#x-toolbar',
pager : '#x-pager'
},
columns : [
{
name : 'series',
label : 'Series',
cell : SeriesTitleCell
},
{
name : 'sourceTitle',
label : 'Source Title',
cell : 'string'
},
{
name : 'quality',
label : 'Quality',
cell : QualityCell,
sortable : false
},
{
name : 'date',
label : 'Date',
cell : RelativeDateCell
},
{
name : 'this',
label : '',
cell : BlacklistActionsCell,
sortable : false
}
],
initialize : function() {
this.collection = new BlacklistCollection({ tableName : 'blacklist' });
this.listenTo(this.collection, 'sync', this._showTable);
this.listenTo(vent, vent.Events.CommandComplete, this._commandComplete);
},
onShow : function() {
this.blacklist.show(new LoadingView());
this._showToolbar();
this.collection.fetch();
},
_showTable : function(collection) {
this.blacklist.show(new Backgrid.Grid({
columns : this.columns,
collection : collection,
className : 'table table-hover'
}));
this.pager.show(new GridPager({
columns : this.columns,
collection : collection
}));
},
_showToolbar : function() {
var leftSideButtons = {
type : 'default',
storeState : false,
items : [
{
title : 'Clear Blacklist',
icon : 'icon-sonarr-clear',
command : 'clearBlacklist'
}
]
};
this.toolbar.show(new ToolbarLayout({
left : [
leftSideButtons
],
context : this
}));
},
_refreshTable : function(buttonContext) {
this.collection.state.currentPage = 1;
var promise = this.collection.fetch({ reset : true });
if (buttonContext) {
buttonContext.ui.icon.spinForPromise(promise);
}
},
_commandComplete : function(options) {
if (options.command.get('name') === 'clearblacklist') {
this._refreshTable();
}
}
});

View File

@ -1,11 +0,0 @@
<div id="x-toolbar"/>
<div class="row">
<div class="col-md-12">
<div id="x-blacklist" class="table-responsive"/>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="x-pager"/>
</div>
</div>

View File

@ -1,17 +0,0 @@
var Backbone = require('backbone');
var SeriesCollection = require('../../Series/SeriesCollection');
module.exports = Backbone.Model.extend({
//Hack to deal with Backbone 1.0's bug
initialize : function() {
this.url = function() {
return this.collection.url + '/' + this.get('id');
};
},
parse : function(model) {
model.series = SeriesCollection.get(model.seriesId);
return model;
}
});

View File

@ -1,14 +0,0 @@
var Marionette = require('marionette');
var BlacklistDetailsView = require('./BlacklistDetailsView');
module.exports = Marionette.Layout.extend({
template : 'Activity/Blacklist/Details/BlacklistDetailsLayoutTemplate',
regions : {
bodyRegion : '.modal-body'
},
onShow : function() {
this.bodyRegion.show(new BlacklistDetailsView({ model : this.model }));
}
});

View File

@ -1,18 +0,0 @@
<div class="modal-content">
<div class="history-detail-modal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>
Blacklisted
</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
</div>
</div>
</div>

View File

@ -1,5 +0,0 @@
var Marionette = require('marionette');
module.exports = Marionette.ItemView.extend({
template : 'Activity/Blacklist/Details/BlacklistDetailsViewTemplate'
});

View File

@ -1,23 +0,0 @@
<dl class="dl-horizontal info">
<dt>Name:</dt>
<dd>{{sourceTitle}}</dd>
{{#if protocol}}
{{#unless_eq protocol compare="unknown"}}
<dt>Protocol:</dt>
<dd>{{protocol}}</dd>
{{/unless_eq}}
{{/if}}
{{#if indexer}}
<dt>Indexer:</dt>
<dd>{{indexer}}</dd>
{{/if}}
{{#if message}}
<dt>Message:</dt>
<dd>{{message}}</dd>
{{/if}}
</dl>

View File

@ -1,22 +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>{0} {1}</dd>'.format(age, unit));
});

View File

@ -1,35 +0,0 @@
var $ = require('jquery');