From 026b64cafb3b27c8ff24ecf25183e2979aa8a63d Mon Sep 17 00:00:00 2001 From: Franco Springveldt Date: Thu, 14 Sep 2017 09:55:09 +1200 Subject: [PATCH] FIX PHP Linter fixes --- gulpfile.js | 4 +- js/cms.js | 192 ++++++++++++++++++++++++++-------------------------- 2 files changed, 98 insertions(+), 98 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4aa2f74..819222d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,10 +8,10 @@ gulp.task("scss", function () { .pipe(gulp.dest("./css")); }); -gulp.task('watch', ['scss'], function() { +gulp.task('watch', ['scss'], function () { gulp.watch('./scss/*.scss', ['scss']); }); -gulp.task('default', ['scss'], function() { +gulp.task('default', ['scss'], function () { // noop }); diff --git a/js/cms.js b/js/cms.js index 36fb506..926c78b 100644 --- a/js/cms.js +++ b/js/cms.js @@ -1,6 +1,6 @@ (function ($) { - $.entwine('ss', function ($) { + $.entwine('ss', function ($) { /** * The page success/error message sits outside of the html block @@ -10,136 +10,136 @@ * @see https://github.com/silverstripe/silverstripe-blog/issues/210 */ $('.cms-content-fields > #Form_EditForm_error').entwine({ - 'onadd': function() { + 'onadd': function () { var $target = $('.blog-admin-outer'); - if($target.length == 1) { + if ($target.length == 1) { $target.prepend(this); } } }); - /** - * Register expandable help text functions with fields. - */ - $('.toggle-description').entwine({ - 'onadd': function () { - var $this = $(this); + /** + * Register expandable help text functions with fields. + */ + $('.toggle-description').entwine({ + 'onadd': function () { + var $this = $(this); - /** - * Prevent multiple events being added. - */ - if ($this.hasClass('toggle-description-enabled')) { - return; - } + /** + * Prevent multiple events being added. + */ + if ($this.hasClass('toggle-description-enabled')) { + return; + } - $this.addClass('toggle-description-enabled'); + $this.addClass('toggle-description-enabled'); - /** - * Toggle next description when button is clicked. - */ - var shown = false; + /** + * Toggle next description when button is clicked. + */ + var shown = false; - $this.on('click', function() { - $this.parent().next('.description')[shown ? 'hide' : 'show'](); + $this.on('click', function () { + $this.parent().next('.description')[shown ? 'hide' : 'show'](); - $this.toggleClass('toggle-description-shown'); + $this.toggleClass('toggle-description-shown'); - shown = !shown; - }); + shown = !shown; + }); - /** - * Hide next description by default. - */ - $this.parent().next('.description').hide(); + /** + * Hide next description by default. + */ + $this.parent().next('.description').hide(); - /** - * Add classes to correct inherited layout issues in a small context. - */ - $this.parent().addClass('toggle-description-correct-right'); - $this.parent().prev('.middleColumn').addClass('toggle-description-correct-middle'); - $this.parent().next('.description').addClass('toggle-description-correct-description'); - } - }); + /** + * Add classes to correct inherited layout issues in a small context. + */ + $this.parent().addClass('toggle-description-correct-right'); + $this.parent().prev('.middleColumn').addClass('toggle-description-correct-middle'); + $this.parent().next('.description').addClass('toggle-description-correct-description'); + } + }); - /** - * Custom merge actions for tags and categories - */ - $('.MergeAction').entwine({ - 'onadd': function() { - var $this = $(this); + /** + * Custom merge actions for tags and categories + */ + $('.MergeAction').entwine({ + 'onadd': function () { + var $this = $(this); - $this.on('click', 'select', function() { - return false; - }); + $this.on('click', 'select', function () { + return false; + }); - $this.children('button').each(function(i, button) { - var $button = $(button); - var $select = $button.prev('select'); + $this.children('button').each(function (i, button) { + var $button = $(button); + var $select = $button.prev('select'); - $button.before(''); - }); + $button.before(''); + }); - $this.on('change', 'select', function(e) { - var $target = $(e.target); + $this.on('change', 'select', function (e) { + var $target = $(e.target); - $target.next('input').val($target.val()); - }); + $target.next('input').val($target.val()); + }); - $this.children('button, select').hide(); + $this.children('button, select').hide(); - $this.on('click', '.MergeActionReveal', function(e) { - var $target = $(e.target); + $this.on('click', '.MergeActionReveal', function (e) { + var $target = $(e.target); - $target.parent().children('button, select').show(); - $target.hide(); + $target.parent().children('button, select').show(); + $target.hide(); - return false; - }); - } - }); + return false; + }); + } + }); - /** - * Customise the cms-panel behaviour for blog sidebar - * - * see LeftAndMain.Panel.js for base behaviour - */ - $('.blog-admin-sidebar.cms-panel').entwine({ - MinInnerWidth: 620, - onadd: function() { - this._super(); - this.updateLayout(); + /** + * Customise the cms-panel behaviour for blog sidebar + * + * see LeftAndMain.Panel.js for base behaviour + */ + $('.blog-admin-sidebar.cms-panel').entwine({ + MinInnerWidth: 620, + onadd: function () { + this._super(); + this.updateLayout(); - // If this panel is open and the left hand column is smaller than the minimum, contract it instead - if(!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getMinInnerWidth())) { - this.collapsePanel(); - } + // If this panel is open and the left hand column is smaller than the minimum, contract it instead + if (!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getMinInnerWidth())) { + this.collapsePanel(); + } - window.onresize = function() { + window.onresize = function () { this.updateLayout(); }.bind(this); - }, - togglePanel: function(bool, silent) { - this._super(bool, silent); - this.updateLayout(); - }, - /** - * Adjust minimum width of content to account for extra panel - * - * @returns {undefined} - */ - updateLayout: function() { + }, + togglePanel: function (bool, silent) { + this._super(bool, silent); + this.updateLayout(); + }, + /** + * Adjust minimum width of content to account for extra panel + * + * @returns {undefined} + */ + updateLayout: function () { $(this).css('height', '100%'); var currentHeight = $(this).outerHeight(); var bottomHeight = $('.cms-content-actions').eq(0).outerHeight(); $(this).css('height', (currentHeight - bottomHeight) + "px"); $(this).css('bottom', bottomHeight + "px"); - $('.cms-container').updateLayoutOptions({ - minContentWidth: 820 + this.width() - }); + $('.cms-container').updateLayoutOptions({ + minContentWidth: 820 + this.width() + }); - } - }); + } + }); - }); + }); })(jQuery);