diff --git a/client/dist/js/LeftAndMain.Ping.js b/client/dist/js/LeftAndMain.Ping.js index fce8451e1..0f4fe1fc1 100644 --- a/client/dist/js/LeftAndMain.Ping.js +++ b/client/dist/js/LeftAndMain.Ping.js @@ -1,67 +1 @@ -<<<<<<< HEAD -webpackJsonp([6],{15:function(n,e,t){"use strict";var i=void 0!==window.jQuery?window.jQuery:null;n.exports=i},930:function(n,e,t){"use strict";var i=t(15);(function(n){return n&&n.__esModule?n:{default:n}})(i).default.entwine("ss.ping",function(n){n(".cms-container").entwine({PingIntervalSeconds:300,onadd:function(){this._setupPinging(),this._super()},_setupPinging:function(){var e=function(n,e){(n.status>400||0==n.responseText)&&(window.open("Security/login")?alert("Please log in and then try again"):alert("Please enable pop-ups for this site"))};setInterval(function(){n.ajax({url:"Security/ping",global:!1,type:"POST",complete:e})},1e3*this.getPingIntervalSeconds())}})})}},[930]); -======= -webpackJsonp([6],{ - -/***/ 16: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var jQuery = typeof window.jQuery !== 'undefined' ? window.jQuery : null; - -module.exports = jQuery; - -/***/ }), - -/***/ 944: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _jQuery = __webpack_require__(16); - -var _jQuery2 = _interopRequireDefault(_jQuery); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_jQuery2.default.entwine('ss.ping', function ($) { - - $('.cms-container').entwine({ - PingIntervalSeconds: 5 * 60, - - onadd: function onadd() { - this._setupPinging(); - this._super(); - }, - - _setupPinging: function _setupPinging() { - var onSessionLost = function onSessionLost(xmlhttp, status) { - if (xmlhttp.status > 400 || xmlhttp.responseText == 0) { - if (window.open('Security/login')) { - alert('Please log in and then try again'); - } else { - alert('Please enable pop-ups for this site'); - } - } - }; - - setInterval(function () { - $.ajax({ - url: 'Security/ping', - global: false, - type: 'POST', - complete: onSessionLost - }); - }, this.getPingIntervalSeconds() * 1000); - } - }); -}); - -/***/ }) - -},[944]); -//# sourceMappingURL=LeftAndMain.Ping.js.map ->>>>>>> Save button's visual (changed and unchanged states) +webpackJsonp([6],{15:function(n,e,t){"use strict";var i=void 0!==window.jQuery?window.jQuery:null;n.exports=i},931:function(n,e,t){"use strict";var i=t(15);(function(n){return n&&n.__esModule?n:{default:n}})(i).default.entwine("ss.ping",function(n){n(".cms-container").entwine({PingIntervalSeconds:300,onadd:function(){this._setupPinging(),this._super()},_setupPinging:function(){var e=function(n,e){(n.status>400||0==n.responseText)&&(window.open("Security/login")?alert("Please log in and then try again"):alert("Please enable pop-ups for this site"))};setInterval(function(){n.ajax({url:"Security/ping",global:!1,type:"POST",complete:e})},1e3*this.getPingIntervalSeconds())}})})}},[931]); \ No newline at end of file diff --git a/client/dist/js/MemberImportForm.js b/client/dist/js/MemberImportForm.js index 9059077ac..21f862348 100644 --- a/client/dist/js/MemberImportForm.js +++ b/client/dist/js/MemberImportForm.js @@ -1,54 +1 @@ -<<<<<<< HEAD -webpackJsonp([5],{15:function(n,t,e){"use strict";var i=void 0!==window.jQuery?window.jQuery:null;n.exports=i},931:function(n,t,e){"use strict";var i=e(15);(function(n){return n&&n.__esModule?n:{default:n}})(i).default.entwine("ss",function(n){n(".import-form .advanced").entwine({onmatch:function(){this._super(),this.hide()},onunmatch:function(){this._super()}}),n(".import-form a.toggle-advanced").entwine({onclick:function(n){return this.parents("form:eq(0)").find(".advanced").toggle(),!1}})})}},[931]); -======= -webpackJsonp([5],{ - -/***/ 16: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var jQuery = typeof window.jQuery !== 'undefined' ? window.jQuery : null; - -module.exports = jQuery; - -/***/ }), - -/***/ 945: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _jQuery = __webpack_require__(16); - -var _jQuery2 = _interopRequireDefault(_jQuery); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_jQuery2.default.entwine('ss', function ($) { - $('.import-form .advanced').entwine({ - onmatch: function onmatch() { - this._super(); - - this.hide(); - }, - onunmatch: function onunmatch() { - this._super(); - } - }); - - $('.import-form a.toggle-advanced').entwine({ - onclick: function onclick(e) { - this.parents('form:eq(0)').find('.advanced').toggle(); - return false; - } - }); -}); - -/***/ }) - -},[945]); -//# sourceMappingURL=MemberImportForm.js.map ->>>>>>> Save button's visual (changed and unchanged states) +webpackJsonp([5],{15:function(n,t,e){"use strict";var i=void 0!==window.jQuery?window.jQuery:null;n.exports=i},932:function(n,t,e){"use strict";var i=e(15);(function(n){return n&&n.__esModule?n:{default:n}})(i).default.entwine("ss",function(n){n(".import-form .advanced").entwine({onmatch:function(){this._super(),this.hide()},onunmatch:function(){this._super()}}),n(".import-form a.toggle-advanced").entwine({onclick:function(n){return this.parents("form:eq(0)").find(".advanced").toggle(),!1}})})}},[932]); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_sslink-email.js b/client/dist/js/TinyMCE_sslink-email.js index 53b4e97b5..30c0fd00f 100644 --- a/client/dist/js/TinyMCE_sslink-email.js +++ b/client/dist/js/TinyMCE_sslink-email.js @@ -1,209 +1 @@ -<<<<<<< HEAD -webpackJsonp([2],{100:function(e,t){e.exports=TinyMCEActionRegistrar},125:function(e,t){e.exports=ReactApollo},180:function(e,t){e.exports=InsertLinkModal},24:function(e,t){e.exports=i18n},45:function(e,t){e.exports=Injector},933:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(24),a=n(r),l=i(100),o=n(l),s=i(0),d=n(s),u=i(25),c=n(u),m=i(125),f=i(27),p=n(f),k=i(180),g=i(45);o.default.addAction("sslink",{text:a.default._t("Admin.LINKLABEL_EMAIL","Link to email address"),onclick:function(e){return e.execCommand("sslinkemail")}}).addCommandWithUrlTest("sslinkemail",/^mailto:/);var h={init:function(e){e.addCommand("sslinkemail",function(){window.jQuery("#"+e.id).entwine("ss").openLinkEmailDialog()})}},_="insert-link__dialog-wrapper--email",A=(0,g.provideInjector)((0,k.createInsertLinkModal)("SilverStripe\\Admin\\LeftAndMain","EditorEmailLink"));p.default.entwine("ss",function(e){e("textarea.htmleditor").entwine({openLinkEmailDialog:function(){var t=e("#"+_);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e("#"+_).entwine({renderModal:function(e){var t=this,i=ss.store,n=ss.apolloClient,r=function(){return t.close()},l=function(){return t.handleInsert.apply(t,arguments)},o=this.getOriginalAttributes();c.default.render(d.default.createElement(m.ApolloProvider,{store:i,client:n},d.default.createElement(A,{show:e,onInsert:l,onHide:r,title:a.default._t("Admin.LINK_EMAIL","Insert email link"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--email",fileAttributes:o,identifier:"Admin.InsertLinkEmailModal"})),this[0])},getOriginalAttributes:function(){var t=this.getElement().getEditor(),i=e(t.getSelectedNode()),n=(i.attr("href")||"").split("?"),r=n[0].replace(/^mailto:/,"").split("?")[0];r.match(/.+@.+\..+/)||(r="");var a=n[1]?n[1].match(/subject=([^&]+)/):"";return{Link:r,Subject:a?a[1]:"",Description:i.attr("title")}},buildAttributes:function(e){var t=this._super(e),i="",n=t.href.replace(/^mailto:/,"").split("?")[0];return n.match(/.+@.+\..+/)||(n=""),n&&(i="mailto:"+n),i&&e.Subject&&(i=i+"?subject="+encodeURIComponent(e.Subject)),t.href=i,delete t.target,t}})}),tinymce.PluginManager.add("sslinkemail",function(e){return h.init(e)}),t.default=h}},[933]); -======= -<<<<<<< HEAD -webpackJsonp([2],{100:function(e,t){e.exports=TinyMCEActionRegistrar},125:function(e,t){e.exports=ReactApollo},180:function(e,t){e.exports=InsertLinkModal},24:function(e,t){e.exports=i18n},45:function(e,t){e.exports=Injector},932:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(24),a=n(r),l=i(100),o=n(l),s=i(0),d=n(s),u=i(25),c=n(u),m=i(125),f=i(27),p=n(f),k=i(180),g=i(45);o.default.addAction("sslink",{text:a.default._t("Admin.LINKLABEL_EMAIL","Link to email address"),onclick:function(e){return e.execCommand("sslinkemail")}}).addCommandWithUrlTest("sslinkemail",/^mailto:/);var h={init:function(e){e.addCommand("sslinkemail",function(){window.jQuery("#"+e.id).entwine("ss").openLinkEmailDialog()})}},_="insert-link__dialog-wrapper--email",A=(0,g.provideInjector)((0,k.createInsertLinkModal)("SilverStripe\\Admin\\LeftAndMain","EditorEmailLink"));p.default.entwine("ss",function(e){e("textarea.htmleditor").entwine({openLinkEmailDialog:function(){var t=e("#"+_);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e("#"+_).entwine({renderModal:function(e){var t=this,i=ss.store,n=ss.apolloClient,r=function(){return t.close()},l=function(){return t.handleInsert.apply(t,arguments)},o=this.getOriginalAttributes();c.default.render(d.default.createElement(m.ApolloProvider,{store:i,client:n},d.default.createElement(A,{show:e,onInsert:l,onHide:r,title:a.default._t("Admin.LINK_EMAIL","Insert email link"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--email",fileAttributes:o,identifier:"Admin.InsertLinkEmailModal"})),this[0])},getOriginalAttributes:function(){var t=this.getElement().getEditor(),i=e(t.getSelectedNode()),n=(i.attr("href")||"").split("?"),r=n[0].replace(/^mailto:/,"").split("?")[0];r.match(/.+@.+\..+/)||(r="");var a=n[1]?n[1].match(/subject=([^&]+)/):"";return{Link:r,Subject:a?a[1]:"",Description:i.attr("title")}},buildAttributes:function(e){var t=this._super(e),i="",n=t.href.replace(/^mailto:/,"").split("?")[0];return n.match(/.+@.+\..+/)||(n=""),n&&(i="mailto:"+n),i&&e.Subject&&(i=i+"?subject="+encodeURIComponent(e.Subject)),t.href=i,delete t.target,t}})}),tinymce.PluginManager.add("sslinkemail",function(e){return h.init(e)}),t.default=h}},[932]); -======= -webpackJsonp([2],{ - -/***/ 100: -/***/ (function(module, exports) { - -module.exports = TinyMCEActionRegistrar; - -/***/ }), - -/***/ 126: -/***/ (function(module, exports) { - -module.exports = ReactApollo; - -/***/ }), - -/***/ 182: -/***/ (function(module, exports) { - -module.exports = InsertLinkModal; - -/***/ }), - -/***/ 23: -/***/ (function(module, exports) { - -module.exports = i18n; - -/***/ }), - -/***/ 45: -/***/ (function(module, exports) { - -module.exports = Injector; - -/***/ }), - -/***/ 947: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _i18n = __webpack_require__(23); - -var _i18n2 = _interopRequireDefault(_i18n); - -var _TinyMCEActionRegistrar = __webpack_require__(100); - -var _TinyMCEActionRegistrar2 = _interopRequireDefault(_TinyMCEActionRegistrar); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(26); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _reactApollo = __webpack_require__(126); - -var _jquery = __webpack_require__(27); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _InsertLinkModal = __webpack_require__(182); - -var _Injector = __webpack_require__(45); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var commandName = 'sslinkemail'; - -_TinyMCEActionRegistrar2.default.addAction('sslink', { - text: _i18n2.default._t('Admin.LINKLABEL_EMAIL', 'Link to email address'), - - onclick: function onclick(editor) { - return editor.execCommand(commandName); - } -}).addCommandWithUrlTest(commandName, /^mailto:/); - -var plugin = { - init: function init(editor) { - editor.addCommand(commandName, function () { - var field = window.jQuery('#' + editor.id).entwine('ss'); - - field.openLinkEmailDialog(); - }); - } -}; - -var modalId = 'insert-link__dialog-wrapper--email'; -var sectionConfigKey = 'SilverStripe\\Admin\\LeftAndMain'; -var formName = 'EditorEmailLink'; -var InsertLinkEmailModal = (0, _Injector.provideInjector)((0, _InsertLinkModal.createInsertLinkModal)(sectionConfigKey, formName)); - -_jquery2.default.entwine('ss', function ($) { - $('textarea.htmleditor').entwine({ - openLinkEmailDialog: function openLinkEmailDialog() { - var dialog = $('#' + modalId); - - if (!dialog.length) { - dialog = $('
'); - $('body').append(dialog); - } - dialog.addClass('insert-link__dialog-wrapper'); - - dialog.setElement(this); - dialog.open(); - } - }); - - $('#' + modalId).entwine({ - renderModal: function renderModal(show) { - var _this = this; - - var store = ss.store; - var client = ss.apolloClient; - var handleHide = function handleHide() { - return _this.close(); - }; - var handleInsert = function handleInsert() { - return _this.handleInsert.apply(_this, arguments); - }; - var attrs = this.getOriginalAttributes(); - - _reactDom2.default.render(_react2.default.createElement( - _reactApollo.ApolloProvider, - { store: store, client: client }, - _react2.default.createElement(InsertLinkEmailModal, { - show: show, - onInsert: handleInsert, - onHide: handleHide, - title: _i18n2.default._t('Admin.LINK_EMAIL', 'Insert email link'), - bodyClassName: 'modal__dialog', - className: 'insert-link__dialog-wrapper--email', - fileAttributes: attrs, - identifier: 'Admin.InsertLinkEmailModal' - }) - ), this[0]); - }, - getOriginalAttributes: function getOriginalAttributes() { - var editor = this.getElement().getEditor(); - var node = $(editor.getSelectedNode()); - - var hrefParts = (node.attr('href') || '').split('?'); - - var email = hrefParts[0].replace(/^mailto:/, '').split('?')[0]; - - if (!email.match(/.+@.+\..+/)) { - email = ''; - } - - var subjectMatch = hrefParts[1] ? hrefParts[1].match(/subject=([^&]+)/) : ''; - var subject = subjectMatch ? subjectMatch[1] : ''; - - return { - Link: email, - Subject: subject, - Description: node.attr('title') - }; - }, - buildAttributes: function buildAttributes(data) { - var attributes = this._super(data); - - var href = ''; - - var email = attributes.href.replace(/^mailto:/, '').split('?')[0]; - - if (!email.match(/.+@.+\..+/)) { - email = ''; - } - - if (email) { - href = 'mailto:' + email; - } - if (href && data.Subject) { - href = href + '?subject=' + encodeURIComponent(data.Subject); - } - attributes.href = href; - - delete attributes.target; - - return attributes; - } - }); -}); - -tinymce.PluginManager.add(commandName, function (editor) { - return plugin.init(editor); -}); -exports.default = plugin; - -/***/ }) - -},[947]); -//# sourceMappingURL=TinyMCE_sslink-email.js.map ->>>>>>> Save button's visual (changed and unchanged states) ->>>>>>> Save button's visual (changed and unchanged states) +webpackJsonp([2],{100:function(e,t){e.exports=TinyMCEActionRegistrar},125:function(e,t){e.exports=ReactApollo},180:function(e,t){e.exports=InsertLinkModal},24:function(e,t){e.exports=i18n},43:function(e,t){e.exports=Injector},934:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(24),a=n(r),l=i(100),o=n(l),s=i(0),d=n(s),u=i(25),c=n(u),m=i(125),f=i(27),p=n(f),k=i(180),g=i(43);o.default.addAction("sslink",{text:a.default._t("Admin.LINKLABEL_EMAIL","Link to email address"),onclick:function(e){return e.execCommand("sslinkemail")}}).addCommandWithUrlTest("sslinkemail",/^mailto:/);var h={init:function(e){e.addCommand("sslinkemail",function(){window.jQuery("#"+e.id).entwine("ss").openLinkEmailDialog()})}},_="insert-link__dialog-wrapper--email",A=(0,g.provideInjector)((0,k.createInsertLinkModal)("SilverStripe\\Admin\\LeftAndMain","EditorEmailLink"));p.default.entwine("ss",function(e){e("textarea.htmleditor").entwine({openLinkEmailDialog:function(){var t=e("#"+_);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e("#"+_).entwine({renderModal:function(e){var t=this,i=ss.store,n=ss.apolloClient,r=function(){return t.close()},l=function(){return t.handleInsert.apply(t,arguments)},o=this.getOriginalAttributes();c.default.render(d.default.createElement(m.ApolloProvider,{store:i,client:n},d.default.createElement(A,{show:e,onInsert:l,onHide:r,title:a.default._t("Admin.LINK_EMAIL","Insert email link"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--email",fileAttributes:o,identifier:"Admin.InsertLinkEmailModal"})),this[0])},getOriginalAttributes:function(){var t=this.getElement().getEditor(),i=e(t.getSelectedNode()),n=(i.attr("href")||"").split("?"),r=n[0].replace(/^mailto:/,"").split("?")[0];r.match(/.+@.+\..+/)||(r="");var a=n[1]?n[1].match(/subject=([^&]+)/):"";return{Link:r,Subject:a?a[1]:"",Description:i.attr("title")}},buildAttributes:function(e){var t=this._super(e),i="",n=t.href.replace(/^mailto:/,"").split("?")[0];return n.match(/.+@.+\..+/)||(n=""),n&&(i="mailto:"+n),i&&e.Subject&&(i=i+"?subject="+encodeURIComponent(e.Subject)),t.href=i,delete t.target,t}})}),tinymce.PluginManager.add("sslinkemail",function(e){return h.init(e)}),t.default=h}},[934]); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_sslink-external.js b/client/dist/js/TinyMCE_sslink-external.js index 910ee983e..54fefddda 100644 --- a/client/dist/js/TinyMCE_sslink-external.js +++ b/client/dist/js/TinyMCE_sslink-external.js @@ -1,182 +1 @@ -<<<<<<< HEAD -webpackJsonp([1],{100:function(e,n){e.exports=TinyMCEActionRegistrar},125:function(e,n){e.exports=ReactApollo},180:function(e,n){e.exports=InsertLinkModal},24:function(e,n){e.exports=i18n},45:function(e,n){e.exports=Injector},934:function(e,n,t){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=t(24),o=i(r),a=t(100),l=i(a),s=t(0),d=i(s),u=t(25),c=i(u),f=t(125),p=t(27),x=i(p),m=t(180),k=t(45);l.default.addAction("sslink",{text:o.default._t("Admin.LINKLABEL_EXTERNALURL","Link to external URL"),onclick:function(e){return e.execCommand("sslinkexternal")}});var _={init:function(e){e.addCommand("sslinkexternal",function(){window.jQuery("#"+e.id).entwine("ss").openLinkExternalDialog()})}},L="insert-link__dialog-wrapper--external",A=(0,k.provideInjector)((0,m.createInsertLinkModal)("SilverStripe\\Admin\\LeftAndMain","EditorExternalLink"));x.default.entwine("ss",function(e){e("textarea.htmleditor").entwine({openLinkExternalDialog:function(){var n=e("#"+L);n.length||(n=e('
'),e("body").append(n)),n.addClass("insert-link__dialog-wrapper"),n.setElement(this),n.open()}}),e("#"+L).entwine({renderModal:function(e){var n=this,t=ss.store,i=ss.apolloClient,r=function(){return n.close()},a=function(){return n.handleInsert.apply(n,arguments)},l=this.getOriginalAttributes();c.default.render(d.default.createElement(f.ApolloProvider,{store:t,client:i},d.default.createElement(A,{show:e,onInsert:a,onHide:r,title:o.default._t("Admin.LINK_EXTERNAL","Insert external link"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--external",fileAttributes:l,identifier:"Admin.InsertLinkExternalModal"})),this[0])},buildAttributes:function(e){var n=this._super(e),t=n.href;return t.match(/:\/\//)||(t=window.location.protocol+"//"+t),t=t.replace(/:\/\/(#.*)$/,"$2"),t.match(/:\/\/$/)&&(t=""),n.href=t,n}})}),tinymce.PluginManager.add("sslinkexternal",function(e){return _.init(e)}),n.default=_}},[934]); -======= -<<<<<<< HEAD -webpackJsonp([1],{100:function(e,n){e.exports=TinyMCEActionRegistrar},125:function(e,n){e.exports=ReactApollo},180:function(e,n){e.exports=InsertLinkModal},24:function(e,n){e.exports=i18n},45:function(e,n){e.exports=Injector},933:function(e,n,t){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=t(24),o=i(r),a=t(100),l=i(a),s=t(0),d=i(s),u=t(25),c=i(u),f=t(125),p=t(27),x=i(p),m=t(180),k=t(45);l.default.addAction("sslink",{text:o.default._t("Admin.LINKLABEL_EXTERNALURL","Link to external URL"),onclick:function(e){return e.execCommand("sslinkexternal")}});var _={init:function(e){e.addCommand("sslinkexternal",function(){window.jQuery("#"+e.id).entwine("ss").openLinkExternalDialog()})}},L="insert-link__dialog-wrapper--external",A=(0,k.provideInjector)((0,m.createInsertLinkModal)("SilverStripe\\Admin\\LeftAndMain","EditorExternalLink"));x.default.entwine("ss",function(e){e("textarea.htmleditor").entwine({openLinkExternalDialog:function(){var n=e("#"+L);n.length||(n=e('
'),e("body").append(n)),n.addClass("insert-link__dialog-wrapper"),n.setElement(this),n.open()}}),e("#"+L).entwine({renderModal:function(e){var n=this,t=ss.store,i=ss.apolloClient,r=function(){return n.close()},a=function(){return n.handleInsert.apply(n,arguments)},l=this.getOriginalAttributes();c.default.render(d.default.createElement(f.ApolloProvider,{store:t,client:i},d.default.createElement(A,{show:e,onInsert:a,onHide:r,title:o.default._t("Admin.LINK_EXTERNAL","Insert external link"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--external",fileAttributes:l,identifier:"Admin.InsertLinkExternalModal"})),this[0])},buildAttributes:function(e){var n=this._super(e),t=n.href;return t.match(/:\/\//)||(t=window.location.protocol+"//"+t),t=t.replace(/:\/\/(#.*)$/,"$2"),t.match(/:\/\/$/)&&(t=""),n.href=t,n}})}),tinymce.PluginManager.add("sslinkexternal",function(e){return _.init(e)}),n.default=_}},[933]); -======= -webpackJsonp([1],{ - -/***/ 100: -/***/ (function(module, exports) { - -module.exports = TinyMCEActionRegistrar; - -/***/ }), - -/***/ 126: -/***/ (function(module, exports) { - -module.exports = ReactApollo; - -/***/ }), - -/***/ 182: -/***/ (function(module, exports) { - -module.exports = InsertLinkModal; - -/***/ }), - -/***/ 23: -/***/ (function(module, exports) { - -module.exports = i18n; - -/***/ }), - -/***/ 45: -/***/ (function(module, exports) { - -module.exports = Injector; - -/***/ }), - -/***/ 948: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _i18n = __webpack_require__(23); - -var _i18n2 = _interopRequireDefault(_i18n); - -var _TinyMCEActionRegistrar = __webpack_require__(100); - -var _TinyMCEActionRegistrar2 = _interopRequireDefault(_TinyMCEActionRegistrar); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(26); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _reactApollo = __webpack_require__(126); - -var _jquery = __webpack_require__(27); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _InsertLinkModal = __webpack_require__(182); - -var _Injector = __webpack_require__(45); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_TinyMCEActionRegistrar2.default.addAction('sslink', { - text: _i18n2.default._t('Admin.LINKLABEL_EXTERNALURL', 'Link to external URL'), - - onclick: function onclick(editor) { - return editor.execCommand('sslinkexternal'); - } -}); - -var plugin = { - init: function init(editor) { - editor.addCommand('sslinkexternal', function () { - var field = window.jQuery('#' + editor.id).entwine('ss'); - - field.openLinkExternalDialog(); - }); - } -}; - -var modalId = 'insert-link__dialog-wrapper--external'; -var sectionConfigKey = 'SilverStripe\\Admin\\LeftAndMain'; -var formName = 'EditorExternalLink'; -var InsertLinkExternalModal = (0, _Injector.provideInjector)((0, _InsertLinkModal.createInsertLinkModal)(sectionConfigKey, formName)); - -_jquery2.default.entwine('ss', function ($) { - $('textarea.htmleditor').entwine({ - openLinkExternalDialog: function openLinkExternalDialog() { - var dialog = $('#' + modalId); - - if (!dialog.length) { - dialog = $('
'); - $('body').append(dialog); - } - dialog.addClass('insert-link__dialog-wrapper'); - - dialog.setElement(this); - dialog.open(); - } - }); - - $('#' + modalId).entwine({ - renderModal: function renderModal(show) { - var _this = this; - - var store = ss.store; - var client = ss.apolloClient; - var handleHide = function handleHide() { - return _this.close(); - }; - var handleInsert = function handleInsert() { - return _this.handleInsert.apply(_this, arguments); - }; - var attrs = this.getOriginalAttributes(); - - _reactDom2.default.render(_react2.default.createElement( - _reactApollo.ApolloProvider, - { store: store, client: client }, - _react2.default.createElement(InsertLinkExternalModal, { - show: show, - onInsert: handleInsert, - onHide: handleHide, - title: _i18n2.default._t('Admin.LINK_EXTERNAL', 'Insert external link'), - bodyClassName: 'modal__dialog', - className: 'insert-link__dialog-wrapper--external', - fileAttributes: attrs, - identifier: 'Admin.InsertLinkExternalModal' - }) - ), this[0]); - }, - buildAttributes: function buildAttributes(data) { - var attributes = this._super(data); - - var href = attributes.href; - - if (!href.match(/:\/\//)) { - href = window.location.protocol + '//' + href; - } - - href = href.replace(/:\/\/(#.*)$/, '$2'); - - if (href.match(/:\/\/$/)) { - href = ''; - } - attributes.href = href; - - return attributes; - } - }); -}); - -tinymce.PluginManager.add('sslinkexternal', function (editor) { - return plugin.init(editor); -}); - -exports.default = plugin; - -/***/ }) - -},[948]); -//# sourceMappingURL=TinyMCE_sslink-external.js.map ->>>>>>> Save button's visual (changed and unchanged states) ->>>>>>> Save button's visual (changed and unchanged states) +webpackJsonp([1],{100:function(e,n){e.exports=TinyMCEActionRegistrar},125:function(e,n){e.exports=ReactApollo},180:function(e,n){e.exports=InsertLinkModal},24:function(e,n){e.exports=i18n},43:function(e,n){e.exports=Injector},935:function(e,n,t){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=t(24),o=i(r),a=t(100),l=i(a),s=t(0),d=i(s),u=t(25),c=i(u),f=t(125),p=t(27),x=i(p),m=t(180),k=t(43);l.default.addAction("sslink",{text:o.default._t("Admin.LINKLABEL_EXTERNALURL","Link to external URL"),onclick:function(e){return e.execCommand("sslinkexternal")}});var _={init:function(e){e.addCommand("sslinkexternal",function(){window.jQuery("#"+e.id).entwine("ss").openLinkExternalDialog()})}},L="insert-link__dialog-wrapper--external",A=(0,k.provideInjector)((0,m.createInsertLinkModal)("SilverStripe\\Admin\\LeftAndMain","EditorExternalLink"));x.default.entwine("ss",function(e){e("textarea.htmleditor").entwine({openLinkExternalDialog:function(){var n=e("#"+L);n.length||(n=e('
'),e("body").append(n)),n.addClass("insert-link__dialog-wrapper"),n.setElement(this),n.open()}}),e("#"+L).entwine({renderModal:function(e){var n=this,t=ss.store,i=ss.apolloClient,r=function(){return n.close()},a=function(){return n.handleInsert.apply(n,arguments)},l=this.getOriginalAttributes();c.default.render(d.default.createElement(f.ApolloProvider,{store:t,client:i},d.default.createElement(A,{show:e,onInsert:a,onHide:r,title:o.default._t("Admin.LINK_EXTERNAL","Insert external link"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--external",fileAttributes:l,identifier:"Admin.InsertLinkExternalModal"})),this[0])},buildAttributes:function(e){var n=this._super(e),t=n.href;return t.match(/:\/\//)||(t=window.location.protocol+"//"+t),t=t.replace(/:\/\/(#.*)$/,"$2"),t.match(/:\/\/$/)&&(t=""),n.href=t,n}})}),tinymce.PluginManager.add("sslinkexternal",function(e){return _.init(e)}),n.default=_}},[935]); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_sslink.js b/client/dist/js/TinyMCE_sslink.js index 97e7cadf2..2ca0b89ce 100644 --- a/client/dist/js/TinyMCE_sslink.js +++ b/client/dist/js/TinyMCE_sslink.js @@ -1,386 +1 @@ -<<<<<<< HEAD -webpackJsonp([3],{100:function(t,e){t.exports=TinyMCEActionRegistrar},776:function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){var o=Array.isArray(n)?n:[n||""];return Boolean(t&&o.map(function(t){return String(t)}).map(function(t){return t.toLowerCase()}).includes((t.tagName||"").toLowerCase())&&e)}function r(t,e){function n(){i(l,u,o)&&(r.hide(),clearTimeout(c),c=setTimeout(function(){r.show(),r.reposition(l)},300))}var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["a"],r=new a(t,e),l=null,c=null,u=!1;return r.hide().renderTo(window.document.body),t.on("remove",function(){r.remove()}),t.on("focus",function(){u=!0}),t.on("blur hide",function(){r.hide(),u=!1}),t.on("nodechange",function(e){var n={element:e.element,parents:e.parents,collapsed:t.selection.isCollapsed()};l=n.selection||n.element,i(l,u,o)?(r.show(),r.reposition(l)):r.hide()}),window.addEventListener("scroll",function(e){e.target.contains(document.querySelector("#"+t.id))&&n()},!0),t.contentDocument.addEventListener("scroll",n),r}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n=w||b>=w?this.hide():(this.bottom?b>=d?(y=" mce-arrow-up",v=u.bottom+r.top+n+10):g>=d&&(y=" mce-arrow-down",v=u.top+r.top+n-c-8):g>=d?(y=" mce-arrow-down",v=u.top+r.top+n-c-8):b>=d&&w/2>u.bottom+r.top-m&&(y=" mce-arrow-up",v=u.bottom+r.top+n+10),void 0===v&&(v=n+m+5),k=s-a/2+r.left+e,u.left<0||u.right>r.width?k=r.left+e+(r.width-a)/2:a>=o?(y+=" mce-arrow-full",k=0):k<0&&u.left+a>o||k+a>o&&u.right-a<0?k=(o-a)/2:kr.width+r.left+e&&(y+=" mce-arrow-right",k=u.right-a+r.left+e),l.className=l.className.replace(/ ?mce-arrow-[\w]+/g,"")+y,this.setStyles({left:k,top:v}),this)}}]),t}();e.default=a,e.setupTinyMceInlineToolbar=r,e.shouldShowToolbar=i},935:function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(100),r=o(i),l=n(25),a=o(l),c=n(27),u=o(c),s=n(776),d={init:function(t){function e(){var e=tinymce.activeEditor.selection.getNode(),n=e.getAttribute("href");n&&t.execCommand(r.default.getEditorCommandFromUrl(n))}var n=r.default.getActions("sslink").map(function(e){return Object.assign({},e,{onclick:function(){return e.onclick(t)}})});t.addButton("sslink",{icon:"link",title:"Insert Link",type:"menubutton",menu:n}),t.addMenuItem("sslink",{icon:"link",text:"Insert Link",menu:n}),t.on("preinit",function(){(0,s.setupTinyMceInlineToolbar)(t,[{type:"button",onClick:e,text:"Edit link"},{type:"button",onClick:function(){return t.execCommand("unlink")},text:"Remove link"}])})}};u.default.entwine("ss",function(t){t(".insert-link__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){a.default.unmountComponentAtNode(this[0])},open:function(){this.renderModal(!0)},close:function(){this.setData({}),this.renderModal(!1)},renderModal:function(){},handleInsert:function(t){var e=this.buildAttributes(t);return this.insertLinkInEditor(e),this.close(),Promise.resolve()},buildAttributes:function(t){var e=t.Anchor&&t.Anchor.length?"#"+t.Anchor:"";return{href:""+t.Link+e,target:t.TargetBlank?"_blank":"",title:t.Description}},insertLinkInEditor:function(t){var e=this.getElement().getEditor();e.insertLink(t),e.addUndo(),e.repaint()},getOriginalAttributes:function(){var e=this.getElement().getEditor(),n=t(e.getSelectedNode()),o=(n.attr("href")||"").split("#");return{Link:o[0]||"",Anchor:o[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}})}),tinymce.PluginManager.add("sslink",function(t){return d.init(t)}),e.default=d}},[935]); -======= -<<<<<<< HEAD -webpackJsonp([3],{100:function(t,e){t.exports=TinyMCEActionRegistrar},775:function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){var o=Array.isArray(n)?n:[n||""];return Boolean(t&&o.map(function(t){return String(t)}).map(function(t){return t.toLowerCase()}).includes((t.tagName||"").toLowerCase())&&e)}function r(t,e){function n(){i(l,u,o)&&(r.hide(),clearTimeout(c),c=setTimeout(function(){r.show(),r.reposition(l)},300))}var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["a"],r=new a(t,e),l=null,c=null,u=!1;return r.hide().renderTo(window.document.body),t.on("remove",function(){r.remove()}),t.on("focus",function(){u=!0}),t.on("blur hide",function(){r.hide(),u=!1}),t.on("nodechange",function(e){var n={element:e.element,parents:e.parents,collapsed:t.selection.isCollapsed()};l=n.selection||n.element,i(l,u,o)?(r.show(),r.reposition(l)):r.hide()}),window.addEventListener("scroll",function(e){e.target.contains(document.querySelector("#"+t.id))&&n()},!0),t.contentDocument.addEventListener("scroll",n),r}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n=w||b>=w?this.hide():(this.bottom?b>=d?(y=" mce-arrow-up",v=u.bottom+r.top+n+10):g>=d&&(y=" mce-arrow-down",v=u.top+r.top+n-c-8):g>=d?(y=" mce-arrow-down",v=u.top+r.top+n-c-8):b>=d&&w/2>u.bottom+r.top-m&&(y=" mce-arrow-up",v=u.bottom+r.top+n+10),void 0===v&&(v=n+m+5),k=s-a/2+r.left+e,u.left<0||u.right>r.width?k=r.left+e+(r.width-a)/2:a>=o?(y+=" mce-arrow-full",k=0):k<0&&u.left+a>o||k+a>o&&u.right-a<0?k=(o-a)/2:kr.width+r.left+e&&(y+=" mce-arrow-right",k=u.right-a+r.left+e),l.className=l.className.replace(/ ?mce-arrow-[\w]+/g,"")+y,this.setStyles({left:k,top:v}),this)}}]),t}();e.default=a,e.setupTinyMceInlineToolbar=r,e.shouldShowToolbar=i},934:function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(100),r=o(i),l=n(25),a=o(l),c=n(27),u=o(c),s=n(775),d={init:function(t){function e(){var e=tinymce.activeEditor.selection.getNode(),n=e.getAttribute("href");n&&t.execCommand(r.default.getEditorCommandFromUrl(n))}var n=r.default.getActions("sslink").map(function(e){return Object.assign({},e,{onclick:function(){return e.onclick(t)}})});t.addButton("sslink",{icon:"link",title:"Insert Link",type:"menubutton",menu:n}),t.addMenuItem("sslink",{icon:"link",text:"Insert Link",menu:n}),t.on("preinit",function(){(0,s.setupTinyMceInlineToolbar)(t,[{type:"button",onClick:e,text:"Edit link"},{type:"button",onClick:function(){return t.execCommand("unlink")},text:"Remove link"}])})}};u.default.entwine("ss",function(t){t(".insert-link__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){a.default.unmountComponentAtNode(this[0])},open:function(){this.renderModal(!0)},close:function(){this.setData({}),this.renderModal(!1)},renderModal:function(){},handleInsert:function(t){var e=this.buildAttributes(t);return this.insertLinkInEditor(e),this.close(),Promise.resolve()},buildAttributes:function(t){var e=t.Anchor&&t.Anchor.length?"#"+t.Anchor:"";return{href:""+t.Link+e,target:t.TargetBlank?"_blank":"",title:t.Description}},insertLinkInEditor:function(t){var e=this.getElement().getEditor();e.insertLink(t),e.addUndo(),e.repaint()},getOriginalAttributes:function(){var e=this.getElement().getEditor(),n=t(e.getSelectedNode()),o=(n.attr("href")||"").split("#");return{Link:o[0]||"",Anchor:o[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}})}),tinymce.PluginManager.add("sslink",function(t){return d.init(t)}),e.default=d}},[934]); -======= -webpackJsonp([3],{ - -/***/ 100: -/***/ (function(module, exports) { - -module.exports = TinyMCEActionRegistrar; - -/***/ }), - -/***/ 769: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var TinymceInlineToolbar = function () { - function TinymceInlineToolbar(editor, buttons) { - _classCallCheck(this, TinymceInlineToolbar); - - this.mceIframe = document.getElementById(editor.id + '_ifr'); - this.container = editor.getContainer(); - this.mceToolbar = null; - this.mceStatusbar = null; - - if (this.container) { - this.mceToolbar = this.container.querySelector('.mce-toolbar-grp'); - this.mceStatusbar = this.container.querySelector('.mce-statusbar'); - } - - this.control = tinymce.ui.Factory.create({ - type: 'panel', - classes: 'inline-toolbar', - layout: 'stack', - items: [{ - type: 'toolbar', - items: buttons - }] - }); - } - - _createClass(TinymceInlineToolbar, [{ - key: 'remove', - value: function remove() { - this.control.remove(); - return this; - } - }, { - key: 'hide', - value: function hide() { - this.control.hide(); - return this; - } - }, { - key: 'show', - value: function show() { - this.control.show(); - return this; - } - }, { - key: 'renderTo', - value: function renderTo(dom) { - this.control.renderTo(dom); - return this; - } - }, { - key: 'setStyles', - value: function setStyles(styles) { - tinymce.DOM.setStyles(this.control.getEl(), styles); - return this; - } - }, { - key: 'reposition', - value: function reposition(currSelection) { - if (!currSelection) { - return this; - } - - var scrollX = window.pageXOffset || document.documentElement.scrollLeft; - var scrollY = window.pageYOffset || document.documentElement.scrollTop; - var windowWidth = window.innerWidth; - var windowHeight = window.innerHeight; - var iframeRect = this.mceIframe ? this.mceIframe.getBoundingClientRect() : { - top: 0, - right: windowWidth, - bottom: windowHeight, - left: 0, - width: windowWidth, - height: windowHeight - }; - var toolbarEl = this.control.getEl(); - var toolbarWidth = toolbarEl.offsetWidth; - var toolbarHeight = toolbarEl.offsetHeight; - var selection = currSelection.getBoundingClientRect(); - var selectionMiddle = (selection.left + selection.right) / 2; - var buffer = 5; - var margin = 8; - var spaceNeeded = toolbarHeight + margin + buffer; - var mceToolbarBottom = this.mceToolbar ? this.mceToolbar.getBoundingClientRect().bottom : 0; - var mceStatusbarTop = this.mceStatusbar ? windowHeight - this.mceStatusbar.getBoundingClientRect().top : 0; - var blockedTop = Math.max(0, mceToolbarBottom, iframeRect.top); - var blockedBottom = Math.max(0, mceStatusbarTop, windowHeight - iframeRect.bottom); - var spaceTop = selection.top + iframeRect.top - blockedTop; - var spaceBottom = windowHeight - iframeRect.top - selection.bottom - blockedBottom; - var editorHeight = windowHeight - blockedTop - blockedBottom; - var topOffset = 10; - var className = ''; - var top = 0; - var left = 0; - - if (spaceTop >= editorHeight || spaceBottom >= editorHeight) { - return this.hide(); - } - - if (this.bottom) { - if (spaceBottom >= spaceNeeded) { - className = ' mce-arrow-up'; - top = selection.bottom + iframeRect.top + scrollY + topOffset; - } else if (spaceTop >= spaceNeeded) { - className = ' mce-arrow-down'; - top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin; - } - } else if (spaceTop >= spaceNeeded) { - className = ' mce-arrow-down'; - top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin; - } else if (spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop) { - className = ' mce-arrow-up'; - top = selection.bottom + iframeRect.top + scrollY + topOffset; - } - - if (typeof top === 'undefined') { - top = scrollY + blockedTop + buffer; - } - - left = selectionMiddle - toolbarWidth / 2 + iframeRect.left + scrollX; - - if (selection.left < 0 || selection.right > iframeRect.width) { - left = iframeRect.left + scrollX + (iframeRect.width - toolbarWidth) / 2; - } else if (toolbarWidth >= windowWidth) { - className += ' mce-arrow-full'; - left = 0; - } else if (left < 0 && selection.left + toolbarWidth > windowWidth || left + toolbarWidth > windowWidth && selection.right - toolbarWidth < 0) { - left = (windowWidth - toolbarWidth) / 2; - } else if (left < iframeRect.left + scrollX) { - className += ' mce-arrow-left'; - left = selection.left + iframeRect.left + scrollX; - } else if (left + toolbarWidth > iframeRect.width + iframeRect.left + scrollX) { - className += ' mce-arrow-right'; - left = selection.right - toolbarWidth + iframeRect.left + scrollX; - } - - toolbarEl.className = toolbarEl.className.replace(/ ?mce-arrow-[\w]+/g, '') + className; - this.setStyles({ left: left, top: top }); - - return this; - } - }]); - - return TinymceInlineToolbar; -}(); - -function shouldShowToolbar(selection, isEditorFocused, tagTypes) { - var tags = Array.isArray(tagTypes) ? tagTypes : [tagTypes || '']; - return Boolean(selection && tags.map(function (tag) { - return String(tag); - }).map(function (tag) { - return tag.toLowerCase(); - }).includes((selection.tagName || '').toLowerCase()) && isEditorFocused); -} - -function setupTinyMceInlineToolbar(editor, buttons) { - var tagTypes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['a']; - - var toolbar = new TinymceInlineToolbar(editor, buttons); - var currentSelection = null; - var scrollTimeoutId = null; - var focused = false; - - toolbar.hide().renderTo(window.document.body); - - editor.on('remove', function () { - toolbar.remove(); - }); - - editor.on('focus', function () { - focused = true; - }); - - editor.on('blur hide', function () { - toolbar.hide(); - focused = false; - }); - - editor.on('nodechange', function (event) { - var args = { - element: event.element, - parents: event.parents, - collapsed: editor.selection.isCollapsed() - }; - - currentSelection = args.selection || args.element; - if (shouldShowToolbar(currentSelection, focused, tagTypes)) { - toolbar.show(); - toolbar.reposition(currentSelection); - } else { - toolbar.hide(); - } - }); - - function handleScroll() { - if (shouldShowToolbar(currentSelection, focused, tagTypes)) { - toolbar.hide(); - - clearTimeout(scrollTimeoutId); - scrollTimeoutId = setTimeout(function () { - toolbar.show(); - toolbar.reposition(currentSelection); - }, 300); - } - } - - window.addEventListener('scroll', function (e) { - if (e.target.contains(document.querySelector('#' + editor.id))) { - handleScroll(); - } - }, true); - - editor.contentDocument.addEventListener('scroll', handleScroll); - - return toolbar; -} - -exports.default = TinymceInlineToolbar; -exports.setupTinyMceInlineToolbar = setupTinyMceInlineToolbar; -exports.shouldShowToolbar = shouldShowToolbar; - -/***/ }), - -/***/ 949: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _TinyMCEActionRegistrar = __webpack_require__(100); - -var _TinyMCEActionRegistrar2 = _interopRequireDefault(_TinyMCEActionRegistrar); - -var _reactDom = __webpack_require__(26); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _jquery = __webpack_require__(27); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _TinymceInlineToolbar = __webpack_require__(769); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var plugin = { - init: function init(editor) { - var actions = _TinyMCEActionRegistrar2.default.getActions('sslink').map(function (action) { - return Object.assign({}, action, { onclick: function onclick() { - return action.onclick(editor); - } }); - }); - - editor.addButton('sslink', { - icon: 'link', - title: 'Insert Link', - type: 'menubutton', - menu: actions - }); - - editor.addMenuItem('sslink', { - icon: 'link', - text: 'Insert Link', - menu: actions - }); - - function openLinkDialog() { - var node = tinymce.activeEditor.selection.getNode(); - var href = node.getAttribute('href'); - if (href) { - editor.execCommand(_TinyMCEActionRegistrar2.default.getEditorCommandFromUrl(href)); - } - } - - editor.on('preinit', function () { - (0, _TinymceInlineToolbar.setupTinyMceInlineToolbar)(editor, [{ type: 'button', onClick: openLinkDialog, text: 'Edit link' }, { type: 'button', onClick: function onClick() { - return editor.execCommand('unlink'); - }, text: 'Remove link' }]); - }); - } -}; - -_jquery2.default.entwine('ss', function ($) { - $('.insert-link__dialog-wrapper').entwine({ - Element: null, - - Data: {}, - - onunmatch: function onunmatch() { - this._clearModal(); - }, - _clearModal: function _clearModal() { - _reactDom2.default.unmountComponentAtNode(this[0]); - }, - open: function open() { - this.renderModal(true); - }, - close: function close() { - this.setData({}); - this.renderModal(false); - }, - renderModal: function renderModal() {}, - handleInsert: function handleInsert(data) { - var attributes = this.buildAttributes(data); - - this.insertLinkInEditor(attributes); - this.close(); - - return Promise.resolve(); - }, - buildAttributes: function buildAttributes(data) { - var anchor = data.Anchor && data.Anchor.length ? '#' + data.Anchor : ''; - var href = '' + data.Link + anchor; - - return { - href: href, - target: data.TargetBlank ? '_blank' : '', - title: data.Description - }; - }, - insertLinkInEditor: function insertLinkInEditor(attributes) { - var editor = this.getElement().getEditor(); - editor.insertLink(attributes); - editor.addUndo(); - editor.repaint(); - }, - getOriginalAttributes: function getOriginalAttributes() { - var editor = this.getElement().getEditor(); - var node = $(editor.getSelectedNode()); - - var hrefParts = (node.attr('href') || '').split('#'); - - return { - Link: hrefParts[0] || '', - Anchor: hrefParts[1] || '', - Description: node.attr('title'), - TargetBlank: !!node.attr('target') - }; - } - }); -}); - -tinymce.PluginManager.add('sslink', function (editor) { - return plugin.init(editor); -}); - -exports.default = plugin; - -/***/ }) - -},[949]); -//# sourceMappingURL=TinyMCE_sslink.js.map ->>>>>>> Save button's visual (changed and unchanged states) ->>>>>>> Save button's visual (changed and unchanged states) +webpackJsonp([3],{100:function(t,e){t.exports=TinyMCEActionRegistrar},776:function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){var o=Array.isArray(n)?n:[n||""];return Boolean(t&&o.map(function(t){return String(t)}).map(function(t){return t.toLowerCase()}).includes((t.tagName||"").toLowerCase())&&e)}function r(t,e){function n(){i(l,u,o)&&(r.hide(),clearTimeout(c),c=setTimeout(function(){r.show(),r.reposition(l)},300))}var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["a"],r=new a(t,e),l=null,c=null,u=!1;return r.hide().renderTo(window.document.body),t.on("remove",function(){r.remove()}),t.on("focus",function(){u=!0}),t.on("blur hide",function(){r.hide(),u=!1}),t.on("nodechange",function(e){var n={element:e.element,parents:e.parents,collapsed:t.selection.isCollapsed()};l=n.selection||n.element,i(l,u,o)?(r.show(),r.reposition(l)):r.hide()}),window.addEventListener("scroll",function(e){e.target.contains(document.querySelector("#"+t.id))&&n()},!0),t.contentDocument.addEventListener("scroll",n),r}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n=w||b>=w?this.hide():(this.bottom?b>=d?(y=" mce-arrow-up",v=u.bottom+r.top+n+10):g>=d&&(y=" mce-arrow-down",v=u.top+r.top+n-c-8):g>=d?(y=" mce-arrow-down",v=u.top+r.top+n-c-8):b>=d&&w/2>u.bottom+r.top-m&&(y=" mce-arrow-up",v=u.bottom+r.top+n+10),void 0===v&&(v=n+m+5),k=s-a/2+r.left+e,u.left<0||u.right>r.width?k=r.left+e+(r.width-a)/2:a>=o?(y+=" mce-arrow-full",k=0):k<0&&u.left+a>o||k+a>o&&u.right-a<0?k=(o-a)/2:kr.width+r.left+e&&(y+=" mce-arrow-right",k=u.right-a+r.left+e),l.className=l.className.replace(/ ?mce-arrow-[\w]+/g,"")+y,this.setStyles({left:k,top:v}),this)}}]),t}();e.default=a,e.setupTinyMceInlineToolbar=r,e.shouldShowToolbar=i},936:function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(100),r=o(i),l=n(25),a=o(l),c=n(27),u=o(c),s=n(776),d={init:function(t){function e(){var e=tinymce.activeEditor.selection.getNode(),n=e.getAttribute("href");n&&t.execCommand(r.default.getEditorCommandFromUrl(n))}var n=r.default.getActions("sslink").map(function(e){return Object.assign({},e,{onclick:function(){return e.onclick(t)}})});t.addButton("sslink",{icon:"link",title:"Insert Link",type:"menubutton",menu:n}),t.addMenuItem("sslink",{icon:"link",text:"Insert Link",menu:n}),t.on("preinit",function(){(0,s.setupTinyMceInlineToolbar)(t,[{type:"button",onClick:e,text:"Edit link"},{type:"button",onClick:function(){return t.execCommand("unlink")},text:"Remove link"}])})}};u.default.entwine("ss",function(t){t(".insert-link__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){a.default.unmountComponentAtNode(this[0])},open:function(){this.renderModal(!0)},close:function(){this.setData({}),this.renderModal(!1)},renderModal:function(){},handleInsert:function(t){var e=this.buildAttributes(t);return this.insertLinkInEditor(e),this.close(),Promise.resolve()},buildAttributes:function(t){var e=t.Anchor&&t.Anchor.length?"#"+t.Anchor:"";return{href:""+t.Link+e,target:t.TargetBlank?"_blank":"",title:t.Description}},insertLinkInEditor:function(t){var e=this.getElement().getEditor();e.insertLink(t),e.addUndo(),e.repaint()},getOriginalAttributes:function(){var e=this.getElement().getEditor(),n=t(e.getSelectedNode()),o=(n.attr("href")||"").split("#");return{Link:o[0]||"",Anchor:o[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}})}),tinymce.PluginManager.add("sslink",function(t){return d.init(t)}),e.default=d}},[936]); \ No newline at end of file diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index a7f56fdb6..65629c600 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1,20138 +1 @@ -<<<<<<< HEAD -webpackJsonp([0],{1e3:function(e,t,n){"use strict";function r(e){return{type:i.default.SET_BREADCRUMBS,payload:{breadcrumbs:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setBreadcrumbs=r;var o=n(403),i=function(e){return e&&e.__esModule?e:{default:e}}(o)},1001:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},1002:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return["id"].reduce(function(e,n){return e.replace(":"+n,t[n])},e)}function i(e,t,n){var r={recordType:e},i={Accept:"text/json"},a=t.toLowerCase();return function(t){t({type:u.default.FETCH_RECORDS_REQUEST,payload:r});var s="get"===a?[o(n,r),i]:[o(n,r),{},i];return d.default[a].apply(d.default,s).then(function(e){return e.json()}).then(function(n){t({type:u.default.FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:n}})}).catch(function(n){throw t({type:u.default.FETCH_RECORDS_FAILURE,payload:{error:n,recordType:e}}),n})}}function a(e,t,n){var r={recordType:e},i={Accept:"text/json"},a=t.toLowerCase();return function(t){t({type:u.default.FETCH_RECORD_REQUEST,payload:r});var s="get"===a?[o(n,r),i]:[o(n,r),{},i];return d.default[a].apply(d.default,s).then(function(e){return e.json()}).then(function(n){t({type:u.default.FETCH_RECORD_SUCCESS,payload:{recordType:e,data:n}})}).catch(function(n){throw t({type:u.default.FETCH_RECORD_FAILURE,payload:{error:n,recordType:e}}),n})}}function s(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={recordType:e,id:t},s=n.toLowerCase(),l="get"===s?[o(r,a),i]:[o(r,a),{},i];return function(n){return n({type:u.default.DELETE_RECORD_REQUEST,payload:a}),d.default[s].apply(d.default,l).then(function(){n({type:u.default.DELETE_RECORD_SUCCESS,payload:{recordType:e,id:t}})}).catch(function(r){throw n({type:u.default.DELETE_RECORD_FAILURE,payload:{error:r,recordType:e,id:t}}),r})}}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchRecords=i,t.fetchRecord=a,t.deleteRecord=s;var l=n(407),u=r(l),c=n(937),d=r(c)},1003:function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];return{type:l.default.SET_SCHEMA,payload:a({id:e},t,{name:n})}}function o(e,t){return{type:l.default.SET_SCHEMA_STATE_OVERRIDES,payload:{id:e,stateOverride:t}}}function i(e,t){return{type:l.default.SET_SCHEMA_LOADING,payload:{id:e,loading:t}}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t399?"bad":"good",l=["OK","success","HTTP/2.0 200"];if(null===o||isSameUrl(r,o)&&isSameUrl(i,o)||window.ss.router.show(o,{id:(new Date).getTime()+String(Math.random()).replace(/\D/g,""),pjax:t.getResponseHeader("X-Pjax")?t.getResponseHeader("X-Pjax"):n.headers["X-Pjax"]}),t.getResponseHeader("X-Reauthenticate"))return void $(".cms-container").showLoginDialog();0!==t.status&&a&&-1===$.inArray(a,l)&&statusMessage(decodeURIComponent(a),s),ajaxCompleteEvent(this)}),$(".cms-container").entwine({StateChangeXHR:null,FragmentXHR:{},StateChangeCount:0,LayoutOptions:{minContentWidth:940,minPreviewWidth:400,mode:"content"},onadd:function(){if($.browser.msie&&parseInt($.browser.version,10)<8)return $(".ss-loading-screen").append('

