From 8b005b325108cb3b34929b85aadaa07e859c074d Mon Sep 17 00:00:00 2001 From: Raissa North Date: Mon, 29 Jan 2018 16:03:51 +1300 Subject: [PATCH] FIX Javascript and SCSS linting and removed unused images --- client/dist/js/main.bundle.js | 247 ++++++++-------- client/dist/styles/main.css | 2 +- {images => client/images}/site-tree-icon.png | Bin client/src/bundles/cms.js | 280 +++++++++---------- client/src/bundles/gridfieldaddbydbfield.js | 29 +- client/src/main.js | 4 +- client/src/styles/blog.scss | 99 +++---- client/src/styles/cms.scss | 280 +++++++++---------- images/blog-icon-s0a5ab5f851.png | Bin 680 -> 0 bytes images/information.png | Bin 778 -> 0 bytes images/move-icon.png | Bin 1677 -> 0 bytes 11 files changed, 469 insertions(+), 472 deletions(-) rename {images => client/images}/site-tree-icon.png (100%) delete mode 100644 images/blog-icon-s0a5ab5f851.png delete mode 100755 images/information.png delete mode 100644 images/move-icon.png diff --git a/client/dist/js/main.bundle.js b/client/dist/js/main.bundle.js index d71d585..3a4be96 100644 --- a/client/dist/js/main.bundle.js +++ b/client/dist/js/main.bundle.js @@ -74,134 +74,139 @@ module.exports = jQuery; /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(jQuery) {(function ($) { +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); - $.entwine('ss', function ($) { - $('.cms-content-fields > #Form_EditForm_error').entwine({ - 'onadd': function onadd() { - var $target = $('.blog-admin-outer'); - if ($target.length == 1) { - $target.prepend(this); - } + + +__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.entwine('ss', function ($) { + $('.cms-content-fields > #Form_EditForm_error').entwine({ + 'onadd': function onadd() { + var $target = $('.blog-admin-outer'); + if ($target.length == 1) { + $target.prepend(this); } - }); - - $('.toggle-description').entwine({ - 'onadd': function onadd() { - var $this = $(this); - - if ($this.hasClass('toggle-description-enabled')) { - return; - } - - $this.addClass('toggle-description-enabled'); - - var shown = false; - var $helpInfo = $this.closest('.field').find('.form-text'); - - $this.on('click', function () { - $helpInfo[shown ? 'hide' : 'show'](); - $this.toggleClass('toggle-description-shown'); - shown = !shown; - }); - - $helpInfo.hide(); - - $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'); - } - }); - - $('.MergeAction').entwine({ - 'onadd': function onadd() { - var $this = $(this); - - $this.on('click', 'select', function () { - return false; - }); - - $this.children('button').each(function (i, button) { - var $button = $(button); - var $select = $button.prev('select'); - - $button.before(''); - }); - - $this.on('change', 'select', function (e) { - var $target = $(e.target); - - $target.next('input').val($target.val()); - }); - - $this.children('button, select').hide(); - - $this.on('click', '.MergeActionReveal', function (e) { - var $target = $(e.target); - - $target.parent().children('button, select').show(); - $target.hide(); - - return false; - }); - } - }); - - $('.blog-admin-sidebar.cms-panel').entwine({ - MinInnerWidth: 620, - onadd: function onadd() { - this._super(); - this.updateLayout(); - - if (!this.hasClass('collapsed') && $(".blog-admin-outer").width() < this.getMinInnerWidth()) { - this.collapsePanel(); - } - - window.onresize = function () { - this.updateLayout(); - }.bind(this); - }, - togglePanel: function togglePanel(bool, silent) { - this._super(bool, silent); - this.updateLayout(); - }, - - updateLayout: function updateLayout() { - $(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() - }); - } - }); + } }); -})(jQuery); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + + $('.toggle-description').entwine({ + 'onadd': function onadd() { + var $this = $(this); + + if ($this.hasClass('toggle-description-enabled')) { + return; + } + + $this.addClass('toggle-description-enabled'); + + var shown = false; + var $helpInfo = $this.closest('.field').find('.form-text'); + + $this.on('click', function () { + $helpInfo[shown ? 'hide' : 'show'](); + $this.toggleClass('toggle-description-shown'); + shown = !shown; + }); + + $helpInfo.hide(); + + $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'); + } + }); + + $('.MergeAction').entwine({ + 'onadd': function onadd() { + var $this = $(this); + + $this.on('click', 'select', function () { + return false; + }); + + $this.children('button').each(function (i, button) { + var $button = $(button); + var $select = $button.prev('select'); + + $button.before(''); + }); + + $this.on('change', 'select', function (e) { + var $target = $(e.target); + + $target.next('input').val($target.val()); + }); + + $this.children('button, select').hide(); + + $this.on('click', '.MergeActionReveal', function (e) { + var $target = $(e.target); + + $target.parent().children('button, select').show(); + $target.hide(); + + return false; + }); + } + }); + + $('.blog-admin-sidebar.cms-panel').entwine({ + MinInnerWidth: 620, + onadd: function onadd() { + this._super(); + this.updateLayout(); + + if (!this.hasClass('collapsed') && $(".blog-admin-outer").width() < this.getMinInnerWidth()) { + this.collapsePanel(); + } + + window.onresize = function () { + this.updateLayout(); + }.bind(this); + }, + togglePanel: function togglePanel(bool, silent) { + this._super(bool, silent); + this.updateLayout(); + }, + + updateLayout: function updateLayout() { + $(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() + }); + } + }); +}); /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(jQuery) {(function ($) { - $.entwine('ss', function ($) { - $('.add-existing-autocompleter input.text').entwine({ - 'onkeydown': function onkeydown(e) { - if (e.which == 13) { - $parent = $(this).parents('.add-existing-autocompleter'); - $parent.find('button[type="submit"]').click(); - return false; - } +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); + + +__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.entwine('ss', function ($) { + $('.add-existing-autocompleter input.text').entwine({ + 'onkeydown': function onkeydown(e) { + if (e.which === 13) { + var $parent = $(this).parents('.add-existing-autocompleter'); + $parent.find('button[type="submit"]').click(); + e.preventDefault(); + return false; } - }); + } }); -})(jQuery); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +}); /***/ }), /* 3 */ @@ -209,10 +214,8 @@ module.exports = jQuery; "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bundles_cms_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bundles_cms_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_bundles_cms_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_bundles_gridfieldaddbydbfield_js__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_bundles_gridfieldaddbydbfield_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_bundles_gridfieldaddbydbfield_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bundles_cms__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_bundles_gridfieldaddbydbfield__ = __webpack_require__(2); diff --git a/client/dist/styles/main.css b/client/dist/styles/main.css index 4a5ba9d..7f3b52b 100644 --- a/client/dist/styles/main.css +++ b/client/dist/styles/main.css @@ -1,2 +1,2 @@ -.no-sidebar .content-container.size3of4{width:75%}.blog-entry .post-image img{width:98.75%}.blog-sidebar .WidgetHolder ul{margin-left:0}.blog-sidebar .WidgetHolder ul li,ul.blogTagCloud{list-style-type:none}ul.blogTagCloud{clear:both}ul.blogTagCloud li{float:left;display:inline;padding-right:8px}ul.blogTagCloud li a span{float:left;line-height:30px;text-align:center;padding:0}ul.blogTagCloud .tagCount10{font-size:26pt}ul.blogTagCloud .tagCount9{font-size:24pt}ul.blogTagCloud .tagCount8{font-size:22pt}ul.blogTagCloud .tagCount7{font-size:20pt}ul.blogTagCloud .tagCount6{font-size:18pt}ul.blogTagCloud .tagCount5{font-size:16pt}ul.blogTagCloud .tagCount4{font-size:14pt}ul.blogTagCloud .tagCount3{font-size:12pt}ul.blogTagCloud .tagCount2{font-size:10pt}ul.blogTagCloud .tagCount1{font-size:8pt}#FeaturedImage .middleColumn{clear:none;float:left}.has-panel .cms-content-tools.blog-admin-sidebar{width:280px;border-right:none;border-left:1px solid #c0c0c2;position:absolute!important;right:0;top:0;height:100%}.has-panel .cms-content-tools.blog-admin-sidebar .cms-panel-toggle a{text-align:left;margin:0}.has-panel .cms-content-tools.blog-admin-sidebar .cms-panel-toggle.south{border-top:1px solid #aaa}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer{width:100%;padding-right:280px;position:absolute;height:100%;overflow-y:hidden;overflow-x:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset{position:relative;overflow:auto;height:100%;width:100%}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset #Title label{float:none}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset #Title .middleColumn,.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset #Title input{width:100%;max-width:100%;margin-left:0}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field+.field{margin-top:10px}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.urlsegment .preview{padding-top:0;line-height:25px}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.urlsegment .edit{float:right}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn>.date{width:60%}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn>.time{width:36%;float:right}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn .middleColumn,.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn input{width:100%}.has-panel .cms-content-tools.blog-admin-sidebar.collapsed~.blog-admin-outer{padding-right:41px}.has-panel .cms-content-tools.blog-admin-sidebar.collapsed~.blog-admin-outer #Root_Main{margin-right:15px}.has-panel .cms-content-tools.blog-admin-sidebar.cms-content-tools .cms-panel-content{width:auto}.toggle-description{text-indent:-1000000px;display:inline-block;width:20px;height:20px;margin-left:4px;cursor:pointer}.middleColumn.toggle-description-correct-middle{margin-left:0;float:left;width:416px}.tab-content .field p.toggle-description-correct-right{display:inline-block;margin-left:0;padding-left:0;clear:none;float:left}.description.toggle-description-correct-description{width:416px;padding:12px 0}.custom-summary .ui-accordion-content .field{margin:0}.custom-summary .ui-accordion-content,.custom-summary .ui-accordion-content .field{padding:0}.custom-summary .ui-icon-triangle-1-e{background-position:-16px -128px}.cms table.ss-gridfield-table tr td.MergeAction{width:225px}.cms table.ss-gridfield-table tr td.MergeAction a{display:block;height:100%;width:100%}.cms table.ss-gridfield-table tr td.MergeAction select{width:150px}.cms-content-actions,.cms-preview-controls{z-index:999}.blog-cms-categorisation .MergeActionReveal{margin-left:10px}.blog-cms-categorisation .toolbar--content{margin-top:0}.blog-cms-categorisation .MergeActionReveal:after{content:"";display:inline-block;height:16px;width:16px;margin-left:4px}.blog-cms-categorisation button.action{margin-left:5px} +.no-sidebar .content-container.size3of4{width:75%}.blog-entry .post-image img{width:98.75%}.blog-sidebar .WidgetHolder ul{margin-left:0}.blog-sidebar .WidgetHolder ul li,ul.blogTagCloud{list-style-type:none}ul.blogTagCloud{clear:both}ul.blogTagCloud li{float:left;display:inline;padding-right:8px}ul.blogTagCloud li a span{float:left;line-height:30px;text-align:center;padding:0}ul.blogTagCloud .tagCount10{font-size:26pt}ul.blogTagCloud .tagCount9{font-size:24pt}ul.blogTagCloud .tagCount8{font-size:22pt}ul.blogTagCloud .tagCount7{font-size:20pt}ul.blogTagCloud .tagCount6{font-size:18pt}ul.blogTagCloud .tagCount5{font-size:16pt}ul.blogTagCloud .tagCount4{font-size:14pt}ul.blogTagCloud .tagCount3{font-size:12pt}ul.blogTagCloud .tagCount2{font-size:10pt}ul.blogTagCloud .tagCount1{font-size:8pt}#FeaturedImage .middleColumn{clear:none;float:left}.has-panel .cms-content-tools.blog-admin-sidebar{width:280px;border-right:0;border-left:1px solid #c0c0c2;position:absolute!important;right:0;top:0;height:100%}.has-panel .cms-content-tools.blog-admin-sidebar .cms-panel-toggle a{text-align:left;margin:0}.has-panel .cms-content-tools.blog-admin-sidebar .cms-panel-toggle.south{border-top:1px solid #aaa}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer{width:100%;padding-right:280px;position:absolute;height:100%;overflow-y:hidden;overflow-x:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset{position:relative;overflow:auto;height:100%;width:100%}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset #Title label{float:none}.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset #Title .middleColumn,.has-panel .cms-content-tools.blog-admin-sidebar~.blog-admin-outer>.ss-tabset #Title input{width:100%;max-width:100%;margin-left:0}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field+.field{margin-top:10px}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.urlsegment .preview{padding-top:0;line-height:25px}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.urlsegment .edit{float:right}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn>.date{width:60%}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn>.time{width:36%;float:right}.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn .middleColumn,.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view>.field.datetime>.middleColumn input{width:100%}.has-panel .cms-content-tools.blog-admin-sidebar.collapsed~.blog-admin-outer{padding-right:41px}.has-panel .cms-content-tools.blog-admin-sidebar.collapsed~.blog-admin-outer #Root_Main{margin-right:15px}.has-panel .cms-content-tools.blog-admin-sidebar.cms-content-tools .cms-panel-content{width:auto}.toggle-description{display:inline-block;font-size:1.2rem;width:20px;height:20px;margin-top:1px;cursor:pointer}.middleColumn.toggle-description-correct-middle{margin-left:0;float:left;width:416px}.tab-content .field p.toggle-description-correct-right{display:inline-block;margin-left:0;padding-left:0;clear:none;float:left}.description.toggle-description-correct-description{width:416px;padding:12px 0}.custom-summary .ui-accordion-content,.custom-summary .ui-accordion-content .field{padding:0}.custom-summary .ui-icon-triangle-1-e{background-position:-16px -128px}.cms table.ss-gridfield-table tr td.MergeAction{width:225px}.cms table.ss-gridfield-table tr td.MergeAction a{display:block;height:100%;width:100%}.cms table.ss-gridfield-table tr td.MergeAction select{width:150px}.cms-content-actions,.cms-preview-controls{z-index:999}.blog-cms-categorisation .toolbar--content{margin-top:0}.blog-cms-categorisation .MergeActionReveal:after{content:"@";font-family:silverstripe;display:inline-block;position:relative;margin-left:10px;top:3px}.blog-cms-categorisation .blog-merge-action{margin-top:5px} /*# sourceMappingURL=main.css.map*/ \ No newline at end of file diff --git a/images/site-tree-icon.png b/client/images/site-tree-icon.png similarity index 100% rename from images/site-tree-icon.png rename to client/images/site-tree-icon.png diff --git a/client/src/bundles/cms.js b/client/src/bundles/cms.js index d73f70c..22d076e 100644 --- a/client/src/bundles/cms.js +++ b/client/src/bundles/cms.js @@ -1,144 +1,142 @@ -(function ($) { +/* global window */ +import jQuery from 'jquery'; - $.entwine('ss', function ($) { - - /** - * The page success/error message sits outside of the html block - * containing the sidebar and cms fields. This means it overflows - * underneath the sidebar. - * - * @see https://github.com/silverstripe/silverstripe-blog/issues/210 - */ - $('.cms-content-fields > #Form_EditForm_error').entwine({ - 'onadd': function () { - var $target = $('.blog-admin-outer'); - if ($target.length == 1) { - $target.prepend(this); - } +jQuery.entwine('ss', ($) => { + /** + * The page success/error message sits outside of the html block + * containing the sidebar and cms fields. This means it overflows + * underneath the sidebar. + * + * @see https://github.com/silverstripe/silverstripe-blog/issues/210 + */ + $('.cms-content-fields > #Form_EditForm_error').entwine({ + 'onadd': function () { + var $target = $('.blog-admin-outer'); + if ($target.length == 1) { + $target.prepend(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; - } - - $this.addClass('toggle-description-enabled'); - - /** - * Toggle next description when button is clicked. - */ - var shown = false; - var $helpInfo = $this.closest('.field').find('.form-text'); - - $this.on('click', function () { - $helpInfo[shown ? 'hide' : 'show'](); - $this.toggleClass('toggle-description-shown'); - shown = !shown; - }); - - /** - * Hide next description by default. - */ - $helpInfo.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'); - } - }); - - /** - * Custom merge actions for tags and categories - */ - $('.MergeAction').entwine({ - 'onadd': function () { - var $this = $(this); - - $this.on('click', 'select', function () { - return false; - }); - - $this.children('button').each(function (i, button) { - var $button = $(button); - var $select = $button.prev('select'); - - $button.before(''); - }); - - $this.on('change', 'select', function (e) { - var $target = $(e.target); - - $target.next('input').val($target.val()); - }); - - $this.children('button, select').hide(); - - $this.on('click', '.MergeActionReveal', function (e) { - var $target = $(e.target); - - $target.parent().children('button, select').show(); - $target.hide(); - - 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(); - - // 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 () { - 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 () { - $(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() - }); - - } - }); - + } }); -})(jQuery); + + /** + * 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; + } + + $this.addClass('toggle-description-enabled'); + + /** + * Toggle next description when button is clicked. + */ + var shown = false; + var $helpInfo = $this.closest('.field').find('.form-text'); + + $this.on('click', function () { + $helpInfo[shown ? 'hide' : 'show'](); + $this.toggleClass('toggle-description-shown'); + shown = !shown; + }); + + /** + * Hide next description by default. + */ + $helpInfo.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'); + } + }); + + /** + * Custom merge actions for tags and categories + */ + $('.MergeAction').entwine({ + 'onadd': function () { + var $this = $(this); + + $this.on('click', 'select', function () { + return false; + }); + + $this.children('button').each(function (i, button) { + var $button = $(button); + var $select = $button.prev('select'); + + $button.before(''); + }); + + $this.on('change', 'select', function (e) { + var $target = $(e.target); + + $target.next('input').val($target.val()); + }); + + $this.children('button, select').hide(); + + $this.on('click', '.MergeActionReveal', function (e) { + var $target = $(e.target); + + $target.parent().children('button, select').show(); + $target.hide(); + + 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(); + + // 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 () { + 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 () { + $(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() + }); + + } + }); +}); diff --git a/client/src/bundles/gridfieldaddbydbfield.js b/client/src/bundles/gridfieldaddbydbfield.js index 67799f3..4dbc331 100644 --- a/client/src/bundles/gridfieldaddbydbfield.js +++ b/client/src/bundles/gridfieldaddbydbfield.js @@ -1,16 +1,17 @@ -(function ($) { - $.entwine('ss', function ($) { - /** - * Prevent the CMS hijacking the return key - */ - $('.add-existing-autocompleter input.text').entwine({ - 'onkeydown': function (e) { - if (e.which == 13) { - $parent = $(this).parents('.add-existing-autocompleter'); - $parent.find('button[type="submit"]').click(); - return false; - } +import jQuery from 'jquery'; + +jQuery.entwine('ss', ($) => { + /** + * Prevent the CMS hijacking the return key + */ + $('.add-existing-autocompleter input.text').entwine({ + 'onkeydown': function (e) { + if (e.which === 13) { + const $parent = $(this).parents('.add-existing-autocompleter'); + $parent.find('button[type="submit"]').click(); + e.preventDefault(); + return false; } - }); + } }); -})(jQuery); +}); diff --git a/client/src/main.js b/client/src/main.js index d33d3b6..d71c17a 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -1,2 +1,2 @@ -import 'bundles/cms.js'; -import 'bundles/gridfieldaddbydbfield.js'; +import 'bundles/cms'; +import 'bundles/gridfieldaddbydbfield'; diff --git a/client/src/styles/blog.scss b/client/src/styles/blog.scss index 2f022cf..5f409f7 100644 --- a/client/src/styles/blog.scss +++ b/client/src/styles/blog.scss @@ -1,75 +1,76 @@ .no-sidebar .content-container.size3of4 { - width: 75%; + width: 75%; } .blog-entry .post-image img { - width: 98.75%; + width: 98.75%; } .blog-sidebar .WidgetHolder ul { - margin-left: 0; + margin-left: 0; - li { - list-style-type: none; - } + li { + list-style-type: none; + } } // tag cloud related -$baseTagFontSize:4pt; +$base_tag_font_size: 4pt; ul.blogTagCloud { - list-style-type: none; - clear: both; + list-style-type: none; + clear: both; - li { - float: left; - display: inline; - padding-right: 8px; + li { + float: left; + display: inline; + padding-right: 8px; - a span { - float: left; - line-height: 30px; text-align: center; - padding: 0px; - } - } + a span { + float: left; + line-height: 30px; + text-align: center; + padding: 0; + } + } - .tagCount10 { - font-size: $baseTagFontSize+22pt; - } + .tagCount10 { + font-size: $base_tag_font_size + 22pt; + } - .tagCount9 { - font-size: $baseTagFontSize+20pt; - } + .tagCount9 { + font-size: $base_tag_font_size + 20pt; + } - .tagCount8 { - font-size: $baseTagFontSize+18pt; - } + .tagCount8 { + font-size: $base_tag_font_size + 18pt; + } - .tagCount7 { - font-size: $baseTagFontSize+16pt; - } + .tagCount7 { + font-size: $base_tag_font_size + 16pt; + } - .tagCount6 { - font-size: $baseTagFontSize+14pt; - } + .tagCount6 { + font-size: $base_tag_font_size + 14pt; + } - .tagCount5 { - font-size: $baseTagFontSize+12pt; - } + .tagCount5 { + font-size: $base_tag_font_size + 12pt; + } - .tagCount4 { - font-size: $baseTagFontSize+10pt; - } + .tagCount4 { + font-size: $base_tag_font_size + 10pt; + } - .tagCount3 { - font-size: $baseTagFontSize+8pt; - } + .tagCount3 { + font-size: $base_tag_font_size + 8pt; + } - .tagCount2 { - font-size: $baseTagFontSize+6pt; - } + .tagCount2 { + font-size: $base_tag_font_size + 6pt; + } - .tagCount1 { - font-size: $baseTagFontSize+4pt; - } + .tagCount1 { + font-size: $base_tag_font_size + 4pt; + } } diff --git a/client/src/styles/cms.scss b/client/src/styles/cms.scss index 84c2b37..f4fcd7f 100755 --- a/client/src/styles/cms.scss +++ b/client/src/styles/cms.scss @@ -3,194 +3,188 @@ */ #FeaturedImage .middleColumn { - clear: none; - float: left; + clear: none; + float: left; } .has-panel .cms-content-tools.blog-admin-sidebar { - width: 280px; - border-right: none; - border-left: 1px solid #C0C0C2; - position: absolute !important; /* overrides cms !imporant style */ - right: 0px; - top: 0; + width: 280px; + border-right: 0; + border-left: 1px solid #C0C0C2; + position: absolute !important; /* overrides cms !imporant style */ + right: 0; + top: 0; + height: 100%; + + .cms-panel-toggle a { + text-align: left; + margin: 0; + } + + .cms-panel-toggle.south { + border-top: 1px solid #aaaaaa; + } + + ~ .blog-admin-outer { + width: 100%; + padding-right: 280px; + position: absolute; height: 100%; + overflow-y: hidden; + overflow-x: hidden; + box-sizing: border-box; - .cms-panel-toggle a { - text-align: left; - margin: 0; + > .ss-tabset { + position: relative; + overflow: auto; + height: 100%; + width: 100%; + + #Title { + label { + float: none; + } + + .middleColumn, + input { + width: 100%; + max-width: 100%; + margin-left: 0; + } + } } + } - .cms-panel-toggle.south { - border-top: 1px solid #aaaaaa; - } + .cms-content-view { + > .field { + + .field { + margin-top: 10px; + } - ~ .blog-admin-outer { - width: 100%; - padding-right: 280px; - position: absolute; - height: 100%; - overflow-y: hidden; - overflow-x: hidden; - box-sizing: border-box; + &.urlsegment { + .preview { + padding-top: 0; + line-height: 25px; + } - > .ss-tabset { - position: relative; - overflow: auto; - height: 100%; + .edit { + float: right; + } + } + + &.datetime { + > .middleColumn { + > .date { + width: 60%; + } + + > .time { + width: 36%; + float: right; + } + + .middleColumn, + input { width: 100%; - - #Title { - label { - float: none; - } - .middleColumn, input { - width: 100%; - max-width: 100%; - margin-left: 0; - } - } + } } + } } + } - .cms-content-view { - > .field { - + .field { - margin-top: 10px; - } + &.collapsed { + ~ .blog-admin-outer { + padding-right: 41px; - &.urlsegment { - .preview { - padding-top: 0; - line-height: 25px; - } - - .edit { - float: right; - } - } - - &.datetime { - > .middleColumn { - > .date { - width: 60%; - } - - > .time { - width: 36%; - float: right; - } - - .middleColumn, input { - width: 100%; - } - } - } - } + #Root_Main { + margin-right: 15px; + } } + } - &.collapsed { - ~ .blog-admin-outer { - padding-right: 41px; - - #Root_Main { - margin-right: 15px; - } - } - - } - - &.cms-content-tools { - .cms-panel-content { - width: auto; - } + &.cms-content-tools { + .cms-panel-content { + width: auto; } + } } .toggle-description { - text-indent: -1000000px; - display: inline-block; - //background: url("../images/information.png") no-repeat center center; - width: 20px; - height: 20px; - margin-left: 4px; - cursor:pointer; + display: inline-block; + font-size: 1.2rem; + width: 20px; + height: 20px; + margin-top: 1px; + cursor: pointer; } .middleColumn.toggle-description-correct-middle { - margin-left: 0; - float: left; - width: 416px; + margin-left: 0; + float: left; + width: 416px; } .tab-content .field p.toggle-description-correct-right { - display: inline-block; - margin-left: 0; - padding-left: 0; - clear: none; - float: left; + display: inline-block; + margin-left: 0; + padding-left: 0; + clear: none; + float: left; } .description.toggle-description-correct-description { - width: 416px; - padding: 12px 0; + width: 416px; + padding: 12px 0; } .custom-summary { - .ui-accordion-content .field { - margin: 0; - } + .ui-accordion-content, + .ui-accordion-content .field { + padding: 0; + } - .ui-accordion-content, - .ui-accordion-content .field { - padding: 0; - } - - .ui-icon-triangle-1-e { - background-position: -16px -128px; - } + // Change the caret to a plus icon + .ui-icon-triangle-1-e { + background-position: -16px -128px; + } } .cms table.ss-gridfield-table { - tr td.MergeAction { - width: 225px; + tr td.MergeAction { + width: 225px; - a { - display: block; - height: 100%; - width: 100%; - } - - select { - width: 150px; - } + a { + display: block; + height: 100%; + width: 100%; } + + select { + width: 150px; + } + } } .cms-content-actions, .cms-preview-controls { - z-index: 999; + z-index: 999; } .blog-cms-categorisation { - .MergeActionReveal { - margin-left: 10px; - } + .toolbar--content { + margin-top: 0; + } - .toolbar--content { - margin-top: 0; - } + .MergeActionReveal:after { + content: "@"; + font-family: silverstripe; + display: inline-block; + position: relative; + margin-left: 10px; + top: 3px; + } - .MergeActionReveal:after { - content: ''; - //background: url('../images/move-icon.png'); - display: inline-block; - height: 16px; - width: 16px; - margin-left: 4px; - } - - button.action { - margin-left: 5px; - } + .blog-merge-action { + margin-top: 5px; + } } diff --git a/images/blog-icon-s0a5ab5f851.png b/images/blog-icon-s0a5ab5f851.png deleted file mode 100644 index 1668f7a748b75abd1239f984b762017ae3d75f2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 680 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl482JKxLR^7d*49s~Z6CQB9&p#) z<*B_ZP<2_b>XK0T8Oi(|(z%g5Cm&W?`G zPEH`??Cesz*45F`9SEwIdwO~XHLeP8S(VeZq@;IIW8bXK>5C_olujutpFU^dj2ScL zELgl@!-n0vckkJ=XD<-!+rMw`zQc!)oIij5?%lih@85s$;K9q6FW||6bKC7l9!X zRTAVE%=rKRmoJ|_J$wB7(xw0B|Npc*$(ljoVTu3$8~o>yPrUeCyzlEtb{;1nwt2Sd_zS<^{g2WlCUQTeH zT6?T+@4V;@|5hs*OnmdH@m1xXY$a#y(wOGZvTcF~j?HJ8YtzbmDMn=8Y1YOHZDy-U zI~HivCo#pJTY6D$&f4df)Foomv!luqy4L3yWNqrvpMO}l>W!=VV>21Q^s{yR iTxPm*=W)TzZ~U=Ap{A33_znWS&fw|l=d#Wzp$PzZm|+|M diff --git a/images/information.png b/images/information.png deleted file mode 100755 index 12cd1aef900803abba99b26920337ec01ad5c267..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 778 zcmV+l1NHogP)BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@ zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@ zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxOgGuU&_u!9QqR!T z%-qskN5Kfl*Eg`xH!{#Qu(UEYwlXkMfC43;ZAB?*RzWUqP`iLUTcwPWk^(Dz{qpj1 zy>er{{GxPyLrY6beFGzXBO_g)3fZE`@j@w*YQzUNJP7fB~jokyxN_sAmB35=^15FMg%Dxp39RB|)hO_hL1;IHa;5 zRX-@TIKQ+g85nVC${?!>telHd6HD@oLh|!-V4)b0kzbNuoRMFk;OqX$Y%oHml7Xu>;H**(PLkm+wLst_EXEzsDGb2YM zM-vw_XES4%UYGpj(%jU%5}4i;gkD#idO-;yw*Y9fOKMSOS!#+~QGTuh*yC22xZUD} z(>$o&6x?oc#;I2y=oo!a^ddz!ObD2UKumbz1#;lYKQ#}S=8J%dd*brWjSLJ-zdcs}|0h9YTB1gvr+|p#U+&s9{uh^T zaPi$>b9sqQQ^zGA;fotY4o?4kW%KUK)pu`CpLsVo?KRWs#`c>xfBv2K-2D8XHZ$MJ zw{j-@pOzZf%KWw-YT(8v`OK_;_ic8-m-h|?pn1=rO!8J zrAGY(MTQ+Y+H<+Ct@-=s*11BSf}P#-ESEOvZL)k5uNIt|{5*R;AFrUg`fa^=cEZgk zKL0rV!&f~a*yPG(>p!3W+E3_nc=yfuYvfJWT9?X{i|ZDwT6grjTkDCix~|EmxjrAu zV3U|De7U#!^Pb=mlRt0kjO?m!Kh)a!xafV(vdm+8(!w%3KP*`t@7ShNsPOSm*4>qV zTYoOrvST}J!1m4kI8#SlT!nS+jHtwe=U&%*S~^ecFOOF3yb z|82Y}K5f}iZ^IQ^mI-!DjL@;4>Q$8zSti|fu%-F%Tou2-L!lC7tA!2p$_tGZyWG^| zJ~=S?F=((eyv*5d?Zcxw@5rJ?DN9L<^P4VhQK+y_ey})Vf1?1?#0ww1SG26ERD50= z=693#jQP<`Wv{KTA2Pnac;d<3Cdq}ayZeOg?Q$x(Zv^r=o)zx*-6ACPX)^00nX?6k z9KotPdR1j3HS_&`ng(jUP-IKH*XQe?rSR4#CiL>bD9eo(SQ6hfBsz(+$J9CA`F85< o&EozvnS(wuFPnKz>NB!2yjwFTb>c;#m7og3)78&qol`;+0FLN~eE