From 1d8da9a7683fd97a5d7598e0d81c13be987c9df3 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 21 May 2013 20:22:21 +0200 Subject: [PATCH] fix some javascript warnings --- .../sonia.action.changepasswordwindow.js | 2 +- .../js/action/sonia.action.exceptionwindow.js | 2 +- .../js/config/sonia.config.configform.js | 4 +- .../js/config/sonia.config.configpanel.js | 2 +- .../config/sonia.config.repositoryconfig.js | 2 +- .../js/config/sonia.config.scmconfigpanel.js | 2 +- .../js/group/sonia.group.memberformpanel.js | 2 +- .../resources/js/login/sonia.login.form.js | 2 +- .../navigation/sonia.navigation.navpanel.js | 2 +- .../navigation/sonia.navigation.navsection.js | 8 ++-- .../resources/js/override/ext.data.store.js | 4 +- .../resources/js/override/ext.form.field.js | 2 +- .../resources/js/override/ext.form.vtypes.js | 2 +- .../js/override/ext.grid.columnmodel.js | 4 +- .../js/override/ext.grid.gridpanel.js | 2 +- .../js/override/ext.grid.groupingview.js | 4 +- .../resources/js/override/ext.util.format.js | 4 +- .../sonia.panel.syntaxhighlighterpanel.js | 4 +- .../resources/js/plugin/sonia.plugin.grid.js | 6 +-- .../repository/sonia.repository.blamepanel.js | 6 +-- .../sonia.repository.changesetpanel.js | 12 +++--- .../sonia.repository.changesetviewergrid.js | 10 ++--- .../sonia.repository.changesetviewerpanel.js | 10 ++--- .../sonia.repository.commitpanel.js | 4 +- .../sonia.repository.contentpanel.js | 16 ++++---- .../repository/sonia.repository.diffpanel.js | 4 +- .../sonia.repository.extendedinfopanel.js | 4 +- .../repository/sonia.repository.formpanel.js | 2 +- .../js/repository/sonia.repository.grid.js | 8 ++-- .../sonia.repository.importwindow.js | 2 +- .../js/repository/sonia.repository.js | 28 ++++++------- .../sonia.repository.permissionformpanel.js | 8 ++-- .../sonia.repository.propertiesformpanel.js | 4 +- .../sonia.repository.repositorybrowser.js | 32 +++++++-------- .../resources/js/rest/sonia.rest.grid.js | 6 +-- .../webapp/resources/js/rest/sonia.rest.js | 4 +- .../resources/js/rest/sonia.rest.jsonstore.js | 3 +- .../main/webapp/resources/js/sonia.global.js | 6 +-- .../main/webapp/resources/js/sonia.history.js | 4 +- .../src/main/webapp/resources/js/sonia.scm.js | 40 +++++++++---------- .../sonia.uistate.webstorageprovider.js | 2 +- .../webapp/resources/js/util/sonia.util.js | 32 +++++++-------- .../resources/js/util/sonia.util.link.js | 3 +- 43 files changed, 156 insertions(+), 154 deletions(-) diff --git a/scm-webapp/src/main/webapp/resources/js/action/sonia.action.changepasswordwindow.js b/scm-webapp/src/main/webapp/resources/js/action/sonia.action.changepasswordwindow.js index 6f80d109d6..35ba82adb2 100644 --- a/scm-webapp/src/main/webapp/resources/js/action/sonia.action.changepasswordwindow.js +++ b/scm-webapp/src/main/webapp/resources/js/action/sonia.action.changepasswordwindow.js @@ -96,7 +96,7 @@ Sonia.action.ChangePasswordWindow = Ext.extend(Ext.Window,{ handler: this.cancel }] }] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.action.ChangePasswordWindow.superclass.initComponent.apply(this, arguments); diff --git a/scm-webapp/src/main/webapp/resources/js/action/sonia.action.exceptionwindow.js b/scm-webapp/src/main/webapp/resources/js/action/sonia.action.exceptionwindow.js index 85a7a7feb6..08f6143f4b 100644 --- a/scm-webapp/src/main/webapp/resources/js/action/sonia.action.exceptionwindow.js +++ b/scm-webapp/src/main/webapp/resources/js/action/sonia.action.exceptionwindow.js @@ -77,7 +77,7 @@ Sonia.action.ExceptionWindow = Ext.extend(Ext.Window,{ scope: this, handler: this.showDetails }] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.action.ChangePasswordWindow.superclass.initComponent.apply(this, arguments); diff --git a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configform.js b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configform.js index 7bd033e815..bcbeff5f92 100644 --- a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configform.js +++ b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configform.js @@ -73,7 +73,7 @@ Sonia.config.ConfigForm = Ext.extend(Ext.form.FormPanel, { }, listeners: { render: function(){ - if ( this.onLoad != null && Ext.isFunction( this.onLoad ) ){ + if ( this.onLoad !== null && Ext.isFunction( this.onLoad ) ){ this.onLoad(this.el); } }, @@ -108,7 +108,7 @@ Sonia.config.ConfigForm = Ext.extend(Ext.form.FormPanel, { submitForm: function(){ var form = this.getForm(); - if ( this.onSubmit != null && Ext.isFunction( this.onSubmit ) ){ + if ( this.onSubmit !== null && Ext.isFunction( this.onSubmit ) ){ this.onSubmit( form.getValues() ); } } diff --git a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configpanel.js b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configpanel.js index 51f2904243..a465f60e15 100644 --- a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.configpanel.js @@ -45,7 +45,7 @@ Sonia.config.ConfigPanel = Ext.extend(Ext.Panel, { collapsible: false, collapsed: false, items: this.panels - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.config.ConfigPanel.superclass.initComponent.apply(this, arguments); diff --git a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.repositoryconfig.js b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.repositoryconfig.js index 68f5a1dda7..eda05258af 100644 --- a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.repositoryconfig.js +++ b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.repositoryconfig.js @@ -36,7 +36,7 @@ Sonia.config.RepositoryConfig = Ext.extend(Sonia.config.ConfigPanel,{ var config = { title: main.tabRepositoryTypesText, panels: repositoryConfigPanels - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.config.RepositoryConfig.superclass.initComponent.apply(this, arguments); diff --git a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.scmconfigpanel.js b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.scmconfigpanel.js index f444dcdb31..7aa5875add 100644 --- a/scm-webapp/src/main/webapp/resources/js/config/sonia.config.scmconfigpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/config/sonia.config.scmconfigpanel.js @@ -264,7 +264,7 @@ Sonia.config.ScmConfigPanel = Ext.extend(Sonia.config.ConfigPanel,{ }); } }, generalConfigPanels] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.config.ScmConfigPanel.superclass.initComponent.apply(this, arguments); diff --git a/scm-webapp/src/main/webapp/resources/js/group/sonia.group.memberformpanel.js b/scm-webapp/src/main/webapp/resources/js/group/sonia.group.memberformpanel.js index 5714cddee8..c0bd17716f 100644 --- a/scm-webapp/src/main/webapp/resources/js/group/sonia.group.memberformpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/group/sonia.group.memberformpanel.js @@ -157,7 +157,7 @@ Sonia.group.MemberFormPanel = Ext.extend(Sonia.group.FormPanel, { var members = []; this.memberStore.data.each(function(record){ members.push( record.data.member ); - }) + }); item.members = members; }, diff --git a/scm-webapp/src/main/webapp/resources/js/login/sonia.login.form.js b/scm-webapp/src/main/webapp/resources/js/login/sonia.login.form.js index aec8decb96..e26f795556 100644 --- a/scm-webapp/src/main/webapp/resources/js/login/sonia.login.form.js +++ b/scm-webapp/src/main/webapp/resources/js/login/sonia.login.form.js @@ -139,7 +139,7 @@ Sonia.login.Form = Ext.extend(Ext.FormPanel,{ }, specialKeyPressed: function(field, e){ - if (e.getKey() == e.ENTER) { + if (e.getKey() === e.ENTER) { var form = this.getForm(); if ( form.isValid() ){ this.authenticate(); diff --git a/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navpanel.js b/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navpanel.js index 340ef1c41c..c1d62d38fc 100644 --- a/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navpanel.js @@ -49,7 +49,7 @@ Sonia.navigation.NavPanel = Ext.extend(Ext.Panel, { }, renderSections: function(){ - if ( this.sections != null ){ + if ( this.sections !== null ){ this.addSections( this.sections ); } }, diff --git a/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navsection.js b/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navsection.js index 85cdb7a4b1..17ac3d51e1 100644 --- a/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navsection.js +++ b/scm-webapp/src/main/webapp/resources/js/navigation/sonia.navigation.navsection.js @@ -44,10 +44,10 @@ Sonia.navigation.NavSection = Ext.extend(Ext.Panel, { initComponent: function(){ - if ( this.links == null ){ + if ( this.links === null ){ this.links = this.items; } - if ( this.links == null ){ + if ( this.links === null ){ this.links = []; } @@ -59,7 +59,7 @@ Sonia.navigation.NavSection = Ext.extend(Ext.Panel, { frame: true, collapsible:true, style: 'margin: 5px' - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.navigation.NavSection.superclass.initComponent.apply(this, arguments); @@ -68,7 +68,7 @@ Sonia.navigation.NavSection = Ext.extend(Ext.Panel, { doAction: function(e, t){ e.stopEvent(); Ext.each(this.links, function(navItem){ - if ( navItem.id == t.id && Ext.isFunction(navItem.fn) ){ + if ( navItem.id === t.id && Ext.isFunction(navItem.fn) ){ var scope = navItem.scope; if ( Ext.isObject( scope )){ navItem.fn.call(scope); diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.data.store.js b/scm-webapp/src/main/webapp/resources/js/override/ext.data.store.js index db896fe1d5..2f0596f20b 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.data.store.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.data.store.js @@ -33,9 +33,9 @@ Ext.override(Ext.data.Store,{ addField: function(field){ field = new Ext.data.Field(field); this.recordType.prototype.fields.replace(field); - if(typeof field.defaultValue != 'undefined'){ + if(typeof field.defaultValue !== 'undefined'){ this.each(function(r){ - if(typeof r.data[field.name] == 'undefined'){ + if(typeof r.data[field.name] === 'undefined'){ r.data[field.name] = field.defaultValue; } }); diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.form.field.js b/scm-webapp/src/main/webapp/resources/js/override/ext.form.field.js index 759d1895c7..5e74d2d44a 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.form.field.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.form.field.js @@ -34,7 +34,7 @@ Ext.form.Field.prototype.afterRenderExt = Ext.form.Field.prototype.afterRender; Ext.override(Ext.form.Field, { afterRender : function() { - if ( this.helpText != null ){ + if ( this.helpText !== null ){ this.renderHelp( this.helpText ); } this.afterRenderExt.apply(this, arguments); diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.form.vtypes.js b/scm-webapp/src/main/webapp/resources/js/override/ext.form.vtypes.js index b5c8edb7c7..80a5dec976 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.form.vtypes.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.form.vtypes.js @@ -36,7 +36,7 @@ Ext.apply(Ext.form.VTypes, { password: function(val, field) { if (field.initialPassField) { var pwd = Ext.getCmp(field.initialPassField); - return (val == pwd.getValue()); + return (val === pwd.getValue()); } return true; }, diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.grid.columnmodel.js b/scm-webapp/src/main/webapp/resources/js/override/ext.grid.columnmodel.js index e8c2922b7e..75fd7a6074 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.grid.columnmodel.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.grid.columnmodel.js @@ -31,7 +31,7 @@ Ext.override(Ext.grid.ColumnModel,{ addColumn: function(column, colIndex){ - if(typeof column == 'string'){ + if(typeof column === 'string'){ column = { header: column, dataIndex: column @@ -39,7 +39,7 @@ Ext.override(Ext.grid.ColumnModel,{ } var config = this.config; this.config = []; - if(typeof colIndex == 'number'){ + if(typeof colIndex === 'number'){ config.splice(colIndex, 0, column); }else{ colIndex = config.push(column); diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.grid.gridpanel.js b/scm-webapp/src/main/webapp/resources/js/override/ext.grid.gridpanel.js index 8784954eba..97fa30a4fa 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.grid.gridpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.grid.gridpanel.js @@ -51,7 +51,7 @@ Ext.override(Ext.grid.GridPanel,{ removeColumn: function(name, colIndex){ this.store.removeField(name); - if(typeof colIndex != 'number'){ + if(typeof colIndex !== 'number'){ colIndex = this.colModel.findColumnIndex(name); } if(colIndex >= 0){ diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.grid.groupingview.js b/scm-webapp/src/main/webapp/resources/js/override/ext.grid.groupingview.js index 18fd547420..0bcc883f57 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.grid.groupingview.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.grid.groupingview.js @@ -58,9 +58,9 @@ Ext.override(Ext.grid.GroupingView,{ getPrefix: function(field){ var prefix; - if ( this.idPrefix == '{grid.id}' ){ + if ( this.idPrefix === '{grid.id}' ){ prefix = this.grid.getId(); - } else if (this.idPrefix == '{grid.el.id}') { + } else if (this.idPrefix === '{grid.el.id}') { prefix = this.grid.getGridEl().id; } else { prefix = this.idPrefix; diff --git a/scm-webapp/src/main/webapp/resources/js/override/ext.util.format.js b/scm-webapp/src/main/webapp/resources/js/override/ext.util.format.js index ac33b71cce..c0e3429144 100644 --- a/scm-webapp/src/main/webapp/resources/js/override/ext.util.format.js +++ b/scm-webapp/src/main/webapp/resources/js/override/ext.util.format.js @@ -33,9 +33,9 @@ Ext.apply(Ext.util.Format, { formatTimestamp: function(value){ var result = ''; - if ( value != null && (value > 0 || value.length > 0)){ + if ( value !== null && (value > 0 || value.length > 0)){ var df = state.clientConfig.dateFormat; - if ( df == null || df.length == 0 || ! Ext.isDefined(value) ){ + if ( df === null || df.length === 0 || ! Ext.isDefined(value) ){ df = "YYYY-MM-DD HH:mm:ss"; } result = moment(value).format(df); diff --git a/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js b/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js index adb2dfc198..61c059b45c 100644 --- a/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js @@ -148,13 +148,13 @@ Sonia.panel.SyntaxHighlighterPanel = Ext.extend(Ext.Panel, { console.debug( 'try to find brush for ' + this.syntax ); } - if ( this.syntax != 'plain' ){ + if ( this.syntax !== 'plain' ){ var s = null; var found = false; for (var i=0; i', this.repository.name, ':', this.revision], items: [panel] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.ChangesetPanel.superclass.initComponent.apply(this, arguments); @@ -99,7 +99,7 @@ Sonia.repository.ChangesetPanel = Ext.extend(Ext.Panel, { xtype: 'commitPanel', repository: this.repository, revision: this.revision - } + }; }, createDiffPanel: function(){ @@ -108,7 +108,7 @@ Sonia.repository.ChangesetPanel = Ext.extend(Ext.Panel, { xtype: 'syntaxHighlighterPanel', syntax: 'diff', contentUrl: this.createDiffUrl() - } + }; }, createDiffUrl: function(){ @@ -159,10 +159,10 @@ Sonia.History.register('changesetPanel', { }, onChange: function(repoId, revision, view){ - if (revision == 'null'){ + if (revision === 'null'){ revision = null; } - if (!view || view == 'null'){ + if (!view || view === 'null'){ view = 'commit'; } var id = 'changesetPanel;' + repoId + ';' + revision; @@ -177,7 +177,7 @@ Sonia.History.register('changesetPanel', { view: view, closable: true, autoScroll: true - } + }; } else { panel.loadPanel(view); } diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewergrid.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewergrid.js index a30072ef0f..4131c6bff2 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewergrid.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewergrid.js @@ -105,7 +105,7 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, { scope: this } } - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.ChangesetViewerGrid.superclass.initComponent.apply(this, arguments); @@ -167,9 +167,9 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, { renderChangesetMetadata: function(author, p, record){ var authorValue = ''; - if ( author != null ){ + if ( author !== null ){ authorValue = author.name; - if ( author.mail != null ){ + if ( author.mail !== null ){ authorValue += ' ' + String.format(this.mailTemplate, author.mail); } } @@ -178,7 +178,7 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, { // description = Ext.util.Format.htmlEncode(description); // } var date = record.data.date; - if ( date != null ){ + if ( date !== null ){ date = Ext.util.Format.formatTimestamp(date); } return String.format( @@ -198,7 +198,7 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, { getLabeledValue: function(label, array){ var result = ''; - if ( array != null && array.length > 0 ){ + if ( array !== null && array.length > 0 ){ result = label + ': ' + Sonia.util.getStringFromArray(array); } return result; diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewerpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewerpanel.js index 03ff5c1fbd..3e276d2c27 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewerpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewerpanel.js @@ -56,7 +56,7 @@ Sonia.repository.ChangesetViewerPanel = Ext.extend(Ext.Panel, { var params = { start: this.start, limit: this.startLimit - } + }; var baseParams = {}; @@ -100,7 +100,7 @@ Sonia.repository.ChangesetViewerPanel = Ext.extend(Ext.Panel, { }; if ( ! this.inline ){ - config.title = String.format(this.changesetViewerTitleText, this.repository.name) + config.title = String.format(this.changesetViewerTitleText, this.repository.name); var type = Sonia.repository.getTypeByName( this.repository.type ); if ( type && type.supportedCommands && type.supportedCommands.indexOf('BRANCHES') >= 0){ @@ -112,7 +112,7 @@ Sonia.repository.ChangesetViewerPanel = Ext.extend(Ext.Panel, { displayInfo: true, pageSize: this.pageSize, prependButtons: true - } + }; } Ext.apply(this, Ext.apply(this.initialConfig, config)); @@ -154,7 +154,7 @@ Sonia.repository.ChangesetViewerPanel = Ext.extend(Ext.Panel, { } } }] - } + }; }, selectBranch: function(combo, rec){ @@ -229,7 +229,7 @@ Sonia.History.register('repositoryChangesetViewerPanel', { pageSize: limit, closable: true, autoScroll: true - } + }; } else { panel.loadChangesets(start, limit); } diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js index b28bfc9174..b3456e6fae 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js @@ -97,7 +97,7 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, { padding: 10, autoScroll: true, items: [this.commitPanel, this.diffPanel] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.CommitPanel.superclass.initComponent.apply(this, arguments); @@ -122,7 +122,7 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, { scope: this, success: function(response){ var changeset = Ext.decode(response.responseText); - this.update(changeset) + this.update(changeset); }, failure: function(result){ main.handleRestFailure( diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.contentpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.contentpanel.js index 8fd643863b..cc73ec2069 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.contentpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.contentpanel.js @@ -81,7 +81,7 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, { }], bbar: bottomBar, items: [panel] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.ContentPanel.superclass.initComponent.apply(this, arguments); @@ -111,7 +111,7 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, { // TODO find a better way pageSize: 9999, startLimit: -1 - } + }; }, openHistoryPanel: function(){ @@ -125,7 +125,7 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, { xtype: 'syntaxHighlighterPanel', syntax: Sonia.util.getExtension(this.path), contentUrl: this.contentUrl - } + }; }, openSyntaxPanel: function(){ @@ -140,7 +140,7 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, { repository: this.repository, revision: this.revision, path: this.path - } + }; }, openBlamePanel: function(){ @@ -172,7 +172,7 @@ Sonia.repository.ContentPanel = Ext.extend(Ext.Panel, { appendRepositoryProperties: function(bar){ bar.push('->',this.repository.name); - if ( this.revision != null ){ + if ( this.revision !== null ){ bar.push(': ', this.revision); } }, @@ -205,10 +205,10 @@ Sonia.History.register('contentPanel', { }, onChange: function(repoId, revision, path, view){ - if (revision == 'null'){ + if (revision === 'null'){ revision = null; } - if (!view || view == 'null'){ + if (!view || view === 'null'){ view = 'content'; } var id = 'contentPanel;' + repoId + ';' + revision + ';' + path; @@ -224,7 +224,7 @@ Sonia.History.register('contentPanel', { view: view, closable: true, autoScroll: true - } + }; } else { panel.loadPanel(view); } diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.diffpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.diffpanel.js index c5abf52472..8cd1b5d90e 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.diffpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.diffpanel.js @@ -54,7 +54,7 @@ Sonia.repository.DiffPanel = Ext.extend(Ext.Panel, { syntax: 'diff', contentUrl: this.diffUrl }] - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.DiffPanel.superclass.initComponent.apply(this, arguments); @@ -92,7 +92,7 @@ Sonia.History.register('diffPanel', { revision: revision, closable: true, autoScroll: true - } + }; } main.addTab(panel); }); diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js index 11a1af60ed..15b2d301fe 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.extendedinfopanel.js @@ -45,7 +45,7 @@ Sonia.repository.ExtendedInfoPanel = Ext.extend(Sonia.repository.InfoPanel,{ modifyDefaultConfig: function(config){ var items = config.items; - if ( items == null ){ + if ( items === null ){ items = []; } items.push({ @@ -99,7 +99,7 @@ Sonia.repository.ExtendedInfoPanel = Ext.extend(Sonia.repository.InfoPanel,{ xtype: 'repositoryBrowser', repository: this.item, closable: true - } + }; }, openRepositoryBrowser: function(browser){ diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.formpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.formpanel.js index 5d51db40f9..d717a77daf 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.formpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.formpanel.js @@ -105,7 +105,7 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ getIdFromResponse: function(response){ var id = null; - var location = response.getResponseHeader('Location') + var location = response.getResponseHeader('Location'); if (location){ var parts = location.split('/'); id = parts[parts.length - 1]; diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js index b24e6f1ca4..c086072f66 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js @@ -275,7 +275,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, { }, renderGroupName: function(v){ - if (v == 'zzz__'){ + if (v === 'zzz__'){ v = this.mainGroup; } return v; @@ -350,7 +350,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, { var desc = rec.get('description'); return (! query || rec.get('name').toLowerCase().indexOf(query) >= 0 || (desc && desc.toLowerCase().indexOf(query) >= 0)) && - (! this.filterRequest.type || rec.get('type') == this.filterRequest.type) && + (! this.filterRequest.type || rec.get('type') === this.filterRequest.type) && (archived || ! rec.get('archived')); }, this); } @@ -372,7 +372,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, { var desc = rec.get('description'); return (! search || rec.get('name').toLowerCase().indexOf(search) >= 0 || (desc && desc.toLowerCase().indexOf(search) >= 0)) && - (! this.typeFilter || rec.get('type') == this.typeFilter); + (! this.typeFilter || rec.get('type') === this.typeFilter); }, this); } }, @@ -444,7 +444,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, { renderRepositoryType: function(repositoryType){ var displayName = this.unknownType; var rec = repositoryTypeStore.queryBy(function(rec){ - return rec.data.name == repositoryType; + return rec.data.name === repositoryType; }).itemAt(0); if ( rec ){ displayName = rec.get('displayName'); diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.importwindow.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.importwindow.js index 10d276eccc..53ea0dcf19 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.importwindow.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.importwindow.js @@ -80,7 +80,7 @@ Sonia.repository.ImportWindow = Ext.extend(Ext.Window,{ scope: this } } - } + }; Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.repository.ImportWindow.superclass.initComponent.apply(this, arguments); }, diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.js index 3660376b77..d1224da20b 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.js @@ -51,7 +51,7 @@ Sonia.repository.typeIcons = []; Sonia.repository.getTypeIcon = function(type){ return Sonia.repository.typeIcons[type]; -} +}; Sonia.repository.createContentUrl = function(repository, path, revision){ var contentUrl = restUrl + 'repositories/' + repository.id + '/'; @@ -60,7 +60,7 @@ Sonia.repository.createContentUrl = function(repository, path, revision){ contentUrl += "&revision=" + revision; } return contentUrl; -} +}; Sonia.repository.createContentId = function(repository, path, revision){ var id = repository.id + '-b-' + path; @@ -68,11 +68,11 @@ Sonia.repository.createContentId = function(repository, path, revision){ id += '-r-' + revision; } return id; -} +}; Sonia.repository.isOwner = function(repository){ - return admin || repository.permissions != null; -} + return admin || repository.permissions !== null; +}; Sonia.repository.setEditPanel = function(panels){ var editPanel = Ext.getCmp('repositoryEditPanel'); @@ -82,25 +82,25 @@ Sonia.repository.setEditPanel = function(panels){ }); editPanel.setActiveTab(0); editPanel.doLayout(); -} +}; Sonia.repository.createUrl = function(type, name){ - return Sonia.util.getBaseUrl() + '/' + type + '/' + name -} + return Sonia.util.getBaseUrl() + '/' + type + '/' + name; +}; Sonia.repository.createUrlFromObject = function(repository){ return Sonia.repository.createUrl(repository.type, repository.name); -} +}; Sonia.repository.getTypeByName = function(name){ var type = null; repositoryTypeStore.queryBy(function(rec){ - if ( rec.get('name') == name ){ + if ( rec.get('name') === name ){ type = rec.data; } }); return type; -} +}; /** * default panel @@ -112,7 +112,7 @@ Sonia.repository.DefaultPanel = { xtype: 'panel', bodyCssClass: 'x-panel-mc', html: 'Add or select an Repository' -} +}; // load object from store or from web service @@ -137,7 +137,7 @@ Sonia.repository.get = function(id, callback){ var type = id.substring(0, index); var name = id.substring(index); index = store.findBy(function(rec){ - return rec.get('name') == name && rec.get('type') == type; + return rec.get('name') === name && rec.get('type') === type; }); if ( index >= 0 ){ rec = store.getAt(index); @@ -168,4 +168,4 @@ Sonia.repository.get = function(id, callback){ } }); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.permissionformpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.permissionformpanel.js index 61cc4b8095..ef2229a4aa 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.permissionformpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.permissionformpanel.js @@ -91,7 +91,7 @@ Sonia.repository.PermissionFormPanel = Ext.extend(Sonia.repository.FormPanel, { }], getCellEditor: function(colIndex, rowIndex) { - if (colIndex == 0) { + if (colIndex === 0) { var store = null; var rec = permissionStore.getAt(rowIndex); if ( rec.data.groupPermission ){ @@ -121,8 +121,8 @@ Sonia.repository.PermissionFormPanel = Ext.extend(Sonia.repository.FormPanel, { } }); - if ( this.item != null ){ - if ( this.item.permissions == null ){ + if ( this.item !== null ){ + if ( this.item.permissions === null ){ this.item.permissions = []; } this.permissionStore.loadData( this.item ); @@ -213,7 +213,7 @@ Sonia.repository.PermissionFormPanel = Ext.extend(Sonia.repository.FormPanel, { var permissions = []; this.permissionStore.data.each(function(record){ permissions.push( record.data ); - }) + }); item.permissions = permissions; }, diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.propertiesformpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.propertiesformpanel.js index 9c14d93c32..81311fda86 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.propertiesformpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.propertiesformpanel.js @@ -64,7 +64,7 @@ Sonia.repository.PropertiesFormPanel = Ext.extend(Sonia.repository.FormPanel, { for ( var j in this.item.properties ){ var property = this.item.properties[j]; - if ( property.key == field.property ){ + if ( property.key === field.property ){ field.setValue(property.value); } } @@ -86,7 +86,7 @@ Sonia.repository.PropertiesFormPanel = Ext.extend(Sonia.repository.FormPanel, { var result = !Ext.isEmpty(p.key); if ( result ){ for (var i in this.properties[this.id]){ - if ( p.key == this.properties[this.id][i].property ){ + if ( p.key === this.properties[this.id][i].property ){ result = false; break; } diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js index 9457f7ae9e..200524e6a8 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js @@ -183,7 +183,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { var tbar = { xtype: 'toolbar', items: [items] - } + }; return tbar; }, @@ -207,7 +207,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { loadStore: function(store, records, extra){ var path = extra.params.path; - if ( path != null && path.length > 0 ){ + if ( path !== null && path.length > 0 ){ var index = path.lastIndexOf('/'); if ( index > 0 ){ @@ -240,7 +240,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { onClick: function(e){ var el = e.getTarget('.scm-browser'); - if ( el != null ){ + if ( el !== null ){ var rel = el.rel; var index = rel.indexOf(':'); @@ -248,9 +248,9 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { var prefix = rel.substring(0, index); var path = rel.substring(index + 1); - if ( prefix == 'sub' ){ + if ( prefix === 'sub' ){ this.openSubRepository(path); - } else if ( prefix == 'dir' ){ + } else if ( prefix === 'dir' ){ this.changeDirectory(path); } else { this.openFile(path); @@ -280,7 +280,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { revision: revision, closable: true, autoScroll: true - } + }; } main.addTab(panel); }); @@ -288,7 +288,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { appendRepositoryProperties: function(bar){ bar.push('->',this.repository.name); - if ( this.revision != null ){ + if ( this.revision !== null ){ bar.push(': ', this.revision); } }, @@ -326,7 +326,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { var params = { path: path - } + }; if (this.revision){ params.revision = this.revision; @@ -373,7 +373,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { var currentPath = ''; var items = [this.createFolderButton(currentPath, '')]; - if ( path != '' ){ + if ( path !== '' ){ for (var i=0; i', this.repository.name); - if ( this.revision != null ){ + if ( this.revision !== null ){ items.push(':', this.revision); } @@ -395,7 +395,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { if ( i > 0 ){ url = url.substring( i + ctxPath.length ); } - if ( url.indexOf('/') == 0 ){ + if ( url.indexOf('/') === 0 ){ url = url.substring(1); } return url; @@ -404,7 +404,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { transformLink: function(url, revision){ var link = null; var server = Sonia.util.getServername(url); - if ( server == window.location.hostname || server == 'localhost' ){ + if ( server === window.location.hostname || server === 'localhost' ){ var repositoryPath = this.getRepositoryPath( url ); if (repositoryPath){ link = 'sub:' + repositoryPath; @@ -464,7 +464,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { icon = this.iconDocument; } var img = String.format(this.templateIcon, icon, name, name); - return this.renderLink(img, record) + return this.renderLink(img, record); }, renderLength: function(length, p, record){ @@ -495,10 +495,10 @@ Sonia.History.register('repositoryBrowser', { }, onChange: function(repoId, revision, path){ - if (revision == 'null'){ + if (revision === 'null'){ revision = null; } - if (path == 'null'){ + if (path === 'null'){ path = ''; } var id = 'repositoryBrowser;' + repoId + ';' + revision; @@ -512,7 +512,7 @@ Sonia.History.register('repositoryBrowser', { revision: revision, closable: true, autoScroll: true - } + }; if (path){ panel.path = path; } diff --git a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js index bf5a167adf..9fda9a7ad9 100644 --- a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js @@ -119,7 +119,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { renderUrl: function(url){ var result = ''; - if ( url != null ){ + if ( url !== null ){ result = String.format( this.urlTemplate, url ); } return result; @@ -127,7 +127,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { renderMailto: function(mail){ var result = ''; - if ( mail != null ){ + if ( mail !== null ){ result = String.format( this.mailtoTemplate, mail ); } return result; @@ -155,7 +155,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { handleHistory: function(params){ if (params && params.length > 0){ - this.selectById(params[0]) + this.selectById(params[0]); } else { if (debug){ console.debug( 'clear selection' ); diff --git a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.js b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.js index 93576b3a04..c524299fca 100644 --- a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.js +++ b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.js @@ -39,7 +39,7 @@ Sonia.rest.ExceptionHandler = function(proxy, type, action, options, response, a if (debug){ console.debug('store returned statuscode ' + status); } - if ( status == 200 && action == 'read' && response.responseText == 'null' ){ + if ( status === 200 && action === 'read' && response.responseText === 'null' ){ if ( debug ){ console.debug( 'empty array, clear whole store' ); } @@ -54,4 +54,4 @@ Sonia.rest.ExceptionHandler = function(proxy, type, action, options, response, a String.format(Sonia.rest.exceptionMsgText, status) ); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.jsonstore.js b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.jsonstore.js index b6d8a53245..909d54da3d 100644 --- a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.jsonstore.js +++ b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.jsonstore.js @@ -35,11 +35,12 @@ Sonia.rest.JsonStore = Ext.extend( Ext.data.JsonStore, { if ( ! config.listeners ){ config.listeners = {}; } + // fix jersey empty array problem config.listeners.exception = { fn: Sonia.rest.ExceptionHandler, scope: this - } + }; var baseConfig = { autoLoad: true diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.global.js b/scm-webapp/src/main/webapp/resources/js/sonia.global.js index 7246da041e..32dec370a9 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.global.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.global.js @@ -30,7 +30,7 @@ */ // enable debug mode, if console is available -var debug = typeof console != 'undefined' && typeof console.debug != 'undefined'; +var debug = typeof console !== 'undefined' && typeof console.debug !== 'undefined'; // send X-SCM-Client on every ajax request Ext.Ajax.defaultHeaders = { @@ -102,13 +102,13 @@ Sonia = { id += this.idSeparator; } } - if (id.length() == 0){ + if (id.length() === 0){ id = Ext.id(); } return id; } -} +}; // the main object (sonia.scm) diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.history.js b/scm-webapp/src/main/webapp/resources/js/sonia.history.js index e07cc5e717..44360bde6f 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.history.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.history.js @@ -40,7 +40,7 @@ Sonia.History = { add: function(token){ if (this.initialized){ - if (token != Ext.History.getToken()){ + if (token !== Ext.History.getToken()){ if (this.isInvokeable(this.recentlyChanged, token)){ if ( debug ){ console.debug('add history element ' + token); @@ -177,7 +177,7 @@ Sonia.History = { Ext.History.on('ready', function(history){ var token = history.getToken(); - if (token && token != 'null'){ + if (token && token !== 'null'){ Sonia.History.onChange(token); } Sonia.History.initialized = true; diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.scm.js b/scm-webapp/src/main/webapp/resources/js/sonia.scm.js index 13b7493c0f..0c9617d372 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.scm.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.scm.js @@ -99,7 +99,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { getInfoPanel: function(type){ var rp = null; var panel = this.infoPanels[type]; - if ( panel == null ){ + if ( panel === null ){ rp = { xtype: 'repositoryInfoPanel' }; @@ -191,7 +191,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { var securitySection = null; - if ( state.user.type == state.defaultUserType && state.user.name != 'anonymous' ){ + if ( state.user.type === state.defaultUserType && state.user.name !== 'anonymous' ){ securitySection = { id: 'securityConfig', title: this.sectionSecurityText, @@ -201,7 +201,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { new Sonia.action.ChangePasswordWindow().show(); } }] - } + }; } if ( admin ){ @@ -224,12 +224,12 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { }] }]); - if ( securitySection == null ){ + if ( securitySection === null ){ securitySection = { id: 'securityConfig', title: this.sectionSecurityText, links: [] - } + }; } securitySection.links.push({ @@ -243,11 +243,11 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { }); } - if ( securitySection != null ){ + if ( securitySection !== null ){ panel.addSection( securitySection ); } - if ( state.user.name == 'anonymous' ){ + if ( state.user.name === 'anonymous' ){ panel.addSection({ id: 'navLogin', title: this.sectionLoginText, @@ -291,7 +291,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { addTab: function(panel){ var tab = this.mainTabPanel.findById(panel.id); - if ( tab == null ){ + if ( tab === null ){ this.mainTabPanel.add(panel); } this.mainTabPanel.setActiveTab(panel.id); @@ -362,10 +362,10 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { var s = null; var text = response.responseText; - if ( text != null && text.length > 0 ){ + if ( text !== null && text.length > 0 ){ s = Ext.decode( text ); } - if ( s != null && s.success ){ + if ( s !== null && s.success ){ this.loadState(s); } else { // show login window @@ -403,35 +403,35 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { console.debug( 'handle failure for status code: ' + status ); } // TODO handle already exists exceptions specific - if ( status == 401 ){ + if ( status === 401 ){ Ext.Msg.show({ title: this.errorSessionExpiredTitle, msg: this.errorSessionExpiredMessage, buttons: Ext.Msg.OKCANCEL, fn: function(btn){ - if ( btn == 'ok' ){ + if ( btn === 'ok' ){ this.login(); } }, scope: this }); - } else if ( status == 403 ){ + } else if ( status === 403 ){ Ext.Msg.show({ title: this.errorNoPermissionsTitle, msg: this.errorNoPermissionsMessage, buttons: Ext.Msg.OKCANCEL }); - } else if ( status == 404 ){ + } else if ( status === 404 ){ Ext.Msg.show({ title: this.errorNotFoundTitle, msg: this.errorNotFoundMessage, buttons: Ext.Msg.OKCANCEL }); } else { - if ( title == null ){ + if ( title === null ){ title = this.errorTitle; } - if ( message == null ){ + if ( message === null ){ message = this.errorMessage; } @@ -454,7 +454,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { message = String.format(message, status); - if ( text == null ){ + if ( text === null ){ Ext.MessageBox.show({ title: title, @@ -483,7 +483,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { } else { callback(); } - } + }; if ( this.scripts.indexOf(url) < 0 ){ var js = document.createElement('script'); js.type = "text/javascript"; @@ -496,7 +496,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { this.readyState === 'complete'){ doCallback(); } - } + }; } else { js.onload = doCallback; js.onerror = doCallback; @@ -534,7 +534,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { }, renderUserInformations: function(state){ - if ( state.user.name != 'anonymous' ){ + if ( state.user.name !== 'anonymous' ){ var tpl = new Ext.XTemplate(this.loggedInTextTemplate); tpl.overwrite(Ext.get('scm-userinfo'), state); var text = ''; diff --git a/scm-webapp/src/main/webapp/resources/js/uistate/sonia.uistate.webstorageprovider.js b/scm-webapp/src/main/webapp/resources/js/uistate/sonia.uistate.webstorageprovider.js index 5d67f144ae..9e1f873691 100644 --- a/scm-webapp/src/main/webapp/resources/js/uistate/sonia.uistate.webstorageprovider.js +++ b/scm-webapp/src/main/webapp/resources/js/uistate/sonia.uistate.webstorageprovider.js @@ -60,7 +60,7 @@ Sonia.uistate.WebStorageProvider = Ext.extend(Ext.state.Provider,{ * @param {Mixed} value The state data */ set : function(name, value){ - if(typeof value == "undefined" || value === null){ + if(typeof value === "undefined" || value === null){ this.clear(name); } else { localStorage.setItem(name, this.encodeValue(value)); diff --git a/scm-webapp/src/main/webapp/resources/js/util/sonia.util.js b/scm-webapp/src/main/webapp/resources/js/util/sonia.util.js index 1845efd1ae..826be5c096 100644 --- a/scm-webapp/src/main/webapp/resources/js/util/sonia.util.js +++ b/scm-webapp/src/main/webapp/resources/js/util/sonia.util.js @@ -46,7 +46,7 @@ Sonia.util.getServername = function(url){ } } return url; -} +}; Sonia.util.getContextPath = function(){ var path = window.location.pathname; @@ -57,7 +57,7 @@ Sonia.util.getContextPath = function(){ } } return path; -} +}; Sonia.util.getBaseUrl = function(){ var url = location.href; @@ -72,7 +72,7 @@ Sonia.util.getBaseUrl = function(){ url = url.substring(0, url.length -1); } return url; -} +}; Sonia.util.getName = function(path){ var name = path; @@ -81,7 +81,7 @@ Sonia.util.getName = function(path){ name = path.substr(index +1); } return name; -} +}; Sonia.util.getExtension = function(path){ var ext = null; @@ -90,15 +90,15 @@ Sonia.util.getExtension = function(path){ ext = path.substr(index + 1, path.length); } return ext; -} +}; Sonia.util.clone = function(obj) { var newObj = (this instanceof Array) ? [] : {}; for (i in obj) { - if (i == 'clone') continue; - if (obj[i] && typeof obj[i] == "object") { + if (i === 'clone') continue; + if (obj[i] && typeof obj[i] === "object") { newObj[i] = Sonia.util.clone(obj[i]); - } else newObj[i] = obj[i] + } else newObj[i] = obj[i]; } return newObj; }; @@ -116,7 +116,7 @@ Sonia.util.parseInt = function(string, defaultValue){ result = defaultValue; } return result; -} +}; Sonia.util.getStringFromArray = function(array){ var value = ''; @@ -130,14 +130,14 @@ Sonia.util.getStringFromArray = function(array){ } return value; -} +}; Sonia.util.applySub = function(obj, name, p){ if (name){ obj = obj[name]; } return Sonia.util.call(obj, p); -} +}; Sonia.util.apply = function(obj, p){ var result = null; @@ -164,7 +164,7 @@ Sonia.util.apply = function(obj, p){ } } return result; -} +}; if (!Array.prototype.filter) { @@ -176,20 +176,20 @@ if (!Array.prototype.filter) { } } return results; - } + }; } Sonia.util.getProperty = function(properties, key){ var value = null; - if ( properties != null ){ + if ( properties !== null ){ for (var i=0; i