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 bcbeff5f92..3598045799 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 && 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 && Ext.isFunction( this.onSubmit ) ){ this.onSubmit( form.getValues() ); } } diff --git a/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js b/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js index c6be5f151a..a7f269ee35 100644 --- a/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js @@ -105,7 +105,7 @@ Sonia.group.Grid = Ext.extend(Sonia.rest.Grid, { renderMembers: function(members){ var out = ''; - if ( members !== null ){ + if ( members ){ var s = members.length; for ( var i=0; i 0 || value.length > 0)){ + if ( value && (value > 0 || value.length > 0)){ var df = state.clientConfig.dateFormat; - if ( df === null || df.length === 0 || ! Ext.isDefined(value) ){ + if ( ! df || 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/repository/sonia.repository.blamepanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.blamepanel.js index efd7db40a1..6ca0d651ce 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.blamepanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.blamepanel.js @@ -96,7 +96,7 @@ Sonia.repository.BlamePanel = Ext.extend(Ext.grid.GridPanel, { onClick: function(e){ var el = e.getTarget('.blame-link'); - if ( el !== null ){ + if ( el ){ var revision = el.rel; if (debug){ console.debug('load content for ' + revision); 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 4131c6bff2..22ee81471f 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 @@ -167,18 +167,18 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, { renderChangesetMetadata: function(author, p, record){ var authorValue = ''; - if ( author !== null ){ + if ( author ){ authorValue = author.name; - if ( author.mail !== null ){ + if ( author.mail ){ authorValue += ' ' + String.format(this.mailTemplate, author.mail); } } var description = record.data.description; - // if ( description != null ){ + // if ( description ){ // description = Ext.util.Format.htmlEncode(description); // } var date = record.data.date; - if ( date !== null ){ + if ( date ){ 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 && array.length > 0 ){ result = label + ': ' + Sonia.util.getStringFromArray(array); } return result; 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 cc73ec2069..36622a55ed 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 @@ -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 ){ bar.push(': ', this.revision); } }, 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 15b2d301fe..062c93aefa 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 ){ items = []; } items.push({ diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js index 755e4def23..45f9a06dc2 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.infopanel.js @@ -47,7 +47,7 @@ Sonia.repository.InfoPanel = Ext.extend(Ext.Panel, { initComponent: function(){ var contact = ''; - if ( this.item.contact !== null ){ + if ( this.item.contact ){ contact = String.format(this.mailTemplate, this.item.contact); } 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 d1224da20b..c962c24ae5 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 @@ -71,7 +71,7 @@ Sonia.repository.createContentId = function(repository, path, revision){ }; Sonia.repository.isOwner = function(repository){ - return admin || repository.permissions !== null; + return admin || repository.permissions; }; Sonia.repository.setEditPanel = function(panels){ 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 ef2229a4aa..4670ddf9b1 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 @@ -121,8 +121,8 @@ Sonia.repository.PermissionFormPanel = Ext.extend(Sonia.repository.FormPanel, { } }); - if ( this.item !== null ){ - if ( this.item.permissions === null ){ + if ( this.item ){ + if ( !this.item.permissions ){ this.item.permissions = []; } this.permissionStore.loadData( this.item ); 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 200524e6a8..2fff4dc1c4 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 @@ -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 && 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 ){ var rel = el.rel; var index = rel.indexOf(':'); @@ -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 ){ bar.push(': ', this.revision); } }, @@ -381,7 +381,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { } items.push('->', this.repository.name); - if ( this.revision !== null ){ + if ( this.revision ){ items.push(':', this.revision); } diff --git a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.formpanel.js b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.formpanel.js index 54fcd9e4ff..eabea80386 100644 --- a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.formpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.formpanel.js @@ -61,7 +61,7 @@ Sonia.rest.FormPanel = Ext.extend(Ext.form.FormPanel,{ Ext.apply(this, Ext.apply(this.initialConfig, config)); Sonia.rest.FormPanel.superclass.initComponent.apply(this, arguments); - if ( this.item !== null ){ + if ( this.item ){ this.loadData(this.item); } }, 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 9fda9a7ad9..9f05a75375 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 ){ 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 ){ result = String.format( this.mailtoTemplate, mail ); } return result; 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 0c9617d372..bfab4abfcb 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 ){ rp = { xtype: 'repositoryInfoPanel' }; @@ -224,7 +224,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { }] }]); - if ( securitySection === null ){ + if ( ! securitySection ){ securitySection = { id: 'securityConfig', title: this.sectionSecurityText, @@ -243,7 +243,7 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { }); } - if ( securitySection !== null ){ + if ( securitySection ){ panel.addSection( securitySection ); } @@ -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 ){ 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 && text.length > 0 ){ s = Ext.decode( text ); } - if ( s !== null && s.success ){ + if ( s && s.success ){ this.loadState(s); } else { // show login window @@ -428,10 +428,10 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { buttons: Ext.Msg.OKCANCEL }); } else { - if ( title === null ){ + if ( ! title ){ title = this.errorTitle; } - if ( message === null ){ + if ( ! message ){ 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 ){ Ext.MessageBox.show({ title: title, diff --git a/scm-webapp/src/main/webapp/resources/js/user/sonia.user.formpanel.js b/scm-webapp/src/main/webapp/resources/js/user/sonia.user.formpanel.js index c52f262de4..827189a97c 100644 --- a/scm-webapp/src/main/webapp/resources/js/user/sonia.user.formpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/user/sonia.user.formpanel.js @@ -75,7 +75,7 @@ Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ helpText: this.mailHelpText }]; - if ( this.item === null || this.item.type === state.defaultUserType ){ + if ( ! this.item || this.item.type === state.defaultUserType ){ items.push({ fieldLabel: this.passwordText, id: 'pwd', @@ -115,7 +115,7 @@ Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ }, isReadOnly: function(){ - return this.item !== null && this.item.type !== state.defaultUserType; + return this.item && this.item.type !== state.defaultUserType; }, fixRequest: function(user){ 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 826be5c096..d220bf7161 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 @@ -182,7 +182,7 @@ if (!Array.prototype.filter) { Sonia.util.getProperty = function(properties, key){ var value = null; - if ( properties !== null ){ + if ( properties ){ for (var i=0; i