diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-09-10 10:42:07 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-09-10 12:26:16 +0200 |
commit | e1b6cbcba2e342b4671a1bf88e1fd174b55b44cf (patch) | |
tree | 38069eebe3c0ccbcfc2e612f74dbd1dfd772c380 /server/sonar-web/src/main/js/apps/coding-rules | |
parent | 5981d630ff9637a78868d989f22a3f10f15306c5 (diff) | |
download | sonarqube-e1b6cbcba2e342b4671a1bf88e1fd174b55b44cf.tar.gz sonarqube-e1b6cbcba2e342b4671a1bf88e1fd174b55b44cf.zip |
Revert "use single web app"
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules')
27 files changed, 367 insertions, 100 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/app.js b/server/sonar-web/src/main/js/apps/coding-rules/app.js index 67b18ef2b11..61f5e97ddd2 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/app.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/app.js @@ -1,6 +1,4 @@ define([ - 'backbone', - 'backbone.marionette', './models/state', './layout', './models/rules', @@ -15,9 +13,7 @@ define([ './facets-view', './filters-view' ], - function (Backbone, - Marionette, - State, + function (State, Layout, Rules, Facets, @@ -75,7 +71,7 @@ define([ App.manualRepository = function () { return { key: 'manual', - name: window.t('coding_rules.manual_rule'), + name: t('coding_rules.manual_rule'), language: 'none' }; }; @@ -108,7 +104,7 @@ define([ }); App.on('start', function (options) { - $.when(appXHR).done(function () { + $.when(window.requestMessages(), appXHR).done(function () { init.call(App, options); }); }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js index d9bff5b021d..bdd2cbb5f34 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js @@ -36,14 +36,14 @@ define([ showSuccessMessage: function (profile, succeeded) { var profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile }), profileName = profileBase != null ? profileBase.name : profile, - message = window.tp('coding_rules.bulk_change.success', profileName, profileBase.language, succeeded); + message = tp('coding_rules.bulk_change.success', profileName, profileBase.language, succeeded); this.ui.messagesContainer.append('<div class="alert alert-success">' + message + '</div>'); }, showWarnMessage: function (profile, succeeded, failed) { var profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile }), profileName = profileBase != null ? profileBase.name : profile, - message = window.tp('coding_rules.bulk_change.warning', profileName, profileBase.language, succeeded, failed); + message = tp('coding_rules.bulk_change.warning', profileName, profileBase.language, succeeded, failed); this.ui.messagesContainer.append('<div class="alert alert-warning">' + message + '</div>'); }, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js index 7cabf7b44e2..6695943968d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/active-severity-facet.js @@ -46,7 +46,7 @@ define([ forbid: function () { BaseFacet.prototype.forbid.apply(this, arguments); - this.$el.prop('title', window.t('coding_rules.filters.active_severity.inactive')); + this.$el.prop('title', t('coding_rules.filters.active_severity.inactive')); }, allow: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js index b43aadb3ff1..7aad57ad48c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js @@ -32,7 +32,7 @@ define([ }, getUrl: function () { - return window.baseUrl; + return baseUrl; }, onRender: function () { @@ -42,17 +42,17 @@ define([ prepareSearch: function () { this.$('.js-custom-value').select2({ - placeholder: window.t('search_verb'), + placeholder: t('search_verb'), minimumInputLength: 1, allowClear: false, formatNoMatches: function () { - return window.t('select2.noMatches'); + return t('select2.noMatches'); }, formatSearching: function () { - return window.t('select2.searching'); + return t('select2.searching'); }, formatInputTooShort: function () { - return window.tp('select2.tooShort', 1); + return tp('select2.tooShort', 1); }, width: '100%', ajax: this.prepareAjaxSearch() diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js index 50bef351339..1a05fff7479 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/inheritance-facet.js @@ -51,7 +51,7 @@ define([ forbid: function () { BaseFacet.prototype.forbid.apply(this, arguments); - this.$el.prop('title', window.t('coding_rules.filters.inheritance.inactive')); + this.$el.prop('title', t('coding_rules.filters.inheritance.inactive')); }, allow: function () { @@ -63,7 +63,7 @@ define([ var values = ['NONE', 'INHERITED', 'OVERRIDES']; return values.map(function (key) { return { - label: window.t('coding_rules.filters.inheritance', key.toLowerCase()), + label: t('coding_rules.filters.inheritance', key.toLowerCase()), val: key }; }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js index 1873599e3cd..478c589032c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js @@ -24,7 +24,7 @@ define([ return CustomValuesFacet.extend({ getUrl: function () { - return window.baseUrl + '/api/languages/list'; + return baseUrl + '/api/languages/list'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js index ae064ba3b2a..08283dc5b18 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js @@ -24,7 +24,7 @@ define([ return CustomValuesFacet.extend({ getUrl: function () { - return window.baseUrl + '/api/rules/repositories'; + return baseUrl + '/api/rules/repositories'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js index 2d2b6b654e8..96854e47564 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/status-facet.js @@ -27,7 +27,7 @@ define([ getValues: function () { var values = this.model.getValues(); var x = values.map(function (value) { - return _.extend(value, { label: window.t('rules.status', value.val.toLowerCase()) }); + return _.extend(value, { label: t('rules.status', value.val.toLowerCase()) }); }); return x; }, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js index 3e6a064ef6c..9a5b0f21570 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js @@ -24,7 +24,7 @@ define([ return CustomValuesFacet.extend({ getUrl: function () { - return window.baseUrl + '/api/rules/tags'; + return baseUrl + '/api/rules/tags'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js index c7a289e9c29..4626acd9d02 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/filters-view.js @@ -1,8 +1,26 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', './rule/manual-rule-creation-view', './templates' -], function (Marionette, ManualRuleCreationView) { +], function (ManualRuleCreationView) { return Marionette.ItemView.extend({ template: Templates['coding-rules-filters'], @@ -18,9 +36,7 @@ define([ }, serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - canWrite: this.options.app.canWrite - }); + return _.extend(this._super(), { canWrite: this.options.app.canWrite }); } }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/layout.js b/server/sonar-web/src/main/js/apps/coding-rules/layout.js index d2fff28e341..34f66a61a2e 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/layout.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/layout.js @@ -1,8 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', - '../../components/common/jquery-isolated-scroll', './templates' -], function (Marionette) { +], function () { var $ = jQuery; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js b/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js index fbc5ecdd8b0..51993df4b98 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/models/rule.js @@ -1,6 +1,23 @@ -define([ - 'backbone' -], function (Backbone) { +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +define(function () { return Backbone.Model.extend({ idAttribute: 'key', diff --git a/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js b/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js index 39a833309e5..f1f83bcf1bd 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/models/rules.js @@ -1,7 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone', './rule' -], function (Backbone, Rule) { +], function (Rule) { return Backbone.Collection.extend({ model: Rule, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js index f1536004dff..05856342aa4 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js @@ -1,6 +1,23 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone', - 'backbone.marionette', './models/rules', './rule/rule-meta-view', './rule/rule-description-view', @@ -10,12 +27,9 @@ define([ './rule/manual-rule-creation-view', './rule/custom-rule-creation-view', './rule/rule-issues-view', - '../../components/common/dialogs', './templates' ], - function (Backbone, - Marionette, - Rules, + function (Rules, MetaView, DescView, ParamView, @@ -23,8 +37,7 @@ define([ CustomRulesView, ManualRuleCreationView, CustomRuleCreationView, - IssuesView, - confirmDialog) { + IssuesView) { var $ = jQuery; @@ -150,9 +163,9 @@ define([ deleteRule: function () { var that = this, ruleType = this.model.has('templateKey') ? 'custom' : 'manual'; - confirmDialog({ - title: window.t('delete'), - html: window.tp('coding_rules.delete.' + ruleType + '.confirm', this.model.get('name')), + window.confirmDialog({ + title: t('delete'), + html: tp('coding_rules.delete.' + ruleType + '.confirm', this.model.get('name')), yesHandler: function () { var url = baseUrl + '/api/rules/delete', options = { key: that.model.id }; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js index 1ee49177642..e15a1149e69 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js @@ -19,9 +19,8 @@ */ define([ 'components/common/modal-form', - '../../../libs/csv', '../templates' -], function (ModalFormView, csvEscape) { +], function (ModalFormView) { var $ = jQuery; @@ -129,7 +128,7 @@ define([ }; }).get(); options.params = params.map(function (param) { - return param.key + '=' + csvEscape(param.value); + return param.key + '=' + window.csvEscape(param.value); }).join(';'); this.sendRequest(action, options); }, @@ -173,7 +172,7 @@ define([ }).fail(function (jqXHR) { if (jqXHR.status === 409) { that.existingRule = jqXHR.responseJSON.rule; - that.showErrors([], [{ msg: window.t('coding_rules.reactivate.help') }]); + that.showErrors([], [{ msg: t('coding_rules.reactivate.help') }]); that.ui.customRuleCreationCreate.addClass('hidden'); that.ui.customRuleCreationReactivate.removeClass('hidden'); } else { @@ -195,7 +194,7 @@ define([ var statuses = ['READY', 'BETA', 'DEPRECATED'].map(function (status) { return { id: status, - text: window.t('rules.status', status.toLowerCase()) + text: t('rules.status', status.toLowerCase()) }; }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js index 5dc0c9ac732..e50b7c11005 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js @@ -1,8 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', - '../../../components/common/dialogs', '../templates' -], function (Marionette, confirmDialog) { +], function () { var $ = jQuery; @@ -20,9 +37,9 @@ define([ deleteRule: function () { var that = this; - confirmDialog({ - title: window.t('delete'), - html: window.t('are_you_sure'), + window.confirmDialog({ + title: t('delete'), + html: t('are_you_sure'), yesHandler: function () { var url = baseUrl + '/api/rules/delete', options = { key: that.model.id }; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js index bd51911930d..56ae2a95833 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rules-view.js @@ -1,9 +1,27 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', './custom-rule-view', './custom-rule-creation-view', '../templates' -], function (Marionette, CustomRuleView, CustomRuleCreationView) { +], function (CustomRuleView, CustomRuleCreationView) { return Marionette.CompositeView.extend({ template: Templates['coding-rules-custom-rules'], diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js index 32c707f6c9a..66617fc33ed 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js @@ -119,7 +119,7 @@ define([ }).fail(function (jqXHR) { if (jqXHR.status === 409) { that.existingRule = jqXHR.responseJSON.rule; - that.showErrors([], [{ msg: window.t('coding_rules.reactivate.help') }]); + that.showErrors([], [{ msg: t('coding_rules.reactivate.help') }]); that.ui.manualRuleCreationCreate.addClass('hidden'); that.ui.manualRuleCreationReactivate.removeClass('hidden'); } else { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js index 663895b4823..87296ca2e0f 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js @@ -1,9 +1,26 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone', 'components/common/modal-form', - '../../../libs/csv', '../templates' -], function (Backbone, ModalForm, csvEscape) { +], function (ModalForm) { var $ = jQuery; @@ -11,7 +28,7 @@ define([ template: Templates['coding-rules-profile-activation'], ui: function () { - return _.extend(ModalForm.prototype.ui.apply(this, arguments), { + return _.extend(this._super(), { qualityProfileSelect: '#coding-rules-quality-profile-activation-select', qualityProfileSeverity: '#coding-rules-quality-profile-activation-severity', qualityProfileActivate: '#coding-rules-quality-profile-activation-activate', @@ -20,13 +37,13 @@ define([ }, events: function () { - return _.extend(ModalForm.prototype.events.apply(this, arguments), { + return _.extend(this._super(), { 'click @ui.qualityProfileActivate': 'activate' }); }, onRender: function () { - ModalForm.prototype.onRender.apply(this, arguments); + this._super(); this.ui.qualityProfileSelect.select2({ width: '250px', @@ -65,7 +82,7 @@ define([ }; }).get(), paramsHash = (params.map(function (param) { - return param.key + '=' + csvEscape(param.value); + return param.key + '=' + window.csvEscape(param.value); })).join(';'); if (this.model) { @@ -129,7 +146,7 @@ define([ var availableProfiles = this.getAvailableQualityProfiles(this.options.rule.get('lang')); - return _.extend(ModalForm.prototype.serializeData.apply(this, arguments), { + return _.extend(this._super(), { change: this.model && this.model.has('severity'), params: params, qualityProfiles: availableProfiles, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js index cd36bb7d3d9..c84213c614d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js @@ -1,8 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', - '../../../components/common/dialogs', '../templates' -], function (Marionette, confirmDialog) { +], function () { return Marionette.ItemView.extend({ template: Templates['coding-rules-rule-description'], @@ -63,8 +80,8 @@ define([ removeExtendedDescription: function () { var that = this; - confirmDialog({ - html: window.t('coding_rules.remove_extended_description.confirm'), + window.confirmDialog({ + html: t('coding_rules.remove_extended_description.confirm'), yesHandler: function () { that.ui.extendDescriptionText.val(''); that.submitExtendDescription(); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js index 373c4a54a45..ebbd0f62149 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js @@ -1,7 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', '../templates' -], function (Marionette) { +], function () { var $ = jQuery; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js index f31fbb7656e..d8565818c52 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js @@ -1,8 +1,26 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', './rule-filter-mixin', '../templates' -], function (Marionette, RuleFilterMixin) { +], function (RuleFilterMixin) { return Marionette.ItemView.extend(RuleFilterMixin).extend({ template: Templates['coding-rules-rule-meta'], diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js index d49a6adcb21..2e5a927621d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-parameters-view.js @@ -1,7 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', '../templates' -], function (Marionette) { +], function () { return Marionette.ItemView.extend({ template: Templates['coding-rules-rule-parameters'], diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js index 5701de25f80..42902e38c3c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js @@ -1,10 +1,26 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone', - 'backbone.marionette', './profile-activation-view', - '../../../components/common/dialogs', '../templates' -], function (Backbone, Marionette, ProfileActivationView, confirmDialog) { +], function (ProfileActivationView) { return Marionette.ItemView.extend({ tagName: 'tr', @@ -49,9 +65,9 @@ define([ revert: function () { var that = this, ruleKey = this.options.rule.get('key'); - confirmDialog({ - title: window.t('coding_rules.revert_to_parent_definition'), - html: window.tp('coding_rules.revert_to_parent_definition.confirm', this.getParent().name), + window.confirmDialog({ + title: t('coding_rules.revert_to_parent_definition'), + html: tp('coding_rules.revert_to_parent_definition.confirm', this.getParent().name), yesHandler: function () { return jQuery.ajax({ type: 'POST', @@ -71,9 +87,9 @@ define([ deactivate: function () { var that = this, ruleKey = this.options.rule.get('key'); - confirmDialog({ - title: window.t('coding_rules.deactivate'), - html: window.tp('coding_rules.deactivate.confirm'), + window.confirmDialog({ + title: t('coding_rules.deactivate'), + html: tp('coding_rules.deactivate.confirm'), yesHandler: function () { return jQuery.ajax({ type: 'POST', diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js index 562f349939a..fc7662e5073 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profiles-view.js @@ -1,9 +1,27 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone.marionette', './rule-profile-view', './profile-activation-view', '../templates' -], function (Marionette, ProfileView, ProfileActivationView) { +], function (ProfileView, ProfileActivationView) { return Marionette.CompositeView.extend({ template: Templates['coding-rules-rule-profiles'], diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js index 20b4f0f4b3f..2aefada2578 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-empty-view.js @@ -1,12 +1,29 @@ -define([ - 'backbone.marionette' -], function (Marionette) { +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +define(function () { return Marionette.ItemView.extend({ className: 'search-navigator-no-results', template: function () { - return window.t('coding_rules.no_results'); + return t('coding_rules.no_results'); } }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js index f3c8de7de57..1041a326de9 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js @@ -1,11 +1,28 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ define([ - 'backbone', 'components/navigator/workspace-list-item-view', './rule/profile-activation-view', - '../../components/common/dialogs', './rule/rule-filter-mixin', './templates' -], function (Backbone, WorkspaceListItemView, ProfileActivationView, confirmDialog, RuleFilterMixin) { +], function (WorkspaceListItemView, ProfileActivationView, RuleFilterMixin) { return WorkspaceListItemView.extend(RuleFilterMixin).extend({ className: 'coding-rule', @@ -61,9 +78,9 @@ define([ var that = this, ruleKey = this.model.get('key'), activation = this.model.get('activation'); - confirmDialog({ - title: window.t('coding_rules.deactivate'), - html: window.tp('coding_rules.deactivate.confirm'), + window.confirmDialog({ + title: t('coding_rules.deactivate'), + html: tp('coding_rules.deactivate.confirm'), yesHandler: function () { return jQuery.ajax({ type: 'POST', |