added shared code style settings for Webstorm

pull/6/head
kay.one 12 years ago
parent 8327849e96
commit e29c07c4a5

@ -0,0 +1,10 @@
<?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" />
</component>
</module>

@ -2,8 +2,38 @@
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value />
<value>
<option name="LINE_SEPARATOR" value="&#13;&#10;" />
<option name="RIGHT_MARGIN" value="190" />
<option name="HTML_ALIGN_ATTRIBUTES" value="false" />
<CssCodeStyleSettings>
<option name="HEX_COLOR_UPPER_CASE" value="true" />
<option name="HEX_COLOR_LONG_FORMAT" value="true" />
</CssCodeStyleSettings>
<JSCodeStyleSettings>
<option name="ALIGN_OBJECT_PROPERTIES" value="2" />
</JSCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="SPACE_AFTER_COLON" value="false" />
<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>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

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

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{jQuery-1.9.1}" />
</component>
</project>

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JSHintConfiguration" version="1.1.0" use-config-file="false">
<option bitwise="true" />
<option camelcase="false" />
<option curly="true" />
<option eqeqeq="true" />
<option forin="true" />
<option immed="false" />
<option latedef="false" />
<option newcap="false" />
<option noarg="true" />
<option noempty="true" />
<option nonew="true" />
<option plusplus="false" />
<option regexp="false" />
<option undef="true" />
<option unused="false" />
<option strict="true" />
<option trailing="false" />
<option asi="false" />
<option boss="false" />
<option debug="false" />
<option eqnull="false" />
<option es5="false" />
<option esnext="false" />
<option evil="false" />
<option expr="false" />
<option funcscope="false" />
<option globalstrict="true" />
<option iterator="false" />
<option lastsemic="false" />
<option laxbreak="false" />
<option laxcomma="false" />
<option loopfunc="false" />
<option multistr="false" />
<option proto="false" />
<option onecase="false" />
<option regexdash="false" />
<option scripturl="false" />
<option smarttabs="false" />
<option shadow="false" />
<option sub="false" />
<option supernew="false" />
<option validthis="false" />
<option browser="true" />
<option couch="false" />
<option devel="false" />
<option dojo="false" />
<option jquery="false" />
<option mootools="false" />
<option node="false" />
<option nonstandard="false" />
<option prototypejs="false" />
<option rhino="false" />
<option worker="false" />
<option wsh="false" />
<option yui="false" />
<option nomen="false" />
<option onevar="false" />
<option passfail="false" />
<option white="false" />
<option maxerr="50" />
<option predef="NzbDrone, define, Backbone, _, window,Handlebars, console,require,$" />
</component>
</project>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" />
</project>

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

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

