diff --git a/wa-apps/installer/lib/config/app.php b/wa-apps/installer/lib/config/app.php index b296512cf..114a796ba 100644 --- a/wa-apps/installer/lib/config/app.php +++ b/wa-apps/installer/lib/config/app.php @@ -4,8 +4,8 @@ 'description' => 'Install new apps from the Webasyst Store', 'icon' => 'img/installer.svg', 'mobile' => false, - 'version' => '2.3.2', - 'critical' => '2.3.2', + 'version' => '2.3.3', + 'critical' => '2.3.3', 'system' => true, 'vendor' => 'webasyst', 'csrf' => true, diff --git a/wa-content/css/wa-settings/legacy/settings.css b/wa-content/css/wa-settings/legacy/settings.css index 1767350cf..eaf0577d9 100644 --- a/wa-content/css/wa-settings/legacy/settings.css +++ b/wa-content/css/wa-settings/legacy/settings.css @@ -109,8 +109,6 @@ ul.pager li { } input.wide { width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; box-sizing: border-box; } .ui-datepicker { @@ -206,7 +204,6 @@ ul.menu-v.without-icons li.selected a { color: inherit; } html .ui-datepicker.ui-widget-content { - -webkit-box-shadow: 0 0 15px rgba(0,0,0,0.33); box-shadow: 0 0 15px rgba(0,0,0,0.33); } html .ui-datepicker.ui-widget-content .ui-state-default { @@ -219,91 +216,52 @@ html .ui-datepicker.ui-widget-content .ui-state-active { color: inherit; } table.zebra tr:nth-child(2n+1) .s-single-line:after { - -webkit-box-shadow: -10px 0 10px #f2f7ff inset; box-shadow: -10px 0 10px #f2f7ff inset; } table.zebra tr:hover .s-single-line:after { - -webkit-box-shadow: -10px 0 10px #ffffe5 inset; box-shadow: -10px 0 10px #ffffe5 inset; } table.zebra tr.selected .s-single-line:after { - -webkit-box-shadow: -10px 0 10px #eed inset; box-shadow: -10px 0 10px #eed inset; } .animated { -webkit-animation-duration: 1s; - -webkit-animation-duration: 1s; - -moz-animation-duration: 1s; - -o-animation-duration: 1s; - -ms-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; - -webkit-animation-fill-mode: both; - -moz-animation-fill-mode: both; - -o-animation-fill-mode: both; - -ms-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes shake { 0%, 100% { -webkit-transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 10%, 30%, 50%, 70%, 90% { -webkit-transform: translate3d(-10px, 0, 0); - -webkit-transform: translate3d(-10px, 0, 0); - -moz-transform: translate3d(-10px, 0, 0); - -o-transform: translate3d(-10px, 0, 0); - -ms-transform: translate3d(-10px, 0, 0); transform: translate3d(-10px, 0, 0); } 20%, 40%, 60%, 80% { -webkit-transform: translate3d(10px, 0, 0); - -webkit-transform: translate3d(10px, 0, 0); - -moz-transform: translate3d(10px, 0, 0); - -o-transform: translate3d(10px, 0, 0); - -ms-transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0); } } .shake { -webkit-animation-name: shake; - -webkit-animation-name: shake; - -moz-animation-name: shake; - -o-animation-name: shake; - -ms-animation-name: shake; animation-name: shake; } @-moz-keyframes shake { 0%, 100% { -webkit-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 10%, 30%, 50%, 70%, 90% { -webkit-transform: translate3d(-10px, 0, 0); -ms-transform: translate3d(-10px, 0, 0); - -webkit-transform: translate3d(-10px, 0, 0); - -moz-transform: translate3d(-10px, 0, 0); - -o-transform: translate3d(-10px, 0, 0); - -ms-transform: translate3d(-10px, 0, 0); transform: translate3d(-10px, 0, 0); } 20%, 40%, 60%, 80% { -webkit-transform: translate3d(10px, 0, 0); -ms-transform: translate3d(10px, 0, 0); - -webkit-transform: translate3d(10px, 0, 0); - -moz-transform: translate3d(10px, 0, 0); - -o-transform: translate3d(10px, 0, 0); - -ms-transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0); } } @@ -311,28 +269,16 @@ table.zebra tr.selected .s-single-line:after { 0%, 100% { -webkit-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 10%, 30%, 50%, 70%, 90% { -webkit-transform: translate3d(-10px, 0, 0); -ms-transform: translate3d(-10px, 0, 0); - -webkit-transform: translate3d(-10px, 0, 0); - -moz-transform: translate3d(-10px, 0, 0); - -o-transform: translate3d(-10px, 0, 0); - -ms-transform: translate3d(-10px, 0, 0); transform: translate3d(-10px, 0, 0); } 20%, 40%, 60%, 80% { -webkit-transform: translate3d(10px, 0, 0); -ms-transform: translate3d(10px, 0, 0); - -webkit-transform: translate3d(10px, 0, 0); - -moz-transform: translate3d(10px, 0, 0); - -o-transform: translate3d(10px, 0, 0); - -ms-transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0); } } @@ -340,28 +286,16 @@ table.zebra tr.selected .s-single-line:after { 0%, 100% { -webkit-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 10%, 30%, 50%, 70%, 90% { -webkit-transform: translate3d(-10px, 0, 0); -ms-transform: translate3d(-10px, 0, 0); - -webkit-transform: translate3d(-10px, 0, 0); - -moz-transform: translate3d(-10px, 0, 0); - -o-transform: translate3d(-10px, 0, 0); - -ms-transform: translate3d(-10px, 0, 0); transform: translate3d(-10px, 0, 0); } 20%, 40%, 60%, 80% { -webkit-transform: translate3d(10px, 0, 0); -ms-transform: translate3d(10px, 0, 0); - -webkit-transform: translate3d(10px, 0, 0); - -moz-transform: translate3d(10px, 0, 0); - -o-transform: translate3d(10px, 0, 0); - -ms-transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0); } } @@ -369,28 +303,16 @@ table.zebra tr.selected .s-single-line:after { 0%, 100% { -webkit-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 10%, 30%, 50%, 70%, 90% { -webkit-transform: translate3d(-10px, 0, 0); -ms-transform: translate3d(-10px, 0, 0); - -webkit-transform: translate3d(-10px, 0, 0); - -moz-transform: translate3d(-10px, 0, 0); - -o-transform: translate3d(-10px, 0, 0); - -ms-transform: translate3d(-10px, 0, 0); transform: translate3d(-10px, 0, 0); } 20%, 40%, 60%, 80% { -webkit-transform: translate3d(10px, 0, 0); -ms-transform: translate3d(10px, 0, 0); - -webkit-transform: translate3d(10px, 0, 0); - -moz-transform: translate3d(10px, 0, 0); - -o-transform: translate3d(10px, 0, 0); - -ms-transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0); } } @@ -399,24 +321,16 @@ table.zebra tr.selected .s-single-line:after { } .s-sidebar-block .menu-v a { color: #777; - -webkit-transition: all 0.3s ease; - -moz-transition: all 0.3s ease; - -o-transition: all 0.3s ease; - -ms-transition: all 0.3s ease; transition: all 0.3s ease; } .s-sidebar-block .menu-v a i.icon16 { opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); } .s-sidebar-block .menu-v a:hover { color: #333 !important; } .s-sidebar-block .menu-v a:hover i.icon16 { opacity: 0.8; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; - filter: alpha(opacity=80); } .s-sidebar-block .menu-v li { margin-bottom: 6px; @@ -428,80 +342,64 @@ table.zebra tr.selected .s-single-line:after { } .s-sidebar-block .menu-v li.selected a i.icon16 { opacity: 1; - -ms-filter: none; - filter: none; } .icon16.ws { - -webkit-transition: all 0.3s ease; - -moz-transition: all 0.3s ease; - -o-transition: all 0.3s ease; - -ms-transition: all 0.3s ease; transition: all 0.3s ease; - -webkit-background-size: contain; - -moz-background-size: contain; background-size: contain; background-position: center; } .icon16.ws.general { - background-image: url("../../../img/wa-settings/ws-general.svg"); + background-image: url("../../img/wa-settings/ws-general.svg"); } .icon16.ws.email { - background-image: url("../../../img/wa-settings/ws-email.svg"); + background-image: url("../../img/wa-settings/ws-email.svg"); } .icon16.ws.maps { - background-image: url("../../../img/wa-settings/ws-map.svg"); + background-image: url("../../img/wa-settings/ws-map.svg"); } .icon16.ws.captcha { - background-image: url("../../../img/wa-settings/ws-lock.svg"); + background-image: url("../../img/wa-settings/ws-lock.svg"); } .icon16.ws.sms { - background-image: url("../../../img/wa-settings/ws-sms.svg"); + background-image: url("../../img/wa-settings/ws-sms.svg"); } .icon16.ws.auth { - background-image: url("../../../img/wa-settings/ws-key.svg"); + background-image: url("../../img/wa-settings/ws-key.svg"); } .icon16.ws.email-template, .icon16.ws.sms-template { - background-image: url("../../../img/wa-settings/ws-template.svg"); + background-image: url("../../img/wa-settings/ws-template.svg"); } .icon16.ws.db { - background-image: url("../../../img/wa-settings/ws-db.svg"); + background-image: url("../../img/wa-settings/ws-db.svg"); } .s-error-message-wrapper { color: #f00; margin-top: 6px; } .icon16.ws.field { - background-image: url("../../../img/wa-settings/ws-fields.svg"); - -webkit-background-size: contain; - -moz-background-size: contain; + background-image: url("../../img/wa-settings/ws-fields.svg"); background-size: contain; background-position: center; } .icon16.ws.regions { - background-image: url("../../../img/wa-settings/ws-regions.svg"); - -webkit-background-size: contain; - -moz-background-size: contain; + background-image: url("../../img/wa-settings/ws-regions.svg"); background-size: contain; background-position: center; } .icon16.ws.push { - background-image: url("../../../img/wa-settings/ws-push.svg"); - -webkit-background-size: contain; - -moz-background-size: contain; + background-image: url("../../img/wa-settings/ws-push.svg"); background-size: contain; background-position: center; } .icon16.ws.waid { - background-image: url("../../../img/wa-settings/ws-waid.svg"); + background-image: url("../../img/wa-settings/ws-waid.svg"); } .icon16.ws.waid-green { - background-image: url("../../../img/webasyst-wand-bold.svg"); + background-image: url("../../img/wa-settings/ws-waid-green.svg"); } .s-email-settings-page .s-settings-items .s-item:hover > .s-remove { opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); } .s-email-settings-page .s-settings-items .s-item:not(:last-child) { border-bottom: 1px solid #ccc; @@ -515,18 +413,10 @@ table.zebra tr.selected .s-single-line:after { top: 0; right: 0; opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: opacity 200ms linear; - -moz-transition: opacity 200ms linear; - -o-transition: opacity 200ms linear; - -ms-transition: opacity 200ms linear; transition: opacity 200ms linear; } .s-email-settings-page .s-settings-items .s-item .s-remove:hover { opacity: 1; - -ms-filter: none; - filter: none; } .s-email-settings-page .s-settings-items .s-item .s-dkim-field { margin-top: 10px; @@ -539,7 +429,7 @@ table.zebra tr.selected .s-single-line:after { } .s-email-settings-page .s-add-item { display: inline-block; - margin: 20px 0; + margin-bottom: 20px; } .s-email-templates-page .s-email-template-sidebar-wrapper .s-new-templates { display: block; @@ -563,20 +453,12 @@ table.zebra tr.selected .s-single-line:after { .s-email-templates-page .s-email-template-sidebar-wrapper .s-sidebar-items .s-channel-edit { margin-top: 1px; opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - -webkit-transition: opacity 200ms linear; - -moz-transition: opacity 200ms linear; - -o-transition: opacity 200ms linear; - -ms-transition: opacity 200ms linear; transition: opacity 200ms linear; cursor: pointer; float: right; } .s-email-templates-page .s-email-template-sidebar-wrapper .s-sidebar-items .s-channel-edit:hover { opacity: 1; - -ms-filter: none; - filter: none; } .s-email-templates-page .s-email-template-sidebar-wrapper .s-sidebar-items .s-template-item { padding-left: 44px !important; @@ -606,7 +488,6 @@ table.zebra tr.selected .s-single-line:after { border: 1px solid #ccc; } .s-email-templates-page .content .s-template-form .ace .ace_scroller.ace_scroll-left { - -webkit-box-shadow: initial !important; box-shadow: initial !important; } .s-email-templates-page .content .s-template-form .ace .ace_print-margin { @@ -685,7 +566,6 @@ table.zebra tr.selected .s-single-line:after { border: 1px solid #ccc; } .s-sms-templates-page .content .ace .ace_scroller.ace_scroll-left { - -webkit-box-shadow: initial !important; box-shadow: initial !important; } .s-sms-templates-page .content .ace .ace_print-margin { @@ -755,10 +635,6 @@ table.zebra tr.selected .s-single-line:after { width: 30px; z-index: -1; left: -50px; - -webkit-transform: rotateY(180deg); - -moz-transform: rotateY(180deg); - -o-transform: rotateY(180deg); - -ms-transform: rotateY(180deg); transform: rotateY(180deg); } .s-sms-preview-template-dialog .s-sender-wrapper { @@ -822,18 +698,10 @@ table.zebra tr.selected .s-single-line:after { max-width: 95px; overflow: hidden; opacity: 0.7; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; - filter: alpha(opacity=70); - -webkit-transition: opacity 100ms linear; - -moz-transition: opacity 100ms linear; - -o-transition: opacity 100ms linear; - -ms-transition: opacity 100ms linear; transition: opacity 100ms linear; } .s-auth-settings-page .s-auth-settings-fields-block .s-auth-background .s-background-images li a:hover { opacity: 0.9; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; - filter: alpha(opacity=90); } .s-auth-settings-page .s-auth-settings-fields-block .s-auth-background .s-background-images li a img { width: 95px; @@ -844,8 +712,6 @@ table.zebra tr.selected .s-single-line:after { border-color: #fdda3b; border-radius: 4px; opacity: 1; - -ms-filter: none; - filter: none; } .s-auth-settings-page .s-auth-settings-fields-block .s-custom-background-preview .s-custom-image-preview { display: block; @@ -962,8 +828,6 @@ table.zebra tr.selected .s-single-line:after { .s-auth-settings-page .s-auth-settings-fields-block-cover { background: #fff; opacity: 0.8; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; - filter: alpha(opacity=80); z-index: 100; right: 0; position: absolute; @@ -1012,8 +876,6 @@ table.zebra tr.selected .s-single-line:after { } .s-field-edit-dialog .subfields-list tr:hover .c-link-wrapper a { opacity: 1; - -ms-filter: none; - filter: none; } .s-field-edit-dialog .editor-on .edit { visibility: hidden; @@ -1055,18 +917,10 @@ table.zebra tr.selected .s-single-line:after { } .s-field-edit-dialog .s-link-wrapper a { opacity: 0.5; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - filter: alpha(opacity=50); - -webkit-transition: opacity 200ms linear; - -moz-transition: opacity 200ms linear; - -o-transition: opacity 200ms linear; - -ms-transition: opacity 200ms linear; transition: opacity 200ms linear; } .s-field-edit-dialog .s-link-wrapper a:hover { opacity: 1; - -ms-filter: none; - filter: none; } .s-field-edit-dialog .s-link-wrapper .icon16 { margin: 0 4px 0 0; @@ -1076,7 +930,6 @@ table.zebra tr.selected .s-single-line:after { } .s-field-edit-dialog .ellipsis { white-space: nowrap; - -o-text-overflow: ellipsis; text-overflow: ellipsis; width: 210px; display: inline-block; @@ -1123,23 +976,8 @@ table.zebra tr.selected .s-single-line:after { color: #808080; } .s-db-list-dialog .s-dialog-header { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; align-items: center; - -webkit-box-pack: justify; - -moz-box-pack: justify; - -o-box-pack: justify; - -ms-flex-pack: justify; - -webkit-justify-content: space-between; justify-content: space-between; } .s-db-list-dialog .s-dialog-header a.is-selected b { @@ -1155,23 +993,8 @@ table.zebra tr.selected .s-single-line:after { color: #000; } .s-db-list-dialog .s-dialog-footer { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; align-items: center; - -webkit-box-pack: justify; - -moz-box-pack: justify; - -o-box-pack: justify; - -ms-flex-pack: justify; - -webkit-justify-content: space-between; justify-content: space-between; } @-webkit-keyframes pending { @@ -1187,10 +1010,6 @@ table.zebra tr.selected .s-single-line:after { } .s-db-list-dialog .s-dialog-footer .s-dialog-notice { -webkit-animation: pending 2s linear infinite; - -webkit-animation: pending 2s linear infinite; - -moz-animation: pending 2s linear infinite; - -o-animation: pending 2s linear infinite; - -ms-animation: pending 2s linear infinite; animation: pending 2s linear infinite; } @-moz-keyframes pending { diff --git a/wa-content/css/wa-settings/settings.css b/wa-content/css/wa-settings/settings.css index b4c5e0d93..bac6070cc 100644 --- a/wa-content/css/wa-settings/settings.css +++ b/wa-content/css/wa-settings/settings.css @@ -763,7 +763,7 @@ } .s-email-settings-page .s-add-item { display: inline-block; - margin: 20px 0; + margin-top: 20px; } .s-email-templates-page .s-email-template-sidebar-wrapper section header { cursor: pointer; diff --git a/wa-content/js/jquery-wa/wa-settings/legacy/settings.email.js b/wa-content/js/jquery-wa/wa-settings/legacy/settings.email.js index 60dbe7fe1..ba6583bb0 100644 --- a/wa-content/js/jquery-wa/wa-settings/legacy/settings.email.js +++ b/wa-content/js/jquery-wa/wa-settings/legacy/settings.email.js @@ -165,8 +165,9 @@ var WASettingsEmail = ( function($) { e.preventDefault(); var $item = that.$item_template.clone().removeClass('js-template').addClass('js-item'); $item.find('.js-key').val(''); - that.$items_wrapper.append($item); + that.$items_wrapper.prepend($item); that.$form.trigger('input'); + $item.find(that.transport_class).trigger('change'); }); // Remove item diff --git a/wa-content/js/jquery-wa/wa-settings/settings.email.js b/wa-content/js/jquery-wa/wa-settings/settings.email.js index b59a81ce6..203f20b04 100644 --- a/wa-content/js/jquery-wa/wa-settings/settings.email.js +++ b/wa-content/js/jquery-wa/wa-settings/settings.email.js @@ -352,8 +352,9 @@ class WASettingsEmail { e.preventDefault(); let $item = that.$item_template.clone().removeClass('js-template').addClass('js-item'); $item.find('.js-key').val(''); - that.$items_wrapper.append($item); + that.$items_wrapper.prepend($item); that.$form.trigger('input'); + $item.find(that.transport_class).trigger('change'); }); // Remove item diff --git a/wa-content/js/redactor/2/redactor.min.js b/wa-content/js/redactor/2/redactor.min.js index a80afe9ab..6412a143f 100644 --- a/wa-content/js/redactor/2/redactor.min.js +++ b/wa-content/js/redactor/2/redactor.min.js @@ -11,9 +11,9 @@ Usage: $('#content').redactor(); */ if(function(t){"use strict";function e(t,i){return new e.prototype.init(t,i)}Function.prototype.bind||(Function.prototype.bind=function(t){var e=this;return function(){return e.apply(t)}});var i=0;t.fn.redactor=function(i){var o=[],r=Array.prototype.slice.call(arguments,1);return"string"==typeof i?this.each(function(){var e,s=t.data(this,"redactor");if("-1"!==i.search(/\./)?(e=i.split("."),void 0!==s[e[0]]&&(e=s[e[0]][e[1]])):e=s[i],void 0!==s&&t.isFunction(e)){var n=e.apply(s,r);void 0!==n&&n!==s&&o.push(n)}else t.error('No such method "'+i+'" for Redactor')}):this.each(function(){t.data(this,"redactor",{}),t.data(this,"redactor",e(this,i))}),0===o.length?this:1===o.length?o[0]:o},t.Redactor=e,t.Redactor.VERSION="2.10",t.Redactor.modules=["air","autosave","block","buffer","build","button","caret","clean","code","core","detect","dropdown","events","file","focus","image","indent","inline","insert","keydown","keyup","lang","line","link","linkify","list","marker","modal","observe","offset","paragraphize","paste","placeholder","progress","selection","shortcuts","storage","toolbar","upload","uploads3","utils","browser"],t.Redactor.settings={},t.Redactor.opts={animation:!1,lang:"en",direction:"ltr",spellcheck:!0,overrideStyles:!0,stylesClass:!1,scrollTarget:document,focus:!1,focusEnd:!1,clickToEdit:!1,structure:!1,tabindex:!1,minHeight:!1,maxHeight:!1,maxWidth:!1,plugins:!1,callbacks:{},placeholder:!1,linkify:!0,enterKey:!0,pastePlainText:!1,pasteImages:!0,pasteLinks:!0,pasteBlockTags:["pre","h1","h2","h3","h4","h5","h6","table","tbody","thead","tfoot","th","tr","td","ul","ol","li","blockquote","p","figure","figcaption"],pasteInlineTags:["br","strong","ins","code","del","span","samp","kbd","sup","sub","mark","var","cite","small","b","u","em","i"],preClass:!1,preSpaces:4,tabAsSpaces:!1,tabKey:!0,autosave:!1,autosaveName:!1,autosaveFields:!1,imageUpload:null,imageUploadParam:"file",imageUploadFields:!1,imageUploadForms:!1,imageTag:"figure",imageEditable:!0,imageCaption:!0,imagePosition:!1,imageResizable:!1,imageFloatMargin:"10px",dragImageUpload:!0,multipleImageUpload:!0,clipboardImageUpload:!0,fileUpload:null,fileUploadParam:"file",fileUploadFields:!1,fileUploadForms:!1,dragFileUpload:!0,s3:!1,linkNewTab:!1,linkTooltip:!0,linkNofollow:!1,linkSize:30,linkValidation:!0,pasteLinkTarget:!1,videoContainerClass:"video-container",toolbar:!0,toolbarFixed:!0,toolbarFixedTarget:document,toolbarFixedTopOffset:0,toolbarExternal:!1,toolbarOverflow:!1,air:!1,airWidth:!1,formatting:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],formattingAdd:!1,buttons:["format","bold","italic","deleted","lists","image","file","link","horizontalrule"],buttonsTextLabeled:!1,buttonsHide:[],buttonsHideOnMobile:[],script:!0,removeNewlines:!1,removeComments:!0,replaceTags:{b:"strong",i:"em",strike:"del"},keepStyleAttr:[],keepInlineOnEnter:!1,shortcuts:{"ctrl+shift+m, meta+shift+m":{func:"inline.removeFormat"},"ctrl+b, meta+b":{func:"inline.format",params:["bold"]},"ctrl+i, meta+i":{func:"inline.format",params:["italic"]},"ctrl+h, meta+h":{func:"inline.format",params:["superscript"]},"ctrl+l, meta+l":{func:"inline.format",params:["subscript"]},"ctrl+k, meta+k":{func:"link.show"},"ctrl+shift+7":{func:"list.toggle",params:["orderedlist"]},"ctrl+shift+8":{func:"list.toggle",params:["unorderedlist"]}},shortcutsAdd:!1,activeButtons:["deleted","italic","bold"],activeButtonsStates:{b:"bold",strong:"bold",i:"italic",em:"italic",del:"deleted",u:"underline",strike:"deleted"},langs:{en:{format:"Format",image:"Image",file:"File",link:"Link",bold:"Bold",italic:"Italic",deleted:"Strikethrough",underline:"Underline","bold-abbr":"B","italic-abbr":"I","deleted-abbr":"S","underline-abbr":"U",lists:"Lists","link-insert":"Insert link","link-edit":"Edit link","link-in-new-tab":"Open link in new tab",unlink:"Unlink",cancel:"Cancel",close:"Close",insert:"Insert",save:"Save",delete:"Delete",text:"Text",edit:"Edit",title:"Title",general:"General",paragraph:"Normal text",quote:"Quote",code:"Code",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",filename:"Name",optional:"optional",unorderedlist:"Unordered List",orderedlist:"Ordered List",outdent:"Outdent",indent:"Indent",horizontalrule:"Line","upload-label":"Drop file here or ",caption:"Caption",upload:"Upload",bulletslist:"Bullets",numberslist:"Numbers","image-position":"Position",none:"None",left:"Left",right:"Right",center:"Center","accessibility-help-label":"Rich text editor"}},type:"textarea",inline:!1,inlineTags:["a","span","strong","strike","b","u","em","i","code","del","ins","samp","kbd","sup","sub","mark","var","cite","small"],blockTags:["pre","ul","ol","li","p","h1","h2","h3","h4","h5","h6","dl","dt","dd","div","td","blockquote","output","figcaption","figure","address","section","header","footer","aside","article","iframe"],paragraphize:!0,paragraphizeBlocks:["table","div","pre","form","ul","ol","h1","h2","h3","h4","h5","h6","dl","blockquote","figcaption","address","section","header","footer","aside","article","object","style","script","iframe","select","input","textarea","button","option","map","area","math","hr","fieldset","legend","hgroup","nav","figure","details","menu","summary","p"],emptyHtml:"

",invisibleSpace:"​",emptyHtmlRendered:t("").html("​").html(),imageTypes:["image/png","image/jpeg","image/gif"],userAgent:navigator.userAgent.toLowerCase(),observe:{dropdowns:[]},regexps:{linkyoutube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.\-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/gi,linkvimeo:/https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,linkvimeochannel:/https?:\/\/(www\.)?vimeo.com\/channels\/[^\/]+\/(\d+)($|\/)/,linkimage:/((https?|www)[^\s]+\.)(jpe?g|png|gif)(\?[^\s-]+)?/gi,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi}},e.fn=t.Redactor.prototype={keyCode:{BACKSPACE:8,DELETE:46,UP:38,DOWN:40,ENTER:13,SPACE:32,ESC:27,TAB:9,CTRL:17,META:91,SHIFT:16,ALT:18,RIGHT:39,LEFT:37,LEFT_WIN:91},init:function(e,o){if(this.$element=t(e),this.uuid=i++,this.sBuffer=[],this.sRebuffer=[],this.loadOptions(o),this.loadModules(),this.opts.clickToEdit&&!this.$element.hasClass("redactor-click-to-edit"))return this.loadToEdit(o);this.$element.hasClass("redactor-click-to-edit")&&this.$element.removeClass("redactor-click-to-edit"),this.reIsBlock=new RegExp("^("+this.opts.blockTags.join("|").toUpperCase()+")$","i"),this.reIsInline=new RegExp("^("+this.opts.inlineTags.join("|").toUpperCase()+")$","i"),this.opts.dragImageUpload=null!==this.opts.imageUpload&&this.opts.dragImageUpload,this.opts.dragFileUpload=null!==this.opts.fileUpload&&this.opts.dragFileUpload,this.formatting={},this.lang.load(),t.extend(this.opts.shortcuts,this.opts.shortcutsAdd),this.$editor=this.$element,this.detectType(),this.core.callback("start"),this.core.callback("startToEdit"),this.start=!0,this.build.start()},detectType:function(){this.build.isInline()||this.opts.inline?this.opts.type="inline":this.build.isTag("DIV")?this.opts.type="div":this.build.isTag("PRE")&&(this.opts.type="pre")},loadToEdit:function(e){this.$element.on("click.redactor-click-to-edit",t.proxy(function(){this.initToEdit(e)},this)),this.$element.addClass("redactor-click-to-edit")},initToEdit:function(e){t.extend(e.callbacks,{startToEdit:function(){this.insert.node(this.marker.get(),!1)},initToEdit:function(){this.selection.restore(),this.clickToCancelStorage=this.code.get(),t(this.opts.clickToCancel).off(".redactor-click-to-edit"),t(this.opts.clickToCancel).show().on("click.redactor-click-to-edit",t.proxy(function(i){i.preventDefault(),this.core.destroy(),this.events.syncFire=!1,this.$element.html(this.clickToCancelStorage),this.core.callback("cancel",this.clickToCancelStorage),this.events.syncFire=!0,this.clickToCancelStorage="",t(this.opts.clickToCancel).hide(),t(this.opts.clickToSave).hide(),this.$element.on("click.redactor-click-to-edit",t.proxy(function(){this.initToEdit(e)},this)),this.$element.addClass("redactor-click-to-edit")},this)),t(this.opts.clickToSave).off(".redactor-click-to-edit"),t(this.opts.clickToSave).show().on("click.redactor-click-to-edit",t.proxy(function(i){i.preventDefault(),this.core.destroy(),this.core.callback("save",this.code.get()),t(this.opts.clickToCancel).hide(),t(this.opts.clickToSave).hide(),this.$element.on("click.redactor-click-to-edit",t.proxy(function(){this.initToEdit(e)},this)),this.$element.addClass("redactor-click-to-edit")},this))}}),this.$element.redactor(e),this.$element.off(".redactor-click-to-edit")},loadOptions:function(e){var i={};void 0!==t.Redactor.settings.namespace?this.$element.hasClass(t.Redactor.settings.namespace)&&(i=t.Redactor.settings):i=t.Redactor.settings,this.opts=t.extend({},t.Redactor.opts,this.$element.data(),e),this.opts=t.extend({},this.opts,i)},getModuleMethods:function(t){return Object.getOwnPropertyNames(t).filter(function(e){return"function"==typeof t[e]})},loadModules:function(){for(var e=t.Redactor.modules.length,i=0;i").addClass("redactor-air").attr({id:"redactor-air-"+this.uuid,role:"toolbar"}).hide()},show:function(e){this.selection.saveInstant(),t(".redactor-air").hide();var i=0,o=this.$air.innerWidth();t(window).width()')},setIn:function(){this.core.editor().addClass("redactor-in")},setId:function(){var t="textarea"===this.opts.type?"redactor-uuid-"+this.uuid:this.$element.attr("id");this.core.editor().attr("id",void 0===t?"redactor-uuid-"+this.uuid:t)},getName:function(){var t=this.$element.attr("name");return void 0===t?"content-"+this.uuid:t},buildTextarea:function(){this.$textarea=t("
"},show:function(){this.buffer.set(),this.selection.save(),this.modal.load(t,o,800),this.modal.show(),this.detect.isDesktop()&&setTimeout(function(){$("#h-"+t+"-textarea").focus()},1)},insertSnippet:function(t){this.modal.close(),this.selection.restore(),s.insertNewline($("<"+e+">").text(t).insertAfter(this.selection.current())),this.code.sync()},insertNewline:function(t){return $("

").insertAfter(t)}}}}RedactorPlugins.codeblock=t("codeblock","pre","re-icon-html","Insert code block","code-to-insert"),RedactorPlugins.blockquote=t("blockquote","blockquote","re-icon-clips","Insert quote","blockquote-to-insert"),$.wa&&($.wa.RedactorCodeblockPluginFactory=t)}(),function(t){t.Redactor.prototype.fontcolor=function(){return{langs:{en:{fontcolor:"Text Color","fontcolor-highlight":"Highlight","fontcolor-text":"Text","fontcolor-none":"None"}},init:function(){var e=["#ffffff","#000000","#ff0000","#cc0000","#4f81bd","#c0504d","#9bbb59","#8064a2","#4bacc6","#f79646","#ffff00","#f2f2f2","#7f7f7f","#0000ff","#0000cc","#dbe5f1","#f2dcdb","#ebf1dd","#e5e0ec","#dbeef3","#fdeada","#fff2ca","#d8d8d8","#595959","#00ff00","#00cc00","#b8cce4","#e5b9b7","#d7e3bc","#ccc1d9","#b7dde8","#fbd5b5","#ffe694","#bfbfbf","#3f3f3f","#7bed0c","#59a60d","#95b3d7","#d99694","#c3d69b","#b2a2c7","#b7dde8","#fac08f","#f2c314","#a5a5a5","#262626","#00ffff","#00cccc","#366092","#953734","#76923c","#5f497a","#92cddc","#e36c09","#c09100","#7f7f7f","#0c0c0c","#ff00ff","#cc00cc","#244061","#632423","#4f6128","#3f3151","#31859b","#974806","#7f6000"],i=this.button.add("fontcolor",this.lang.get("fontcolor"));this.button.setIcon(i,'');var o=this.button.addDropdown(i);o.attr("rel","fontcolor"),o.width(242);var r=t('
'),s=t(''+this.lang.get("fontcolor-text")+""),n=t(''+this.lang.get("fontcolor-highlight")+"");r.append(s),r.append(n),o.append(r),this.fontcolor.buildPicker(o,"textcolor",e),this.fontcolor.buildPicker(o,"backcolor",e),s.on("mousedown",function(e){e.preventDefault(),o.find(".re-dropdown-box-selector-font").css("background","none"),o.find(".re-dropdown-box-backcolor").hide(),o.find(".re-dropdown-box-textcolor").show(),t(this).css("background","#eee")}),n.on("mousedown",function(e){e.preventDefault(),o.find(".re-dropdown-box-selector-font").css("background","none"),o.find(".re-dropdown-box-textcolor").hide(),o.find(".re-dropdown-box-backcolor").show(),t(this).css("background","#eee")})},buildPicker:function(e,i,o){for(var r=t('
'),s="backcolor"==i?"background-color":"color",n=o.length,a=this,l=function(e){e.preventDefault(),a.fontcolor.set(t(this).data("rule"),t(this).attr("rel"))},c=0;c');h.css("background-color",d),h.on("mousedown",l),r.append(h)}var u=t('').html(this.lang.get("fontcolor-none"));u.on("mousedown",t.proxy(function(t){t.preventDefault(),this.fontcolor.remove(s)},this)),r.append(u),e.append(r),"backcolor"==i&&r.hide()},set:function(t,e){this.inline.format("span","style",t+": "+e+";"),this.dropdown.hide()},remove:function(t){this.inline.removeStyleRule(t),this.dropdown.hide()}}}}(jQuery),function(t){t.Redactor.prototype.fontfamily=function(){return{langs:{en:{fontfamily:"Font","fontfamily-remove":"Remove Font Family"}},init:function(){var e=["Arial","Helvetica","Georgia","Times New Roman","Verdana","Monospace"],i=this,o={};t.each(e,function(t,e){o["s"+t]={title:e,func:function(){i.fontfamily.set(e)}}}),o.remove={title:this.lang.get("fontfamily-remove"),func:i.fontfamily.reset};var r=this.button.add("fontfamily",this.lang.get("fontfamily"));this.button.setIcon(r,''),this.button.addDropdown(r,o)},set:function(t){this.inline.format("span","style","font-family:"+t+";")},reset:function(){this.inline.removeStyleRule("font-family")}}}}(jQuery),function(t){t.Redactor.prototype.fontsize=function(){return{langs:{en:{fontsize:"Size","fontsize-remove":"Remove Font Size"}},init:function(){var e=[10,11,12,14,16,18,20,24,28,30],i=this,o={};t.each(e,function(t,e){o["s"+t]={title:e+"px",func:function(){i.fontsize.set(e)}}}),o.remove={title:this.lang.get("fontsize-remove"),func:i.fontsize.reset};var r=this.button.add("fontsize",this.lang.get("fontsize"));this.button.setIcon(r,''),this.button.addDropdown(r,o)},set:function(t){this.inline.format("span","style","font-size: "+t+"px;")},reset:function(){this.inline.removeStyleRule("font-size")}}}}(jQuery),function(t){t.Redactor.prototype.inlinestyle=function(){return{langs:{en:{style:"Style","style-marked":"Marked","style-code":"Code","style-sample":"Sample","style-variable":"Variable","style-shortcut":"Shortcut","style-cite":"Cite","style-sup":"Superscript","style-sub":"Subscript"}},init:function(){var e={marked:{title:"style-marked",args:["mark"]},code:{title:"style-code",args:["code"]},sample:{title:"style-sample",args:["samp"]},variable:{title:"style-variable",args:["var"]},shortcut:{title:"style-shortcut",args:["kbd"]},cite:{title:"style-cite",args:["cite"]},sup:{title:"style-sup",args:["sup"]},sub:{title:"style-sub",args:["sub"]}},i=this,o={};t.each(e,function(t,e){o[t]={title:i.lang.get(e.title),func:"inline.format",args:e.args}});var r=this.button.addAfter("format","inline",this.lang.get("style"));this.button.setIcon(r,''),this.button.addDropdown(r,o)}}}}(jQuery),function(t){t.Redactor.prototype.properties=function(){return{langs:{en:{properties:"Properties"}},block:!1,labelStyle:{position:"absolute",padding:"2px 5px","line-height":1,"border-radius":"5px","font-size":"10px",color:"rgba(255, 255, 255, .9)","z-index":99},getTemplate:function(){return String()+''},setup:function(){this.opts.properties=void 0===this.opts.properties?{}:this.opts.properties,this.opts.properties.id=void 0===this.opts.properties.id||this.opts.properties.id,this.opts.properties.classname=void 0===this.opts.properties.classname||this.opts.properties.classname,this.opts.properties.show=void 0!==this.opts.properties.show&&this.opts.properties.show},init:function(){if("pre"!==this.opts.type&&"inline"!==this.opts.type){this.properties.setup(),this.properties.createLabelId(this.properties.labelStyle),this.properties.createLabelClass(this.properties.labelStyle),this.properties.setEvents();var t=this.button.add("properties",this.lang.get("properties"));this.button.setIcon(t,''),this.button.addCallback(t,this.properties.show)}},show:function(){this.modal.addTemplate("properties",this.properties.getTemplate()),this.modal.load("properties","Properties",600),this.modal.getActionButton().text("Save").on("click",this.properties.save),this.properties.showId(),this.properties.showClass(),this.modal.show()},createLabelId:function(e){(this.opts.properties.show||this.opts.properties.id)&&(this.properties.labelId=t("").attr("id","redactor-properties-label-id-"+this.uuid).attr("title","ID").hide(),this.properties.labelId.css(e).css("background","rgba(229, 57, 143, .7)"),t("body").append(this.properties.labelId))},createLabelClass:function(e){(this.opts.properties.show||this.opts.properties.classname)&&(this.properties.labelClass=t("").attr("id","redactor-properties-label-class-"+this.uuid).attr("title","class").hide(),this.properties.labelClass.css(e).css("background","rgba(61, 121, 242, .7)"),t("body").append(this.properties.labelClass))},setEvents:function(){this.core.element().on("click.callback.redactor",this.properties.showOnClick),t(document).on("mousedown.redactor-properties",t.proxy(this.properties.hideOnBlur,this)),this.core.element().on("destroy.callback.redactor",t.proxy(function(){t(document).off(".redactor-properties")},this))},showId:function(){this.opts.properties.id?(t("#modal-properties-id-label").show(),t("#modal-properties-id").show().val(t(this.properties.block).attr("id"))):t("#modal-properties-id, #modal-properties-id-label").hide()},showClass:function(){this.opts.properties.classname?(t("#modal-properties-class-label").show(),t("#modal-properties-class").show().val(t(this.properties.block).attr("class"))):t("#modal-properties-class, #modal-properties-class-label").hide()},save:function(){if(this.opts.properties.id){var e=t("#modal-properties-id").val();void 0===e||""===e?this.block.removeAttr("id",this.properties.block):this.block.replaceAttr("id",e,this.properties.block)}if(this.opts.properties.classname){var i=t("#modal-properties-class").val();void 0===i||""===i?this.block.removeAttr("class",this.properties.block):this.block.replaceClass(i,this.properties.block)}this.modal.close(),this.properties.showOnClick(!1)},showOnClick:function(e){!1!==e&&e.preventDefault();var i=void 0!==this.fullscreen&&this.fullscreen.isOpen?1052:99;if(this.properties.block=this.selection.block(),this.properties.block&&this.utils.isRedactorParent(this.properties.block)&&!this.utils.isCurrentOrParent(["figure","li"])){var o=t(this.properties.block).offset(),r=this.properties.showOnClickClass(o,i);this.properties.showOnClickId(o,i,r)}},showOnClickId:function(e,i,o){var r=t(this.properties.block).attr("id");this.opts.properties.show&&this.opts.properties.id&&void 0!==r&&""!==r&&setTimeout(t.proxy(function(){var t=this.opts.properties.classname&&void 0!==o&&""!==o?this.properties.labelClass.innerWidth():-3;this.properties.labelId.css({zIndex:i,top:e.top-13,left:e.left+t}).show().text("#"+r)},this),10)},showOnClickClass:function(e,i){var o=t(this.properties.block).attr("class");return this.opts.properties.show&&this.opts.properties.classname&&void 0!==o&&""!==o&&this.properties.labelClass.css({zIndex:i,top:e.top-13,left:e.left-3}).show().text(o),o},hideOnBlur:function(t){t.target!==this.properties.block&&(this.properties.hideOnBlurId(),this.properties.hideOnBlurClass())},hideOnBlurId:function(){this.opts.properties.show&&this.opts.properties.id&&this.properties.labelId.css("z-index",99).hide()},hideOnBlurClass:function(){this.opts.properties.show&&this.opts.properties.classname&&this.properties.labelClass.css("z-index",99).hide()}}}}(jQuery),function(t){t.Redactor.prototype.source=function(){return{init:function(){var e=this.button.addFirst("html","HTML");this.button.setIcon(e,''),this.button.addCallback(e,this.source.toggle);var i={width:"100%",margin:"0",background:"#1d1d1d","box-sizing":"border-box",color:"#ccc","font-size":"15px",outline:"none",padding:"20px","line-height":"24px","font-family":'Consolas, Menlo, Monaco, "Courier New", monospace'};this.source.$textarea=t("
"},init:function(){var t=this.button.addAfter("image","video",this.lang.get("video"));this.button.setIcon(t,''),this.button.addCallback(t,this.video.show)},show:function(){this.modal.addTemplate("video",this.video.getTemplate()),this.modal.load("video",this.lang.get("video"),700),this.modal.getActionButton().text(this.lang.get("insert")).on("click",this.video.insert),this.modal.show(),this.detect.isDesktop()&&setTimeout(function(){t("#redactor-insert-video-area").focus()},1)},insert:function(){var e=t("#redactor-insert-video-area").val(),i=e.match(/]*>/gi;e=e.replace(r,function(t,e){return-1===o.indexOf(e.toLowerCase())?"":t}),this.opts.videoContainerClass=void 0===this.opts.videoContainerClass?"video-container":this.opts.videoContainerClass;var s='
';e=e.match(this.video.reUrlYoutube)?e.replace(this.video.reUrlYoutube,s+"//www.youtube.com/embed/$1"+n):e.match(this.video.reIframeYoutube)?e.replace(this.video.reIframeYoutube,s+"//www.youtube.com/embed/$2"+n):e.match(this.video.reUrlVimeo)?e.replace(this.video.reUrlVimeo,s+"//player.vimeo.com/video/$2"+n):e.match(this.video.reUrlVimeoChannel)?e.replace(this.video.reUrlVimeoChannel,s+"//player.vimeo.com/video/$2"+n):e.match(this.video.reIframeVimeo)?e.replace(this.video.reIframeVimeo,s+"//player.vimeo.com/video/$2"+n):'
'+e+"
"}this.modal.close(),this.placeholder.hide(),this.buffer.set(),this.air.collapsed(),this.insert.html(e)}}}}(jQuery); +setStartEmptyOrInline:function(e,i){var o=window.getSelection(),r=document.createRange(),s=document.createTextNode("​");r.setStart(e,0),r.insertNode(s),r.setStartAfter(s),r.collapse(!0),o.removeAllRanges(),o.addRange(r),i||this.core.editor().on("keydown.redactor-remove-textnode",function(){t(s).remove(),t(this).off("keydown.redactor-remove-textnode")})},end:function(e){var i,o;if(e=this.caret.prepare(e)){if("BR"!==e.tagName&&""===e.innerHTML)return this.caret.start(e);if("BR"===e.tagName){var r=document.createElement("span");return r.className="redactor-invisible-space",r.innerHTML="​",t(e).after(r),i=window.getSelection(),i.removeAllRanges(),o=document.createRange(),o.setStartBefore(r),o.setEndBefore(r),i.addRange(o),void t(r).replaceWith(function(){return t(this).contents()})}if(e.lastChild&&1===e.lastChild.nodeType)return this.caret.after(e.lastChild);var i=window.getSelection();if(i.getRangeAt||i.rangeCount)try{var o=i.getRangeAt(0);o.selectNodeContents(e),o.collapse(!1),i.removeAllRanges(),i.addRange(o)}catch(t){}}},after:function(e){var i,o;if(e=this.caret.prepare(e)){if("BR"===e.tagName)return this.caret.end(e);if(this.utils.isBlockTag(e.tagName)){var r=this.caret.next(e);return void(void 0===r?this.caret.end(e):("TABLE"===r.tagName?r=t(r).find("th, td").first()[0]:"UL"!==r.tagName&&"OL"!==r.tagName||(r=t(r).find("li").first()[0]),this.caret.start(r)))}var s=document.createTextNode("​");i=window.getSelection(),i.removeAllRanges(),o=document.createRange(),o.setStartAfter(e),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),i.addRange(o)}},before:function(e){var i,o;if(e=this.caret.prepare(e)){if(this.utils.isBlockTag(e.tagName)){var r=this.caret.prev(e);return void(void 0===r?this.caret.start(e):("TABLE"===r.tagName?r=t(r).find("th, td").last()[0]:"UL"!==r.tagName&&"OL"!==r.tagName||(r=t(r).find("li").last()[0]),this.caret.end(r)))}i=window.getSelection(),i.removeAllRanges(),o=document.createRange(),o.setStartBefore(e),o.collapse(!0),i.addRange(o)}},next:function(e){var i=t(e).next();return i.hasClass("redactor-script-tag, redactor-selection-marker")?i.next()[0]:i[0]},prev:function(e){var i=t(e).prev();return i.hasClass("redactor-script-tag, redactor-selection-marker")?i.prev()[0]:i[0]},offset:function(t){return this.offset.get(t)}}},clean:function(){return{onSet:function(e){e=this.clean.savePreCode(e),e=this.clean.saveFormTags(e),this.opts.script&&(e=e.replace(/]?)>([\w\W]*?)<\/script>/gi,'
$2
')),e=e.replace(/\$/g,"$"),e=e.replace(//gi,''),e=e.replace(/]?)>​<\/span>/gi,"###marker1###"),e=e.replace(/]?)>​<\/span>/gi,"###marker2###");var i=this,o=t("
").html(t.parseHTML(e,document,!0)),r=this.opts.replaceTags;if(r){var s=Object.keys(this.opts.replaceTags);o.find(s.join(",")).each(function(t,e){i.utils.replaceToTag(e,r[e.tagName.toLowerCase()])})}o.find("span, a").attr("data-redactor-span",!0),o.find(this.opts.inlineTags.join(",")).each(function(){var e=t(this);e.attr("style")&&e.attr("data-redactor-style-cache",e.attr("style"))}),e=o.html();var n=["font","html","head","link","body","meta","applet"];return this.opts.script||n.push("script"),e=this.clean.stripTags(e,n),this.opts.removeComments&&(e=e.replace(//gi,"")),e=this.paragraphize.load(e),e=e.replace("###marker1###",''),e=e.replace("###marker2###",''),-1!==e.search(/^(||\s|||| )$/i)?this.opts.emptyHtml:e},onGet:function(t){return this.clean.onSync(t)},onSync:function(e){if(e=e.replace(/\u200B/g,""),e=e.replace(/​/gi,""),-1!==e.search(/^

(||\s|||| )<\/p>$/i))return"";e=e.replace(/])>([\w\W]*?)<\/span>/gi,"$3"),e=e.replace(/])>(.*?)<\/span>/gi,""),e=e.replace(/])>(.*?)<\/span>/gi,""),e=e.replace(//gi,'');var i=t("

").html(t.parseHTML(e,document,!0));i.find('*[style=""]').removeAttr("style"),i.find('*[class=""]').removeAttr("class"),i.find('*[rel=""]').removeAttr("rel"),i.find('*[data-image=""]').removeAttr("data-image"),i.find('*[alt=""]').removeAttr("alt"),i.find('*[title=""]').removeAttr("title"),i.find("*[data-redactor-style-cache]").removeAttr("data-redactor-style-cache"),i.find(".redactor-invisible-space, .redactor-unlink").each(function(){t(this).contents().unwrap()}),i.find("span, a").removeAttr("data-redactor-span data-redactor-style-cache").each(function(){0===this.attributes.length&&t(this).contents().unwrap()}),i.find("img").removeAttr("rel"),i.find(".redactor-selection-marker, #redactor-insert-marker").remove(),e=i.html(),this.opts.script&&(e=e.replace(/
]?)>([\w\W]*?)<\/pre>/gi,"$2<\/script>")),e=this.clean.restoreFormTags(e),e=e.replace(new RegExp("","gi"),""),e=e.replace(new RegExp("","gi"),""),e=e.replace(/
/gi,"
\n"),this.opts.preClass&&(e=e.replace(/
/gi,'
')),this.opts.linkNofollow&&(e=e.replace(/])>/gi,""),e=e.replace(/])>/gi,''));var o={"™":"™","©":"©","…":"…","—":"—","‐":"‐"};return t.each(o,function(t,i){e=e.replace(new RegExp(t,"g"),i)}),e=e.replace(/\n{2,}/g,"\n\n"),this.opts.removeNewlines&&(e=e.replace(/\r?\n/g,"")),e=this.core.callback("syncClean",e)},onPaste:function(e,i,o){if(!0!==o){e=e.replace(/([\w\W]*?)<\/b>/gi,"$2"),e=e.replace(/([\w\W]*?)<\/b>/gi,"$3"),e=e.replace(/]*(font-style: italic; font-weight: bold|font-weight: bold; font-style: italic)[^>]*>([\w\W]*?)<\/span>/gi,"$2"),e=e.replace(/]*(font-style: italic; font-weight: 700|font-weight: 700; font-style: italic)[^>]*>([\w\W]*?)<\/span>/gi,"$2"),e=e.replace(/]*font-style: italic[^>]*>([\w\W]*?)<\/span>/gi,"$1"),e=e.replace(/]*font-weight: bold[^>]*>([\w\W]*?)<\/span>/gi,"$1"),e=e.replace(/]*font-weight: 700[^>]*>([\w\W]*?)<\/span>/gi,"$1"),e=e.replace(/]*>/gi,""),e=e.replace(/<\/o:p>/gi,"");this.clean.isHtmlMsWord(e)&&(e=this.clean.cleanMsWord(e))}if(e=t.trim(e),i.pre)this.opts.preSpaces&&(e=e.replace(/\t/g,new Array(this.opts.preSpaces+1).join(" ")));else{if(e.indexOf("=0&&e.indexOf("=0){var r=t("
").html(e),s=this;r.find("p").each(function(){var e=t(this),i=t.trim(e.html().replace(/\n/g," "));i.indexOf("=0&&t.trim(s.clean.replaceBrToNl(i))&&e.html(i.replace(/\s*\s*/gi,'
\n'))}),e=r.html()}e=this.clean.replaceBrToNl(e),e=this.clean.replaceNbspToSpaces(e),e=this.clean.removeTagsInsidePre(e)}return!0!==o&&(e=this.clean.removeEmptyInlineTags(e),!1===i.encode&&(e=e.replace(/&/g,"&"),e=this.clean.convertTags(e,i),e=this.clean.getPlainText(e),e=this.clean.reconvertTags(e,i))),i.text&&(e=this.clean.replaceNbspToSpaces(e),e=this.clean.getPlainText(e)),i.lists&&(e=e.replace("\n","
")),i.encode&&(e=this.clean.encodeHtml(e)),i.paragraphize&&(e=e.replace(/ \n/g," "),e=e.replace(/\n /g," "),e=this.paragraphize.load(e),e=e.replace(/

\s*<\/p>/g,"")),e=e.replace(/

  • \s*

    /g,"

  • "),e=e.replace(/<\/p>\s*<\/li>/g,"
  • "),i.pre||(e=e.replace(/\n|\r/g," ")),e},getCurrentType:function(t,e){var i=this.selection.blocks(),o={text:!1,encode:!1,paragraphize:!0,line:this.clean.isHtmlLine(t),blocks:this.clean.isHtmlBlocked(t),pre:!1,lists:!1,block:!0,inline:!0,links:!0,images:!0};return 1===i.length&&this.utils.isCurrentOrParent(["h1","h2","h3","h4","h5","h6","a","figcaption"])?(o.text=!0,o.paragraphize=!1,o.inline=!1,o.images=!1,o.links=!1,o.line=!0):"inline"===this.opts.type||!1===this.opts.enterKey?(o.paragraphize=!1,o.block=!1,o.line=!0):1===i.length&&this.utils.isCurrentOrParent(["li"])?(o.lists=!0,o.block=!1,o.paragraphize=!1,o.images=!0):1===i.length&&this.utils.isCurrentOrParent(["th","td","blockquote"])?(o.block=!1,o.paragraphize=!1):("pre"===this.opts.type||1===i.length&&this.utils.isCurrentOrParent("pre"))&&(o.inline=!1,o.block=!1,o.encode=!0,o.pre=!0,o.paragraphize=!1,o.images=!1,o.links=!1),!0===o.line&&(o.paragraphize=!1),!0===e&&(o.text=!1),o},isHtmlBlocked:function(t){var e=t.match(new RegExp("","gi")),i=t.match(new RegExp("])>","gi"));return null!==e||null!==i},isHtmlLine:function(t){if(this.clean.isHtmlBlocked(t))return!1;var e=t.match(//gi),i=t.match(/\n/gi);return!e&&!i},isHtmlMsWord:function(t){return t.match(/class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i)},removeEmptyInlineTags:function(e){var i=this.opts.inlineTags,o=t("
    ").html(t.parseHTML(e,document,!0)),r=this,s=o.find("span"),n=o.find(i.join(","));return n.removeAttr("style"),n.each(function(){var e=t(this).html();0===this.attributes.length&&r.utils.isEmpty(e)&&t(this).replaceWith(function(){return t(this).contents()})}),s.each(function(){t(this).html();0===this.attributes.length&&t(this).replaceWith(function(){return t(this).contents()})}),e=o.html(),e=e.replace("\x3c!--?php",""),o.remove(),e},cleanMsWord:function(e){e=e.replace(//g,""),e=e.replace(/[\s\S]*?<\/o:p>/gi,""),e=e.replace(/\n/g," "),e=e.replace(/|<\/p>|<\/div>|<\/li>|<\/td>/gi,"\n\n");var i=t("
    ").html(e),o=!1,r=1,s=[];return i.find("p[style]").each(function(){var e=t(this).attr("style").match(/mso\-list\:l([0-9]+)\slevel([0-9]+)/);if(e){var n=parseInt(e[1]),a=parseInt(e[2]),l=t(this).html().match(/^[\w]+\./)?"ol":"ul",c=t("
  • ").html(t(this).html());if(c.html(c.html().replace(/^([\w\.]+)").attr({"data-level":a,"data-list":n}).html(c);t(this).replaceWith(d),o=n,s.push(n)}else{if(a>r){for(var h=i.find('[data-level="'+r+'"][data-list="'+o+'"]'),u=h,p=r;p"),d.appendTo(u.find("li").last()),u=d;u.attr({"data-level":a,"data-list":n}).html(c)}else{var h=i.find('[data-level="'+a+'"][data-list="'+n+'"]').last();h.append(c)}r=a,o=n,t(this).remove()}}}),i.find("[data-level][data-list]").removeAttr("data-level data-list"),e=i.html()},replaceNbspToSpaces:function(t){return t.replace(/ /gi," ")},replaceBrToNl:function(t){return t.replace(//gi,"\n")},replaceNlToBr:function(t){return t.replace(/\n/g,"
    ")},convertTags:function(e,i){var o=t("
    ").html(e);o.find("iframe").remove();var r=o.find("a");if(r.removeAttr("style"),!1!==this.opts.pasteLinkTarget&&r.attr("target",this.opts.pasteLinkTarget),i.links&&this.opts.pasteLinks&&o.find("a").each(function(t,e){if(e.href){for(var i,o='##%%a href="'+e.href+'"',r=0,s=e.attributes.length;r])>/gi,'##%%img$1src="$2"$3%%##')),this.opts.pastePlainText)return e;var s,n=i.lists?["ul","ol","li"]:this.opts.pasteBlockTags;s=i.block||i.lists?i.inline?n.concat(this.opts.pasteInlineTags):n:i.inline?this.opts.pasteInlineTags:[];for(var a=s.length,l=0;l","gi"),"###/"+s[l]+"###"),"td"===s[l]||"th"===s[l]?e=e.replace(new RegExp("<"+s[l]+'(.*?[^>])((colspan|rowspan)="(.*?[^>])")?(.*?[^>])>',"gi"),"###"+s[l]+" $2###"):this.utils.isInlineTag(s[l])?(e=e.replace(new RegExp("<"+s[l]+'([^>]*)class="([^>]*)"[^>]*>',"gi"),"###"+s[l]+' class="$2"###'),e=e.replace(new RegExp("<"+s[l]+'([^>]*)data-redactor-style-cache="([^>]*)"[^>]*>',"gi"),"###"+s[l]+' cache="$2"###'),e=e.replace(new RegExp("<"+s[l]+"[^>]*>","gi"),"###"+s[l]+"###")):e=e.replace(new RegExp("<"+s[l]+"[^>]*>","gi"),"###"+s[l]+"###");return e},reconvertTags:function(t,e){if((e.links&&this.opts.pasteLinks||e.images&&this.opts.pasteImages)&&(t=t.replace(new RegExp("##%%","gi"),"<"),t=t.replace(new RegExp("%%##","gi"),">")),this.opts.pastePlainText)return t;var i,o=e.lists?["ul","ol","li"]:this.opts.pasteBlockTags;i=e.block||e.lists?e.inline?o.concat(this.opts.pasteInlineTags):o:e.inline?this.opts.pasteInlineTags:[];for(var r=i.length,s=0;s");for(var s=0;s");for(var s=0;s");else if(this.utils.isInlineTag(i[s])){var n="span"===i[s]?' data-redactor-span="true"':"";t=t.replace(new RegExp("###"+i[s]+' cache="(.*?[^#])"###',"gi"),"<"+i[s]+' style="$1"'+n+' data-redactor-style-cache="$1">'),t=t.replace(new RegExp("###"+i[s]+"s?(.*?[^#])###","gi"),"<"+i[s]+"$1>")}return t},cleanPre:function(e){e=void 0===e?t(this.selection.block()).closest("pre",this.core.editor()[0]):e,t(e).find("br").replaceWith(function(){return document.createTextNode("\n")}),t(e).find("p").replaceWith(function(){return t(this).contents()})},removeTagsInsidePre:function(e){var i=t("
    ").append(e);return i.find("pre").replaceWith(function(){var e=t(this).html();return e=e.replace(/|<\/p>|<\/div>|<\/li>|<\/td>/gi,"\n"),e=e.replace(/(<([^>]+)>)/gi,""),t("
    ").append(e)}),e=i.html(),i.remove(),e},getPlainText:function(e){e=e.replace(//gi,""),e=e.replace(//gi,""),e=e.replace(/

    <\/p>/g,""),e=e.replace(/<\/div>|<\/li>|<\/td>/gi,"\n"),e=e.replace(/<\/p>/gi,"\n\n"),e=e.replace(/<\/H[1-6]>/gi,"\n\n");var i=document.createElement("div");return i.innerHTML=e,e=i.textContent||i.innerText,t.trim(e)},savePreCode:function(t){return t=this.clean.savePreFormatting(t),t=this.clean.saveCodeFormatting(t),t=this.clean.restoreSelectionMarkers(t)},savePreFormatting:function(e){var i=e.match(/([\w\W]*?)<\/pre>/gi);return null===i?e:(t.each(i,t.proxy(function(t,i){var o,r,s,n=[],a=!1;i.match(/(([\n\r\s]+)?)/i)?(n=i.match(/(([\n\r\s]+)?)([\w\W]*?)<\/code>(([\n\r\s]+)?)<\/pre>/i),a=!0,o=n[5],r=n[1],s=n[4]):(n=i.match(/([\w\W]*?)<\/pre>/i),o=n[2],r=n[1]),o=o.replace(//g,"\n"),o=o.replace(/ /g," "),this.opts.preSpaces&&(o=o.replace(/\t/g,new Array(this.opts.preSpaces+1).join(" "))),o=this.clean.encodeEntities(o),o=o.replace(/\$/g,"$"),e=a?e.replace(i,""+o+"

    "):e.replace(i,""+o+"
  • ")},this)),e)},saveCodeFormatting:function(e){var i=e.match(/([\w\W]*?)<\/code>/gi);return null===i?e:(t.each(i,t.proxy(function(t,i){var o=i.match(/([\w\W]*?)<\/code>/i);o[2]=o[2].replace(/ /g," "),o[2]=this.clean.encodeEntities(o[2]),o[2]=o[2].replace(/\$/g,"$"),e=e.replace(i,""+o[2]+"")},this)),e)},restoreSelectionMarkers:function(t){return t=t.replace(/<span id="selection-marker-([0-9])" class="redactor-selection-marker">​<\/span>/g,'')},saveFormTags:function(t){return t.replace(/([\w\W]*?)<\/form>/gi,'$2')},restoreFormTags:function(t){return t.replace(/([\w\W]*?)<\/section>/gi,"$3")},encodeHtml:function(t){return t=t.replace(/”/g,'"'),t=t.replace(/“/g,'"'),t=t.replace(/‘/g,"'"),t=t.replace(/’/g,"'"),t=this.clean.encodeEntities(t)},encodeEntities:function(t){return t=String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"'),t=t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},stripTags:function(t,e){if(void 0===e)return t.replace(/(<([^>]+)>)/gi,"");var i=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;return t.replace(i,function(t,i){return-1===e.indexOf(i.toLowerCase())?t:""})},removeMarkers:function(t){return t.replace(/]?)class="redactor-selection-marker"(.*?[^>]?)>([\w\W]*?)<\/span>/gi,"")},removeSpaces:function(e){return e=t.trim(e),e=e.replace(/\n/g,""),e=e.replace(/[\t]*/g,""),e=e.replace(/\n\s*\n/g,"\n"),e=e.replace(/^[\s\n]*/g," "),e=e.replace(/[\s\n]*$/g," "),e=e.replace(/>\s{2,} <"),e=e.replace(/\n\n/g,"\n"),e=e.replace(/\u200B/g,"")},removeSpacesHard:function(e){return e=t.trim(e),e=e.replace(/\n/g,""),e=e.replace(/[\t]*/g,""),e=e.replace(/\n\s*\n/g,"\n"),e=e.replace(/^[\s\n]*/g,""),e=e.replace(/[\s\n]*$/g,""),e=e.replace(/>\s{2,}<"),e=e.replace(/\n\n/g,"\n"),e=e.replace(/\u200B/g,"")},normalizeCurrentHeading:function(){var t=this.selection.block();this.utils.isCurrentOrParentHeader()&&t&&t.normalize()}}},code:function(){return{syncFire:!0,html:!1,start:function(e){e=t.trim(e),e=e.replace(/^(​<\/span>)/,""),"textarea"===this.opts.type?e=this.clean.onSet(e):"div"===this.opts.type&&""===e&&(e=this.opts.emptyHtml),e=e.replace(/

    ​<\/span><\/p>/,""),this.events.stopDetectChanges(),this.core.editor().html(e),this.observe.load(),this.events.startDetectChanges()},set:function(e,i){e=t.trim(e),i=i||{},i.start&&(this.start=i.start),"textarea"===this.opts.type?e=this.clean.onSet(e):"div"===this.opts.type&&""===e&&(e=this.opts.emptyHtml),this.core.editor().html(e),this.observe.load(),"textarea"===this.opts.type&&this.code.sync(),this.placeholder.enable()},get:function(){if("textarea"===this.opts.type)return this.core.textarea().val();var t=this.core.editor().html();return t=this.clean.onGet(t)},sync:function(){if(this.code.syncFire){var e=this.core.editor().html(),i=this.code.cleaned(e);if(!this.code.isSync(i)){if(this.code.html=i,"textarea"!==this.opts.type)return this.core.callback("sync",e),void this.core.callback("change",e);"textarea"===this.opts.type&&setTimeout(t.proxy(function(){this.code.startSync(e)},this),10)}}},startSync:function(t){t=this.core.callback("syncBefore",t),t=this.clean.onSync(t),this.core.textarea().val(t),this.core.callback("sync",t),!1===this.start&&this.core.callback("change",t),this.start=!1},isSync:function(t){var e=!1!==this.code.html&&this.code.html;return!1!==e&&e===t},cleaned:function(t){return t=t.replace(/\u200B/g,""),this.clean.removeMarkers(t)}}},core:function(){return{id:function(){return this.$editor.attr("id")},element:function(){return this.$element},editor:function(){return void 0===this.$editor?t():this.$editor},textarea:function(){return this.$textarea},box:function(){return"textarea"===this.opts.type?this.$box:this.$element},toolbar:function(){return!!this.$toolbar&&this.$toolbar},air:function(){return!!this.$air&&this.$air},object:function(){return t.extend({},this)},structure:function(){this.core.editor().toggleClass("redactor-structure")},addEvent:function(t){this.core.event=t},getEvent:function(){return this.core.event},callback:function(e,i,o){var r=!1,s=t._data(this.core.element()[0],"events");if(void 0!==s&&void 0!==s[e])for(var n=s[e].length,a=0;a-1},isIe:function(t){if(document.documentMode||/Edge/.test(navigator.userAgent))return"edge";var e;return e=RegExp("msie"+(isNaN(t)?"":"\\s"+t),"i").test(navigator.userAgent),e||(e=!!navigator.userAgent.match(/Trident.*rv[ :]*11\./)),e},isMobile:function(){return/(iPhone|iPod|BlackBerry|Android)/.test(navigator.userAgent)},isDesktop:function(){return!/(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent)},isIpad:function(){return/iPad/.test(navigator.userAgent)}}},dropdown:function(){return{active:!1,button:!1,key:!1,position:[],getDropdown:function(){return this.dropdown.active},build:function(e,i,o){o=this.dropdown.buildFormatting(e,o),t.each(o,t.proxy(function(t,o){var r=this.dropdown.buildItem(t,o);this.observe.addDropdown(r,t,o),i.attr("rel",e).append(r)},this))},buildFormatting:function(e,i){return"format"!==e||!1===this.opts.formattingAdd?i:(t.each(this.opts.formattingAdd,t.proxy(function(t,e){var o=this.utils.isBlockTag(e.args[0])?"block":"inline";i[t]={func:"block"===o?"block.format":"inline.format",args:e.args,title:e.title}},this)),i)},buildItem:function(e,i){var o=t("

  • ");if(void 0!==i.classname&&o.addClass(i.classname),-1!==e.search(/^divider/i))return o.addClass("redactor-dropdown-divider"),o;var r=t(''),s=t("").html(i.title);return r.append(s),r.on("mousedown",t.proxy(function(t){t.preventDefault(),this.dropdown.buildClick(t,e,i)},this)),o.append(r),o},buildClick:function(e,i,o){if(!t(e.target).hasClass("redactor-dropdown-link-inactive")){var r=this.dropdown.buildCommand(o);void 0!==o.args?this.button.toggle(e,i,r.type,r.callback,o.args):this.button.toggle(e,i,r.type,r.callback)}},buildCommand:function(t){var e={};return e.type="func",e.callback=t.func,t.command?(e.type="command",e.callback=t.command):t.dropdown&&(e.type="dropdown",e.callback=t.dropdown),e},show:function(e,i){if(this.detect.isDesktop()&&this.core.editor().focus(),this.dropdown.hideAll(!1,i),this.dropdown.key=i,this.dropdown.button=this.button.get(this.dropdown.key),this.dropdown.button.hasClass("dropact"))return void this.dropdown.hide();this.dropdown.active=this.dropdown.button.data("dropdown").appendTo(document.body),this.core.callback("dropdownShow",{dropdown:this.dropdown.active,key:this.dropdown.key,button:this.dropdown.button}),this.button.setActive(this.dropdown.key),this.dropdown.button.addClass("dropact"),this.dropdown.getButtonPosition(),this.button.toolbar().hasClass("toolbar-fixed-box")&&this.detect.isDesktop()?this.dropdown.showIsFixedToolbar():this.dropdown.showIsUnFixedToolbar(),this.detect.isDesktop()&&!this.detect.isFirefox()&&(this.dropdown.active.on("mouseover.redactor-dropdown",t.proxy(this.utils.disableBodyScroll,this)),this.dropdown.active.on("mouseout.redactor-dropdown mousedown.redactor-dropdown",t.proxy(this.utils.enableBodyScroll,this))),e.stopPropagation()},showIsFixedToolbar:function(){var e=this.dropdown.button.position().top+this.dropdown.button.innerHeight()+this.opts.toolbarFixedTopOffset,i="fixed";this.opts.toolbarFixedTarget!==document&&(e=this.dropdown.button.innerHeight()+this.$toolbar.offset().top+this.opts.toolbarFixedTopOffset,i="absolute"),this.dropdown.active.css({position:i,left:this.dropdown.position.left+"px",top:e+"px"}).show(),this.dropdown.active.redactorAnimation("slideDown",{duration:.2},t.proxy(function(){this.dropdown.enableCallback(),this.dropdown.enableEvents()},this))},showIsUnFixedToolbar:function(){this.dropdown.active.css({position:"absolute",left:this.dropdown.position.left+"px",top:this.dropdown.button.innerHeight()+this.dropdown.position.top+"px"}).show(),this.dropdown.active.redactorAnimation(this.opts.animation?"slideDown":"show",{duration:.2},t.proxy(function(){this.dropdown.enableCallback(),this.dropdown.enableEvents()},this))},enableEvents:function(){t(document).on("mousedown.redactor-dropdown",t.proxy(this.dropdown.hideAll,this)),this.core.editor().on("touchstart.redactor-dropdown",t.proxy(this.dropdown.hideAll,this)),t(document).on("keyup.redactor-dropdown",t.proxy(this.dropdown.closeHandler,this))},enableCallback:function(){this.core.callback("dropdownShown",{dropdown:this.dropdown.active,key:this.dropdown.key,button:this.dropdown.button})},getButtonPosition:function(){this.dropdown.position=this.dropdown.button.offset();var e=this.dropdown.active.width();this.dropdown.position.left+e>t(document).width()&&(this.dropdown.position.left=Math.max(0,this.dropdown.position.left-e+parseInt(this.dropdown.button.innerWidth())))},closeHandler:function(t){t.which===this.keyCode.ESC&&(this.dropdown.hideAll(t),this.core.editor().focus())},hideAll:function(e,i){if(this.detect.isDesktop()&&this.utils.enableBodyScroll(),!1===e||0===t(e.target).closest(".redactor-dropdown").length){var o=void 0===i?this.button.toolbar().find("a.dropact"):this.button.toolbar().find("a.dropact").not(".re-"+i),r=void 0===i?t(".redactor-dropdown-"+this.uuid):t(".redactor-dropdown-"+this.uuid).not(".redactor-dropdown-box-"+i);0!==r.length&&(t(document).off(".redactor-dropdown"),this.core.editor().off(".redactor-dropdown"),t.each(r,t.proxy(function(e,i){var o=t(i);this.core.callback("dropdownHide",o),o.hide(),o.off("mouseover mouseout").off(".redactor-dropdown")},this)),o.removeClass("redactor-act dropact"))}},hide:function(){!1!==this.dropdown.active&&(this.detect.isDesktop()&&this.utils.enableBodyScroll(),this.dropdown.active.redactorAnimation(this.opts.animation?"slideUp":"hide",{duration:.2},t.proxy(function(){t(document).off(".redactor-dropdown"),this.core.editor().off(".redactor-dropdown"),this.dropdown.hideOut()},this)))},hideOut:function(){this.core.callback("dropdownHide",this.dropdown.active),this.dropdown.button.removeClass("redactor-act dropact"),this.dropdown.active.off("mouseover mouseout").off(".redactor-dropdown"),this.dropdown.button=!1,this.dropdown.key=!1,this.dropdown.active=!1}}},events:function(){return{focused:!1,blured:!0,dropImage:!1,stopChanges:!1,stopDetectChanges:function(){this.events.stopChanges=!0},startDetectChanges:function(){var t=this;setTimeout(function(){t.events.stopChanges=!1},1)},dragover:function(e){e.preventDefault(),e.stopPropagation(),"IMG"===e.target.tagName&&t(e.target).addClass("redactor-image-dragover")},dragleave:function(t){this.core.editor().find("img").removeClass("redactor-image-dragover")},drop:function(t){return t=t.originalEvent||t,this.core.editor().find("img").removeClass("redactor-image-dragover"),"inline"===this.opts.type||"pre"===this.opts.type?(t.preventDefault(),!1):void 0===window.FormData||!t.dataTransfer||(0===t.dataTransfer.files.length?this.events.onDrop(t):(this.events.onDropUpload(t),void this.core.callback("drop",t)))},click:function(t){var e=this.core.getEvent(),i="click"!==e&&"arrow"!==e&&"click";this.core.addEvent(i),this.utils.disableSelectAll(),this.core.callback("click",t)},focus:function(t){if(!this.rtePaste&&(this.events.isCallback("focus")&&this.core.callback("focus",t),this.events.focused=!0,this.events.blured=!1,!1===this.selection.current())){var e=this.selection.get(),i=this.selection.range(e);i.setStart(this.core.editor()[0],0),i.setEnd(this.core.editor()[0],0),this.selection.update(e,i)}},blur:function(e){this.start||this.rtePaste||0===t(e.target).closest("#"+this.core.id()+", .redactor-toolbar, .redactor-dropdown, #redactor-modal-box").length&&(!this.events.blured&&this.events.isCallback("blur")&&this.core.callback("blur",e),this.events.focused=!1,this.events.blured=!0)},touchImageEditing:function(){var e=-1;this.events.imageEditing=!1,t(window).on("touchmove.redactor."+this.uuid,t.proxy(function(){this.events.imageEditing=!0,-1!==e&&clearTimeout(e),e=setTimeout(t.proxy(function(){this.events.imageEditing=!1},this),500)},this))},init:function(){this.core.editor().on("dragover.redactor dragenter.redactor",t.proxy(this.events.dragover,this)),this.core.editor().on("dragleave.redactor",t.proxy(this.events.dragleave,this)),this.core.editor().on("drop.redactor",t.proxy(this.events.drop,this)),this.core.editor().on("click.redactor",t.proxy(this.events.click,this)),this.core.editor().on("paste.redactor",t.proxy(this.paste.init,this)),this.core.editor().on("keydown.redactor",t.proxy(this.keydown.init,this)),this.core.editor().on("keyup.redactor",t.proxy(this.keyup.init,this)),this.core.editor().on("focus.redactor",t.proxy(this.events.focus,this)),t(document).on("mousedown.redactor-blur."+this.uuid,t.proxy(this.events.blur,this)),this.events.touchImageEditing(),this.events.createObserver(),this.events.setupObserver()},createObserver:function(){var e=this;this.events.observer=new MutationObserver(function(i){i.forEach(t.proxy(e.events.iterateObserver,e))})},iterateObserver:function(t){var e=!1;(("textarea"===this.opts.type||"div"===this.opts.type)&&!this.detect.isFirefox()&&t.target===this.core.editor()[0]||"class"===t.attributeName&&t.target===this.core.editor()[0]||"data-vivaldi-spatnav-clickable"==t.attributeName)&&(e=!0),e||(this.observe.load(),this.events.changeHandler())},setupObserver:function(){this.events.observer.observe(this.core.editor()[0],{attributes:!0,subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0})},changeHandler:function(){this.events.stopChanges||(this.code.sync(),this.autosave.is()&&(clearTimeout(this.autosaveTimeout),this.autosaveTimeout=setTimeout(t.proxy(this.autosave.send,this),300)))},onDropUpload:function(t){if(t.preventDefault(),t.stopPropagation(),(this.opts.dragImageUpload||this.opts.dragFileUpload)&&(null!==this.opts.imageUpload||null!==this.opts.fileUpload)){"IMG"===t.target.tagName&&(this.events.dropImage=t.target);for(var e=t.dataTransfer.files,i=e.length,o=0;o").attr("href",e.url).text(r),n=void 0===e.id?"":e.id,a=void 0===e.s3?"file":"s3";s.attr("data-"+a,n),s=t(this.insert.node(s)),this.caret.after(s),this.storage.add({type:a,node:s[0],url:e.url,id:n}),null!==i&&this.core.callback("fileUpload",s,e)},release:function(t,e){e?(this.marker.remove(),this.insert.nodeToPoint(t,this.marker.get()),this.selection.restore()):this.modal.close()},text:function(e){var i=t("#redactor-filename").val();return void 0===i||""===i?e.name:i}}},focus:function(){return{start:function(){if(this.core.editor().focus(),"inline"!==this.opts.type){var t=this.focus.first();!1!==t&&this.caret.start(t)}},end:function(){this.core.editor().focus();var t=this.opts.inline?this.core.editor():this.focus.last();if(0!==t.length){var e=this.focus.lastChild(t);if(this.detect.isWebkit()||!1===e){var i=this.selection.get(),o=this.selection.range(i);null!==o?(o.selectNodeContents(t[0]),o.collapse(!1),this.selection.update(i,o)):this.caret.end(t)}else this.caret.end(e)}},first:function(){var t=this.core.editor().children().first();return!t.length||"UL"!==t[0].tagName&&"OL"!==t[0].tagName||(t=t.find("li").first()),0!==t.length&&0!==t[0].length&&"BR"!==t[0].tagName&&"HR"!==t[0].tagName&&3!==t[0].nodeType&&t},last:function(){return this.core.editor().children().last()},lastChild:function(t){var e=t[0].lastChild;return!(null===e||!this.utils.isInlineTag(e.tagName))&&e},is:function(){return this.core.editor()[0]===document.activeElement}}},image:function(){return{is:function(){return!(!this.opts.imageUpload||!this.opts.imageUpload&&!this.opts.s3)},show:function(){var e=this.selection.current();if(e)if(this.utils.isTag(e,"img"))this.events.dropImage=e;else{var i=t(e).find("img:first");if(i.length)return this.image.showEdit(i)}this.modal.load("image",this.lang.get("image"),700),this.upload.init("#redactor-modal-image-droparea",this.opts.imageUpload,this.image.insert),this.modal.show()},insert:function(e,i,o){var r;if(void 0!==e.error)return this.modal.close(),this.events.dropImage=!1,void this.core.callback("imageUploadError",e,o);if(!1!==this.events.dropImage)return r=t(this.events.dropImage),this.core.callback("imageDelete",r[0].src,r),r.attr("src",e.url),this.events.dropImage=!1,this.core.callback("imageUpload",r,e),void this.modal.close();this.placeholder.hide();var s=t("<"+this.opts.imageTag+">");r=t(""),r.attr("src",e.url);var n=void 0===e.id?"":e.id,a=void 0===e.s3?"image":"s3";r.attr("data-"+a,n),s.append(r);var l=this.utils.isTag(this.selection.current(),"pre");if(i){this.air.collapsed(),this.marker.remove();var c=this.insert.nodeToPoint(o,this.marker.get()),d=t(c).next();this.selection.restore(),this.buffer.set(),void 0!==d&&0!==d.length&&"IMG"===d[0].tagName?(this.core.callback("imageDelete",d[0].src,d),d.closest("figure, p",this.core.editor()[0]).replaceWith(s),this.caret.after(s)):(l?t(l).after(s):this.insert.node(s),this.caret.after(s))}else this.modal.close(),this.buffer.set(),this.air.collapsed(),l?t(l).after(s):this.insert.node(s),this.caret.after(s);this.events.dropImage=!1,this.storage.add({type:a,node:r[0],url:e.url,id:n});var h=r[0].nextSibling,u=s.next(),p=t(h).text().replace(/\u200B/g,""),f=u.text().replace(/\u200B/g,"");""===p&&t(h).remove(),1===u.length&&"FIGURE"===u[0].tagName&&""===f&&u.remove(),null!==i?this.core.callback("imageUpload",r,e):this.core.callback("imageInserted",r,e)},setEditable:function(e){if(e.on("dragstart",function(t){t.preventDefault()}),this.opts.imageResizable){var i=t.proxy(function(i){this.observe.image=e,this.image.resizer=this.image.loadEditableControls(e),t(document).on("mousedown.redactor-image-resize-hide."+this.uuid,t.proxy(this.image.hideResize,this)),this.image.resizer&&this.image.resizer.on("mousedown.redactor touchstart.redactor",t.proxy(function(t){this.image.setResizable(t,e)},this))},this);e.off("mousedown.redactor").on("mousedown.redactor",t.proxy(this.image.hideResize,this)),e.off("click.redactor touchstart.redactor").on("click.redactor touchstart.redactor",i)}else e.off("click.redactor touchstart.redactor").on("click.redactor touchstart.redactor",t.proxy(function(i){setTimeout(t.proxy(function(){this.image.showEdit(e)},this),200)},this))},setResizable:function(t,e){t.preventDefault(),this.image.resizeHandle={x:t.pageX,y:t.pageY,el:e,ratio:e.width()/e.height(),h:e.height()},t=t.originalEvent||t,t.targetTouches&&(this.image.resizeHandle.x=t.targetTouches[0].pageX,this.image.resizeHandle.y=t.targetTouches[0].pageY),this.image.startResize()},startResize:function(){t(document).on("mousemove.redactor-image-resize touchmove.redactor-image-resize",t.proxy(this.image.moveResize,this)),t(document).on("mouseup.redactor-image-resize touchend.redactor-image-resize",t.proxy(this.image.stopResize,this))},moveResize:function(t){t.preventDefault(),t=t.originalEvent||t;var e=this.image.resizeHandle.h;t.targetTouches?e+=t.targetTouches[0].pageY-this.image.resizeHandle.y:e+=t.pageY-this.image.resizeHandle.y;var i=Math.round(e*this.image.resizeHandle.ratio);e<50||i<100||(this.image.resizeHandle.el.attr({width:i,height:e}),this.image.resizeHandle.el.width(i),this.image.resizeHandle.el.height(e),this.code.sync())},stopResize:function(){this.handle=!1,t(document).off(".redactor-image-resize"),this.image.hideResize()},hideResize:function(e){if(!e||0===t(e.target).closest("#redactor-image-box",this.$editor[0]).length){if(e&&"IMG"==e.target.tagName){t(e.target)}var i=this.$editor.find("#redactor-image-box");0!==i.length&&(t("#redactor-image-editter").remove(),t("#redactor-image-resizer").remove(),i.find("img").css({marginTop:i[0].style.marginTop,marginBottom:i[0].style.marginBottom,marginLeft:i[0].style.marginLeft,marginRight:i[0].style.marginRight}),i.css("margin",""),i.find("img").css("opacity",""),i.replaceWith(function(){return t(this).contents()}),t(document).off("mousedown.redactor-image-resize-hide."+this.uuid),void 0!==this.image.resizeHandle&&this.image.resizeHandle.el.attr("rel",this.image.resizeHandle.el.attr("style")))}},loadResizableControls:function(e,i){if(this.opts.imageResizable&&!this.detect.isMobile()){var o=t('');return this.detect.isDesktop()||o.css({width:"15px",height:"15px"}),o.attr("contenteditable",!1),i.append(o),i.append(e),o}return i.append(e),!1},loadEditableControls:function(e){if(0===t("#redactor-image-box").length){var i=t('');if(i.css("float",e.css("float")).attr("contenteditable",!1),"auto"!=e[0].style.margin?(i.css({marginTop:e[0].style.marginTop,marginBottom:e[0].style.marginBottom,marginLeft:e[0].style.marginLeft,marginRight:e[0].style.marginRight}),e.css("margin","")):i.css({display:"block",margin:"auto"}),e.css("opacity",".5").after(i),this.opts.imageEditable){this.image.editter=t(''+this.lang.get("edit")+""),this.image.editter.attr("contenteditable",!1),this.image.editter.on("click",t.proxy(function(){this.image.showEdit(e)},this)),i.append(this.image.editter);var o=this.image.editter.innerWidth();this.image.editter.css("margin-left","-"+o/2+"px")}return this.image.loadResizableControls(e,i)}},showEdit:function(e){if(!this.events.imageEditing){this.observe.image=e;var i=e.closest("a",this.$editor[0]),o=e.closest("figure",this.$editor[0]),r=0!==o.length?o:e;if(this.modal.load("image-edit",this.lang.get("edit"),705),this.image.buttonDelete=this.modal.getDeleteButton().text(this.lang.get("delete")),this.image.buttonSave=this.modal.getActionButton().text(this.lang.get("save")),this.image.buttonDelete.on("click",t.proxy(this.image.remove,this)),this.image.buttonSave.on("click",t.proxy(this.image.update,this)),!1===this.opts.imageCaption)t("#redactor-image-caption").val("").hide().prev().hide();else{var s=e.closest(this.opts.imageTag,this.$editor[0]),n=s.find("figcaption");0!==n&&t("#redactor-image-caption").val(n.text()).show()}if(this.opts.imagePosition){var a=0!==o.length?"center"===r.css("text-align"):"block"==r.css("display")&&"none"==r.css("float"),l=a?"center":r.css("float");t("#redactor-image-align").val(l)}else t(".redactor-image-position-option").hide();t("#redactor-image-preview").html(t('')),t("#redactor-image-title").val(e.attr("alt")),0!==i.length&&(t("#redactor-image-link").val(i.attr("href")),"_blank"===i.attr("target")&&t("#redactor-image-link-blank").prop("checked",!0)),t(".redactor-link-tooltip").remove(),this.modal.show(),this.detect.isDesktop()&&t("#redactor-image-title").focus()}},update:function(){var e=this.observe.image,i=e.closest("a",this.core.editor()[0]),o=t("#redactor-image-title").val().replace(/(<([^>]+)>)/gi,"");e.attr("alt",o).attr("title",o),this.image.setFloating(e);var r=t.trim(t("#redactor-image-link").val()).replace(/(<([^>]+)>)/gi,"");if(""!==r){var s="((xn--)?[a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}",n=new RegExp("^(http|ftp|https)://"+s,"i"),a=new RegExp("^"+s,"i");-1===r.search(n)&&0===r.search(a)&&this.opts.linkProtocol&&(r=this.opts.linkProtocol+"://"+r);var l=!!t("#redactor-image-link-blank").prop("checked");if(0===i.length){var c=t(''+this.utils.getOuterHtml(e)+"");l&&c.attr("target","_blank"),e=e.replaceWith(c),i=this.core.editor().find("#redactor-img-tmp"),i.removeAttr("id")}else i.attr("href",r),l?i.attr("target","_blank"):i.removeAttr("target")}else 0!==i.length&&i.replaceWith(this.utils.getOuterHtml(e));this.image.addCaption(e,i),this.modal.close(),this.buffer.set()},setFloating:function(e){var i=e.closest("figure",this.$editor[0]),o=0!==i.length?i:e,r=t("#redactor-image-align").val(),s="",n="",a="",l="";switch(r){case"left":s="left",a="0 "+this.opts.imageFloatMargin+" "+this.opts.imageFloatMargin+" 0";break;case"right":s="right",a="0 0 "+this.opts.imageFloatMargin+" "+this.opts.imageFloatMargin;break;case"center":0!==i.length?l="center":(n="block",a="auto")}o.css({float:s,display:n,margin:a,"text-align":l}),o.attr("rel",e.attr("style"))},addCaption:function(e,i){var o=t("#redactor-image-caption").val(),r=0!==i.length?i:e,s=r.next();0!==s.length&&"FIGCAPTION"===s[0].tagName||(s=!1),""!==o?!1===s?(s=t("
    ").text(o),r.after(s)):s.text(o):!1!==s&&s.remove()},remove:function(e,i,o){i=void 0===i?t(this.observe.image):i,"boolean"!=typeof e&&this.buffer.set(),this.events.stopDetectChanges();var r=i.closest("a",this.core.editor()[0]),s=i.closest(this.opts.imageTag,this.core.editor()[0]);i.parent();if(!1===this.core.callback("imageDelete",e,i[0]))return e&&e.preventDefault(),!1;0!==t("#redactor-image-box").length&&t("#redactor-image-box").parent();var n,a;0!==s.length?(a=s.prev(),n=s.next(),s.remove()):0!==r.length?(r.parent(),r.remove()):i.remove(),t("#redactor-image-box").remove(),!1!==e&&(n&&0!==n.length?this.caret.start(n):a&&0!==a.length&&this.caret.end(a)),"boolean"!=typeof e&&this.modal.close(),this.utils.restoreScroll(),this.observe.image=!1,this.events.startDetectChanges(),this.placeholder.enable(),this.code.sync()}}},indent:function(){return{increase:function(){if(this.list.get()){var e=t(this.selection.current()).closest("li"),i=e.closest("ul, ol",this.core.editor()[0]),o=e.closest("li"),r=o.prev();if(0!==r.length&&"LI"===r[0].tagName)if(this.buffer.set(),this.utils.isCollapsed()){var s=i[0].tagName,n=t("<"+s+" />");this.selection.save();var a=r.find("ol").first();if(1===a.length)a.append(e);else{var s=i[0].tagName,n=t("<"+s+" />");n.append(e),r.append(n)}this.selection.restore()}else document.execCommand("indent"),this.selection.save(),this.indent.removeEmpty(),this.indent.normalize(),this.selection.restore()}},decrease:function(){if(this.list.get()){var e=t(this.selection.current()).closest("li");e.closest("ul, ol",this.core.editor()[0]);this.buffer.set(),document.execCommand("outdent");var i=t(this.selection.current()).closest("li",this.core.editor()[0]);if(this.utils.isCollapsed()&&this.indent.repositionItem(i),0===i.length){document.execCommand("formatblock",!1,"p"),i=t(this.selection.current());var o=i.next();0!==o.length&&"BR"===o[0].tagName&&o.remove()}this.selection.save(),this.indent.removeEmpty(),this.indent.normalize(),this.selection.restore()}},repositionItem:function(t){var e=t.next();0===e.length||"UL"===e[0].tagName&&"OL"===e[0].tagName||t.append(e);var i=t.prev();if(0!==i.length&&"LI"!==i[0].tagName){this.selection.save();t.parents("li",this.core.editor()[0]).after(t),this.selection.restore()}},normalize:function(){this.core.editor().find("li").each(t.proxy(function(e,i){var o=t(i),r="";0!==this.opts.keepStyleAttr.length&&(r=","+this.opts.keepStyleAttr.join(",")),o.find(this.opts.inlineTags.join(",")).not("img"+r).removeAttr("style");var s=o.parent();if(0!==s.length&&"LI"===s[0].tagName)return void s.after(o);var n=o.next();0===n.length||"UL"!==n[0].tagName&&"OL"!==n[0].tagName||o.append(n)},this))},removeEmpty:function(e){var i=this.core.editor().find("ul, ol"),o=this.core.editor().find("li");o.each(t.proxy(function(t,e){this.indent.removeItemEmpty(e)},this)),i.each(t.proxy(function(t,e){this.indent.removeItemEmpty(e)},this)),o.each(t.proxy(function(t,e){this.indent.removeItemEmpty(e)},this))},removeItemEmpty:function(e){var i=e.innerHTML.replace(/[\t\s\n]/g,"");""===(i=i.replace(/<\/span>/g,""))&&t(e).remove()}}},inline:function(){return{format:function(t,e,i,o){if(!this.utils.isCurrentOrParent(["PRE","CODE"])){var r=this.inline.getParams(e,i,o);t=this.inline.arrangeTag(t),this.placeholder.hide(),this.buffer.set(),this.utils.isCollapsed()?this.inline.formatCollapsed(t,r):this.inline.formatUncollapsed(t,r)}},formatCollapsed:function(e,i){var o,r=this.selection.inline();if(r){var s=r.tagName.toLowerCase();if(s===e)if(this.utils.isEmpty(r.innerHTML))this.caret.after(r),t(r).remove();else{var n=this.inline.insertBreakpoint(r,s);this.caret.after(n)}else if(0===t(r).closest(e).length)o=this.inline.insertInline(e),o=this.inline.setParams(o,i);else{var n=this.inline.insertBreakpoint(r,s);this.caret.after(n)}}else o=this.inline.insertInline(e),o=this.inline.setParams(o,i)},formatUncollapsed:function(e,i){this.selection.save();var o=this.inline.getClearedNodes();this.inline.setNodesStriked(o,e,i),this.selection.restore(),document.execCommand("strikethrough"),this.selection.saveInstant();var r=this;this.core.editor().find("strike").each(function(){var o=r.utils.replaceToTag(this,e);r.inline.setParams(o[0],i);var s=o.find(e),n=o.parent(),a=n.parent();if(0!==a.length&&a[0].tagName.toLowerCase()===e&&a.html()==n[0].outerHTML)return o.replaceWith(function(){return t(this).contents()}),void a.replaceWith(function(){return t(this).contents()});0!==s.length&&r.inline.cleanInsideOrParent(s,i),n.html()==o[0].outerHTML&&r.inline.cleanInsideOrParent(n,i),r.detect.isFirefox()&&r.core.editor().find(e+":empty").remove()}),this.selection.restoreInstant()},cleanInsideOrParent:function(t,e){if(e)for(var i in e.data)this.inline.removeSpecificAttr(t,i,e.data[i])},getClearedNodes:function(){for(var e=this.selection.nodes(),i=[],o=e.length,r=0,s=0;s=r&&!this.utils.isBlockTag(e[s].tagName)&&i.push(e[s]);return i},isConvertableAttr:function(e,i,o){var r=t(e).attr(i);if(r)if("style"===i){o=t.trim(o).replace(/;$/,"");for(var s=o.split(";"),n=0,a=0;a").append(t(this).contents())}).attr("data-redactor-inline-converted")}var l=this.inline.isConvertable(e[r],s,i,o);if(l){t(e[r]).replaceWith(function(){return t("").append(t(this).contents())})}}},insertBreakpoint:function(e,i){var o=document.createElement("span");o.id="redactor-inline-breakpoint",o=this.insert.node(o);var r=this.utils.isEndOfElement(e),s=this.utils.getOuterHtml(e),n=r?"":"<"+i+">";s=s.replace(/<\/span>/i,""+n);var a=t(s);return t(e).replaceWith(a),""!==n&&this.utils.cloneAttributes(e,a.last()),a.first()},insertInline:function(t){var e=document.createElement(t);return this.insert.node(e),this.caret.start(e),e},arrangeTag:function(t){var e=["b","bold","i","italic","underline","strikethrough","deleted","superscript","subscript"],i=["strong","strong","em","em","u","del","del","sup","sub"];t=t.toLowerCase();for(var o=0;o").html(e);h.find(r.tagName.toLowerCase()).each(function(){t(this).contents().unwrap()}),e=h.html(),e=t.parseHTML(e),s=t(e).last()}if(this.utils.isSelectAll()){var u=t(this.opts.emptyHtml);this.core.editor().html("").append(u),u.html(e),this.caret.end(u)}else this.insert.placeHtml(e)}this.utils.disableSelectAll(),i.pre&&this.clean.cleanPre(),this.caret.end(s),this.linkify.format()},text:function(e){e=e.toString(),e=t.trim(e);var i=document.createElement("div");if(i.innerHTML=e,void 0!==(e=i.textContent||i.innerText)){this.placeholder.hide(),this.core.editor().focus();var o=this.selection.blocks();if(e=e.replace(/\n/g," "),this.utils.isSelectAll()){var r=t(this.opts.emptyHtml);this.core.editor().html("").append(r),r.html(e),this.caret.end(r)}else{var s=this.selection.get(),n=document.createTextNode(e);if(s.getRangeAt&&s.rangeCount){var a=s.getRangeAt(0);a.deleteContents(),a.insertNode(n),a.setStartAfter(n),a.collapse(!0),this.selection.update(s,a)}o.length>1&&(t(n).wrap("

    "),this.caret.after(n))}this.utils.disableSelectAll(),this.linkify.format(),this.clean.normalizeCurrentHeading()}},raw:function(t){this.placeholder.hide(),this.core.editor().focus();var e=this.selection.get(),i=this.selection.range(e);i.deleteContents();var o=document.createElement("div");o.innerHTML=t;for(var r,s,n=document.createDocumentFragment();r=o.firstChild;)s=n.appendChild(r);i.insertNode(n),s&&(i=i.cloneRange(),i.setStartAfter(s),i.collapse(!0),e.removeAllRanges(),e.addRange(i))},rawAfter:function(e){this.placeholder.hide(),this.core.editor().focus();var i=this.selection.get(),o=this.selection.range(i),r=this.selection.current(),s=document.createElement("div");s.innerHTML=e;var n=s.firstChild;t(r).after(t(n)),o.setStartAfter(n),o.collapse(!0),i.addRange(o)},node:function(e,i){this.placeholder.hide(),void 0!==this.start&&this.core.editor().focus(),e=e[0]||e;var o=this.selection.block(),r=this.utils.isBlockTag(e.tagName),s=!0;if(this.utils.isSelectAll())r?this.core.editor().html(e):this.core.editor().html(t("

    ").html(e)),this.code.sync();else if(r&&o){var n=this.utils.breakBlockTag();!1===n?this.insert.placeNode(e,i):("start"===n.type?n.$block.before(e):n.$block.after(e),this.core.editor().find("p:empty").remove())}else s=this.insert.placeNode(e,i);return this.utils.disableSelectAll(),s&&this.caret.end(e),e},appendLists:function(e,i){var o,r=t(e),s=this.utils.isEmpty(e.innerHTML);if(s||this.utils.isEndOfElement(e))o=r,i.find("li").each(function(){o.after(this),o=t(this)}),s&&r.remove();else if(this.utils.isStartOfElement(e))i.find("li").each(function(){r.before(this),o=t(this)});else{var n=this.selection.extractEndOfNode(e);r.after(t("

  • ").append(n)),r.append(i),o=i}this.marker.remove(),o&&this.caret.end(o),this.linkify.format()},placeHtml:function(e){var i=document.createElement("span");i.id="redactor-insert-marker",i=this.insert.node(i),t(i).before(e),this.selection.restore(),this.caret.after(i),t(i).remove()},placeNode:function(t,e){var i=this.selection.get(),o=this.selection.range(i);if(null==o)return!1;!1!==e&&o.deleteContents(),o.insertNode(t),o.collapse(!1),this.selection.update(i,o)},nodeToPoint:function(e,i){if(this.placeholder.hide(),i=i[0]||i,this.utils.isEmpty())return i=this.utils.isBlock(i)?i:t("

    ").append(i),this.core.editor().html(i),i;var o,r=e.clientX,s=e.clientY;if(document.caretPositionFromPoint){var n=document.caretPositionFromPoint(r,s);o=document.getSelection().getRangeAt(0),o.setStart(n.offsetNode,n.offset),o.collapse(!0),o.insertNode(i)}else if(document.caretRangeFromPoint)o=document.caretRangeFromPoint(r,s),o.insertNode(i);else if(void 0!==document.body.createTextRange){o=document.body.createTextRange(),o.moveToPoint(r,s);var a=o.duplicate();a.moveToPoint(r,s),o.setEndPoint("EndToEnd",a),o.select()}return i},nodeToCaretPositionFromPoint:function(t,e){this.insert.nodeToPoint(t,e)},marker:function(){this.marker.insert()}}},keydown:function(){return{init:function(e){if(!this.rtePaste){var i=e.which,o=i>=37&&i<=40;this.keydown.ctrl=e.ctrlKey||e.metaKey,this.keydown.parent=this.selection.parent(),this.keydown.current=this.selection.current(),this.keydown.block=this.selection.block(),this.keydown.pre=this.utils.isTag(this.keydown.current,"pre"),this.keydown.blockquote=this.utils.isTag(this.keydown.current,"blockquote"),this.keydown.figcaption=this.utils.isTag(this.keydown.current,"figcaption"),this.keydown.figure=this.utils.isTag(this.keydown.current,"figure");if(!1===this.core.callback("keydown",e))return e.preventDefault(),!1;if(this.shortcuts.init(e,i),this.keydown.checkEvents(o,i),this.keydown.setupBuffer(e,i),this.utils.isSelectAll()&&(i===this.keyCode.ENTER||i===this.keyCode.BACKSPACE||i===this.keyCode.DELETE))return e.preventDefault(),this.code.set(this.opts.emptyHtml),void this.events.changeHandler();if(this.keydown.addArrowsEvent(o),this.keydown.setupSelectAll(e,i),!this.opts.enterKey&&i===this.keyCode.ENTER){e.preventDefault();var r=this.selection.get(),s=this.selection.range(r);return void(s.collapsed||s.deleteContents())}if(this.opts.enterKey&&i===this.keyCode.DOWN&&this.keydown.onArrowDown(),this.opts.enterKey&&i===this.keyCode.UP&&this.keydown.onArrowUp(),("textarea"===this.opts.type||"div"===this.opts.type)&&this.keydown.current&&3===this.keydown.current.nodeType&&t(this.keydown.parent).hasClass("redactor-in")&&this.keydown.wrapToParagraph(),!this.keyup.lastShiftKey&&i===this.keyCode.SPACE&&(e.ctrlKey||e.shiftKey))return e.preventDefault(),this.keydown.onShiftSpace();if(i===this.keyCode.ENTER&&(e.ctrlKey||e.shiftKey))return e.preventDefault(),this.keydown.onShiftEnter(e);if(i===this.keyCode.ENTER&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey)return this.keydown.onEnter(e);if(i===this.keyCode.TAB||e.metaKey&&221===i||e.metaKey&&219===i)return this.keydown.onTab(e,i);if(this.detect.isFirefox()&&i===this.keyCode.BACKSPACE&&this.keydown.block&&"P"===this.keydown.block.tagName&&this.utils.isStartOfElement(this.keydown.block)){var n=t(this.keydown.block).prev();if(0!==n.length)return e.preventDefault(),n.append(this.marker.get()),n.append(t(this.keydown.block).html()),t(this.keydown.block).remove(),void this.selection.restore()}if(i===this.keyCode.BACKSPACE||i===this.keyCode.DELETE){if(this.observe.image&&void 0!==this.observe.image&&0!==t("#redactor-image-box").length){e.preventDefault();var n=this.observe.image.closest("figure, p").prev();return this.image.remove(!1),this.observe.image=!1,void(n&&0!==n.length?this.caret.end(n):this.core.editor().focus())}this.keydown.onBackspaceAndDeleteBefore()}if(i===this.keyCode.DELETE){var a=t(this.keydown.block).next();if(this.utils.isEndOfElement(this.keydown.block)&&0!==a.length&&"FIGURE"===a[0].tagName)return a.remove(),!1;if(!(!this.keydown.block||"LI"!==this.keydown.block.tagName)&&this.keydown.block){var l=t(this.keydown.block).parents("ul, ol").last(),c=l.next();if(this.utils.isRedactorParent(l)&&this.utils.isEndOfElement(l)&&0!==c.length&&("UL"===c[0].tagName||"OL"===c[0].tagName))return e.preventDefault(),l.append(c.contents()),c.remove(),!1}if(this.utils.isEndOfElement(this.keydown.block)&&0!==a.length&&"PRE"===a[0].tagName)return t(this.keydown.block).append(a.text()),a.remove(),!1}if(i===this.keyCode.DELETE&&0!==t("#redactor-image-box").length&&this.image.remove(),i===this.keyCode.BACKSPACE){if(this.detect.isFirefox()&&this.line.removeOnBackspace(e),this.list.combineAfterAndBefore(this.keydown.block))return void e.preventDefault();var d=this.selection.block();if(d&&"LI"===d.tagName&&this.utils.isCollapsed()&&this.utils.isStartOfElement())return this.indent.decrease(),void e.preventDefault();this.keydown.removeInvisibleSpace(),this.keydown.removeEmptyListInTable(e)}i!==this.keyCode.BACKSPACE&&i!==this.keyCode.DELETE||this.keydown.onBackspaceAndDeleteAfter(e)}},onShiftSpace:function(){return this.buffer.set(),this.insert.raw(" "),!1},onShiftEnter:function(t){return this.buffer.set(),this.keydown.figure?this.insert.rawAfter("
    "):this.keydown.pre?this.keydown.insertNewLine(t):this.insert.raw("
    ")},onBackspaceAndDeleteBefore:function(){this.utils.saveScroll()},onBackspaceAndDeleteAfter:function(e){setTimeout(t.proxy(function(){this.code.syncFire=!1,this.keydown.removeEmptyLists();var t="";0!==this.opts.keepStyleAttr.length&&(t=","+this.opts.keepStyleAttr.join(",")),this.core.editor().find("*[style]").not("p, h1, h2, h3, h4, h5, h6, div, ul, li, img, figure, iframe, #redactor-image-box, #redactor-image-editter, [data-redactor-style-cache], [data-redactor-span]"+t).removeAttr("style"), +this.keydown.formatEmpty(e),this.code.syncFire=!0},this),1)},onEnter:function(e){if(!1===this.core.callback("enter",e))return e.preventDefault(),!1;if(this.keydown.blockquote&&!0===this.keydown.exitFromBlockquote(e))return!1;if(this.keydown.pre)return this.keydown.insertNewLine(e);if(this.keydown.blockquote||this.keydown.figcaption)return this.keydown.insertBreakLine(e);if(this.keydown.figure)setTimeout(t.proxy(function(){this.keydown.replaceToParagraph("FIGURE")},this),1);else if(this.keydown.block){if(setTimeout(t.proxy(function(){this.keydown.replaceToParagraph("DIV")},this),1),"LI"===this.keydown.block.tagName){var i=this.selection.current(),o=t(i).closest("li",this.$editor[0]),r=o.parents("ul,ol",this.$editor[0]).last();if(0!==o.length&&this.utils.isEmpty(o.html())&&0===r.next().length&&this.utils.isEmpty(r.find("li").last().html())){r.find("li").last().remove();var s=t(this.opts.emptyHtml);return r.after(s),this.caret.start(s),!1}}}else if(!this.keydown.block)return this.keydown.insertParagraph(e);if(this.detect.isFirefox()&&this.utils.isInline(this.keydown.parent))return void this.keydown.insertBreakLine(e);this.opts.keepInlineOnEnter||setTimeout(t.proxy(function(){var e=this.selection.inline();if(e&&this.utils.isEmpty(e.innerHTML)){var i=this.selection.block();t(e).remove();var o=document.createRange();o.setStart(i,0);var r=document.createTextNode("​");o.insertNode(r),o.setStartAfter(r),o.collapse(!0);var s=window.getSelection();s.removeAllRanges(),s.addRange(o)}},this),1),setTimeout(t.proxy(function(){var e=this.selection.block(),i=e.childNodes,o=i[i.length-1];o&&3!==o.nodeType&&"BR"===o.tagName&&t(o).remove()},this),1)},checkEvents:function(t,e){t||"click"!==this.core.getEvent()&&"arrow"!==this.core.getEvent()||(this.core.addEvent(!1),this.keydown.checkKeyEvents(e)&&this.buffer.set())},checkKeyEvents:function(e){var i=this.keyCode,o=[i.BACKSPACE,i.DELETE,i.ENTER,i.ESC,i.TAB,i.CTRL,i.META,i.ALT,i.SHIFT];return-1===t.inArray(e,o)},addArrowsEvent:function(t){if(t)return"click"===this.core.getEvent()||"arrow"===this.core.getEvent()?void this.core.addEvent(!1):void this.core.addEvent("arrow")},setupBuffer:function(t,e){return this.keydown.ctrl&&90===e&&!t.shiftKey&&!t.altKey&&this.sBuffer.length?(t.preventDefault(),void this.buffer.undo()):this.keydown.ctrl&&90===e&&t.shiftKey&&!t.altKey&&0!==this.sRebuffer.length?(t.preventDefault(),void this.buffer.redo()):void(this.keydown.ctrl||e!==this.keyCode.SPACE&&e!==this.keyCode.BACKSPACE&&e!==this.keyCode.DELETE&&(e!==this.keyCode.ENTER||t.ctrlKey||t.shiftKey)||this.buffer.set())},exitFromBlockquote:function(e){if(this.utils.isEndOfElement(this.keydown.blockquote)){if(-1!==this.clean.removeSpacesHard(t(this.keydown.blockquote).html()).search(/(){1}$/i)){e.preventDefault();t(this.keydown.blockquote).children().last().filter("br").remove(),t(this.keydown.blockquote).children().last().filter("span").remove();var i=t(this.opts.emptyHtml);return t(this.keydown.blockquote).after(i),this.caret.start(i),!0}}},onArrowDown:function(){for(var t=[this.keydown.blockquote,this.keydown.pre,this.keydown.figcaption],e=0;e1&&this.core.editor().contents().first()[0]!==e)){var i=t(this.opts.emptyHtml);t(e).before(i),this.caret.start(i)}},onTab:function(t,e){if(!this.opts.tabKey)return!0;var i=this.keydown.block&&"LI"===this.keydown.block.tagName;if(this.utils.isEmpty(this.code.get())||!i&&!this.keydown.pre&&!1===this.opts.tabAsSpaces)return!0;t.preventDefault(),this.buffer.set();var o,r=i&&this.utils.isStartOfElement(this.keydown.block);return this.keydown.pre&&!t.shiftKey?(o=this.opts.preSpaces?document.createTextNode(Array(this.opts.preSpaces+1).join(" ")):document.createTextNode("\t"),this.insert.node(o)):!1===this.opts.tabAsSpaces||r?t.metaKey&&219===e?this.indent.decrease():t.metaKey&&221===e?this.indent.increase():t.shiftKey?this.indent.decrease():this.indent.increase():(o=document.createTextNode(Array(this.opts.tabAsSpaces+1).join(" ")),this.insert.node(o)),!1},setupSelectAll:function(t,e){this.keydown.ctrl&&65===e?this.utils.enableSelectAll():!this.keydown.ctrl||35!=e&&36!=e&&38!=e&&40!=e?e===this.keyCode.LEFT_WIN||this.keydown.ctrl||this.utils.disableSelectAll():this.utils.disableSelectAll()},insertNewLine:function(t){t.preventDefault();var e=document.createTextNode("\n"),i=this.selection.get(),o=this.selection.range(i);return o.deleteContents(),o.insertNode(e),this.caret.after(e),!1},insertParagraph:function(t){t.preventDefault();var e=document.createElement("p");e.innerHTML="
    ";var i=this.selection.get(),o=this.selection.range(i);return o.deleteContents(),o.insertNode(e),this.caret.start(e),!1},insertBreakLine:function(t){return this.keydown.insertBreakLineProcessing(t)},insertDblBreakLine:function(t){return this.keydown.insertBreakLineProcessing(t,!0)},insertBreakLineProcessing:function(t,e){t.stopPropagation();var i=document.createElement("br");if(this.insert.node(i),!0===e){var o=document.createElement("br");this.insert.node(o),this.caret.after(o)}else this.caret.after(i);return!1},wrapToParagraph:function(){var e=t(this.keydown.current),i=t("

    ").append(e.clone());e.replaceWith(i);var o=t(i).next();void 0!==o[0]&&"BR"===o[0].tagName&&o.remove(),this.caret.end(i)},replaceToParagraph:function(e){var i=this.selection.block(),o=t(i).prev(),r=i.innerHTML.replace(//gi,"");if(i.tagName===e&&this.utils.isEmpty(r)&&!t(i).hasClass("redactor-in")){var s=document.createElement("p");return t(i).replaceWith(s),this.keydown.setCaretToParagraph(s),!1}if("P"===i.tagName)return t(i).removeAttr("class").removeAttr("style"),this.detect.isIe()&&this.utils.isEmpty(r)&&this.utils.isInline(this.keydown.parent)&&t(i).on("input",t.proxy(function(){var e=this.selection.parent();if(this.utils.isInline(e)){var o=t(e).html();t(i).html(o),this.caret.end(i)}t(i).off("keyup")},this)),!1;if(o.hasClass(this.opts.videoContainerClass)){o.removeAttr("class");var s=document.createElement("p");return o.replaceWith(s),this.keydown.setCaretToParagraph(s),!1}},setCaretToParagraph:function(t){var e=document.createRange();e.setStart(t,0);var i=document.createTextNode("​");e.insertNode(i),e.setStartAfter(i),e.collapse(!0);var o=window.getSelection();o.removeAllRanges(),o.addRange(e)},removeInvisibleSpace:function(){var e=t(this.keydown.current);0===e.text().search(/^\u200B$/g)&&e.remove()},removeEmptyListInTable:function(e){var i=t(this.keydown.current),o=t(this.keydown.parent),r=i.closest("td",this.$editor[0]);if(0!==r.length&&i.closest("li",this.$editor[0])&&1===o.children("li").length){if(!this.utils.isEmpty(i.text()))return;e.preventDefault(),i.remove(),o.remove(),this.caret.start(r)}},removeEmptyLists:function(){var e=function(){""===t.trim(this.innerHTML).replace(/\/t\/n/g,"")&&t(this).remove()};this.core.editor().find("li").each(e),this.core.editor().find("ul, ol").each(e)},formatEmpty:function(e){var i=t.trim(this.core.editor().html());if(this.utils.isEmpty(i))return e.preventDefault(),"inline"===this.opts.type||"pre"===this.opts.type?(this.core.editor().html(this.marker.html()),this.selection.restore()):(this.core.editor().html(this.opts.emptyHtml),this.focus.start()),!1}}},keyup:function(){return{init:function(e){if(!this.rtePaste){var i=e.which;this.keyup.block=this.selection.block(),this.keyup.current=this.selection.current(),this.keyup.parent=this.selection.parent(),this.keyup.lastShiftKey=e.shiftKey;if(!1===this.core.callback("keyup",e))return e.preventDefault(),!1;if(i===this.keyCode.ENTER&&this.keyup.block&&"FIGURE"===this.keyup.block.tagName){var o=t(this.keyup.block).prev();if(0!==o.length&&"FIGURE"===o[0].tagName){var r=this.utils.replaceToTag(o,"p");return void this.caret.start(r)}}if(i===this.keyCode.BACKSPACE||i===this.keyCode.DELETE){if(this.utils.isSelectAll())return this.focus.start(),void this.toolbar.setUnfixed();if(this.keyup.block&&"P"===this.keyup.block.tagName){var s=t(this.keyup.block).find("img").length;""===t(this.keyup.block).text().replace(/\u200B/g,"")&&0!==s&&this.utils.replaceToTag(this.keyup.block,"figure")}this.keyup.block&&"FIGURE"===this.keyup.block.tagName&&0===t(this.keyup.block).find("img").length&&(this.selection.save(),this.utils.replaceToTag(this.keyup.block,"p"),this.selection.restore())}this.linkify.isKey(i)&&(this.selection.save(),this.linkify.format(),this.selection.restore())}}}},lang:function(){return{load:function(){this.opts.curLang=this.opts.langs[this.opts.lang]},get:function(t){return void 0!==this.opts.curLang[t]?this.opts.curLang[t]:""}}},line:function(){return{insert:function(){this.buffer.set(),this.insert.html(this.line.getLineHtml());var t=this.core.editor().find("#redactor-hr-tmp-id");return t.removeAttr("id"),this.core.callback("insertedLine",t),t},getLineHtml:function(){var t='


    ';return!this.detect.isFirefox()&&this.utils.isEmpty()&&(t+="

    "+this.opts.emptyHtml+"

    "),t},removeOnBackspace:function(e){if(this.utils.isCollapsed()){var i=t(this.selection.block());if(0!==i.length&&this.utils.isStartOfElement(i)){var o=i.prev();o&&0!==o.length&&"HR"===o[0].tagName&&(e.preventDefault(),o.remove())}}}}},link:function(){return{get:function(){return t(this.selection.inlines("a"))},is:function(){var e=this.selection.nodes(),i=t(this.selection.current()).closest("a",this.core.editor()[0]);return!(0===i.length||e.length>1)&&i},unlink:function(t){void 0!==t&&t.preventDefault&&t.preventDefault(),this.buffer.set();var e=this.selection.inlines("a");if(0!==e.length){var i=this.link.replaceLinksToText(e);this.observe.closeAllTooltip(),this.core.callback("deletedLink",i)}},insert:function(e,i){var o=this.link.is();if(!0!==i&&!1===(e=this.link.buildLinkFromObject(o,e)))return!1;if(this.buffer.set(),e=this.core.callback("beforeInsertingLink",e),!1===o){o=t(""),o=this.link.update(o,e),o=t(this.insert.node(o));var r=o.parent();!1===this.utils.isRedactorParent(r)&&o.wrap("

    "),r.hasClass("redactor-unlink")&&r.replaceWith(function(){return t(this).contents()}),this.caret.after(o),this.core.callback("insertedLink",o)}else o=this.link.update(o,e),this.caret.after(o);return o},update:function(t,e){return t.text(e.text),t.attr("href",e.url),this.link.target(t,e.target),t},target:function(t,e){return e?t.attr("target","_blank"):t.removeAttr("target")},show:function(e){void 0!==e&&e.preventDefault&&e.preventDefault(),this.observe.closeAllTooltip();var i=this.link.linkEl();this.link.buildModal(i);var o=this.link.buildLinkFromElement(i);o.url=this.link.removeSelfHostFromUrl(o.url),this.opts.linkNewTab&&!i&&(o.target=!0),this.link.setModalValues(o),this.modal.show(),this.detect.isDesktop()&&t("#redactor-link-url").focus()},linkEl:function(){var e=t(this.selection.current()).closest("a",this.core.editor()[0]);return 0===e.length&&(e=t(t.parseHTML(this.selection.html())).closest("a",this.core.editor()[0])),0!==e.length&&e},setModalValues:function(e){t("#redactor-link-blank").prop("checked",e.target),t("#redactor-link-url").val(e.url),t("#redactor-link-url-text").val(e.text)},buildModal:function(e){this.modal.load("link",this.lang.get(!1===e?"link-insert":"link-edit"),600),this.modal.getActionButton().text(this.lang.get(!1===e?"insert":"save")).on("click",t.proxy(this.link.callback,this))},callback:function(){var t=this.link.buildLinkFromModal();if(!1===t)return!1;this.modal.close(),this.link.insert(t,!0)},cleanUrl:function(e){return void 0===e?"":t.trim(e.replace(/[^\W\w\D\d+&\'@#\/%?=~_|!:,.;\(\)]/gi,""))},cleanText:function(e){return void 0===e?"":t.trim(e)},getText:function(t){return""===t.text&&""!==t.url?this.link.truncateUrl(t.url.replace(/<|>/g,"")):t.text},isUrl:function(t){var e="((xn--)?[\\W\\w\\D\\d]+(-[\\W\\w\\D\\d]+)*\\.)+[\\W\\w]{2,}",i=new RegExp("^(http|ftp|https)://"+e,"i"),o=new RegExp("^"+e,"i"),r=new RegExp(".(html|php)$","i"),s=new RegExp("^/","i"),n=new RegExp("^tel:(.*?)","i");return-1===t.search(i)&&-1!==t.search(o)&&-1===t.search(r)&&"/"!==t.substring(0,1)&&(t="http://"+t),(-1!==t.search(i)||-1!==t.search(r)||-1!==t.search(s)||-1!==t.search(n))&&t},isMailto:function(t){return-1!==t.search("@")&&!1===/(http|ftp|https):\/\//i.test(t)},isEmpty:function(t){return""===t.url||""===t.text&&""===t.url},truncateUrl:function(t){return t.length>this.opts.linkSize?t.substring(0,this.opts.linkSize)+"...":t},parse:function(t){return this.link.isMailto(t.url)?t.url="mailto:"+t.url.replace("mailto:",""):0!==t.url.search("#")&&this.opts.linkValidation&&(t.url=this.link.isUrl(t.url)),!this.link.isEmpty(t)&&!1!==t.url&&t},buildLinkFromModal:function(){var e={};return e.url=this.link.cleanUrl(t("#redactor-link-url").val()),e.text=this.link.cleanText(t("#redactor-link-url-text").val()),e.text=this.link.getText(e),e.target=!!t("#redactor-link-blank").prop("checked"),this.link.parse(e)},buildLinkFromObject:function(t,e){return e.url=this.link.cleanUrl(e.url),e.text=void 0===e.text&&this.selection.is()?this.selection.text():this.link.cleanText(e.text),e.text=this.link.getText(e),e.target=!1===t?e.target:this.link.buildTarget(t),this.link.parse(e)},buildLinkFromElement:function(t){var e={url:"",text:this.selection.is()?this.selection.text():"",target:!1};return!1!==t&&(e.url=t.attr("href"),e.text=e.text?e.text:t.text(),e.target=this.link.buildTarget(t)),e},buildTarget:function(t){return void 0!==t.attr("target")&&"_blank"===t.attr("target")},removeSelfHostFromUrl:function(t){var e=self.location.href.replace("#","").replace(/\/$/i,"");return t.replace(/^\/\#/,"#").replace(e,"").replace("mailto:","")},replaceLinksToText:function(e){var i,o=t.each(e,function(e,o){var r=t(o),s=t('').append(r.contents());return r.replaceWith(s),0===e&&(i=s),r});return 1===e.length&&this.selection.isCollapsed()&&this.caret.after(i),o}}},linkify:function(){return{isKey:function(t){return t===this.keyCode.ENTER||t===this.keyCode.SPACE},isLink:function(t){return t.nodeValue.match(this.opts.regexps.linkyoutube)||t.nodeValue.match(this.opts.regexps.linkvimeo)||t.nodeValue.match(this.opts.regexps.linkvimeochannel)||t.nodeValue.match(this.opts.regexps.linkimage)||t.nodeValue.match(this.opts.regexps.url)},isFiltered:function(e,i){return 3===i.nodeType&&""!==t.trim(i.nodeValue)&&!t(i).parent().is("pre")&&this.linkify.isLink(i)},handler:function(e,i){var o=t(i),r=o.text(),s=r;s=s.match(this.opts.regexps.linkyoutube)||s.match(this.opts.regexps.linkvimeo)||s.match(this.opts.regexps.linkvimeochannel)?this.linkify.convertVideoLinks(s):s.match(this.opts.regexps.linkimage)?this.linkify.convertImages(s):this.linkify.convertLinks(s),o.before(r.replace(r,s)).remove()},format:function(){if(this.opts.linkify&&!this.utils.isCurrentOrParent("pre")){this.core.editor().find(":not(iframe,img,a,pre,code,.redactor-unlink)").addBack().contents().filter(t.proxy(this.linkify.isFiltered,this)).each(t.proxy(this.linkify.handler,this));var e,i=this.core.editor().find(".redactor-linkify-object").each(t.proxy(function(i,o){return e=t(o),e.removeClass("redactor-linkify-object"),""===e.attr("class")&&e.removeAttr("class"),"DIV"===o.tagName?this.linkify.breakBlockTag(e,"video"):"IMG"===o.tagName?this.linkify.breakBlockTag(e,"image"):"A"===o.tagName&&this.core.callback("insertedLink",e),e},this));setTimeout(t.proxy(function(){this.code.sync(),this.core.callback("linkify",i)},this),100)}},breakBlockTag:function(e,i){var o=this.utils.breakBlockTag();if(!1!==o){var r=e;"image"===i&&(r=t("

    ").append(e)),"start"===o.type?o.$block.before(r):o.$block.after(r),"image"===i&&this.caret.after(r)}},convertVideoLinks:function(t){var e='
    ';return t.match(this.opts.regexps.linkyoutube)&&(t=t.replace(this.opts.regexps.linkyoutube,e+"//www.youtube.com/embed/$1"+i)),t.match(this.opts.regexps.linkvimeo)&&(t=t.replace(this.opts.regexps.linkvimeo,e+"//player.vimeo.com/video/$2"+i)),t.match(this.opts.regexps.linkvimeochannel)&&(t=t.replace(this.opts.regexps.linkvimeochannel,e+"//player.vimeo.com/video/$2"+i)),t},convertImages:function(t){var e=t.match(this.opts.regexps.linkimage);return e?t.replace(t,''):t},convertLinks:function(e){var i=e.match(this.opts.regexps.url);if(!i)return e;i=t.grep(i,function(e,o){return t.inArray(e,i)===o});for(var o=i.length,r=0;rthis.opts.linkSize&&(n=n.substring(0,this.opts.linkSize)+"..."),-1===n.search("%")&&(n=decodeURIComponent(n));var l="\\b";-1!==t.inArray(s.slice(-1),["/","&","="])&&(l="");var c=new RegExp("("+s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+l+")","g"),d="";!1!==this.opts.pasteLinkTarget&&(d=' target="'+this.opts.pasteLinkTarget+'"'),e=e.replace(c,'
    '+t.trim(n)+"")}return e}}},list:function(){return{toggle:function(e){if(!this.utils.inBlocks(["table","td","th","tr"])){var i="orderedlist"===e||"ol"===e?"OL":"UL";e="OL"===i?"orderedlist":"unorderedlist";var o=t(this.selection.current()).parentsUntil(".redactor-in","ul, ol").first(),r=t(this.selection.current()).parentsUntil(".redactor-in","li").first();this.placeholder.hide(),this.buffer.set();if(""===this.selection.html()&&0!==r.length&&r[0].parentNode.tagName===i&&this.utils.isRedactorParent(r)){var s=t(r[0]).prev(),n=t(r[0]).next(),a=r.html(),l=t(r[0].parentNode);if(this.selection.save(),!s.length&&n.length)return r.remove(),void l.before(t("

    ").append(a));if(s.length&&n.length){r.replaceWith(function(){return"-~=REMOVED+ITEM=~-"});var c=this.selection.current(),d=t(c)[0].outerHTML.replace(/-~=REMOVED\+ITEM=~-/g,"\n\n

    "+a+"

    \n\n<"+i+">");return t(c).replaceWith(function(){return d})}return s.length&&!n.length?(r.remove(),void l.after(t("

    ").append(a))):void(s.length||n.length||l.replaceWith(function(){return t("

    ").append(a)}))}if(0!==o.length&&o[0].tagName===i&&this.utils.isRedactorParent(o))return this.selection.save(),o.find("ul, ol").each(function(){var e=t(this).closest("li");t(this).find("li").each(function(){t(e).after(this)})}),o.find("ul, ol").remove(),o.find("li").each(function(){return t(this).replaceWith(function(){return t("

    ").append(t(this).contents())})}),o.replaceWith(function(){return t(this).contents()}),void this.selection.restore();this.selection.save(),0!==o.length&&o[0].tagName!==i?o.each(t.proxy(function(t,e){this.utils.replaceToTag(e,i)},this)):document.execCommand("insert"+e),this.selection.restore();var h=this.list.get();if(!h)return void(this.selection.block()||document.execCommand("formatblock",!1,"p"));h.find("span").replaceWith(function(){return t(this).contents()}),h.find(this.opts.inlineTags.join(",")).each(function(){t(this).removeAttr("style")});var u=h.parent();this.utils.isRedactorParent(u)&&"LI"!==u[0].tagName&&this.utils.isBlock(u)&&(this.selection.save(),u.replaceWith(u.contents()),this.selection.restore())}},get:function(){var e=this.selection.current(),i=t(e).closest("ul, ol",this.core.editor()[0]);return 0!==i.length&&i},combineAfterAndBefore:function(e){var i=t(e).prev(),o=t(e).next(),r=e&&"P"===e.tagName&&("
    "===e.innerHTML||""===e.innerHTML),s=1===i.closest("ol, ul",this.core.editor()[0]).length&&1===o.closest("ol, ul",this.core.editor()[0]).length;return!(!r||!s)&&(i.children("li").last().append(this.marker.get()),i.append(o.contents()),this.selection.restore(),!0)}}},marker:function(){return{get:function(t){t=void 0===t?1:t;var e=document.createElement("span");return e.id="selection-marker-"+t,e.className="redactor-selection-marker",e.innerHTML=this.opts.invisibleSpace,e},html:function(t){return this.utils.getOuterHtml(this.marker.get(t))},find:function(t){return t=void 0===t?1:t,this.core.editor().find("span#selection-marker-"+t)},insert:function(){var t=this.selection.get(),e=this.selection.range(t);this.marker.insertNode(e,this.marker.get(1),!0),e&&!1===e.collapsed&&this.marker.insertNode(e,this.marker.get(2),!1)},remove:function(){this.core.editor().find(".redactor-selection-marker").each(this.marker.iterateRemove)},insertNode:function(e,i,o){var r=this.selection.parent();if(null!==e&&0!==t(r).closest(".redactor-in").length){e=e.cloneRange();try{e.collapse(o),e.insertNode(i)}catch(t){this.focus.start()}}},iterateRemove:function(e,i){var o=t(i),r=o.text().replace(/\u200B/g,"");o.parent()[0];""===r?o.remove():o.replaceWith(function(){return t(this).contents()})}}},modal:function(){return{callbacks:{},templates:function(){this.opts.modal={"image-edit":String()+'

    ",image:String()+'
    ',file:String()+'


    ',link:String()+'
    "},t.extend(this.opts,this.opts.modal)},addCallback:function(t,e){this.modal.callbacks[t]=e},addTemplate:function(t,e){this.opts.modal[t]=e},getTemplate:function(t){return this.opts.modal[t]},getModal:function(){return this.$modalBody},getActionButton:function(){return this.$modalBody.find("#redactor-modal-button-action")},getCancelButton:function(){return this.$modalBody.find("#redactor-modal-button-cancel")},getDeleteButton:function(){return this.$modalBody.find("#redactor-modal-button-delete")},load:function(t,e,i){void 0!==this.$modalBox&&this.$modalBox.hasClass("open")||(this.modal.templateName=t,this.modal.width=i,this.modal.build(),this.modal.enableEvents(),this.modal.setTitle(e),this.modal.setDraggable(),this.modal.setContent(),void 0!==this.modal.callbacks[t]&&this.modal.callbacks[t].call(this))},show:function(){this.detect.isDesktop()||document.activeElement.blur(),this.selection.save(),this.modal.buildTabber(),this.detect.isMobile()&&(this.modal.width="96%"),setTimeout(t.proxy(this.modal.buildWidth,this),0),t(window).on("resize.redactor-modal",t.proxy(this.modal.buildWidth,this)),this.$modalOverlay.redactorAnimation("fadeIn",{duration:.25}),this.$modalBox.addClass("open").show(),this.$modal.redactorAnimation("fadeIn",{timing:"cubic-bezier(0.175, 0.885, 0.320, 1.105)"},t.proxy(function(){this.utils.saveScroll(),this.utils.disableBodyScroll(),this.core.callback("modalOpened",this.modal.templateName,this.$modal),t(document).off("focusin.modal"),this.$modal.find("input[type=text],input[type=url],input[type=email]").on("keydown.redactor-modal",t.proxy(this.modal.setEnter,this))},this))},buildWidth:function(){var e=t(window).height(),i=t(window).width(),o="number"==typeof this.modal.width;!o&&this.modal.width.match(/%$/)?this.$modal.css({width:this.modal.width,"margin-bottom":"16px"}):parseInt(this.modal.width)>i?this.$modal.css({width:"96%","margin-bottom":"2%"}):(o&&(this.modal.width+="px"),this.$modal.css({width:this.modal.width,"margin-bottom":"16px"}));var r=this.$modal.outerHeight(),s=e/2-r/2+"px";this.detect.isMobile()?s="2%":r>e&&(s="16px"),this.$modal.css("margin-top",s)},buildTabber:function(){this.modal.tabs=this.$modal.find(".redactor-modal-tab"),this.modal.tabs.length<2||(this.modal.$tabsBox=t('
    '),t.each(this.modal.tabs,t.proxy(function(e,i){var o=t('').text(t(i).attr("data-title"));o.on("click",t.proxy(this.modal.showTab,this)),0===e&&o.addClass("active"),this.modal.$tabsBox.append(o)},this)),this.$modalBody.prepend(this.modal.$tabsBox))},showTab:function(e){e.preventDefault();var i=t(e.target),o=i.attr("rel");return this.modal.tabs.hide(),this.modal.tabs.eq(o).show(),t("#redactor-modal-tabber").find("a").removeClass("active"),i.addClass("active"),!1},setTitle:function(t){this.$modalHeader.html(t)},setContent:function(){this.$modalBody.html(this.modal.getTemplate(this.modal.templateName)),this.modal.getCancelButton().on("mousedown",t.proxy(this.modal.close,this))},setDraggable:function(){void 0!==t.fn.draggable&&(this.$modal.draggable({handle:this.$modalHeader}),this.$modalHeader.css("cursor","move"))},setEnter:function(t){13===t.which&&(t.preventDefault(),this.modal.getActionButton().click())},build:function(){this.modal.buildOverlay(),this.$modalBox=t('
    ').hide(),this.$modal=t('
  • \n\n"),e=e.replace(/

    \s
    <\/p>/gi,"

    "),e=this.paragraphize.getSafes(e),e=e.replace("
    ","\n"),e=this.paragraphize.convert(e),e=this.paragraphize.clear(e),e=this.paragraphize.restoreSafes(e),e=e.replace(new RegExp("\n?<("+this.opts.paragraphizeBlocks.join("|")+")(.*?[^>])>","gi"),"


    \n<$1$2>"),t.trim(e))},getSafes:function(e){var i=t("
    ").append(e);return i.find("blockquote p").replaceWith(function(){return t(this).append("
    ").contents()}),i.find(this.opts.paragraphizeBlocks.join(", ")).each(t.proxy(function(e,i){i&&i.tagName&&"iframe"==i.tagName.toLowerCase()&&(i.innerHTML="");var o=i.outerHTML;if(i&&i.tagName)switch(i.tagName.toLowerCase()){case"ul":case"ol":o=o.replace(new RegExp("(s*)*
  • (s*)*","gi"),"\n
  • "),o=o.replace(new RegExp("(s*)*","gi"),"\n\n"),o=o.replace(new RegExp("(s*)*","gi"),"\n\n");break;case"table":o=o.replace(new RegExp("(s*)*<(tr|td|tbody)>(s*)*","gi"),"\n<$2>"),o=o.replace(new RegExp("(s*)*","gi"),"\n\n"),o=o.replace(new RegExp("(s*)*","gi"),"\n"),o=o.replace(new RegExp("(s*)*","gi"),"\n")}return this.paragraphize.z++,this.paragraphize.safes[this.paragraphize.z]=o,t(i).replaceWith("\n#####replace"+this.paragraphize.z+"#####\n\n")},this)),i.find("span.redactor-selection-marker").each(t.proxy(function(e,i){return this.paragraphize.z++,this.paragraphize.safes[this.paragraphize.z]=i.outerHTML,t(i).replaceWith("\n#####replace"+this.paragraphize.z+"#####\n\n")},this)),i.html()},restoreSafes:function(e){return t.each(this.paragraphize.safes,function(t,i){i=void 0!==i?i.replace(/\$/g,"$"):i,e=e.replace("#####replace"+t+"#####",i)}),e},convert:function(e){e=e.replace(/\r\n/g,"xparagraphmarkerz"),e=e.replace(/\n/g,"xparagraphmarkerz"),e=e.replace(/\r/g,"xparagraphmarkerz");var i=/\s+/g;e=e.replace(i," "),e=t.trim(e);var o=/xparagraphmarkerzxparagraphmarkerz/gi;e=e.replace(o,"

    ");var r=/xparagraphmarkerz/gi;return e=e.replace(r,"
    "),e="

    "+e+"

    ",e=e.replace("

    ",""),e=e.replace("\r\n\r\n",""),e=e.replace(/<\/p>

    /g,"

    \r\n\r\n

    "),e=e.replace(new RegExp("

    ","g"),"

    "),e=e.replace(new RegExp("

    ","g"),"

    "),e=e.replace(new RegExp("

    ","g"),"

    "),e=e.replace(new RegExp("

    ","g"),"

    "),e=e.replace(/

     <\/p>/gi,""),e=e.replace(/

    \s?
     <\/p>/gi,""),e=e.replace(/

    \s?
    /gi,"

    ")},clear:function(t){return t=t.replace(/

    (.*?)#####replace(.*?)#####\s?<\/p>/gi,"

    $1

    #####replace$2#####"),t=t.replace(/(){2,}<\/p>/gi,"

    "),t=t.replace(new RegExp("

    ","gi"),""),t=t.replace(new RegExp("

    ","gi"),""),t=t.replace(new RegExp("

    ","gi"),"
    "),t=t.replace(new RegExp("

    ","gi"),"
    "),t=t.replace(new RegExp("

    ","gi"),"

    "),t=t.replace(new RegExp("

    ","gi"),"

    "),t=t.replace(new RegExp("

    \\s?

    ","gi"),""),t=t.replace(new RegExp("\n

    ","gi"),"

    "),t=t.replace(new RegExp("

    \t?\t?\n?

    ","gi"),"

    "),t=t.replace(new RegExp("

    \t*

    ","gi"),"")}}},paste:function(){return{init:function(e){this.rtePaste=!0;var i=!("pre"!==this.opts.type&&!this.utils.isCurrentOrParent("pre"));if(this.detect.isDesktop()&&!this.paste.pre&&this.opts.clipboardImageUpload&&this.opts.imageUpload&&this.paste.detectClipboardUpload(e))return void(this.detect.isIe()&&setTimeout(t.proxy(this.paste.clipboardUpload,this),100));this.utils.saveScroll(),this.selection.save(),this.paste.createPasteBox(i),t(window).on("scroll.redactor-freeze",t.proxy(function(){t(window).scrollTop(this.saveBodyScroll)},this)),setTimeout(t.proxy(function(){var e=this.paste.getPasteBoxCode(i);this.buffer.set(),this.selection.restore(),this.utils.restoreScroll();var o=this.clean.getCurrentType(e);e=this.clean.onPaste(e,o);var r=this.core.callback("paste",e);e=void 0===r?e:r,this.paste.insert(e,o),this.rtePaste=!1,i&&this.clean.cleanPre(),t(window).off("scroll.redactor-freeze")},this),1)},getPasteBoxCode:function(t){var e=t?this.$pasteBox.val():this.$pasteBox.html();return this.$pasteBox.remove(),e},createPasteBox:function(e){var i={position:"fixed",width:"1px",top:0,left:"-9999px"};this.$pasteBox=e?t("
  • "},show:function(){this.buffer.set(),this.selection.save(),this.modal.load(t,o,800),this.modal.show(),this.detect.isDesktop()&&setTimeout(function(){$("#h-"+t+"-textarea").focus()},1)},insertSnippet:function(t){this.modal.close(),this.selection.restore(),s.insertNewline($("<"+e+">").text(t).insertAfter(this.selection.current())),this.code.sync()},insertNewline:function(t){return $("

    ").insertAfter(t)}}}}RedactorPlugins.codeblock=t("codeblock","pre","re-icon-html","Insert code block","code-to-insert"),RedactorPlugins.blockquote=t("blockquote","blockquote","re-icon-clips","Insert quote","blockquote-to-insert"),$.wa&&($.wa.RedactorCodeblockPluginFactory=t)}(),function(t){t.Redactor.prototype.fontcolor=function(){return{langs:{en:{fontcolor:"Text Color","fontcolor-highlight":"Highlight","fontcolor-text":"Text","fontcolor-none":"None"}},init:function(){var e=["#ffffff","#000000","#ff0000","#cc0000","#4f81bd","#c0504d","#9bbb59","#8064a2","#4bacc6","#f79646","#ffff00","#f2f2f2","#7f7f7f","#0000ff","#0000cc","#dbe5f1","#f2dcdb","#ebf1dd","#e5e0ec","#dbeef3","#fdeada","#fff2ca","#d8d8d8","#595959","#00ff00","#00cc00","#b8cce4","#e5b9b7","#d7e3bc","#ccc1d9","#b7dde8","#fbd5b5","#ffe694","#bfbfbf","#3f3f3f","#7bed0c","#59a60d","#95b3d7","#d99694","#c3d69b","#b2a2c7","#b7dde8","#fac08f","#f2c314","#a5a5a5","#262626","#00ffff","#00cccc","#366092","#953734","#76923c","#5f497a","#92cddc","#e36c09","#c09100","#7f7f7f","#0c0c0c","#ff00ff","#cc00cc","#244061","#632423","#4f6128","#3f3151","#31859b","#974806","#7f6000"],i=this.button.add("fontcolor",this.lang.get("fontcolor"));this.button.setIcon(i,'');var o=this.button.addDropdown(i);o.attr("rel","fontcolor"),o.width(242);var r=t('
    '),s=t(''+this.lang.get("fontcolor-text")+""),n=t(''+this.lang.get("fontcolor-highlight")+"");r.append(s),r.append(n),o.append(r),this.fontcolor.buildPicker(o,"textcolor",e),this.fontcolor.buildPicker(o,"backcolor",e),s.on("mousedown",function(e){e.preventDefault(),o.find(".re-dropdown-box-selector-font").css("background","none"),o.find(".re-dropdown-box-backcolor").hide(),o.find(".re-dropdown-box-textcolor").show(),t(this).css("background","#eee")}),n.on("mousedown",function(e){e.preventDefault(),o.find(".re-dropdown-box-selector-font").css("background","none"),o.find(".re-dropdown-box-textcolor").hide(),o.find(".re-dropdown-box-backcolor").show(),t(this).css("background","#eee")})},buildPicker:function(e,i,o){for(var r=t('
    '),s="backcolor"==i?"background-color":"color",n=o.length,a=this,l=function(e){e.preventDefault(),a.fontcolor.set(t(this).data("rule"),t(this).attr("rel"))},c=0;c');h.css("background-color",d),h.on("mousedown",l),r.append(h)}var u=t('').html(this.lang.get("fontcolor-none"));u.on("mousedown",t.proxy(function(t){t.preventDefault(),this.fontcolor.remove(s)},this)),r.append(u),e.append(r),"backcolor"==i&&r.hide()},set:function(t,e){this.inline.format("span","style",t+": "+e+";"),this.dropdown.hide()},remove:function(t){this.inline.removeStyleRule(t),this.dropdown.hide()}}}}(jQuery),function(t){t.Redactor.prototype.fontfamily=function(){return{langs:{en:{fontfamily:"Font","fontfamily-remove":"Remove Font Family"}},init:function(){var e=["Arial","Helvetica","Georgia","Times New Roman","Verdana","Monospace"],i=this,o={};t.each(e,function(t,e){o["s"+t]={title:e,func:function(){i.fontfamily.set(e)}}}),o.remove={title:this.lang.get("fontfamily-remove"),func:i.fontfamily.reset};var r=this.button.add("fontfamily",this.lang.get("fontfamily"));this.button.setIcon(r,''),this.button.addDropdown(r,o)},set:function(t){this.inline.format("span","style","font-family:"+t+";")},reset:function(){this.inline.removeStyleRule("font-family")}}}}(jQuery),function(t){t.Redactor.prototype.fontsize=function(){return{langs:{en:{fontsize:"Size","fontsize-remove":"Remove Font Size"}},init:function(){var e=[10,11,12,14,16,18,20,24,28,30],i=this,o={};t.each(e,function(t,e){o["s"+t]={title:e+"px",func:function(){i.fontsize.set(e)}}}),o.remove={title:this.lang.get("fontsize-remove"),func:i.fontsize.reset};var r=this.button.add("fontsize",this.lang.get("fontsize"));this.button.setIcon(r,''),this.button.addDropdown(r,o)},set:function(t){this.inline.format("span","style","font-size: "+t+"px;")},reset:function(){this.inline.removeStyleRule("font-size")}}}}(jQuery),function(t){t.Redactor.prototype.inlinestyle=function(){return{langs:{en:{style:"Style","style-marked":"Marked","style-code":"Code","style-sample":"Sample","style-variable":"Variable","style-shortcut":"Shortcut","style-cite":"Cite","style-sup":"Superscript","style-sub":"Subscript"}},init:function(){var e={marked:{title:"style-marked",args:["mark"]},code:{title:"style-code",args:["code"]},sample:{title:"style-sample",args:["samp"]},variable:{title:"style-variable",args:["var"]},shortcut:{title:"style-shortcut",args:["kbd"]},cite:{title:"style-cite",args:["cite"]},sup:{title:"style-sup",args:["sup"]},sub:{title:"style-sub",args:["sub"]}},i=this,o={};t.each(e,function(t,e){o[t]={title:i.lang.get(e.title),func:"inline.format",args:e.args}});var r=this.button.addAfter("format","inline",this.lang.get("style"));this.button.setIcon(r,''),this.button.addDropdown(r,o)}}}}(jQuery),function(t){t.Redactor.prototype.properties=function(){return{langs:{en:{properties:"Properties"}},block:!1,labelStyle:{position:"absolute",padding:"2px 5px","line-height":1,"border-radius":"5px","font-size":"10px",color:"rgba(255, 255, 255, .9)","z-index":99},getTemplate:function(){return String()+''},setup:function(){this.opts.properties=void 0===this.opts.properties?{}:this.opts.properties,this.opts.properties.id=void 0===this.opts.properties.id||this.opts.properties.id,this.opts.properties.classname=void 0===this.opts.properties.classname||this.opts.properties.classname,this.opts.properties.show=void 0!==this.opts.properties.show&&this.opts.properties.show},init:function(){if("pre"!==this.opts.type&&"inline"!==this.opts.type){this.properties.setup(),this.properties.createLabelId(this.properties.labelStyle),this.properties.createLabelClass(this.properties.labelStyle),this.properties.setEvents();var t=this.button.add("properties",this.lang.get("properties"));this.button.setIcon(t,''),this.button.addCallback(t,this.properties.show)}},show:function(){this.modal.addTemplate("properties",this.properties.getTemplate()),this.modal.load("properties","Properties",600),this.modal.getActionButton().text("Save").on("click",this.properties.save),this.properties.showId(),this.properties.showClass(),this.modal.show()},createLabelId:function(e){(this.opts.properties.show||this.opts.properties.id)&&(this.properties.labelId=t("").attr("id","redactor-properties-label-id-"+this.uuid).attr("title","ID").hide(),this.properties.labelId.css(e).css("background","rgba(229, 57, 143, .7)"),t("body").append(this.properties.labelId))},createLabelClass:function(e){(this.opts.properties.show||this.opts.properties.classname)&&(this.properties.labelClass=t("").attr("id","redactor-properties-label-class-"+this.uuid).attr("title","class").hide(),this.properties.labelClass.css(e).css("background","rgba(61, 121, 242, .7)"),t("body").append(this.properties.labelClass))},setEvents:function(){this.core.element().on("click.callback.redactor",this.properties.showOnClick),t(document).on("mousedown.redactor-properties",t.proxy(this.properties.hideOnBlur,this)),this.core.element().on("destroy.callback.redactor",t.proxy(function(){t(document).off(".redactor-properties")},this))},showId:function(){this.opts.properties.id?(t("#modal-properties-id-label").show(),t("#modal-properties-id").show().val(t(this.properties.block).attr("id"))):t("#modal-properties-id, #modal-properties-id-label").hide()},showClass:function(){this.opts.properties.classname?(t("#modal-properties-class-label").show(),t("#modal-properties-class").show().val(t(this.properties.block).attr("class"))):t("#modal-properties-class, #modal-properties-class-label").hide()},save:function(){if(this.opts.properties.id){var e=t("#modal-properties-id").val();void 0===e||""===e?this.block.removeAttr("id",this.properties.block):this.block.replaceAttr("id",e,this.properties.block)}if(this.opts.properties.classname){var i=t("#modal-properties-class").val();void 0===i||""===i?this.block.removeAttr("class",this.properties.block):this.block.replaceClass(i,this.properties.block)}this.modal.close(),this.properties.showOnClick(!1)},showOnClick:function(e){!1!==e&&e.preventDefault();var i=void 0!==this.fullscreen&&this.fullscreen.isOpen?1052:99;if(this.properties.block=this.selection.block(),this.properties.block&&this.utils.isRedactorParent(this.properties.block)&&!this.utils.isCurrentOrParent(["figure","li"])){var o=t(this.properties.block).offset(),r=this.properties.showOnClickClass(o,i);this.properties.showOnClickId(o,i,r)}},showOnClickId:function(e,i,o){var r=t(this.properties.block).attr("id");this.opts.properties.show&&this.opts.properties.id&&void 0!==r&&""!==r&&setTimeout(t.proxy(function(){var t=this.opts.properties.classname&&void 0!==o&&""!==o?this.properties.labelClass.innerWidth():-3;this.properties.labelId.css({zIndex:i,top:e.top-13,left:e.left+t}).show().text("#"+r)},this),10)},showOnClickClass:function(e,i){var o=t(this.properties.block).attr("class");return this.opts.properties.show&&this.opts.properties.classname&&void 0!==o&&""!==o&&this.properties.labelClass.css({zIndex:i,top:e.top-13,left:e.left-3}).show().text(o),o},hideOnBlur:function(t){t.target!==this.properties.block&&(this.properties.hideOnBlurId(),this.properties.hideOnBlurClass())},hideOnBlurId:function(){this.opts.properties.show&&this.opts.properties.id&&this.properties.labelId.css("z-index",99).hide()},hideOnBlurClass:function(){this.opts.properties.show&&this.opts.properties.classname&&this.properties.labelClass.css("z-index",99).hide()}}}}(jQuery),function(t){t.Redactor.prototype.source=function(){return{init:function(){var e=this.button.addFirst("html","HTML");this.button.setIcon(e,''),this.button.addCallback(e,this.source.toggle);var i={width:"100%",margin:"0",background:"#1d1d1d","box-sizing":"border-box",color:"#ccc","font-size":"15px",outline:"none",padding:"20px","line-height":"24px","font-family":'Consolas, Menlo, Monaco, "Courier New", monospace'};this.source.$textarea=t("
    "},init:function(){var t=this.button.addAfter("image","video",this.lang.get("video"));this.button.setIcon(t,''),this.button.addCallback(t,this.video.show)},show:function(){this.modal.addTemplate("video",this.video.getTemplate()),this.modal.load("video",this.lang.get("video"),700),this.modal.getActionButton().text(this.lang.get("insert")).on("click",this.video.insert),this.modal.show(),this.detect.isDesktop()&&setTimeout(function(){t("#redactor-insert-video-area").focus()},1)},insert:function(){var e=t("#redactor-insert-video-area").val(),i=e.match(/]*>/gi;e=e.replace(r,function(t,e){return-1===o.indexOf(e.toLowerCase())?"":t}),this.opts.videoContainerClass=void 0===this.opts.videoContainerClass?"video-container":this.opts.videoContainerClass;var s='
    ';e=e.match(this.video.reUrlYoutube)?e.replace(this.video.reUrlYoutube,s+"//www.youtube.com/embed/$1"+n):e.match(this.video.reIframeYoutube)?e.replace(this.video.reIframeYoutube,s+"//www.youtube.com/embed/$2"+n):e.match(this.video.reUrlVimeo)?e.replace(this.video.reUrlVimeo,s+"//player.vimeo.com/video/$2"+n):e.match(this.video.reUrlVimeoChannel)?e.replace(this.video.reUrlVimeoChannel,s+"//player.vimeo.com/video/$2"+n):e.match(this.video.reIframeVimeo)?e.replace(this.video.reIframeVimeo,s+"//player.vimeo.com/video/$2"+n):'
    '+e+"
    "}this.modal.close(),this.placeholder.hide(),this.buffer.set(),this.air.collapsed(),this.insert.html(e)}}}}(jQuery); //# sourceMappingURL=redactor.min.js.map diff --git a/wa-installer/lib/config/sources.php b/wa-installer/lib/config/sources.php index 3a59b31be..bc1ae424d 100644 --- a/wa-installer/lib/config/sources.php +++ b/wa-installer/lib/config/sources.php @@ -1,6 +1,6 @@ 'https://www.webasyst.com/download/apps/list/', - 'system' => 'https://www.webasyst.com/download/system/list/', + 'apps' => 'https://updates.webasyst.com/download/apps/list/', + 'system' => 'https://updates.webasyst.com/download/system/list/', ); diff --git a/wa-system/design/templates-legacy/Themes.html b/wa-system/design/templates-legacy/Themes.html index 32d304922..c02f43a79 100644 --- a/wa-system/design/templates-legacy/Themes.html +++ b/wa-system/design/templates-legacy/Themes.html @@ -66,7 +66,7 @@

    {$app.name|string_format:'[s`Design themes for %s app`]'|escape}
    -
    +
    @@ -150,32 +150,17 @@

    - \ No newline at end of file diff --git a/wa-system/webasyst/lib/config/app.php b/wa-system/webasyst/lib/config/app.php index 65843799c..e98cf3877 100644 --- a/wa-system/webasyst/lib/config/app.php +++ b/wa-system/webasyst/lib/config/app.php @@ -3,8 +3,8 @@ return array( 'name' => 'Webasyst', 'prefix' => 'webasyst', - 'version' => '2.3.2', - 'critical' => '2.3.2', + 'version' => '2.3.3', + 'critical' => '2.3.3', 'vendor' => 'webasyst', 'csrf' => true, 'header_items' => array( diff --git a/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.mo b/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.mo index 29eeb72e6..f3a137a6d 100644 Binary files a/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.mo and b/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.mo differ diff --git a/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.po b/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.po index 299bcd7b7..a9cf2787b 100755 --- a/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.po +++ b/wa-system/webasyst/locale/en_US/LC_MESSAGES/webasyst.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: WebAsyst\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-09-22 09:47+0300\n" +"PO-Revision-Date: 2021-09-27 12:26+0300\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -1982,9 +1982,6 @@ msgstr "" msgid "Select how email messages must be sent by default from your Webasyst." msgstr "" -msgid "If you use different sender email addresses in your apps, then you can add extra rules to send messages from those addresses. Emails from other addresses will be sent via the transport selected in “Default” section." -msgstr "" - msgid "Add email sending rule" msgstr "" diff --git a/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.mo b/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.mo index 8f3879b37..32cc668c3 100644 Binary files a/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.mo and b/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.mo differ diff --git a/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.po b/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.po index 60bf389b1..ccffbfeb1 100755 --- a/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.po +++ b/wa-system/webasyst/locale/ru_RU/LC_MESSAGES/webasyst.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: WebAsyst\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-09-22 09:47+0300\n" +"PO-Revision-Date: 2021-09-28 13:19+0300\n" "Last-Translator: Webasyst\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -12,7 +12,7 @@ msgstr "" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-Basepath: .\n" "Language: ru_RU\n" -"X-Generator: Poedit 2.0.6\n" +"X-Generator: Poedit 2.4.3\n" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-1: .\n" @@ -4321,8 +4321,8 @@ msgstr "Выберите, каким способом должны по умол msgid "Default" msgstr "По умолчанию" -msgid "If you use different sender email addresses in your apps, then you can add extra rules to send messages from those addresses. Emails from other addresses will be sent via the transport selected in “Default” section." -msgstr "Если вы используете разные адреса отправителей в отдельных приложениях, то для них можно настроить дополнительные правила отправки сообщений. Для всех остальных адресов будет использоваться способ отправки, выбранный в секции «По умолчанию»." +msgid "The email sending parameters specified below are used by default for all outgoing email messages. If you need to use other parameters for all or certain sender addresses or domains then add extra rules using the “%s” button." +msgstr "Указанные ниже параметры отправки используются по умолчанию для всех исходящих email-сообщений. Если вам нужно использовать другие параметры отправки для всех или выбранных адресов или отдельных доменов, добавьте дополнительные правила с помощью кнопки «%s»." msgid "Email transport" msgstr "Email транспорт" @@ -6525,3 +6525,9 @@ msgstr "Выберите файл" msgid "Unable to delete certain files." msgstr "Не удалось удалить некоторые файлы." + +msgid "Default sending parameters" +msgstr "Параметры отправки по умолчанию" + +msgid "Additional sending parameters" +msgstr "Дополнительные параметры отправки" diff --git a/wa-system/webasyst/templates/actions-legacy/settings/SettingsEmail.html b/wa-system/webasyst/templates/actions-legacy/settings/SettingsEmail.html index c73cdba29..58c936710 100644 --- a/wa-system/webasyst/templates/actions-legacy/settings/SettingsEmail.html +++ b/wa-system/webasyst/templates/actions-legacy/settings/SettingsEmail.html @@ -17,7 +17,6 @@ {/if}
    {if $key == 'default'} -

    [s`Default`]

    {else} @@ -227,20 +226,32 @@

    [s`Email settings`]

    {* Editor for wa-config/mail.php *} -
    - [s`Select how email messages must be sent by default from your Webasyst.`] + +

    [s`Default sending parameters`]

    + +
    {sprintf(_ws('The email sending parameters specified below are used by default for all outgoing email messages. If you need to use other parameters for all or certain sender addresses or domains then add extra rules using the “%s” button.'), _ws('Add email sending rule'))}
    + +
    +
    + {_renderConfig key='default' config=$main_configs.default is_template=false} +
    + + +

    [s`Additional sending parameters`]

    + + + [s`Add email sending rule`] + +
    {foreach $main_configs as $key => $config} - {_renderConfig key=$key config=$config is_template=false} + {if $key !== 'default'} + {_renderConfig key=$key config=$config is_template=false} + {/if} {/foreach}
    -
    [s`If you use different sender email addresses in your apps, then you can add extra rules to send messages from those addresses. Emails from other addresses will be sent via the transport selected in “Default” section.`]
    - - - [s`Add email sending rule`] -
    {* Editor for wa-config/mail.php *} - {*

    - [s`Select how email messages must be sent by default from your Webasyst.`] -

    *} + +

    [s`Default sending parameters`]

    +

    {sprintf(_ws('The email sending parameters specified below are used by default for all outgoing email messages. If you need to use other parameters for all or certain sender addresses or domains then add extra rules using the “%s” button.'), _ws('Add email sending rule'))}

    + +
    + {_renderConfig key='default' config=$main_configs.default is_template=false} +
    + +

    [s`Additional sending parameters`]

    + + [s`Add email sending rule`] +
    {foreach $main_configs as $key => $config} - {_renderConfig key=$key config=$config is_template=false} + {if $key !== 'default'} + {_renderConfig key=$key config=$config is_template=false} + {/if} {/foreach}
    -

    [s`If you use different sender email addresses in your apps, then you can add extra rules to send messages from those addresses. Emails from other addresses will be sent via the transport selected in “Default” section.`]

    - [s`Add email sending rule`]