Your browser is not compatible with the CMS interface. Please use Internet Explorer 8+, Google Chrome or Mozilla Firefox.

').css("z-index",$(".ss-loading-screen").css("z-index")+1),$(".loading-animation").remove(),void this._super();this.redraw(),$(".ss-loading-screen").hide(),$("body").removeClass("loading"),$(window).unbind("resize",positionLoadingSpinner),this.restoreTabState(),this._super()},onwindowresize:function(){this.redraw()},"from .cms-panel":{ontoggle:function(){this.redraw()}},"from .cms-container":{onaftersubmitform:function(){this.redraw()}},updateLayoutOptions:function(e){var t=this.getLayoutOptions(),n=!1;for(var r in e)t[r]!==e[r]&&(t[r]=e[r],n=!0);n&&this.redraw()},clearViewMode:function(){this.removeClass("cms-container--split-mode"),this.removeClass("cms-container--preview-mode"),this.removeClass("cms-container--content-mode")},splitViewMode:function(){this.updateLayoutOptions({mode:"split"})},contentViewMode:function(){this.updateLayoutOptions({mode:"content"})},previewMode:function(){this.updateLayoutOptions({mode:"preview"})},RedrawSuppression:!1,redraw:function(){this.getRedrawSuppression()||(window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.setProperMode()||(this.find(".cms-panel-layout").redraw(),this.find(".cms-content-fields[data-layout-type]").redraw(),this.find(".cms-edit-form[data-layout-type]").redraw(),this.find(".cms-preview").redraw(),this.find(".cms-content").redraw()))},setProperMode:function(){var e=this.getLayoutOptions(),t=e.mode;this.clearViewMode();var n=this.find(".cms-content"),r=this.find(".cms-preview");if(n.css({"min-width":0}),r.css({"min-width":0}),n.width()+r.width()>=e.minContentWidth+e.minPreviewWidth)n.css({"min-width":e.minContentWidth}),r.css({"min-width":e.minPreviewWidth}),r.trigger("enable");else if(r.trigger("disable"),"split"==t)return r.trigger("forcecontent"),!0;return this.addClass("cms-container--"+t+"-mode"),!1},checkCanNavigate:function(e){var t=this._findFragments(e||["Content"]),n=t.find(":data(changetracker)").add(t.filter(":data(changetracker)")),r=!0;return!n.length||(n.each(function(){$(this).confirmUnsavedChanges()||(r=!1)}),r)},loadPanel:function(e){var t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),n=arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:document.URL;this.checkCanNavigate(t.pjax?t.pjax.split(","):["Content"])&&(this.saveTabState(),t.__forceReferer=r,n&&(t.__forceReload=1+Math.random()),window.ss.router.show(e,t))},reloadCurrentPanel:function(){this.loadPanel(document.URL,null,null,!0)},submitForm:function(e,t,n,r){var o=this;t||(t=this.find(".btn-toolbar :submit[name=action_save]")),t||(t=this.find(".btn-toolbar :submit:first")),e.trigger("beforesubmitform"),this.trigger("submitform",{form:e,button:t}),$(t).addClass("btn--loading loading"),$(t).is("button")&&($(t).data("original-text",$(t).text()),$(t).append($('
')),$(t).css($(t).outerWidth()+"px"));var i=e.validate(),a=function(){$(t).removeClass("btn--loading loading"),$(t).find(".btn__loading-icon").remove(),$(t).css("width","auto"),$(t).text($(t).data("original-text"))};void 0===i||i||(statusMessage("Validation failed.","bad"),a());var s=e.serializeArray();return s.push({name:$(t).attr("name"),value:"1"}),s.push({name:"BackURL",value:document.URL.replace(/\/$/,"")}),this.saveTabState(),jQuery.ajax(jQuery.extend({headers:{"X-Pjax":"CurrentForm,Breadcrumbs"},url:e.attr("action"),data:s,type:"POST",complete:function(){a()},success:function(t,r,i){a(),e.removeClass("changed"),n&&n(t,r,i);var l=o.handleAjaxResponse(t,r,i);l&&l.filter("form").trigger("aftersubmitform",{status:r,xhr:i,formData:s})}},r)),!1},LastState:null,PauseState:!1,handleStateChange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.history.state;if(!this.getPauseState()){this.getStateChangeXHR()&&this.getStateChangeXHR().abort();var n=this,r=t.pjax||"Content",o={},i=r.split(","),a=this._findFragments(i);if(this.setStateChangeCount(this.getStateChangeCount()+1),!this.checkCanNavigate()){var s=this.getLastState();return this.setPauseState(!0),s&&s.path?window.ss.router.show(s.path):window.ss.router.back(),void this.setPauseState(!1)}if(this.setLastState(t),a.length=0})),r.removeClass(i.join(" ")).addClass(s.join(" ")),o&&r.attr("style",o);var l=r.find("style").detach();l.length&&$(document).find("head").append(l),n.replaceWith(r)});var p=d.filter("form");p.hasClass("cms-tabset")&&p.removeClass("cms-tabset").addClass("cms-tabset")}finally{this.setRedrawSuppression(!1)}return this.redraw(),this.restoreTabState(r&&void 0!==r.tabState?r.tabState:null),d}},_findFragments:function(e){return $("[data-pjax-fragment]").filter(function(){var t,n=$(this).data("pjaxFragment").split(" ");for(t in e)if(-1!=$.inArray(e[t],n))return!0;return!1})},refresh:function(){$(window).trigger("statechange"),$(this).redraw()},saveTabState:function(){if(void 0!==window.sessionStorage&&null!==window.sessionStorage){var e=[],t=this._tabStateUrl();if(this.find(".cms-tabset,.ss-tabset").each(function(t,n){var r=$(n).attr("id");r&&$(n).data("tabs")&&($(n).data("ignoreTabState")||$(n).getIgnoreTabState()||e.push({id:r,selected:$(n).tabs("option","selected")}))}),e){var n="tabs-"+t;try{window.sessionStorage.setItem(n,JSON.stringify(e))}catch(e){if(e.code===DOMException.QUOTA_EXCEEDED_ERR&&0===window.sessionStorage.length)return;throw e}}}},restoreTabState:function(e){var t=this,n=this._tabStateUrl(),r=void 0!==window.sessionStorage&&window.sessionStorage,o=r?window.sessionStorage.getItem("tabs-"+n):null,i=!!o&&JSON.parse(o);this.find(".cms-tabset, .ss-tabset").each(function(){var n,r,o=$(this),a=o.attr("id"),s=o.children("ul").children("li.ss-tabs-force-active");o.data("tabs")&&(o.tabs("refresh"),s.length?n=s.first().index():e&&e[a]?(r=o.find(e[a].tabSelector),r.length&&(n=r.index())):i&&$.each(i,function(e,t){a==t.id&&(n=t.selected)}),null!==n&&(o.tabs("option","active",n),t.trigger("tabstaterestored")))})},clearTabState:function(e){if(void 0!==window.sessionStorage){var t=window.sessionStorage;if(e)t.removeItem("tabs-"+e);else for(var n=0;n