@ -1,4 +1,5 @@
define([
"use strict";
define([
'app',
'AddSeries/RootFolders/RootFolderCollection',
'Quality/QualityProfileCollection',

@ -1,8 +1,9 @@
define(['app', 'Missing/MissingModel'], function () {
"use strict";
define(['app', 'Missing/MissingModel'], function () {
NzbDrone.Missing.MissingCollection = Backbone.Collection.extend({
url: NzbDrone.Constants.ApiRoot + '/missing',
model: NzbDrone.Missing.MissingModel,
comparator: function(model) {
url : NzbDrone.Constants.ApiRoot + '/missing',
model : NzbDrone.Missing.MissingModel,
comparator: function (model) {
return model.get('airDate');
}
});

@ -2,29 +2,30 @@
define(['app', 'Missing/MissingItemView'], function (app) {
NzbDrone.Missing.MissingCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Missing.MissingItemView,
itemView : NzbDrone.Missing.MissingItemView,
itemViewContainer: 'tbody',
template: 'Missing/MissingCollectionTemplate',
template : 'Missing/MissingCollectionTemplate',
ui:{
table : '.x-missing-table',
pager : '.x-missing-table-pager'
ui: {
table: '.x-missing-table',
pager: '.x-missing-table-pager'
},
initialize: function (context, action, query, collection) {
initialize : function (context, action, query, collection) {
this.collection = collection;
},
onCompositeCollectionRendered: function() {
onCompositeCollectionRendered: function () {
this.ui.table.trigger('update');
if(!this.tableSorter && this.collection.length > 0)
{
if (!this.tableSorter && this.collection.length > 0) {
this.tableSorter = this.ui.table.tablesorter({
textExtraction: function (node) {
return node.innerHTML;
},
sortList: [[3,1]],
headers: {
sortList : [
[3, 1]
],
headers : {
0: {
sorter: 'innerHtml'
},
@ -43,45 +44,47 @@ define(['app', 'Missing/MissingItemView'], function (app) {
}
});
this.ui.table.bind('pagerComplete pagerInitialized', function(event, c){
this.ui.table.bind('pagerComplete pagerInitialized', function (event, c) {
c.container.find('.page-number').text(c.page + 1);
});
this.ui.table.tablesorterPager({
container: this.ui.pager,
output: 'Displaying {startRow} to {endRow} of {totalRows} episodes'
output : 'Displaying {startRow} to {endRow} of {totalRows} episodes'
});
this.applySortIcons();
this.ui.table.bind("sortEnd", function() {
this.ui.table.bind("sortEnd", function () {
this.applySortIcons();
});
}
else
{
else {
this.ui.table.trigger('update');
}
},
},
//Todo: Remove this from each view that requires it
applySortIcons: function() {
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function(){
applySortIcons : function () {
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function () {
$(this).remove();
});
$(this.ui.table).find('th.tablesorter-header').each(function () {
if ($(this).hasClass('tablesorter-headerDesc'))
if ($(this).hasClass('tablesorter-headerDesc')) {
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-up pull-right">');
}
else if ($(this).hasClass('tablesorter-headerAsc'))
else if ($(this).hasClass('tablesorter-headerAsc')) {
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-down pull-right">');
}
else if (!$(this).hasClass('sorter-false'))
else if (!$(this).hasClass('sorter-false')) {
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort pull-right">');
}
});
},
updatePageNumber: function(event, stuff) {
updatePageNumber : function (event, stuff) {
}
});

@ -1,7 +1,8 @@
require.config({
"use strict";
require.config({
paths: {
'backbone': 'JsLibraries/backbone',
'backbone' : 'JsLibraries/backbone',
'underscore': 'JsLibraries/underscore',
'marionette': 'JsLibraries/backbone.marionette',
'handlebars': 'JsLibraries/handlebars'
@ -11,12 +12,12 @@
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore'],
backbone : {
deps : ['underscore'],
exports: 'Backbone'
},
marionette: {
deps: ['backbone'],
deps : ['backbone'],
exports: 'Marionette'
},
handlebars: {
@ -26,7 +27,7 @@
}
});
define('app', function () {
define('app', function () {
window.NzbDrone = new Backbone.Marionette.Application();
window.NzbDrone.Series = {};
@ -55,9 +56,9 @@ define('app', function () {
window.NzbDrone.Missing = {};
window.NzbDrone.Events = {
OpenModalDialog :'openModal',
CloseModalDialog : 'closeModal'
},
OpenModalDialog : 'openModal',
CloseModalDialog: 'closeModal'
};
window.NzbDrone.Constants = {
ApiRoot: '/api'
@ -71,19 +72,26 @@ define('app', function () {
//TODO: move this out of here
Handlebars.registerHelper("formatStatus", function (status, monitored) {
if (!monitored) return '<i class="icon-pause grid-icon" title="Not Monitored"></i>';
if (status === 'Continuing') return '<i class="icon-play grid-icon" title="Continuing"></i>';
return '<i class="icon-stop grid-icon" title="Ended"></i>';
if (!monitored) {
return '<i class="icon-pause grid-icon" title="Not Monitored"></i>';
}
if (status === 'Continuing') {
return '<i class="icon-play grid-icon" title="Continuing"></i>';
}
return null;
});
NzbDrone.addRegions({
titleRegion: '#title-region',
mainRegion: '#main-region',
notificationRegion: '#notification-region',
});
return '<i class="icon-stop grid-icon" title="Ended"></i>';
});
NzbDrone.addRegions({
titleRegion : '#title-region',
mainRegion : '#main-region',
notificationRegion: '#notification-region'
});
window.NzbDrone.start();
return NzbDrone;
@ -93,3 +101,4 @@ define('app', function () {

Loading…
Cancel
Save