From b56efe9b0bedceae6b253d792ea751daa2149a93 Mon Sep 17 00:00:00 2001 From: Christian Cable Date: Mon, 11 Jun 2018 14:42:18 +0100 Subject: [PATCH 1/6] replacing redactor 2 files with redactor 3 files --- public/css/redactor.css | 1962 +-- public/js/redactor.js | 28114 ++++++++++++++++++++++++-------------- 2 files changed, 18691 insertions(+), 11385 deletions(-) diff --git a/public/css/redactor.css b/public/css/redactor.css index 43f0dbcf..74629e6f 100644 --- a/public/css/redactor.css +++ b/public/css/redactor.css @@ -1,772 +1,1052 @@ /* - Redactor II + Redactor 3 - http://imperavi.com/redactor/ + http://imperavi.com/redactor/ - Copyright (c) 2009-2016, Imperavi Oy. - License: http://imperavi.com/redactor/license/ + Copyright (c) 2009-2018, Imperavi LLC. + License: http://imperavi.com/redactor/license/ */ -.redactor-box { - position: relative; - overflow: visible; } +@keyframes fadeIn { + from { + opacity: 0; } + to { + opacity: 1; } } -.redactor-editor, -.redactor-box { - background: #fff; } +@keyframes fadeOut { + from { + opacity: 1; } + to { + opacity: 0; } } -.redactor-editor, -.redactor-box, -.redactor-box textarea { - z-index: auto; } +.redactor-animate-hide { + display: none !important; } -.redactor-link-tooltip { - z-index: 99; } +.redactor-fadeIn { + opacity: 0; + animation: fadeIn .5s ease-in-out; } -.redactor-toolbar { - z-index: 100; } +.redactor-fadeOut { + opacity: 1; + animation: fadeOut .5s ease-in-out; } + +@font-face { + font-family: 'Redactor'; + src: url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBkcAAAC8AAAAYGNtYXAXVtKwAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zuxdz/8AAAF4AAAkQGhlYWQPMte3AAAluAAAADZoaGVhB7gD6wAAJfAAAAAkaG10eK4BD60AACYUAAAAuGxvY2GyjqiGAAAmzAAAAF5tYXhwADkBcwAAJywAAAAgbmFtZVDOJQoAACdMAAABknBvc3QAAwAAAAAo4AAAACAAAwP0AZAABQAAApkCzAAAAI8Cm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QAARUEAABABAAAgAQAAQAEAADQBAAAwAQAAAAEAABeBAAAAAQAAEAAAAAAAAoAFAAeAGwAugEIAXgBxAImApIDPAOOA8QD+ATUBRAFWAV6BeIGYAbaBxYHcAfYB+YIBgiuCUAJmgoSCpwK8AtEDEAMmAzwDSANnA3ADhAOWg7wELYRNhIgAAAAAQAAAC4BcQAKAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAgAAAABAAAAAAACAAcAaQABAAAAAAADAAgAOQABAAAAAAAEAAgAfgABAAAAAAAFAAsAGAABAAAAAAAGAAgAUQABAAAAAAAKABoAlgADAAEECQABABAACAADAAEECQACAA4AcAADAAEECQADABAAQQADAAEECQAEABAAhgADAAEECQAFABYAIwADAAEECQAGABAAWQADAAEECQAKADQAsFJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AclZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMFJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AclJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AclJlZ3VsYXIAUgBlAGcAdQBsAGEAclJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AckZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype"); + font-weight: normal; + font-style: normal; } + +[class^="re-icon-"], [class*=" re-icon-"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'Redactor' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } -.redactor-box-fullscreen { - z-index: 1051; } +.re-icon-aligncenter:before { + content: "\e900"; } -.redactor-air, -.redactor-dropdown { - z-index: 1052; } +.re-icon-alignment:before, +.re-icon-alignleft:before { + content: "\e901"; } -#redactor-modal-overlay, -#redactor-modal-box, -#redactor-modal { - z-index: 1053; } +.re-icon-alignright:before { + content: "\e902"; } -.redactor-body-fullscreen .redactor-link-tooltip { - z-index: 1099; } +.re-icon-bold:before { + content: "\e903"; } -.redactor-box-fullscreen { - position: fixed; - top: 0; - left: 0; - width: 100%; } +.re-icon-bookmark:before { + content: "\e904"; } -.redactor-placeholder:after { - position: absolute; - top: 20px; - left: 20px; - content: attr(placeholder); - display: block; - color: rgba(0, 0, 0, 0.3); - font-weight: normal !important; } +.re-icon-clips:before { + content: "\e905"; } -.redactor-editor { - position: relative; - overflow: auto; - margin: 0; - padding: 24px 32px 12px 32px; - outline: none; - white-space: normal; - border: 1px solid rgba(0, 0, 0, 0.07); } +.re-icon-codesnippets:before { + content: "\e906"; } -.redactor-relative { - position: relative; } +.re-icon-deleted:before { + content: "\e907"; } -.redactor-in { - cursor: text; } +.re-icon-expand:before { + content: "\e908"; } -.redactor-editor:focus, -.redactor-in:focus { - outline: none; } +.re-icon-file:before { + content: "\e909"; } -.redactor-scrollbar-measure { - position: absolute; - top: -9999px; - width: 50px; - height: 50px; - overflow: scroll; } +.re-icon-fontcolor:before { + content: "\e90a"; } -.redactor-script-tag { - display: none; } +.re-icon-fontfamily:before { + content: "\e90b"; } -.redactor-editor-img-edit img { - cursor: pointer; } +.re-icon-fontsize:before { + content: "\e90c"; } -.redactor-voice-label { - display: none; } +.re-icon-format:before { + content: "\e90d"; } -.redactor-voice-alert { - position: absolute; - left: -3000px; } +.re-icon-html:before { + content: "\e90e"; } -.redactor-toolbar { - position: relative; - padding: 0 !important; - background: #fff; - border: none; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); } - .redactor-toolbar:after { - content: ""; - display: table; - clear: both; } +.re-icon-imagecenter:before { + content: "\e90f"; } -.redactor-toolbar li a { - color: rgba(0, 0, 0, 0.75); } - .redactor-toolbar li a:hover { - outline: none; - background-color: #3d79f2; - color: #fff; } - .redactor-toolbar li a:active, .redactor-toolbar li a.redactor-act { - outline: none; - background-color: #eee; - color: #444; } +.re-icon-imageleft:before { + content: "\e910"; } -.redactor-toolbar li a.redactor-button-disabled { - opacity: 0.3; } - .redactor-toolbar li a.redactor-button-disabled:hover { - color: #333; - outline: none; - background-color: transparent !important; - cursor: default; } +.re-icon-imageright:before { + content: "\e911"; } -.redactor-toolbar li a.redactor-button-focus { - color: #fff; - background: #000; } +.re-icon-image:before { + content: "\e912"; } -.redactor-toolbar.redactor-toolbar-external { - z-index: 999; - border: 1px solid rgba(0, 0, 0, 0.1); } +.re-icon-indent:before { + content: "\e913"; } -.redactor-air { - position: absolute; - background: rgba(0, 0, 0, 0.9); - padding: 0; - max-width: 600px; - min-width: 200px; - border-radius: 4px; - border: none; } +.re-icon-inline:before { + content: "\e914"; } -.redactor-air li a { - color: rgba(255, 255, 255, 0.75); } - .redactor-air li a:hover { - outline: none; - background-color: #1f78d8; - color: #fff; } - .redactor-air li a:active, .redactor-air li a.redactor-act { - outline: none; - background-color: #333; - color: rgba(255, 255, 255, 0.5); } +.re-icon-italic:before { + content: "\e915"; } -.redactor-air li a.redactor-button-disabled { - opacity: .3; } - .redactor-air li a.redactor-button-disabled:hover { - color: rgba(255, 255, 255, 0.3); - outline: none; - background-color: transparent !important; - cursor: default; } +.re-icon-line:before, +.re-icon-horizontalrule:before { + content: "\e916"; } -.redactor-air li a.redactor-button-focus { - color: #333; - background: #eee; } +.re-icon-link:before { + content: "\e917"; } -.redactor-air, -.redactor-toolbar { - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - margin: 0 !important; - list-style: none !important; - line-height: 1 !important; } +.re-icon-ol:before, +.re-icon-ordered:before { + content: "\e918"; } -.redactor-air li, -.redactor-toolbar li { - vertical-align: top; - display: inline-block; - margin: 0 !important; - padding: 0 !important; - outline: none; - list-style: none !important; } +.re-icon-outdent:before { + content: "\e919"; } -.redactor-air li a, -.redactor-toolbar li a { - font-size: 13px; - display: block; - text-align: center; - padding: 15px 14px 14px; - cursor: pointer; - outline: none; - border: none; - line-height: 1; - text-decoration: none; - cursor: pointer; - zoom: 1; } - .redactor-air li a.re-bold, - .redactor-toolbar li a.re-bold { - font-weight: bold; } - .redactor-air li a.re-italic, - .redactor-toolbar li a.re-italic { - font-style: italic; } - .redactor-air li a.re-deleted, - .redactor-toolbar li a.re-deleted { - text-decoration: line-through; } - .redactor-air li a.re-underline, - .redactor-toolbar li a.re-underline { - text-decoration: underline; } +.re-icon-properties:before { + content: "\e91a"; } -.redactor-link-tooltip { - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - position: absolute; - padding: 10px; - line-height: 1; - display: inline-block; - background-color: #000; - color: #555 !important; - font-size: 12px; } +.re-icon-readmore:before { + content: "\e91b"; } -.redactor-link-tooltip a { - font-size: 12px; - color: #ccc; - margin: 0 5px; - text-decoration: none; } - .redactor-link-tooltip a:hover { - color: #fff; } +.re-icon-redo:before { + content: "\e91c"; } -.redactor-structure h1, .redactor-structure h2, .redactor-structure h3, .redactor-structure h4, .redactor-structure h5, .redactor-structure h6, .redactor-structure div { - position: relative; } - .redactor-structure h1:before, .redactor-structure h2:before, .redactor-structure h3:before, .redactor-structure h4:before, .redactor-structure h5:before, .redactor-structure h6:before, .redactor-structure div:before { - width: 24px; - position: absolute; - font-size: 10px; - font-weight: normal; - opacity: .3; - left: -32px; - text-align: right; } +.re-icon-retract:before { + content: "\e91d"; } -.redactor-structure h1:before { - content: "H1"; } +.re-icon-specialcharacters:before { + content: "\e91e"; } -.redactor-structure h2:before { - content: "H2"; } +.re-icon-sub:before { + content: "\e91f"; } -.redactor-structure h3:before { - content: "H3"; } +.re-icon-sup:before { + content: "\e920"; } -.redactor-structure h4:before { - content: "H4"; } +.re-icon-table:before { + content: "\e921"; } -.redactor-structure h5:before { - content: "H5"; } +.re-icon-textdirection:before { + content: "\e922"; } -.redactor-structure h6:before { - content: "H6"; } +.re-icon-toggle:before { + content: "\e923"; } -.redactor-structure div:before { - content: "DIV"; } +.re-icon-underline:before { + content: "\e924"; } + +.re-icon-undo:before { + content: "\e925"; } + +.re-icon-ul:before, +.re-icon-lists:before, +.re-icon-unordered:before { + content: "\e926"; } -#redactor-image-box { +.re-icon-variable:before { + content: "\e927"; } + +.re-icon-video:before { + content: "\e928"; } + +.re-icon-widget:before { + content: "\e929"; } + +.redactor-box, +.redactor-box textarea { + z-index: auto; } + +.redactor-box { + position: relative; + box-sizing: border-box; } + .redactor-box.redactor-styles-on { + margin: 0; + padding: 0; + background: #fff; + border: 1px solid rgba(0, 0, 0, 0.075); + border-radius: 3px; + box-shadow: none; } + .redactor-box.redactor-inline { + position: static; } + +.redactor-focus.redactor-styles-on, +.redactor-focus:focus.redactor-styles-on { + border-color: #82b7ec !important; } + +.redactor-over:hover.redactor-styles-on { + border-color: #ee698a !important; } + +.redactor-source-view, +.redactor-source-view.redactor-styles-on { + border-color: #000 !important; } + +.redactor-in { position: relative; - max-width: 100%; + overflow: auto; + white-space: normal; + box-sizing: border-box; } + .redactor-in:focus { + outline: none; } + +.redactor-inline .redactor-in { + overflow: hidden; } + +.redactor-in *, +.redactor-read-only * { + outline: none !important; } + +.redactor-in h1:empty, +.redactor-in h2:empty, +.redactor-in h3:empty, +.redactor-in h4:empty, +.redactor-in h5:empty, +.redactor-in h6:empty, +.redactor-in p:empty, +.redactor-in blockquote:empty { + min-height: 1.5em; } + +.redactor-in strong:empty, .redactor-in b:empty, .redactor-in em:empty, .redactor-in i:empty, .redactor-in span:empty, .redactor-in sup:empty, .redactor-in sub:empty, .redactor-in u:empty, .redactor-in ins:empty { display: inline-block; - line-height: 0; - outline: 1px dashed rgba(0, 0, 0, 0.6); } + min-width: 1px; + min-height: 1rem; } + +.redactor-in table { + empty-cells: show; } + +.redactor-in li figure { + width: auto; + display: inline-block; + margin: 0; + vertical-align: top; } + +.redactor-in figcaption:focus, +.redactor-in figure code:focus, +.redactor-in figure pre:focus, +.redactor-in table td:focus, +.redactor-in table th:focus { + outline: none; } + +.redactor-in figure[data-redactor-type=line] { + margin-top: 1em; + padding: 6px 0; + vertical-align: baseline; } + .redactor-in figure[data-redactor-type=line] hr { + margin: 0; + height: 3px; + border: none; + background: rgba(0, 0, 0, 0.1); } + +.redactor-component { + position: relative; } -#redactor-image-editter { +.redactor-component[data-redactor-type="widget"]:before, +.redactor-component[data-redactor-type="video"]:before { + width: 100%; + height: 100%; + content: ""; + display: block; position: absolute; - z-index: 5; - top: 50%; - left: 50%; - margin-top: -11px; - margin-left: -18px; - line-height: 1; - background-color: #000; + z-index: 1; } + +.redactor-component[data-redactor-type=image], +.redactor-component[data-redactor-type=widget] { + clear: both; } + +.redactor-component[data-redactor-type=variable] { + white-space: nowrap; + background: rgba(0, 125, 255, 0.75); color: #fff; - font-size: 11px; - padding: 7px 10px; + display: inline-block; + padding: 3px 6px; + line-height: 1; + border-radius: 4px; cursor: pointer; } -#redactor-image-resizer { +.redactor-component-active { + outline: 5px solid rgba(0, 125, 255, 0.5) !important; } + +.redactor-component-active[data-redactor-type=image] { + outline: none !important; } + .redactor-component-active[data-redactor-type=image] img { + outline: 5px solid rgba(0, 125, 255, 0.5) !important; } + +.redactor-component-active[data-redactor-type=variable] { + outline: none !important; + background: #ee698a; } + +.redactor-component-active[data-redactor-type=video] { + outline: none !important; } + .redactor-component-active[data-redactor-type=video] iframe { + outline: 5px solid rgba(0, 125, 255, 0.5) !important; } + +.redactor-blur.redactor-styles-on .redactor-component-active { + outline: 5px solid #ddd !important; } + .redactor-blur.redactor-styles-on .redactor-component-active[data-redactor-type=image] { + outline: none !important; } + .redactor-blur.redactor-styles-on .redactor-component-active[data-redactor-type=image] img { + outline: 5px solid #ddd !important; } + .redactor-blur.redactor-styles-on .redactor-component-active[data-redactor-type=video] { + outline: none !important; } + .redactor-blur.redactor-styles-on .redactor-component-active[data-redactor-type=video] iframe { + outline: 5px solid #ddd !important; } + .redactor-blur.redactor-styles-on .redactor-component-active[data-redactor-type=variable] { + outline: none !important; + background: #ddd; } + +.redactor-component-caret { position: absolute; - z-index: 2; - line-height: 1; - cursor: nw-resize; - bottom: -4px; - right: -5px; - border: 1px solid #fff; - background-color: #000; - width: 8px; - height: 8px; } + left: -9999px; } -#redactor-droparea { - position: relative; - overflow: hidden; - padding: 64px 24px; - border: 3px dashed rgba(0, 0, 0, 0.1); } - -#redactor-droparea.drag-hover { - background: rgba(200, 222, 250, 0.75); } +.redactor-textnodes-wrapper { + display: inline-block; } -#redactor-droparea.drag-drop { - background: rgba(250, 248, 200, 0.5); } +#redactor-image-resizer { + position: absolute; + background-color: rgba(0, 125, 255, 0.9); + width: 13px; + height: 13px; + border: 1px solid #fff; + cursor: move; + cursor: nwse-resize; } -#redactor-droparea-placeholder { - text-align: center; - font-size: 12px; - margin-left: 64px; - color: rgba(0, 0, 0, 0.7); } +.redactor-file-item { + display: inline-block; + line-height: 1; + padding: 4px 12px; + border-radius: 16px; + border: 1px solid rgba(0, 0, 0, 0.2); } -.redactor-image-dragover { - outline: 2px solid #3d79f2; } +.redactor-file-remover { + margin-left: 2px; + position: relative; + right: -3px; + display: inline-block; + padding: 0 3px; + cursor: pointer; + opacity: .5; } + .redactor-file-remover:hover { + opacity: 1; } -#redactor-progress { +#redactor-overlay { position: fixed; + z-index: 1051; top: 0; left: 0; + right: 0; + bottom: 0; + background-color: rgba(16, 16, 18, 0.18); } + #redactor-overlay > .redactor-close { + position: fixed; + top: 1rem; + right: 1rem; } + +.redactor-source, +.redactor-source:hover, +.redactor-source:focus { + text-align: left; + box-sizing: border-box; + font-family: Consolas, Menlo, Monaco, "Courier New", monospace; width: 100%; - z-index: 1000000; - height: 10px; } - -#redactor-progress span { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); - -webkit-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; display: block; - width: 100%; - height: 100%; - background-color: #3d58a8; - background-size: 40px 40px; } + margin: 0; + border: none; + box-shadow: none; + border-radius: 0; + background: #252525; + color: #ccc; + font-size: 15px; + outline: none; + padding: 10px 18px 20px 18px; + line-height: 1.5; + resize: vertical; } -@-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; } - to { - background-position: 0 0; } } +.redactor-box[dir="rtl"] .redactor-source { + direction: ltr; } -@-o-keyframes progress-bar-stripes { - from { - background-position: 40px 0; } - to { - background-position: 0 0; } } +.redactor-placeholder:before { + position: absolute; + content: attr(placeholder); + color: rgba(0, 0, 0, 0.4); + font-weight: normal; } -@keyframes progress-bar-stripes { - from { - background-position: 40px 0; } - to { - background-position: 0 0; } } +.redactor-in figcaption[placeholder]:empty:before { + content: attr(placeholder); + color: rgba(0, 0, 0, 0.4); + font-weight: normal; } -.animated { - -webkit-animation-duration: 1s; - animation-duration: 1s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; } +.redactor-in figcaption[placeholder]:empty:focus:before { + content: ""; } -@-webkit-keyframes redactorSlideUp { - to { - padding-top: 0; - padding-bottom: 0; - height: 0; } } +.redactor-statusbar { + font-family: Consolas, Menlo, Monaco, "Courier New", monospace; + margin: 0; + padding: 8px 10px; + position: relative; + overflow: hidden; + list-style: none; + background: #f8f8f8; + box-sizing: border-box; + border: none; } + .redactor-statusbar li { + float: left; + font-size: 12px; + color: rgba(0, 0, 0, 0.5); + padding: 0 10px; + line-height: 16px; + border-right: 1px solid rgba(0, 0, 0, 0.1); } + .redactor-statusbar li:last-child { + border-right-color: transparent; } + .redactor-statusbar a { + color: rgba(0, 0, 0, 0.5); + text-decoration: underline; } + .redactor-statusbar a:hover { + color: #f03c69; + text-decoration: underline; } + .redactor-statusbar:empty { + display: none; } -@keyframes redactorSlideUp { - to { - padding-top: 0; - padding-bottom: 0; - height: 0; } } +.redactor-toolbar-wrapper { + position: relative; } -.redactor-slideUp { - overflow: hidden; - -webkit-animation-name: redactorSlideUp; - animation-name: redactorSlideUp; } +.redactor-toolbar, +.redactor-air { + z-index: 100; + font-family: "Trebuchet MS", "Helvetica Neue", Helvetica, Tahoma, sans-serif; + position: relative; + margin: 0 !important; + padding: 0; + list-style: none !important; + line-height: 1 !important; + background: none; + border: none; + box-sizing: border-box; } -@-webkit-keyframes redactorSlideDown { - from { - height: 0; - padding-top: 0; - padding-bottom: 0; } } +.redactor-box.redactor-styles-on .redactor-toolbar { + padding: 18px 16px 0 16px; } -@keyframes redactorSlideDown { - from { - height: 0; - padding-top: 0; - padding-bottom: 0; } } +.redactor-toolbar a, +.redactor-air a { + display: inline-block; + box-sizing: border-box; + font-size: 14px; + text-align: center; + padding: 10px 15px 9px 15px; + cursor: pointer; + outline: none; + border: none; + vertical-align: middle; + text-decoration: none; + zoom: 1; + position: relative; + color: rgba(0, 0, 0, 0.85); + border-radius: 2px; + background: rgba(255, 255, 255, 0.97); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22); + margin-right: 5px; + margin-bottom: 4px; } + +.redactor-toolbar a.re-button-icon, +.redactor-air a.re-button-icon { + font-size: 16px; + padding: 9px 15px 6px 15px; } + +.redactor-toolbar a:hover, +.redactor-air a:hover { + outline: none; + color: #fff; + background: #449aef; } -.redactor-slideDown { - overflow: hidden; - -webkit-animation-name: redactorSlideDown; - animation-name: redactorSlideDown; } +.redactor-toolbar a.redactor-button-active { + background: rgba(245, 245, 245, 0.95); + color: rgba(0, 0, 0, 0.4); } -@-webkit-keyframes redactorFadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } +.redactor-toolbar a.redactor-button-disabled, +.redactor-air a.redactor-button-disabled { + opacity: 0.3; } + .redactor-toolbar a.redactor-button-disabled:hover, + .redactor-air a.redactor-button-disabled:hover { + color: #333; + outline: none; + background-color: transparent !important; + cursor: default; } -@keyframes redactorFadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } +.redactor-source-view .redactor-toolbar { + background: #252525; } -.redactor-fadeIn { - -webkit-animation-name: redactorFadeIn; - animation-name: redactorFadeIn; } +.redactor-source-view .redactor-toolbar a { + background: #000; + color: #fff; } + .redactor-source-view .redactor-toolbar a:hover { + background: #449aef; } -@-webkit-keyframes redactorFadeOut { - from { - opacity: 1; } - to { - opacity: 0; } } +.redactor-source-view .redactor-toolbar a.redactor-button-disabled:hover { + color: #fff !important; + background-color: #000 !important; } -@keyframes redactorFadeOut { - from { - opacity: 1; } - to { - opacity: 0; } } +.re-button-tooltip { + display: none; + position: absolute; + white-space: nowrap; + top: 0; + z-index: 1052; + background: rgba(0, 0, 0, 0.9); + border-radius: 3px; + padding: 5px 9px; + color: rgba(255, 255, 255, 0.8); + font-size: 12px; + line-height: 1; + font-family: Consolas, Menlo, Monaco, "Courier New", monospace; } + .re-button-tooltip:after { + bottom: 100%; + left: 50%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: none; + border-bottom-color: rgba(0, 0, 0, 0.9); + border-width: 4px; + margin-left: -4px; } -.redactor-fadeOut { - -webkit-animation-name: redactorFadeOut; - animation-name: redactorFadeOut; } +.redactor-toolbar-wrapper-air { + position: absolute; + z-index: 100; } -.redactor-dropdown { - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - min-width: 220px; - max-height: 254px; - color: #000; - margin: 0; - padding: 0; - font-size: 14px; - background: #fff; - box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); - overflow: auto; - list-style: none; } - -.redactor-dropdown li { - border-bottom: 1px solid rgba(0, 0, 0, 0.07); } - .redactor-dropdown li:last-child { - border-bottom: none; } - .redactor-dropdown li:hover { - background-color: #3d79f2; } - .redactor-dropdown li:hover a { - color: #fff !important; - text-decoration: none; } - .redactor-dropdown li.redactor-dropdown-link-inactive { - background: none; } - .redactor-dropdown li.redactor-dropdown-link-inactive a, - .redactor-dropdown li.redactor-dropdown-link-inactive a:hover { - background: none; - cursor: default; - color: #000 !important; - opacity: 0.4; - background: none; } +.redactor-air { + padding: 6px 3px 2px 8px; + max-width: 576px; + min-width: 200px; + border-radius: 4px; + background: rgba(0, 0, 0, 0.97); } -.redactor-dropdown a { - display: block; - padding: 16px 16px 15px 16px; - color: #000; - text-decoration: none; } - .redactor-dropdown a span { - padding: 1px 4px; - display: inline-block; - border-radius: 3px; - line-height: 1.4; } - .redactor-dropdown a:focus { - outline: none; } - .redactor-dropdown a.selected { - background-color: #000; - color: #fff; } - .redactor-dropdown a.redactor-dropdown-link-selected { - color: #fff; - background: #000; } +.redactor-air a { + background: rgba(37, 37, 37, 0.95); + box-shadow: none; + color: rgba(255, 255, 255, 0.9); } + +.redactor-air a:hover { + background: #3d79f2; } -.redactor-dropdown-box-inline .redactor-dropdown-marked span { - background-color: #ffd61e; +.redactor-air a.redactor-button-active { + background-color: rgba(255, 255, 255, 0.15); + color: #fff; } + +.redactor-air a.redactor-button-disabled:hover { + color: #fff; } + +.redactor-air-helper { + position: absolute; + right: 0; + top: 0; + line-height: 1; + font-size: 15px; color: #000; - text-decoration: none; } + background: rgba(255, 255, 255, 0.85); + border-bottom-left-radius: 4px; + padding: 7px 10px 6px 10px; + cursor: pointer; } + .redactor-air-helper:hover { + background: #fff; } -.redactor-dropdown-box-inline .redactor-dropdown-code span { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - background: rgba(0, 0, 0, 0.05); } +.redactor-voice-label { + display: none; } -.redactor-dropdown-box-inline .redactor-dropdown-sample span { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - background: #46a9fc; - color: rgba(255, 255, 255, 0.9); } +.redactor-context-toolbar { + position: absolute; + top: 0; + left: 0; + z-index: 1051; + background-color: rgba(0, 0, 0, 0.95); + color: #555; + border-radius: 4px; + padding: 6px 18px 7px 18px; + line-height: 1.5; + font-family: Consolas, Menlo, Monaco, "Courier New", monospace; } + .redactor-context-toolbar a { + font-size: 12px; + color: #ccc; + text-decoration: none; + display: inline-block; + padding: 2px 0 1px 12px; } + .redactor-context-toolbar a:first-child { + padding-left: 0; } + .redactor-context-toolbar a i { + position: relative; + top: 3px; + font-size: 16px; } + .redactor-context-toolbar a:before { + content: ''; + padding-left: 10px; + border-left: 1px solid rgba(255, 255, 255, 0.3); } + .redactor-context-toolbar a:hover { + color: #fff; } + .redactor-context-toolbar a:first-child:before { + padding-left: 0; + border-left: none; } -.redactor-dropdown-box-inline .redactor-dropdown-variable span { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - color: rgba(0, 0, 0, 0.5); } +.redactor-context-toolbar[dir="rtl"] a { + padding: 2px 12px 1px 0; } -.redactor-dropdown-box-inline .redactor-dropdown-shortcut span { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - background: #000; - color: rgba(255, 255, 255, 0.85); - white-space: nowrap; } +.redactor-context-toolbar[dir="rtl"] a:first-child { + padding-right: 0; } -.redactor-dropdown-box-inline .redactor-dropdown-cite span { - color: rgba(0, 0, 0, 0.5); - font-style: italic; } +.redactor-context-toolbar[dir="rtl"] a:before { + padding-left: 0px; + padding-right: 10px; + border-right: 1px solid rgba(255, 255, 255, 0.3); + border-left: none; } -.redactor-dropdown-box-inline .redactor-dropdown-sup span, -.redactor-dropdown-box-inline .redactor-dropdown-sub span { - font-size: 12px; } +.redactor-context-toolbar[dir="rtl"] a:first-child:before { + padding-right: 0; + border-right: none; } -.redactor-dropdown-box-format .redactor-dropdown-blockquote { +.redactor-dropdown { + font-family: "Trebuchet MS", "Helvetica Neue", Helvetica, Tahoma, sans-serif; + display: none; + position: absolute; + z-index: 1051; + background-color: #fff; + box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); + border-radius: 2px; + width: 264px; + max-height: 250px; + margin: 0; + margin-top: -1px; + overflow: auto; + font-size: 15px; + padding: 0; } + .redactor-dropdown a span { + display: inline-block; + line-height: 1; + padding: 2px 4px; + border-radius: 3px; } + .redactor-dropdown a { + display: block; + text-decoration: none; + padding: 10px 8px; + white-space: nowrap; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); } + .redactor-dropdown a:last-child { + border-bottom-color: transparent; } + .redactor-dropdown a { + color: #000; } + .redactor-dropdown a:hover { + color: #fff !important; + background-color: #449aef !important; } + .redactor-dropdown a.redactor-dropdown-item-disabled { + color: rgba(0, 0, 0, 0.4); + background: #fff; } + +.redactor-dropdown-cells { + margin: 10px auto; } + .redactor-dropdown-cells a, + .redactor-dropdown-cells span { + float: left; + cursor: pointer; + box-sizing: border-box; + text-align: center; + padding: 0; + margin: 0; + font-size: 14px; } + +.redactor-dropdown-selector { + display: flex; + text-align: center; } + .redactor-dropdown-selector span { + flex-grow: 1; + font-size: 12px; + padding: 8px; + cursor: pointer; } + .redactor-dropdown-selector span:hover { + background: #eee; } + .redactor-dropdown-selector span.active { + cursor: text; + color: rgba(0, 0, 0, 0.3); + background: #eee; } + +.redactor-dropdown-format .redactor-dropdown-item-blockquote { color: rgba(0, 0, 0, 0.4); font-style: italic; } -.redactor-dropdown-box-format .redactor-dropdown-pre { +.redactor-dropdown-format .redactor-dropdown-item-pre { font-family: monospace, sans-serif; } -.redactor-dropdown-box-format .redactor-dropdown-h1, -.redactor-dropdown-box-format .redactor-dropdown-h2, -.redactor-dropdown-box-format .redactor-dropdown-h3, -.redactor-dropdown-box-format .redactor-dropdown-h4, -.redactor-dropdown-box-format .redactor-dropdown-h5, -.redactor-dropdown-box-format .redactor-dropdown-h6 { - line-height: 24px; - font-weight: bold; } - -.redactor-dropdown-box-format .redactor-dropdown-h1 { +.redactor-dropdown-format .redactor-dropdown-item-h1 { font-size: 40px; + font-weight: bold; line-height: 32px; } -.redactor-dropdown-box-format .redactor-dropdown-h2 { +.redactor-dropdown-format .redactor-dropdown-item-h2 { font-size: 32px; + font-weight: bold; line-height: 32px; } -.redactor-dropdown-box-format .redactor-dropdown-h3 { - font-size: 24px; } +.redactor-dropdown-format .redactor-dropdown-item-h3 { + font-size: 24px; + font-weight: bold; + line-height: 24px; } -.redactor-dropdown-box-format .redactor-dropdown-h4 { - font-size: 18px; } +.redactor-dropdown-format .redactor-dropdown-item-h4 { + font-size: 21px; + font-weight: bold; + line-height: 24px; } -.redactor-dropdown-box-format .redactor-dropdown-h5 { - font-size: 16px; } +.redactor-dropdown-format .redactor-dropdown-item-h5 { + font-size: 18px; + font-weight: bold; + line-height: 24px; } -.redactor-dropdown-box-format .redactor-dropdown-h6 { +.redactor-dropdown-format .redactor-dropdown-item-h6 { font-size: 14px; text-transform: uppercase; - letter-spacing: .04em; } + font-weight: bold; + line-height: 24px; } -#redactor-modal-overlay { - position: fixed; - top: 0; - left: 0; - margin: auto; - overflow: auto; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.6); } - -#redactor-modal-box { +#redactor-modal { position: fixed; top: 0; left: 0; bottom: 0; right: 0; overflow-x: hidden; - overflow-y: auto; } + overflow-y: auto; + z-index: 1051; + font-family: "Trebuchet MS", "Helvetica Neue", Helvetica, Tahoma, sans-serif; + line-height: 24px; } -#redactor-modal { +.redactor-modal { position: relative; - margin: auto; - margin-top: 16px; + margin: 16px auto; padding: 0; background: #fff; - color: #000; - border-radius: 5px; - box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - font-size: 14px; } - @media (max-width: 768px) { - #redactor-modal { - font-size: 16px !important; } } - #redactor-modal #redactor-modal-header { - border-top-right-radius: 5px; - border-top-left-radius: 5px; - padding: 20px 24px; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 2px 15px rgba(80, 80, 80, 0.25); + border-radius: 3px; + color: #000; } + .redactor-modal form { + margin: 0; + padding: 0; + box-sizing: border-box; } + .redactor-modal input, + .redactor-modal select, + .redactor-modal textarea { + box-sizing: border-box; + display: block; + width: 100%; + font-family: inherit; font-size: 16px; - font-weight: bold; - color: #000; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); - background: #f5f5f5; } - #redactor-modal #redactor-modal-close { - position: absolute; - top: 10px; - right: 4px; - width: 30px; height: 40px; - text-align: center; - color: rgba(0, 0, 0, 0.4); - font-size: 30px; - font-weight: 300; - cursor: pointer; + outline: none; + vertical-align: middle; + background-color: #fff; + border: 1px solid #cacfd4; + border-radius: 0.1875em; + box-shadow: none; + padding: 0 .5em; } + .redactor-modal textarea { + padding: .5em; + height: auto; + line-height: 1.5; + vertical-align: top; } + .redactor-modal select { -webkit-appearance: none; + background-image: url('data:image/svg+xml;utf8,'); + background-repeat: no-repeat; + background-position: right .65em center; + padding-right: 28px; } + .redactor-modal select[multiple] { + background-image: none; + height: auto; + padding: .5em .75em; } + .redactor-modal input[type="file"] { + width: auto; + border: none; padding: 0; - border: 0; + height: auto; background: none; - outline: none; } - #redactor-modal #redactor-modal-close:hover { - color: #000; } - #redactor-modal #redactor-modal-body { - overflow: auto; - padding: 40px 48px 24px 48px; } - #redactor-modal #redactor-modal-body section { - margin-bottom: 24px; } - #redactor-modal #redactor-modal-body label { - font-weight: bold; - font-size: 12px; - display: block; - margin-bottom: 4px; } - #redactor-modal #redactor-modal-body label .desc { - font-weight: normal; - color: rgba(0, 0, 0, 0.5); } - #redactor-modal #redactor-modal-body label.checkbox { - font-weight: normal; - font-size: inherit; } - @media (max-width: 768px) { - #redactor-modal #redactor-modal-body { - padding: 24px; } } - #redactor-modal select, - #redactor-modal input[type="text"], - #redactor-modal input[type="password"], - #redactor-modal input[type="email"], - #redactor-modal input[type="url"], - #redactor-modal textarea { - box-sizing: border-box; + box-shadow: none; + display: inline-block; } + .redactor-modal input[type="radio"], + .redactor-modal input[type="checkbox"] { + display: inline-block; + width: auto; + height: auto; + padding: 0; + vertical-align: middle; position: relative; - z-index: 2; - margin: 0; - padding: 8px; - height: 40px; - border: 1px solid #ddd; + bottom: 0.15rem; + font-size: 115%; + margin-right: 3px; } + .redactor-modal .form-item { + margin-bottom: 20px; } + .redactor-modal .form-item:last-child { + margin-bottom: 0; } + .redactor-modal fieldset { + border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 3px; - background-color: white; - box-shadow: none; - color: #333; - width: 100%; - font-size: 14px; - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; } - @media (max-width: 768px) { - #redactor-modal select, - #redactor-modal input[type="text"], - #redactor-modal input[type="password"], - #redactor-modal input[type="email"], - #redactor-modal input[type="url"], - #redactor-modal textarea { - font-size: 16px; } } - #redactor-modal select:focus, - #redactor-modal input[type="text"]:focus, - #redactor-modal input[type="password"]:focus, - #redactor-modal input[type="email"]:focus, - #redactor-modal input[type="url"]:focus, - #redactor-modal textarea:focus { - -moz-transition: border 0.3s ease-in; - transition: border 0.3s ease-in; - outline: none; - border-color: #aaa; } - #redactor-modal textarea { + padding: 16px; + padding-bottom: 20px; + margin-bottom: 20px; } + .redactor-modal fieldset .form-item { + margin-bottom: 12px; } + .redactor-modal label { display: block; - line-height: 1.4em; } - #redactor-modal button { - padding: 13px 24px 14px 24px; - margin: 0; - margin-bottom: 8px; - margin-right: 8px; - height: 40px; + color: #555; + margin-bottom: 0.25em; + font-size: 14px; } + .redactor-modal label .desc, + .redactor-modal label .success, + .redactor-modal label .error { + text-transform: none; + font-weight: normal; } + .redactor-modal label.checkbox { + font-size: 16px; + line-height: 1.5; + cursor: pointer; + color: inherit; } + .redactor-modal .form-checkboxes label.checkbox { + display: inline-block; + margin-right: 1em; } + .redactor-modal input:hover, + .redactor-modal textarea:hover, + .redactor-modal select:hover { + outline: none; + background-color: #fff; + border-color: #969fa9; + box-shadow: none; } + .redactor-modal input:focus, + .redactor-modal textarea:focus, + .redactor-modal select:focus { + transition: all linear .2s; outline: none; - border: 1px solid transparent; - border-radius: 4px; - background-color: #eee; + background-color: #fff; + border-color: rgba(0, 125, 255, 0.5); + box-shadow: 0 0 3px rgba(0, 125, 255, 0.5); } + .redactor-modal input.error, + .redactor-modal textarea.error, + .redactor-modal select.error { + background-color: rgba(255, 50, 101, 0.1); + border: 1px solid #ff7f9e; } + .redactor-modal input.error:focus, + .redactor-modal textarea.error:focus, + .redactor-modal select.error:focus { + border-color: #ff3265; + box-shadow: 0 0 1px #ff3265; } + .redactor-modal input.success, + .redactor-modal textarea.success, + .redactor-modal select.success { + background-color: rgba(47, 196, 182, 0.1); + border: 1px solid #65dacf; } + .redactor-modal input.success:focus, + .redactor-modal textarea.success:focus, + .redactor-modal select.success:focus { + border-color: #2fc4b6; + box-shadow: 0 0 1px #2fc4b6; } + .redactor-modal input:disabled, .redactor-modal input:disabled:hover, .redactor-modal input.disabled, .redactor-modal input.disabled:hover, + .redactor-modal textarea:disabled, + .redactor-modal textarea:disabled:hover, + .redactor-modal textarea.disabled, + .redactor-modal textarea.disabled:hover, + .redactor-modal select:disabled, + .redactor-modal select:disabled:hover, + .redactor-modal select.disabled, + .redactor-modal select.disabled:hover { + resize: none; + opacity: .6; + cursor: default; + font-style: italic; + color: rgba(0, 0, 0, 0.5); + border: 1px solid #cacfd4; + box-shadow: none; + background-color: #fff; } + .redactor-modal .req { + position: relative; + top: 1px; + font-weight: bold; + color: #ff3265; + font-size: 110%; } + .redactor-modal .desc { + color: rgba(51, 51, 51, 0.5); + font-size: 12px; } + .redactor-modal span.desc { + margin-left: 0.25em; } + .redactor-modal div.desc { + margin-top: 0.25em; } + .redactor-modal span.success, + .redactor-modal span.error { + font-size: 12px; + margin-left: 0.25em; } + .redactor-modal div.desc { + margin-bottom: -0.5em; } + .redactor-modal .redactor-close { + position: absolute; + top: 16px; + right: 12px; + font-size: 30px; + line-height: 30px; + padding: 0px 4px; color: #000; + opacity: .3; + cursor: pointer; } + .redactor-modal .redactor-close:hover { + opacity: 1; } + .redactor-modal .redactor-close:before { + content: '\00d7'; } + .redactor-modal button { + display: inline-flex; + align-items: center; + text-decoration: none; text-align: center; + font-family: inherit; + font-size: 15px; + font-weight: 500; + color: #007dff; + background-color: #fff; + border-radius: 3px; + border: 2px solid #007dff; + min-height: 40px; + outline: none; + padding: 0.5em 1.25em; + cursor: pointer; + line-height: 1.2; + vertical-align: middle; + -webkit-appearance: none; } + .redactor-modal button:hover { + outline: none; text-decoration: none; - font-weight: normal; - font-size: 13px; - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - line-height: 1; - cursor: pointer; } - #redactor-modal button:hover { - color: #777; - background: none; - background: #ddd; - text-decoration: none; } - #redactor-modal button.redactor-modal-button-offset { - margin-left: 24px; } - #redactor-modal button#redactor-modal-button-delete { - background: none; - border-color: #f23d3d; - color: #f23d3d; } - #redactor-modal button#redactor-modal-button-delete:hover { - color: rgba(255, 255, 255, 0.6); - background-color: #f23d3d; } - #redactor-modal button#redactor-modal-button-action { + background: none; + color: rgba(0, 125, 255, 0.6); + border-color: rgba(0, 125, 255, 0.5); } + .redactor-modal button.redactor-button-secondary { + border-color: #2a2e34; + color: #2a2e34; } + .redactor-modal button.redactor-button-secondary:hover { + color: rgba(42, 46, 52, 0.6); + border-color: rgba(42, 46, 52, 0.5); } + .redactor-modal button.redactor-button-danger, + .redactor-modal button.redactor-button-unstyled { + background: none; + border-color: transparent; + color: rgba(42, 46, 52, 0.6); } + .redactor-modal button.redactor-button-danger:hover, + .redactor-modal button.redactor-button-unstyled:hover { background: none; - color: #fff; - background-color: #3d79f2; } - #redactor-modal button#redactor-modal-button-action:hover { - color: rgba(255, 255, 255, 0.6); - background-color: #3263c6; } - #redactor-modal .redactor-group:after { + border-color: transparent; + color: #ff3265; + text-decoration: underline; } + .redactor-modal .redactor-modal-group:after { content: ""; display: table; clear: both; } - #redactor-modal .redactor-modal-tab-side { + .redactor-modal .redactor-modal-side { float: left; - width: 26%; - margin-right: 6%; } - #redactor-modal .redactor-modal-tab-area { + width: 30%; + margin-right: 4%; } + .redactor-modal .redactor-modal-side img { + max-width: 100%; + height: auto; + display: block; } + .redactor-modal .redactor-modal-area { float: left; width: 66%; } - @media (max-width: 768px) { - #redactor-modal .redactor-modal-tab-side { - float: none; - width: auto; - margin-right: 0; - margin-bottom: 24px; } - #redactor-modal .redactor-modal-tab-area { - float: none; - width: auto; } } - -#redactor-modal-tabber { - margin-bottom: 40px; - font-size: 12px; } - #redactor-modal-tabber a { - border: 1px solid #ddd; - line-height: 1; - padding: 8px 15px; - margin-right: -1px; - text-decoration: none; - color: #000; } - #redactor-modal-tabber a:hover { - background-color: #1f78d8; - border-color: #1f78d8; - color: #fff; } - #redactor-modal-tabber a.active { - cursor: default; - background-color: rgba(0, 0, 0, 0.05); - border-color: #ddd; - color: rgba(0, 0, 0, 0.5); } -#redactor-modal-list { - margin-left: 0; - padding-left: 0; - list-style: none; - max-height: 250px; - overflow-x: auto; } - #redactor-modal-list li { - border-bottom: 1px solid rgba(0, 0, 0, 0.07); } - #redactor-modal-list li:last-child { - border-bottom: none; } - #redactor-modal-list a { - padding: 10px 5px; - color: #000; +.redactor-modal[dir="rtl"] .redactor-close { + left: 12px; + right: auto; } + +.redactor-modal[dir="rtl"] textarea { + direction: ltr; + text-align: left; } + +.redactor-modal[dir="rtl"] .redactor-modal-footer button.redactor-button-unstyled { + float: left; + margin-left: 0; } + +.redactor-modal-header { + padding: 20px; + font-size: 18px; + line-height: 24px; + font-weight: bold; + color: #000; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); } + .redactor-modal-header:empty { + display: none; } + +.redactor-modal-body { + padding: 32px 48px; + padding-bottom: 40px; } + +.redactor-modal-footer { + padding: 24px; + border-top: 1px solid rgba(0, 0, 0, 0.05); + overflow: hidden; } + .redactor-modal-footer button { + margin-right: 4px; } + .redactor-modal-footer button.redactor-button-unstyled { + margin-right: 0; + float: right; } + .redactor-modal-footer:empty { + display: none; } + +.redactor-modal-tabs { + display: flex; + border-bottom: 2px solid rgba(0, 0, 0, 0.05); + margin-bottom: 1em; } + .redactor-modal-tabs a { + font-size: 15px; + padding: 2px 0; text-decoration: none; - font-size: 13px; - display: block; - position: relative; } - #redactor-modal-list a:hover { - background-color: #eee; } + color: rgba(0, 0, 0, 0.5); + border-bottom: 2px solid transparent; + margin-bottom: -2px; + margin-right: 14px; } + .redactor-modal-tabs a:hover { + transition: all linear .2s; } + .redactor-modal-tabs a:hover, + .redactor-modal-tabs a.active { + font-weight: 500; + color: #007dff; + border-bottom-color: #007dff; } .redactor-styles { - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - font-size: 15px; - line-height: 24px; - color: #222; } + margin: 0; + padding: 16px 18px; + color: #333; + font-family: "Trebuchet MS", "Helvetica Neue", Helvetica, Tahoma, sans-serif; + font-size: 1em; + line-height: 1.5; + box-sizing: border-box; } + .redactor-styles *, + .redactor-styles *:before, + .redactor-styles *:after { + box-sizing: inherit; } .redactor-styles[dir="rtl"] { direction: rtl; unicode-bidi: embed; } @@ -779,49 +1059,13 @@ .redactor-styles[dir="rtl"] ol ol, .redactor-styles[dir="rtl"] ul ol, .redactor-styles[dir="rtl"] ol ul { - margin: 0 24px 0 0; } - @media (max-width: 768px) { - .redactor-styles { - font-size: 16px; } } - .redactor-styles a { - color: #256bc9; } - .redactor-styles a:focus, .redactor-styles a:hover { - color: #e21e3b; } - .redactor-styles h1, - .redactor-styles h2, - .redactor-styles h3, - .redactor-styles h4, - .redactor-styles h5, - .redactor-styles h6 { - font-family: Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; - font-weight: bold; - color: #000; - text-rendering: optimizeLegibility; - margin: 0; - padding: 0; - margin-bottom: 16px; } - .redactor-styles h1 { - font-size: 40px; - line-height: 44px; } - .redactor-styles h2 { - font-size: 32px; - line-height: 36px; } - .redactor-styles h3 { - font-size: 24px; - line-height: 32px; } - .redactor-styles h4 { - font-size: 18px; - line-height: 24px; } - .redactor-styles h5 { - font-size: 16px; - line-height: 24px; } - .redactor-styles h6 { - font-size: 14px; - line-height: 24px; - text-transform: uppercase; } + margin: 0 1.5em 0 0; } + .redactor-styles[dir="rtl"] figcaption { + text-align: right; } + .redactor-styles a, + .redactor-styles a:hover { + color: #3397ff; } .redactor-styles p, - .redactor-styles ul, - .redactor-styles ol, .redactor-styles dl, .redactor-styles blockquote, .redactor-styles hr, @@ -830,14 +1074,18 @@ .redactor-styles figure, .redactor-styles address { padding: 0; - margin: 0; } + margin: 0; + margin-bottom: 1em; } .redactor-styles ul, - .redactor-styles ol, - .redactor-styles ul ul, - .redactor-styles ol ol, - .redactor-styles ul ol, - .redactor-styles ol ul { - margin: 0 0 0 24px; } + .redactor-styles ol { + padding: 0; } + .redactor-styles ul, + .redactor-styles ul ul, + .redactor-styles ul ol, + .redactor-styles ol, + .redactor-styles ol ul, + .redactor-styles ol ol { + margin: 0 0 0 1.5em; } .redactor-styles ul li, .redactor-styles ol li { text-align: left; } @@ -845,142 +1093,103 @@ list-style-type: lower-alpha; } .redactor-styles ol ol ol li { list-style-type: lower-roman; } - .redactor-styles p, .redactor-styles ul, - .redactor-styles ol, - .redactor-styles dl, - .redactor-styles blockquote, - .redactor-styles hr, - .redactor-styles pre, - .redactor-styles table, - .redactor-styles figure, - .redactor-styles address { - margin-bottom: 16px; } + .redactor-styles ol { + margin-bottom: 1em; } + .redactor-styles h1, + .redactor-styles h2, + .redactor-styles h3, + .redactor-styles h4, + .redactor-styles h5, + .redactor-styles h6 { + font-weight: bold; + color: #111; + text-rendering: optimizeLegibility; + margin: 0; + padding: 0; + margin-bottom: 0.5em; + line-height: 1.2; } + .redactor-styles h1 { + font-size: 2.0736em; } + .redactor-styles h2 { + font-size: 1.728em; } + .redactor-styles h3 { + font-size: 1.44em; } + .redactor-styles h4 { + font-size: 1.2em; } + .redactor-styles h5 { + font-size: 1em; } + .redactor-styles h6 { + font-size: 0.83333em; + text-transform: uppercase; + letter-spacing: .035em; } .redactor-styles blockquote { - position: relative; font-style: italic; - color: rgba(0, 0, 0, 0.6); } - .redactor-styles blockquote cite { - font-size: 80%; } - @media (min-width: 768px) { - .redactor-styles blockquote { - padding-left: 24px; - border-left: 1px solid rgba(0, 0, 0, 0.1); } } - .redactor-styles address { - font-style: normal; } - .redactor-styles dl dt { - font-weight: bold; } - .redactor-styles dd { - margin-left: 24px; } - .redactor-styles cite { color: rgba(0, 0, 0, 0.5); - font-style: italic; } - .redactor-styles s, - .redactor-styles del { - text-decoration: line-through; } - .redactor-styles abbr[title], - .redactor-styles dfn[title] { - border-bottom: 1px dotted #000; - cursor: help; } - .redactor-styles strong, - .redactor-styles b { - font-weight: bold; } - .redactor-styles em, - .redactor-styles i { - font-style: italic; } + border: none; } + .redactor-styles table { + width: 100%; } + .redactor-styles time, .redactor-styles small, .redactor-styles var, .redactor-styles code, .redactor-styles kbd, .redactor-styles mark { + display: inline-block; + font-family: Consolas, Menlo, Monaco, "Courier New", monospace; + font-size: 87.5%; + line-height: 1; + color: rgba(51, 51, 51, 0.9); } + .redactor-styles var, .redactor-styles cite { + opacity: .6; } + .redactor-styles var { + font-style: normal; } + .redactor-styles dfn, + .redactor-styles abbr { + text-transform: uppercase; } + .redactor-styles dfn[title], + .redactor-styles abbr[title] { + text-decoration: none; + border-bottom: 1px dotted rgba(0, 0, 0, 0.5); + cursor: help; } + .redactor-styles code, .redactor-styles kbd { + position: relative; + top: -1px; + padding: 0.25em; + padding-bottom: 0.2em; + border-radius: 2px; } + .redactor-styles code { + background-color: #eff1f2; } + .redactor-styles mark { + border-radius: 2px; + padding: 0.125em 0.25em; + background-color: #fdb833; } + .redactor-styles kbd { + border: 1px solid #e5e7e9; } .redactor-styles sub, .redactor-styles sup { - font-size: 10px; + font-size: 75%; line-height: 0; position: relative; - margin-left: .2rem; } - .redactor-styles sup { - top: -.4rem; } + vertical-align: baseline; } .redactor-styles sub { - bottom: -.2rem; } - .redactor-styles figcaption { - margin: .3rem 0; - font-size: 11px; - font-style: italic; - text-align: left; } - .redactor-styles ins, - .redactor-styles u { - text-decoration: underline; } - .redactor-styles mark { - background-color: #ffd61e; - color: #000; - text-decoration: none; } - .redactor-styles pre, - .redactor-styles code, - .redactor-styles kbd, - .redactor-styles samp, - .redactor-styles var, - .redactor-styles output { - font-size: 90%; - font-style: normal; - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } + bottom: -0.25em; } + .redactor-styles sup { + top: -0.5em; } .redactor-styles pre { - margin-top: 16px; - font-size: 90%; - line-height: 24px; - color: rgba(0, 0, 0, 0.75); - overflow: auto; - background: rgba(0, 0, 0, 0.03); - padding: 24px; - word-wrap: normal; } - .redactor-styles mark, - .redactor-styles code, - .redactor-styles samp, - .redactor-styles kbd { - padding: .2rem .4rem; - display: inline-block; - line-height: 1; - border-radius: 4px; } - .redactor-styles code { - background: rgba(0, 0, 0, 0.05); } + font-family: Consolas, Menlo, Monaco, "Courier New", monospace; + font-size: .9em; } + .redactor-styles pre, .redactor-styles pre code { - font-size: 100%; - border: none; + background-color: #f6f7f8; padding: 0; - background: none; - line-height: 24px; } - .redactor-styles var { - color: rgba(0, 0, 0, 0.5); } - .redactor-styles samp { - background: #46a9fc; - color: rgba(255, 255, 255, 0.9); } - .redactor-styles kbd { - background: #000; - color: rgba(255, 255, 255, 0.85); - white-space: nowrap; } - .redactor-styles hr { + top: 0; display: block; - box-sizing: content-box; - height: 1px; - border: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); } - .redactor-styles img, - .redactor-styles video, - .redactor-styles audio, - .redactor-styles embed, - .redactor-styles object { - max-width: 100%; } - .redactor-styles img, - .redactor-styles video, - .redactor-styles embed, - .redactor-styles object { - height: auto; } - .redactor-styles embed, - .redactor-styles object { - height: 100%; } - .redactor-styles img { - vertical-align: middle; - -ms-interpolation-mode: bicubic; } + line-height: 1.5; + color: rgba(51, 51, 51, 0.85); + overflow: none; + white-space: pre-wrap; } + .redactor-styles pre { + padding: 1rem; } .redactor-styles table { border-collapse: collapse; max-width: 100%; - width: 100%; - empty-cells: show; } + width: 100%; } .redactor-styles table caption { text-transform: uppercase; padding: 0; @@ -994,16 +1203,149 @@ .redactor-styles table tfoot th, .redactor-styles table tfoot td { color: rgba(0, 0, 0, 0.5); } - .redactor-styles .video-container { - height: 0; - padding-bottom: 56.25%; - position: relative; - margin-bottom: 16px; } - .redactor-styles .video-container iframe, - .redactor-styles .video-container object, - .redactor-styles .video-container embed { - position: absolute; - top: 0; - left: 0; - width: 100% !important; - height: 100% !important; } + .redactor-styles img, + .redactor-styles video, + .redactor-styles audio, + .redactor-styles embed, + .redactor-styles object { + max-width: 100%; } + .redactor-styles img, + .redactor-styles video, + .redactor-styles embed, + .redactor-styles object { + height: auto !important; } + .redactor-styles img { + vertical-align: middle; + -ms-interpolation-mode: bicubic; } + .redactor-styles figcaption { + display: block; + opacity: .6; + font-size: 12px; + font-style: italic; + text-align: left; } + +.upload-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + box-sizing: border-box; + border: 5px dashed rgba(0, 125, 255, 0.15); + position: relative; + width: 100%; + min-height: 220px; + background: #fff; + cursor: pointer; + overflow: hidden; + text-align: center; } + +.upload-placeholder { + font-size: 15px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.3); + font-style: italic; } + +.upload-hover { + background-color: rgba(0, 125, 255, 0.075); } + +.upload-error { + background-color: rgba(255, 50, 101, 0.075); } + +.upload-box-hover { + outline: 5px dashed rgba(0, 125, 255, 0.3); } + +.upload-box-error { + outline: 5px dashed rgba(255, 50, 101, 0.3); } + +.redactor-structure h1, .redactor-structure h2, .redactor-structure h3, .redactor-structure h4, .redactor-structure h5, .redactor-structure h6, .redactor-structure div { + position: relative; } + .redactor-structure h1:before, .redactor-structure h2:before, .redactor-structure h3:before, .redactor-structure h4:before, .redactor-structure h5:before, .redactor-structure h6:before, .redactor-structure div:before { + width: 24px; + position: absolute; + font-size: 10px; + font-weight: normal; + opacity: .3; + left: -26px; + top: 50%; + margin-top: -7px; + text-align: right; } + +.redactor-structure h1:before { + content: "h1"; } + +.redactor-structure h2:before { + content: "h2"; } + +.redactor-structure h3:before { + content: "h3"; } + +.redactor-structure h4:before { + content: "h4"; } + +.redactor-structure h5:before { + content: "h5"; } + +.redactor-structure h6:before { + content: "h6"; } + +.redactor-structure div:before { + content: "div"; } + +#redactor-progress { + position: fixed; + top: 0; + left: 0; + width: 100%; + z-index: 1000000; + height: 10px; } + +#redactor-progress span { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; + display: block; + width: 100%; + height: 100%; + background-color: #007dff; + background-size: 40px 40px; } + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; } + to { + background-position: 0 0; } } + +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; } + to { + background-position: 0 0; } } + +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; } + to { + background-position: 0 0; } } + +.redactor-box-fullscreen { + z-index: 1051; + position: fixed; + top: 0; + left: 0; + width: 100%; } + +.redactor-box-fullscreen-target { + position: absolute !important; } + +.redactor-body-fullscreen .redactor-dropdown, +.redactor-body-fullscreen .redactor-context-toolbar { + z-index: 1052; } + +.redactor-body-fullscreen #redactor-overlay { + z-index: 1098; } + +.redactor-body-fullscreen #redactor-modal { + z-index: 1099; } diff --git a/public/js/redactor.js b/public/js/redactor.js index 74bbe87e..b038c328 100644 --- a/public/js/redactor.js +++ b/public/js/redactor.js @@ -1,10695 +1,17659 @@ /* - Redactor II - Version 1.3.2 - Updated: November 15, 2016 + Redactor + Version 3.0.11 + Updated: June 3, 2018 - http://imperavi.com/redactor/ + http://imperavi.com/redactor/ - Copyright (c) 2009-2016, Imperavi Oy. - License: http://imperavi.com/redactor/license/ - - Usage: $('#content').redactor(); + Copyright (c) 2009-2018, Imperavi Ltd. + License: http://imperavi.com/redactor/license/ */ +(function() { +var Ajax = {}; + +Ajax.settings = {}; +Ajax.post = function(options) { return new AjaxRequest('post', options); }; +Ajax.get = function(options) { return new AjaxRequest('get', options); }; -(function($) +var AjaxRequest = function(method, options) +{ + var defaults = { + method: method, + url: '', + before: function() {}, + success: function() {}, + error: function() {}, + data: false, + async: true, + headers: {} + }; + + this.p = this.extend(defaults, options); + this.p = this.extend(this.p, Ajax.settings); + this.p.method = this.p.method.toUpperCase(); + + this.prepareData(); + + this.xhr = new XMLHttpRequest(); + this.xhr.open(this.p.method, this.p.url, this.p.async); + + this.setHeaders(); + + var before = (typeof this.p.before === 'function') ? this.p.before(this.xhr) : true; + if (before !== false) + { + this.send(); + } +}; + +AjaxRequest.prototype = { + extend: function(obj1, obj2) + { + if (obj2) for (var name in obj2) { obj1[name] = obj2[name]; } + return obj1; + }, + prepareData: function() + { + if (this.p.method === 'POST' && !this.isFormData()) this.p.headers['Content-Type'] = 'application/x-www-form-urlencoded'; + if (typeof this.p.data === 'object' && !this.isFormData()) this.p.data = this.toParams(this.p.data); + if (this.p.method === 'GET') this.p.url = (this.p.data) ? this.p.url + '?' + this.p.data : this.p.url; + }, + setHeaders: function() + { + this.xhr.setRequestHeader('X-Requested-With', this.p.headers['X-Requested-With'] || 'XMLHttpRequest'); + for (var name in this.p.headers) + { + this.xhr.setRequestHeader(name, this.p.headers[name]); + } + }, + isFormData: function() + { + return (typeof window.FormData !== 'undefined' && this.p.data instanceof window.FormData); + }, + isComplete: function() + { + return !(this.xhr.status < 200 || this.xhr.status >= 300 && this.xhr.status !== 304); + }, + send: function() + { + if (this.p.async) + { + this.xhr.onload = this.loaded.bind(this); + this.xhr.send(this.p.data); + } + else + { + this.xhr.send(this.p.data); + this.loaded.call(this); + } + }, + loaded: function() + { + if (this.isComplete()) + { + var response = this.xhr.response; + var json = this.parseJson(response); + response = (json) ? json : response; + + if (typeof this.p.success === 'function') this.p.success(response, this.xhr); + } + else + { + if (typeof this.p.error === 'function') this.p.error(this.xhr.statusText); + } + }, + parseJson: function(str) + { + try { + var o = JSON.parse(str); + if (o && typeof o === 'object') + { + return o; + } + + } catch (e) {} + + return false; + }, + toParams: function (obj) + { + return Object.keys(obj).map( + function(k){ return encodeURIComponent(k) + '=' + encodeURIComponent(obj[k]); } + ).join('&'); + } +}; +var DomCache = [0]; +var DomExpando = 'data' + new Date(); +var DomDisplayCache = {}; + +var Dom = function(selector, context) { - 'use strict'; + return this.parse(selector, context); +}; - if (!Function.prototype.bind) - { - Function.prototype.bind = function(scope) - { - var fn = this; - return function() - { - return fn.apply(scope); - }; +Dom.ready = function(fn) +{ + if (document.readyState != 'loading') fn(); + else document.addEventListener('DOMContentLoaded', fn); +}; + +Dom.prototype = { + get dom() + { + return true; + }, + get length() + { + return this.nodes.length; + }, + parse: function(selector, context) + { + var nodes; + var reHtmlTest = /^\s*<(\w+|!)[^>]*>/; + + if (!selector) + { + nodes = []; + } + else if (selector.dom) + { + this.nodes = selector.nodes; + return selector; + } + else if (typeof selector !== 'string') + { + if (selector.nodeType && selector.nodeType === 11) + { + nodes = selector.childNodes; + } + else + { + nodes = (selector.nodeType || selector === window) ? [selector] : selector; + } + } + else if (reHtmlTest.test(selector)) + { + nodes = this.create(selector); + } + else + { + nodes = this._query(selector, context); + } + + this.nodes = this._slice(nodes); + }, + create: function(html) + { + if (/^<(\w+)\s*\/?>(?:<\/\1>|)$/.test(html)) + { + return [document.createElement(RegExp.$1)]; + } + + var elements = []; + var container = document.createElement('div'); + var children = container.childNodes; + + container.innerHTML = html; + + for (var i = 0, l = children.length; i < l; i++) + { + elements.push(children[i]); + } + + return elements; + }, + + // add + add: function(nodes) + { + this.nodes = this.nodes.concat(this._toArray(nodes)); + }, + + // get + get: function(index) + { + return this.nodes[(index || 0)] || false; + }, + getAll: function() + { + return this.nodes; + }, + eq: function(index) + { + return new Dom(this.nodes[index]); + }, + first: function() + { + return new Dom(this.nodes[0]); + }, + last: function() + { + return new Dom(this.nodes[this.nodes.length - 1]); + }, + contents: function() + { + return this.get().childNodes; + }, + + // loop + each: function(callback) + { + var len = this.nodes.length; + for (var i = 0; i < len; i++) + { + callback.call(this, (this.nodes[i].dom) ? this.nodes[i].get() : this.nodes[i], i); + } + + return this; + }, + + // traversing + is: function(selector) + { + return (this.filter(selector).length > 0); + }, + filter: function (selector) + { + var callback; + if (selector === undefined) + { + return this; + } + else if (typeof selector === 'function') + { + callback = selector; + } + else + { + callback = function(node) + { + if (selector instanceof Node) + { + return (selector === node); + } + else if (selector && selector.dom) + { + return ((selector.nodes).indexOf(node) !== -1); + } + else + { + node.matches = node.matches || node.msMatchesSelector || node.webkitMatchesSelector; + return (node.nodeType === 1) ? node.matches(selector || '*') : false; + } + }; + } + + return new Dom(this.nodes.filter(callback)); + }, + not: function(filter) + { + return this.filter(function(node) + { + return !new Dom(node).is(filter || true); + }); + }, + find: function(selector) + { + var nodes = []; + this.each(function(node) + { + var ns = this._query(selector || '*', node); + for (var i = 0; i < ns.length; i++) + { + nodes.push(ns[i]); + } + }); + + return new Dom(nodes); + }, + children: function(selector) + { + var nodes = []; + this.each(function(node) + { + if (node.children) + { + var ns = node.children; + for (var i = 0; i < ns.length; i++) + { + nodes.push(ns[i]); + } + } + }); + + return new Dom(nodes).filter(selector); + }, + parent: function(selector) + { + var nodes = []; + this.each(function(node) + { + if (node.parentNode) nodes.push(node.parentNode); + }); + + return new Dom(nodes).filter(selector); + }, + parents: function(selector, context) + { + context = this._getContext(context); + + var nodes = []; + this.each(function(node) + { + var parent = node.parentNode; + while (parent && parent !== context) + { + if (selector) + { + if (new Dom(parent).is(selector)) { nodes.push(parent); } + } + else + { + nodes.push(parent); + } + + parent = parent.parentNode; + } + }); + + return new Dom(nodes); + }, + closest: function(selector, context) + { + context = this._getContext(context); + selector = (selector.dom) ? selector.get() : selector; + + var nodes = []; + var isNode = (selector && selector.nodeType); + this.each(function(node) + { + do { + if ((isNode && node === selector) || new Dom(node).is(selector)) return nodes.push(node); + } while ((node = node.parentNode) && node !== context); + }); + + return new Dom(nodes); + }, + next: function(selector) + { + return this._getSibling(selector, 'nextSibling'); + }, + nextElement: function(selector) + { + return this._getSibling(selector, 'nextElementSibling'); + }, + prev: function(selector) + { + return this._getSibling(selector, 'previousSibling'); + }, + prevElement: function(selector) + { + return this._getSibling(selector, 'previousElementSibling'); + }, + + // css + css: function(name, value) + { + if (value === undefined && (typeof name !== 'object')) + { + var node = this.get(); + if (name === 'width' || name === 'height') + { + return (node.style) ? this._getHeightOrWidth(name, node, false) + 'px' : undefined; + } + else + { + return (node.style) ? getComputedStyle(node, null)[name] : undefined; + } + } + + // set + return this.each(function(node) + { + var obj = {}; + if (typeof name === 'object') obj = name; + else obj[name] = value; + + for (var key in obj) + { + if (node.style) node.style[key] = obj[key]; + } + }); + }, + + // attr + attr: function(name, value, data) + { + data = (data) ? 'data-' : ''; + + if (value === undefined && (typeof name !== 'object')) + { + var node = this.get(); + if (node && node.nodeType !== 3) + { + return (name === 'checked') ? node.checked : this._getBooleanFromStr(node.getAttribute(data + name)); + } + else return; + } + + // set + return this.each(function(node) + { + var obj = {}; + if (typeof name === 'object') obj = name; + else obj[name] = value; + + for (var key in obj) + { + if (node.nodeType !== 3) + { + if (key === 'checked') node.checked = obj[key]; + else node.setAttribute(data + key, obj[key]); + } + } + }); + }, + data: function(name, value) + { + if (name === undefined) + { + var reDataAttr = /^data\-(.+)$/; + var attrs = this.get().attributes; + + var data = {}; + var replacer = function (g) { return g[1].toUpperCase(); }; + + for (var key in attrs) + { + if (reDataAttr.test(attrs[key].nodeName)) + { + var dataName = attrs[key].nodeName.match(reDataAttr)[1]; + var val = attrs[key].value; + dataName = dataName.replace(/-([a-z])/g, replacer); + + if (this._isObjectString(val)) val = this._toObject(val); + else val = (this._isNumber(val)) ? parseFloat(val) : this._getBooleanFromStr(val); + + data[dataName] = val; + } + } + + return data; + } + + return this.attr(name, value, true); + }, + val: function(value) + { + if (value === undefined) + { + var el = this.get(); + if (el.type && el.type === 'checkbox') return el.checked; + else return el.value; + } + + return this.each(function(node) + { + node.value = value; + }); + }, + removeAttr: function(value) + { + return this.each(function(node) + { + var rmAttr = function(name) { if (node.nodeType !== 3) node.removeAttribute(name); }; + value.split(' ').forEach(rmAttr); + }); + }, + removeData: function(value) + { + return this.each(function(node) + { + var rmData = function(name) { if (node.nodeType !== 3) node.removeAttribute('data-' + name); }; + value.split(' ').forEach(rmData); + }); + }, + + // dataset/dataget + dataset: function(key, value) + { + return this.each(function(node) + { + DomCache[this.dataindex(node)][key] = value; + }); + }, + dataget: function(key) + { + return DomCache[this.dataindex(this.get())][key]; + }, + dataindex: function(el) + { + var cacheIndex = el[DomExpando]; + var nextCacheIndex = DomCache.length; + + if (!cacheIndex) + { + cacheIndex = el[DomExpando] = nextCacheIndex; + DomCache[cacheIndex] = {}; + } + + return cacheIndex; + }, + + // class + addClass: function(value) + { + return this._eachClass(value, 'add'); + }, + removeClass: function(value) + { + return this._eachClass(value, 'remove'); + }, + toggleClass: function(value) + { + return this._eachClass(value, 'toggle'); + }, + hasClass: function(value) + { + return this.nodes.some(function(node) + { + return (node.classList) ? node.classList.contains(value) : false; + }); + }, + + // html & text + empty: function() + { + return this.each(function(node) + { + node.innerHTML = ''; + }); + }, + html: function(html) + { + return (html === undefined) ? (this.get().innerHTML || '') : this.empty().append(html); + }, + text: function(text) + { + return (text === undefined) ? (this.get().textContent || '') : this.each(function(node) { node.textContent = text; }); + }, + + // manipulation + after: function(html) + { + return this._inject(html, function(frag, node) + { + if (typeof frag === 'string') + { + node.insertAdjacentHTML('afterend', frag); + } + else + { + var elms = (frag instanceof Node) ? [frag] : this._toArray(frag).reverse(); + for (var i = 0; i < elms.length; i++) + { + node.parentNode.insertBefore(elms[i], node.nextSibling); + } + } + + return node; + + }); + }, + before: function(html) + { + return this._inject(html, function(frag, node) + { + if (typeof frag === 'string') + { + node.insertAdjacentHTML('beforebegin', frag); + } + else + { + var elms = (frag instanceof Node) ? [frag] : this._toArray(frag); + for (var i = 0; i < elms.length; i++) + { + node.parentNode.insertBefore(elms[i], node); + } + } + + return node; + }); + }, + append: function(html) + { + return this._inject(html, function(frag, node) + { + if (typeof frag === 'string' || typeof frag === 'number') + { + node.insertAdjacentHTML('beforeend', frag); + } + else + { + var elms = (frag instanceof Node) ? [frag] : this._toArray(frag); + for (var i = 0; i < elms.length; i++) + { + node.appendChild(elms[i]); + } + } + + return node; + }); + }, + prepend: function(html) + { + return this._inject(html, function(frag, node) + { + if (typeof frag === 'string' || typeof frag === 'number') + { + node.insertAdjacentHTML('afterbegin', frag); + } + else + { + var elms = (frag instanceof Node) ? [frag] : this._toArray(frag).reverse(); + for (var i = 0; i < elms.length; i++) + { + node.insertBefore(elms[i], node.firstChild); + } + } + + return node; + }); + }, + wrap: function(html) + { + return this._inject(html, function(frag, node) + { + var wrapper = (typeof frag === 'string' || typeof frag === 'number') ? this.create(frag)[0] : (frag instanceof Node) ? frag : this._toArray(frag)[0]; + + if (node.parentNode) + { + node.parentNode.insertBefore(wrapper, node); + } + + wrapper.appendChild(node); + + return new Dom(wrapper); + + }); + }, + unwrap: function() + { + return this.each(function(node) + { + var $node = new Dom(node); + + return $node.replaceWith($node.contents()); + }); + }, + replaceWith: function(html) + { + return this._inject(html, function(frag, node) + { + var docFrag = document.createDocumentFragment(); + var elms = (typeof frag === 'string' || typeof frag === 'number') ? this.create(frag) : (frag instanceof Node) ? [frag] : this._toArray(frag); + + for (var i = 0; i < elms.length; i++) + { + docFrag.appendChild(elms[i]); + } + + var result = docFrag.childNodes[0]; + node.parentNode.replaceChild(docFrag, node); + + return result; + + }); + }, + remove: function() + { + return this.each(function(node) + { + if (node.parentNode) node.parentNode.removeChild(node); + }); + }, + clone: function(events) + { + var nodes = []; + this.each(function(node) + { + var copy = this._clone(node); + if (events) copy = this._cloneEvents(node, copy); + nodes.push(copy); + }); + + return new Dom(nodes); + }, + + // show/hide + show: function() + { + return this.each(function(node) + { + if (node.style) + { + if (this._getRealDisplay(node) !== 'none') return; + + var old = node.getAttribute('displayOld'); + node.style.display = old || ''; + + if (this._getRealDisplay(node) === 'none') + { + var nodeName = node.nodeName, body = document.body, display; + + if (DomDisplayCache[nodeName]) + { + display = DomDisplayCache[nodeName]; + } + else + { + var testElem = document.createElement(nodeName); + body.appendChild(testElem); + display = this._getRealDisplay(testElem); + + if (display === 'none') display = 'block'; + + body.removeChild(testElem); + DomDisplayCache[nodeName] = display; + } + + node.setAttribute('displayOld', display); + node.style.display = display; + } + } + }.bind(this)); + }, + hide: function() + { + return this.each(function(node) + { + if (node.style) + { + if (!node.getAttribute('displayOld') && node.style.display !== '') + { + node.setAttribute("displayOld", node.style.display); + } + + node.style.display = 'none'; + } + }); + }, + + // dimensions + scrollTop: function(value) + { + var node = this.get(); + var isWindow = (node === window); + var isDocument = (node.nodeType === 9); + var el = (isDocument) ? (document.scrollingElement || document.body.parentNode || document.body || document.documentElement) : node; + + if (value !== undefined) + { + if (isWindow) window.scrollTo(0, value); + else el.scrollTop = value; + return; + } + + if (isDocument) + { + return (typeof window.pageYOffset != 'undefined') ? window.pageYOffset : ((document.documentElement.scrollTop) ? document.documentElement.scrollTop : ((document.body.scrollTop) ? document.body.scrollTop : 0)); + } + else + { + return (isWindow) ? window.pageYOffset : el.scrollTop; + } + }, + offset: function() + { + return this._getDim('Offset'); + }, + position: function() + { + return this._getDim('Position'); + }, + width: function(value, adjust) + { + return this._getSize('width', 'Width', value, adjust); + }, + height: function(value, adjust) + { + return this._getSize('height', 'Height', value, adjust); + }, + outerWidth: function() + { + return this._getInnerOrOuter('width', 'outer'); + }, + outerHeight: function() + { + return this._getInnerOrOuter('height', 'outer'); + }, + innerWidth: function() + { + return this._getInnerOrOuter('width', 'inner'); + }, + innerHeight: function() + { + return this._getInnerOrOuter('height', 'inner'); + }, + + // events + click: function() + { + return this._triggerEvent('click'); + }, + focus: function() + { + return this._triggerEvent('focus'); + }, + trigger: function(names) + { + return this.each(function(node) + { + var events = names.split(' '); + for (var i = 0; i < events.length; i++) + { + var ev; + var opts = { bubbles: true, cancelable: true }; + + try { + ev = new window.CustomEvent(events[i], opts); + } catch(e) { + ev = document.createEvent('CustomEvent'); + ev.initCustomEvent(events[i], true, true); + } + + node.dispatchEvent(ev); + } + }); + }, + on: function(names, handler, one) + { + return this.each(function(node) + { + var events = names.split(' '); + for (var i = 0; i < events.length; i++) + { + var event = this._getEventName(events[i]); + var namespace = this._getEventNamespace(events[i]); + + handler = (one) ? this._getOneHandler(handler, names) : handler; + node.addEventListener(event, handler); + + node._e = node._e || {}; + node._e[namespace] = node._e[namespace] || {}; + node._e[namespace][event] = node._e[namespace][event] || []; + node._e[namespace][event].push(handler); + } + + }); + }, + one: function(events, handler) + { + return this.on(events, handler, true); + }, + off: function(names, handler) + { + var testEvent = function(name, key, event) { return (name === event); }; + var testNamespace = function(name, key, event, namespace) { return (key === namespace); }; + var testEventNamespace = function(name, key, event, namespace) { return (name === event && key === namespace); }; + var testPositive = function() { return true; }; + + if (names === undefined) + { + // ALL + return this.each(function(node) + { + this._offEvent(node, false, false, handler, testPositive); + }); + } + + return this.each(function(node) + { + var events = names.split(' '); + + for (var i = 0; i < events.length; i++) + { + var event = this._getEventName(events[i]); + var namespace = this._getEventNamespace(events[i]); + + // 1) event without namespace + if (namespace === '_events') this._offEvent(node, event, namespace, handler, testEvent); + // 2) only namespace + else if (!event && namespace !== '_events') this._offEvent(node, event, namespace, handler, testNamespace); + // 3) event + namespace + else this._offEvent(node, event, namespace, handler, testEventNamespace); + } + }); + }, + + // form + serialize: function(asObject) + { + var obj = {}; + var elms = this.get().elements; + for (var i = 0; i < elms.length; i++) + { + var el = elms[i]; + if (/(checkbox|radio)/.test(el.type) && !el.checked) continue; + if (!el.name || el.disabled || el.type === 'file') continue; + + if (el.type === 'select-multiple') + { + for (var z = 0; z < el.options.length; z++) + { + var opt = el.options[z]; + if (opt.selected) obj[el.name] = opt.value; + } + } + + obj[el.name] = el.value; + } + + return (asObject) ? obj : this._toParams(obj); + }, + ajax: function(success, error) + { + if (typeof AjaxRequest !== 'undefined') + { + var method = this.attr('method') || 'post'; + var options = { + url: this.attr('action'), + data: this.serialize(), + success: success, + error: error + }; + + return new AjaxRequest(method, options); + } + }, + + // private + _queryContext: function(selector, context) + { + context = this._getContext(context); + + return (context.nodeType !== 3 && typeof context.querySelectorAll === 'function') ? context.querySelectorAll(selector) : []; + }, + _query: function(selector, context) + { + if (context) + { + return this._queryContext(selector, context); + } + else if (/^[.#]?[\w-]*$/.test(selector)) + { + if (selector[0] === '#') + { + var element = document.getElementById(selector.slice(1)); + return element ? [element] : []; + } + + if (selector[0] === '.') + { + return document.getElementsByClassName(selector.slice(1)); + } + + return document.getElementsByTagName(selector); + } + + return document.querySelectorAll(selector); + }, + _getContext: function(context) + { + context = (typeof context === 'string') ? document.querySelector(context) : context; + + return (context && context.dom) ? context.get() : (context || document); + }, + _inject: function(html, fn) + { + var len = this.nodes.length; + var nodes = []; + while (len--) + { + var res = (typeof html === 'function') ? html.call(this, this.nodes[len]) : html; + var el = (len === 0) ? res : this._clone(res); + var node = fn.call(this, el, this.nodes[len]); + + if (node) + { + if (node.dom) nodes.push(node.get()); + else nodes.push(node); + } + } + + return new Dom(nodes); + }, + _cloneEvents: function(node, copy) + { + var events = node._e; + if (events) + { + copy._e = events; + for (var name in events._events) + { + for (var i = 0; i < events._events[name].length; i++) + { + copy.addEventListener(name, events._events[name][i]); + } + } + } + + return copy; + }, + _clone: function(node) + { + if (typeof node === 'undefined') return; + if (typeof node === 'string') return node; + else if (node instanceof Node) return node.cloneNode(true); + else if ('length' in node) + { + return [].map.call(this._toArray(node), function(el) { return el.cloneNode(true); }); + } + + return node; + }, + _slice: function(obj) + { + return (!obj || obj.length === 0) ? [] : (obj.length) ? [].slice.call(obj.nodes || obj) : [obj]; + }, + _eachClass: function(value, type) + { + return this.each(function(node) + { + if (value) + { + var setClass = function(name) { if (node.classList) node.classList[type](name); }; + value.split(' ').forEach(setClass); + } + }); + }, + _triggerEvent: function(name) + { + var node = this.get(); + if (node && node.nodeType !== 3) node[name](); + return this; + }, + _getOneHandler: function(handler, events) + { + var self = this; + return function() + { + handler.apply(this, arguments); + self.off(events); + }; + }, + _getEventNamespace: function(event) + { + var arr = event.split('.'); + var namespace = (arr[1]) ? arr[1] : '_events'; + return (arr[2]) ? namespace + arr[2] : namespace; + }, + _getEventName: function(event) + { + return event.split('.')[0]; + }, + _offEvent: function(node, event, namespace, handler, condition) + { + for (var key in node._e) + { + for (var name in node._e[key]) + { + if (condition(name, key, event, namespace)) + { + var handlers = node._e[key][name]; + for (var i = 0; i < handlers.length; i++) + { + if (typeof handler !== 'undefined' && handlers[i].toString() !== handler.toString()) + { + continue; + } + + node.removeEventListener(name, handlers[i]); + node._e[key][name].splice(i, 1); + + if (node._e[key][name].length === 0) delete node._e[key][name]; + if (Object.keys(node._e[key]).length === 0) delete node._e[key]; + } + } + } + } + }, + _getInnerOrOuter: function(method, type) + { + return this[method](undefined, type); + }, + _getDocSize: function(node, type) + { + var body = node.body, html = node.documentElement; + return Math.max(body['scroll' + type], body['offset' + type], html['client' + type], html['scroll' + type], html['offset' + type]); + }, + _getSize: function(type, captype, value, adjust) + { + if (value === undefined) + { + var el = this.get(); + if (el.nodeType === 3) value = 0; + else if (el.nodeType === 9) value = this._getDocSize(el, captype); + else if (el === window) value = window['inner' + captype]; + else value = this._getHeightOrWidth(type, el, adjust || 'normal'); + + return Math.round(value); + } + + return this.each(function(node) + { + value = parseFloat(value); + value = value + this._adjustResultHeightOrWidth(type, node, adjust || 'normal'); + + new Dom(node).css(type, value + 'px'); + + }.bind(this)); + }, + _getHeightOrWidth: function(type, el, adjust) + { + var name = type.charAt(0).toUpperCase() + type.slice(1); + var style = getComputedStyle(el, null); + var $el = new Dom(el); + var result = 0; + var $targets = $el.parents().filter(function(node) + { + return (getComputedStyle(node, null).display === 'none') ? node : false; + }); + + if (style.display === 'none') $targets.add(el); + if ($targets.length !== 0) + { + var fixStyle = 'visibility: hidden !important; display: block !important;'; + var tmp = []; + + $targets.each(function(node) + { + var $node = new Dom(node); + var thisStyle = $node.attr('style'); + if (thisStyle !== null) tmp.push(thisStyle); + $node.attr('style', (thisStyle !== null) ? thisStyle + ';' + fixStyle : fixStyle); + }); + + result = $el.get()['offset' + name] - this._adjustResultHeightOrWidth(type, el, adjust); + + $targets.each(function(node, i) + { + var $node = new Dom(node); + if (tmp[i] === undefined) $node.removeAttr('style'); + else $node.attr('style', tmp[i]); + }); + } + else + { + result = el['offset' + name] - this._adjustResultHeightOrWidth(type, el, adjust); + } + + return result; + }, + _adjustResultHeightOrWidth: function(type, el, adjust) + { + if (!el || adjust === false) return 0; + + var fix = 0; + var style = getComputedStyle(el, null); + var isBorderBox = (style.boxSizing === "border-box"); + + if (type === 'height') + { + if (adjust === 'inner' || (adjust === 'normal' && isBorderBox)) + { + fix += (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.borderBottomWidth) || 0); + } + + if (adjust === 'outer') fix -= (parseFloat(style.marginTop) || 0) + (parseFloat(style.marginBottom) || 0); + } + else + { + if (adjust === 'inner' || (adjust === 'normal' && isBorderBox)) + { + fix += (parseFloat(style.borderLeftWidth) || 0) + (parseFloat(style.borderRightWidth) || 0); + } + + if (adjust === 'outer') fix -= (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0); + } + + return fix; + }, + _getDim: function(type) + { + var node = this.get(); + return (node.nodeType === 3) ? { top: 0, left: 0 } : this['_get' + type](node); + }, + _getPosition: function(node) + { + return { top: node.offsetTop, left: node.offsetLeft }; + }, + _getOffset: function(node) + { + var rect = node.getBoundingClientRect(); + var doc = node.ownerDocument; + var docElem = doc.documentElement; + var win = doc.defaultView; + + return { + top: rect.top + win.pageYOffset - docElem.clientTop, + left: rect.left + win.pageXOffset - docElem.clientLeft }; - } + }, + _getSibling: function(selector, method) + { + selector = (selector && selector.dom) ? selector.get() : selector; + + var isNode = (selector && selector.nodeType); + var sibling; + + this.each(function(node) + { + while (node = node[method]) + { + if ((isNode && node === selector) || new Dom(node).is(selector)) + { + sibling = node; + return; + } + } + }); + + return new Dom(sibling); + }, + _toArray: function(obj) + { + if (obj instanceof NodeList) + { + var arr = []; + for (var i = 0; i < obj.length; i++) + { + arr[i] = obj[i]; + } + + return arr; + } + else if (obj === undefined) return []; + else + { + return (obj.dom) ? obj.nodes : obj; + } + }, + _toParams: function(obj) + { + var params = ''; + for (var key in obj) + { + params += '&' + this._encodeUri(key) + '=' + this._encodeUri(obj[key]); + } + + return params.replace(/^&/, ''); + }, + _toObject: function(str) + { + return (new Function("return " + str))(); + }, + _encodeUri: function(str) + { + return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); + }, + _isNumber: function(str) + { + return !isNaN(str) && !isNaN(parseFloat(str)); + }, + _isObjectString: function(str) + { + return (str.search(/^{/) !== -1); + }, + _getBooleanFromStr: function(str) + { + if (str === 'true') return true; + else if (str === 'false') return false; + + return str; + }, + _getRealDisplay: function(elem) + { + if (elem.currentStyle) return elem.currentStyle.display; + else if (window.getComputedStyle) + { + var computedStyle = window.getComputedStyle(elem, null); + return computedStyle.getPropertyValue('display'); + } + } +}; +// Unique ID +var uuid = 0; + +// Wrapper +var $R = function(selector, options) +{ + return RedactorApp(selector, options, [].slice.call(arguments, 2)); +}; + +// Globals +$R.version = '3.0.11'; +$R.options = {}; +$R.modules = {}; +$R.services = {}; +$R.classes = {}; +$R.plugins = {}; +$R.mixins = {}; +$R.modals = {}; +$R.lang = {}; +$R.dom = function(selector, context) { return new Dom(selector, context); }; +$R.ajax = Ajax; +$R.Dom = Dom; +$R.keycodes = { + 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 +}; +$R.env = { + 'plugin': 'plugins', + 'module': 'modules', + 'service': 'services', + 'class': 'classes', + 'mixin': 'mixins' +}; + +// jQuery Wrapper +/*eslint-env jquery*/ +if (typeof jQuery !== 'undefined') +{ + (function($) { $.fn.redactor = function(options) { return RedactorApp(this.toArray(), options, [].slice.call(arguments, 1)); }; })(jQuery); +} - var uuid = 0; +// Class +var RedactorApp = function(selector, options, args) +{ + var namespace = 'redactor'; + var nodes = (Array.isArray(selector)) ? selector : (selector && selector.nodeType) ? [selector] : document.querySelectorAll(selector); + var isApi = (typeof options === 'string' || typeof options === 'function'); + var value = []; + var instance; + + for (var i = 0; i < nodes.length; i++) + { + var el = nodes[i]; + var $el = $R.dom(el); + + instance = $el.dataget(namespace); + if (!instance && !isApi) + { + // Initialization + $el.dataset(namespace, (instance = new App(el, options, uuid))); + uuid++; + } + + // API + if (instance && isApi) + { + var isDestroy = (options === 'destroy'); + options = (isDestroy) ? 'stop' : options; + + var methodValue; + if (typeof options === 'function') + { + methodValue = options.apply(instance, args); + } + else + { + args.unshift(options); + methodValue = instance.api.apply(instance, args); + } + if (methodValue !== undefined) value.push(methodValue); + + if (isDestroy) $el.dataset(namespace, false); + } + } + + return (value.length === 0 || value.length === 1) ? ((value.length === 0) ? instance : value[0]) : value; +}; + +// add +$R.add = function(type, name, obj) +{ + if (typeof $R.env[type] === 'undefined') return; + + // translations + if (obj.translations) + { + $R.lang = $R.extend(true, {}, $R.lang, obj.translations); + } + + // modals + if (obj.modals) + { + $R.modals = $R.extend(true, {}, $R.modals, obj.modals); + } + + // mixin + if (type === 'mixin') + { + $R[$R.env[type]][name] = obj; + } + else + { + // prototype + var F = function() {}; + F.prototype = obj; + + // mixins + if (obj.mixins) + { + for (var i = 0; i < obj.mixins.length; i++) + { + $R.inherit(F, $R.mixins[obj.mixins[i]]); + } + } + + $R[$R.env[type]][name] = F; + } +}; + +// add lang +$R.addLang = function(lang, obj) +{ + if (typeof $R.lang[lang] === 'undefined') + { + $R.lang[lang] = {}; + } - // Plugin - $.fn.redactor = function(options) - { - var val = []; - var args = Array.prototype.slice.call(arguments, 1); + $R.lang[lang] = $R.extend($R.lang[lang], obj); +}; - if (typeof options === 'string') - { - this.each(function() - { - var instance = $.data(this, 'redactor'); - var func; - - if (options.search(/\./) !== '-1') - { - func = options.split('.'); - if (typeof instance[func[0]] !== 'undefined') - { - func = instance[func[0]][func[1]]; - } - } - else - { - func = instance[options]; - } - - if (typeof instance !== 'undefined' && $.isFunction(func)) - { - var methodVal = func.apply(instance, args); - if (methodVal !== undefined && methodVal !== instance) - { - val.push(methodVal); - } - } - else - { - $.error('No such method "' + options + '" for Redactor'); - } - }); - } - else - { - this.each(function() - { - $.data(this, 'redactor', {}); - $.data(this, 'redactor', Redactor(this, options)); - }); - } +// create +$R.create = function(name) +{ + var arr = name.split('.'); + var args = [].slice.call(arguments, 1); - if (val.length === 0) - { - return this; - } - else if (val.length === 1) - { - return val[0]; - } - else - { - return val; - } + var type = 'classes'; + if (typeof $R.env[arr[0]] !== 'undefined') + { + type = $R.env[arr[0]]; + name = arr.slice(1).join('.'); + } - }; + // construct + var instance = new $R[type][name](); - // Initialization - function Redactor(el, options) - { - return new Redactor.prototype.init(el, options); - } + // init + if (instance.init) + { + var res = instance.init.apply(instance, args); - // Options - $.Redactor = Redactor; - $.Redactor.VERSION = '1.3.2'; - $.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', + return (res) ? res : instance; + } - 'browser' // deprecated - ]; + return instance; +}; - $.Redactor.settings = {}; - $.Redactor.opts = { +// inherit +$R.inherit = function(current, parent) +{ + var F = function () {}; + F.prototype = parent; + var f = new F(); - // settings - animation: false, - lang: 'en', - direction: 'ltr', - spellcheck: true, - overrideStyles: true, - - focus: false, - focusEnd: false, - - clickToEdit: false, - structure: false, - - tabindex: false, - - minHeight: false, // string - maxHeight: false, // string - - maxWidth: false, // string - - plugins: false, // array - callbacks: {}, - - placeholder: false, - - linkify: true, - enterKey: true, - - pastePlainText: false, - pasteImages: true, - pasteLinks: true, - 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: false, // string - preSpaces: 4, // or false - tabAsSpaces: false, // true or number of spaces - tabKey: true, - - autosave: false, // false or url - autosaveName: false, - autosaveFields: false, - - imageUpload: null, - imageUploadParam: 'file', - imageUploadFields: false, - imageUploadForms: false, - imageTag: 'figure', - imageEditable: true, - imageCaption: true, - - imagePosition: false, - imageResizable: false, - imageFloatMargin: '10px', - - dragImageUpload: true, - multipleImageUpload: true, - clipboardImageUpload: true, - - fileUpload: null, - fileUploadParam: 'file', - fileUploadFields: false, - fileUploadForms: false, - dragFileUpload: true, - - s3: false, - - linkNewTab: false, - linkTooltip: true, - linkNofollow: false, - linkSize: 30, - pasteLinkTarget: false, - - videoContainerClass: 'video-container', - - toolbar: true, - toolbarFixed: true, - toolbarFixedTarget: document, - toolbarFixedTopOffset: 0, // pixels - toolbarExternal: false, // ID selector - - air: false, - airWidth: false, - - formatting: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], - formattingAdd: false, - - buttons: ['format', 'bold', 'italic', 'deleted', 'lists', 'image', 'file', 'link'], // + 'horizontalrule', 'underline', 'ol', 'ul', 'indent', 'outdent' - - buttonsHide: [], - buttonsHideOnMobile: [], - - script: true, - removeComments: true, - replaceTags: { - 'b': 'strong', - 'i': 'em', - 'strike': 'del' - }, - - // shortcuts - 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: false, - - activeButtons: ['deleted', 'italic', 'bold'], - activeButtonsStates: { - b: 'bold', - strong: 'bold', - i: 'italic', - em: 'italic', - del: 'deleted', - strike: 'deleted' - }, - - // private lang - 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", - "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", - - "bulletslist": "Bullets", - "numberslist": "Numbers", - - "image-position": "Position", - "none": "None", - "left": "Left", - "right": "Right", - "center": "Center", - - "accessibility-help-label": "Rich text editor" - } - }, - - // private - type: 'textarea', // textarea, div, inline, pre - inline: false, - buffer: [], - rebuffer: [], - 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: true, - 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: '​', - 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.-]*/ig, - linkvimeo: /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/, - linkimage: /((https?|www)[^\s]+\.)(jpe?g|png|gif)(\?[^\s-]+)?/ig, - url: /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/ig - } + for (var prop in current.prototype) + { + if (current.prototype.__lookupGetter__(prop)) f.__defineGetter__(prop, current.prototype.__lookupGetter__(prop)); + else f[prop] = current.prototype[prop]; + } - }; - - // Functionality - Redactor.fn = $.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 - init: function(el, options) - { - this.$element = $(el); - this.uuid = uuid++; + current.prototype = f; + current.prototype.super = parent; - this.loadOptions(options); - this.loadModules(); + return current; +}; - // click to edit - if (this.opts.clickToEdit && !this.$element.hasClass('redactor-click-to-edit')) - { - return this.loadToEdit(options); - } - else if (this.$element.hasClass('redactor-click-to-edit')) - { - this.$element.removeClass('redactor-click-to-edit'); - } +// error +$R.error = function(exception) +{ + throw exception; +}; - // block & inline test tag regexp - this.reIsBlock = new RegExp('^(' + this.opts.blockTags.join('|' ).toUpperCase() + ')$', 'i'); - this.reIsInline = new RegExp('^(' + this.opts.inlineTags.join('|' ).toUpperCase() + ')$', 'i'); +// extend +$R.extend = function() +{ + var extended = {}; + var deep = false; + var i = 0; + var length = arguments.length; + + if (Object.prototype.toString.call( arguments[0] ) === '[object Boolean]') + { + deep = arguments[0]; + i++; + } + + var merge = function(obj) + { + for (var prop in obj) + { + if (Object.prototype.hasOwnProperty.call(obj, prop)) + { + if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') extended[prop] = $R.extend(true, extended[prop], obj[prop]); + else extended[prop] = obj[prop]; + } + } + }; + + for (; i < length; i++ ) + { + var obj = arguments[i]; + merge(obj); + } + + return extended; +}; +$R.opts = { + animation: true, + lang: 'en', + direction: 'ltr', + spellcheck: true, + structure: false, + scrollTarget: false, + styles: true, + stylesClass: 'redactor-styles', + placeholder: false, + + source: true, + showSource: false, + + inline: false, + + breakline: false, + markup: 'p', + enterKey: true, + + clickToEdit: false, + clickToSave: false, + clickToCancel: false, + + focus: false, + focusEnd: false, + + minHeight: false, // string, '100px' + maxHeight: false, // string, '100px' + maxWidth: false, // string, '700px' + + plugins: [], // array + callbacks: {}, + + // pre & tab + preClass: false, // string + preSpaces: 4, // or false + tabindex: false, // int + tabAsSpaces: false, // true or number of spaces + tabKey: true, + + // autosave + autosave: false, // false or url + autosaveName: false, + autosaveData: false, + + // toolbar + toolbar: true, + toolbarFixed: true, + toolbarFixedTarget: document, + toolbarFixedTopOffset: 0, // pixels + toolbarExternal: false, // ID selector + toolbarContext: true, + + // air + air: false, + + // formatting + formatting: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], + formattingAdd: false, + formattingHide: false, + + // buttons + buttons: ['html', 'format', 'bold', 'italic', 'deleted', 'lists', 'image', 'file', 'link'], + // + 'line', 'redo', 'undo', 'underline', 'ol', 'ul', 'indent', 'outdent' + buttonsTextLabeled: false, + buttonsAdd: [], + buttonsAddFirst: [], + buttonsAddAfter: false, + buttonsAddBefore: false, + buttonsHide: [], + buttonsHideOnMobile: [], + + // image + imageUpload: false, + imageUploadParam: 'file', + imageData: false, + imageEditable: true, + imageCaption: true, + imagePosition: false, + imageResizable: false, + imageFloatMargin: '10px', + imageFigure: true, + + // file + fileUpload: false, + fileUploadParam: 'file', + fileData: false, + fileAttachment: false, + + // upload opts + uploadData: false, + dragUpload: true, + multipleUpload: true, + clipboardUpload: true, + uploadBase64: false, + + // link + linkTarget: false, + linkTitle: false, + linkNewTab: false, + linkNofollow: false, + linkSize: 30, + linkValidation: true, + + // clean + cleanOnEnter: true, + cleanInlineOnEnter: false, + paragraphize: true, + removeScript: true, + removeNewLines: false, + removeComments: true, + replaceTags: { + 'b': 'strong', + 'i': 'em', + 'strike': 'del' + }, + + // paste + pastePlainText: false, + pasteLinkTarget: false, + pasteImages: true, + pasteLinks: true, + pasteClean: true, + pasteKeepStyle: [], + pasteKeepClass: [], + pasteKeepAttrs: ['td', 'th'], + pasteBlockTags: ['pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'table', 'tbody', 'thead', 'tfoot', 'th', 'tr', 'td', 'ul', 'ol', 'li', 'blockquote', 'p', 'figure', 'figcaption'], + pasteInlineTags: ['a', 'img', 'br', 'strong', 'ins', 'code', 'del', 'span', 'samp', 'kbd', 'sup', 'sub', 'mark', 'var', 'cite', 'small', 'b', 'u', 'em', 'i', 'abbr'], + + // active buttons + activeButtons: { + b: 'bold', + strong: 'bold', + i: 'italic', + em: 'italic', + del: 'deleted', + strike: 'deleted', + u: 'underline' + }, + activeButtonsAdd: {}, + activeButtonsObservers: {}, + + // autoparser + autoparse: true, + autoparseStart: true, + autoparsePaste: true, + autoparseLinks: true, + autoparseImages: true, + autoparseVideo: true, + + // shortcodes + shortcodes: { + 'p.': { format: 'p' }, + 'quote.': { format: 'blockquote' }, + 'pre.': { format: 'pre' }, + 'h1.': { format: 'h1' }, + 'h2.': { format: 'h2' }, + 'h3.': { format: 'h3' }, + 'h4.': { format: 'h4' }, + 'h5.': { format: 'h5' }, + 'h6.': { format: 'h6' }, + '1.': { format: 'ol' }, + '*.': { format: 'ul' } + }, + shortcodesAdd: false, // object + + // shortcuts + shortcuts: { + 'ctrl+shift+m, meta+shift+m': { api: 'module.inline.clearformat' }, + 'ctrl+b, meta+b': { api: 'module.inline.format', args: 'b' }, + 'ctrl+i, meta+i': { api: 'module.inline.format', args: 'i' }, + 'ctrl+u, meta+u': { api: 'module.inline.format', args: 'u' }, + 'ctrl+h, meta+h': { api: 'module.inline.format', args: 'sup' }, + 'ctrl+l, meta+l': { api: 'module.inline.format', args: 'sub' }, + 'ctrl+k, meta+k': { api: 'module.link.open' }, + 'ctrl+alt+0, meta+alt+0': { api: 'module.block.format', args: 'p' }, + 'ctrl+alt+1, meta+alt+1': { api: 'module.block.format', args: 'h1' }, + 'ctrl+alt+2, meta+alt+2': { api: 'module.block.format', args: 'h2' }, + 'ctrl+alt+3, meta+alt+3': { api: 'module.block.format', args: 'h3' }, + 'ctrl+alt+4, meta+alt+4': { api: 'module.block.format', args: 'h4' }, + 'ctrl+alt+5, meta+alt+5': { api: 'module.block.format', args: 'h5' }, + 'ctrl+alt+6, meta+alt+6': { api: 'module.block.format', args: 'h6' }, + 'ctrl+shift+7, meta+shift+7': { api: 'module.list.toggle', args: 'ol' }, + 'ctrl+shift+8, meta+shift+8': { api: 'module.list.toggle', args: 'ul' } + }, + shortcutsAdd: false, // object + + // misc + grammarly: true, + + // private + bufferLimit: 100, + emptyHtml: '

', + markerChar: '\ufeff', + imageTypes: ['image/png', 'image/jpeg', 'image/gif'], + inlineTags: ['a', 'span', 'strong', 'strike', 'b', 'u', 'em', 'i', 'code', 'del', 'ins', 'samp', 'kbd', 'sup', 'sub', 'mark', 'var', 'cite', 'small', 'abbr'], + blockTags: ['pre', 'ul', 'ol', 'li', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'dl', 'dt', 'dd', 'div', 'table', 'tbody', 'thead', 'tfoot', 'tr', 'th', 'td', 'blockquote', 'output', 'figcaption', 'figure', 'address', 'section', 'header', 'footer', 'aside', 'article', 'iframe'], + regex: { + youtube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/gi, + vimeo: /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/gi, + imageurl: /((https?|www)[^\s]+\.)(jpe?g|png|gif)(\?[^\s-]+)?/gi, + url: /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi + }, + input: true, + zindex: false, + modes: { + "inline": { + pastePlainText: true, + pasteImages: false, + enterKey: false, + toolbar: false, + autoparse: false, + source: false, + showSource: false, + styles: false, + air: false + }, + "original": { + styles: false + } + } +}; +$R.lang['en'] = { + "format": "Format", + "image": "Image", + "file": "File", + "link": "Link", + "bold": "Bold", + "italic": "Italic", + "deleted": "Strikethrough", + "underline": "Underline", + "superscript": "Superscript", + "subscript": "Subscript", + "bold-abbr": "B", + "italic-abbr": "I", + "deleted-abbr": "S", + "underline-abbr": "U", + "superscript-abbr": "Sup", + "subscript-abbr": "Sub", + "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", + "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": "Upload", + "upload-label": "Drop files here or click to upload", + "accessibility-help-label": "Rich text editor", + "caption": "Caption", + "bulletslist": "Bullets", + "numberslist": "Numbers", + "image-position": "Position", + "none": "None", + "left": "Left", + "right": "Right", + "center": "Center", + "undo": "Undo", + "redo": "Redo" +}; +$R.buttons = { + html: { + title: 'HTML', + icon: true, + api: 'module.source.toggle' + }, + undo: { + title: '## undo ##', + icon: true, + api: 'module.buffer.undo' + }, + redo: { + title: '## redo ##', + icon: true, + api: 'module.buffer.redo' + }, + format: { + title: '## format ##', + icon: true, + dropdown: { + p: { + title: '## paragraph ##', + api: 'module.block.format', + args: { + tag: 'p' + } + }, + blockquote: { + title: '## quote ##', + api: 'module.block.format', + args: { + tag: 'blockquote' + } + }, + pre: { + title: '## code ##', + api: 'module.block.format', + args: { + tag: 'pre' + } + }, + h1: { + title: '## heading1 ##', + api: 'module.block.format', + args: { + tag: 'h1' + } + }, + h2: { + title: '## heading2 ##', + api: 'module.block.format', + args: { + tag: 'h2' + } + }, + h3: { + title: '## heading3 ##', + api: 'module.block.format', + args: { + tag: 'h3' + } + }, + h4: { + title: '## heading4 ##', + api: 'module.block.format', + args: { + tag: 'h4' + } + }, + h5: { + title: '## heading5 ##', + api: 'module.block.format', + args: { + tag: 'h5' + } + }, + h6: { + title: '## heading6 ##', + api: 'module.block.format', + args: { + tag: 'h6' + } + } + } + }, + bold: { + title: '## bold-abbr ##', + icon: true, + tooltip: '## bold ##', + api: 'module.inline.format', + args: { + tag: 'b' + } + }, + italic: { + title: '## italic-abbr ##', + icon: true, + tooltip: '## italic ##', + api: 'module.inline.format', + args: { + tag: 'i' + } + }, + deleted: { + title: '## deleted-abbr ##', + icon: true, + tooltip: '## deleted ##', + api: 'module.inline.format', + args: { + tag: 'del' + } + }, + underline: { + title: '## underline-abbr ##', + icon: true, + tooltip: '## underline ##', + api: 'module.inline.format', + args: { + tag: 'u' + } + }, + sup: { + title: '## superscript-abbr ##', + icon: true, + tooltip: '## superscript ##', + api: 'module.inline.format', + args: { + tag: 'sup' + } + }, + sub: { + title: '## subscript-abbr ##', + icon: true, + tooltip: '## subscript ##', + api: 'module.inline.format', + args: { + tag: 'sub' + } + }, + lists: { + title: '## lists ##', + icon: true, + observe: 'list', + dropdown: { + observe: 'list', + unorderedlist: { + title: '• ## unorderedlist ##', + api: 'module.list.toggle', + args: 'ul' + }, + orderedlist: { + title: '1. ## orderedlist ##', + api: 'module.list.toggle', + args: 'ol' + }, + outdent: { + title: '< ## outdent ##', + api: 'module.list.outdent' + }, + indent: { + title: '> ## indent ##', + api: 'module.list.indent' + } + } + }, + ul: { + title: '• ## bulletslist ##', + icon: true, + api: 'module.list.toggle', + observe: 'list', + args: 'ul' + }, + ol: { + title: '1. ## numberslist ##', + icon: true, + api: 'module.list.toggle', + observe: 'list', + args: 'ol' + }, + outdent: { + title: '## outdent ##', + icon: true, + api: 'module.list.outdent', + observe: 'list' + }, + indent: { + title: '## indent ##', + icon: true, + api: 'module.list.indent', + observe: 'list' + }, + image: { + title: '## image ##', + icon: true, + api: 'module.image.open' + }, + file: { + title: '## file ##', + icon: true, + api: 'module.file.open' + }, + link: { + title: '## link ##', + icon: true, + observe: 'link', + dropdown: { + observe: 'link', + link: { + title: '## link-insert ##', + api: 'module.link.open' + }, + unlink: { + title: '## unlink ##', + api: 'module.link.unlink' + } + } + }, + line: { + title: '## horizontalrule ##', + icon: true, + api: 'module.line.insert' + } +}; +var App = function(element, options, uuid) +{ + this.module = {}; + this.plugin = {}; + this.instances = {}; + + // start/stop + this.started = false; + this.stopped = false; + + // environment + this.uuid = uuid; + this.rootElement = element; + this.rootOpts = options; + this.dragInside = false; + this.dragComponentInside = false; + this.keycodes = $R.keycodes; + this.namespace = 'redactor'; + this.$win = $R.dom(window); + this.$doc = $R.dom(document); + this.$body = $R.dom('body'); + this.editorReadOnly = false; + + // core services + this.opts = $R.create('service.options', options, element); + this.lang = $R.create('service.lang', this); + + // build + this.buildServices(); + this.buildModules(); + this.buildPlugins(); + + // start + this.start(); +}; + +App.prototype = { + start: function() + { + // start + this.stopped = false; + this.broadcast('start'); + this.broadcast('startcode'); + + if (this.opts.clickToEdit) + { + this.broadcast('startclicktoedit'); + } + else + { + this.broadcast('enable'); + if (this.opts.showSource) this.broadcast('startcodeshow'); + this.broadcast('enablefocus'); + } + + // started + this.broadcast('started'); + this.started = true; + }, + stop: function() + { + this.started = false; + this.stopped = true; + + this.broadcast('stop'); + this.broadcast('disable'); + this.broadcast('stopped'); + }, + + // started & stopped + isStarted: function() + { + return this.started; + }, + isStopped: function() + { + return this.stopped; + }, + + // build + buildServices: function() + { + var core = ['options', 'lang']; + var bindable = ['uuid', 'keycodes', 'opts', 'lang', '$win', '$doc', '$body']; + var services = []; + for (var name in $R.services) + { + if (core.indexOf(name) === -1) + { + this[name] = $R.create('service.' + name, this); + services.push(name); + bindable.push(name); + } + } + + // binding + for (var i = 0; i < services.length; i++) + { + var service = services[i]; + for (var z = 0; z < bindable.length; z++) + { + var inj = bindable[z]; + if (service !== inj) + { + this[service][inj] = this[inj]; + } + } + } + }, + buildModules: function() + { + for (var name in $R.modules) + { + this.module[name] = $R.create('module.' + name, this); + this.instances[name] = this.module[name]; + } + }, + buildPlugins: function() + { + var plugins = this.opts.plugins; + for (var i = 0; i < plugins.length; i++) + { + var name = plugins[i]; + if (typeof $R.plugins[name] !== 'undefined') + { + this.plugin[name] = $R.create('plugin.' + name, this); + this.instances[name] = this.plugin[name]; + } + } + }, + + // draginside + isDragInside: function() + { + return this.dragInside; + }, + setDragInside: function(dragInside) + { + this.dragInside = dragInside; + }, + isDragComponentInside: function() + { + return this.dragComponentInside; + }, + setDragComponentInside: function(dragInside) + { + this.dragComponentInside = dragInside; + }, + getDragComponentInside: function() + { + return this.dragComponentInside; + }, + + // readonly + isReadOnly: function() + { + return this.editorReadOnly; + }, + enableReadOnly: function() + { + this.editorReadOnly = true; + this.broadcast('enablereadonly'); + this.component.clearActive(); + this.toolbar.disableButtons(); + }, + disableReadOnly: function() + { + this.editorReadOnly = false; + this.broadcast('disablereadonly'); + this.toolbar.enableButtons(); + }, + + // messaging + callMessageHandler: function(instance, name, args) + { + var arr = name.split('.'); + if (arr.length === 1) + { + if (typeof instance['on' + name] === 'function') + { + instance['on' + name].apply(instance, args); + } + } + else + { + arr[0] = 'on' + arr[0]; + + var func = this.utils.checkProperty(instance, arr); + if (typeof func === 'function') + { + func.apply(instance, args); + } + } + }, + broadcast: function(name) + { + var args = [].slice.call(arguments, 1); + for (var moduleName in this.instances) + { + this.callMessageHandler(this.instances[moduleName], name, args); + } + + // callback + return this.callback.trigger(name, args); + }, + + // callback + on: function(name, func) + { + this.callback.add(name, func); + }, + off: function(name, func) + { + this.callback.remove(name, func); + }, + + // api + api: function(name) + { + if (!this.isStarted() && name !== 'start') return; + if (this.isReadOnly() && name !== 'disableReadOnly') return; + + this.broadcast('state'); + + var args = [].slice.call(arguments, 1); + var arr = name.split('.'); + + var isApp = (arr.length === 1); + var isCallback = (arr[0] === 'on' || arr[0] === 'off'); + var isService = (!isCallback && arr.length === 2); + var isPlugin = (arr[0] === 'plugin'); + var isModule = (arr[0] === 'module'); + + // app + if (isApp) + { + if (typeof this[arr[0]] === 'function') + { + return this.callInstanceMethod(this, arr[0], args); + } + } + // callback + else if (isCallback) + { + return (arr[0] === 'on') ? this.on(arr[1], args[0]) : this.off(arr[1], args[0] || undefined); + } + // service + else if (isService) + { + if (this.isInstanceExists(this, arr[0])) + { + return this.callInstanceMethod(this[arr[0]], arr[1], args); + } + else + { + $R.error(new Error('Service "' + arr[0] + '" not found')); + } + } + // plugin + else if (isPlugin) + { + if (this.isInstanceExists(this.plugin, arr[1])) + { + return this.callInstanceMethod(this.plugin[arr[1]], arr[2], args); + } + else + { + $R.error(new Error('Plugin "' + arr[1] + '" not found')); + } + } + // module + else if (isModule) + { + if (this.isInstanceExists(this.module, arr[1])) + { + return this.callInstanceMethod(this.module[arr[1]], arr[2], args); + } + else + { + $R.error(new Error('Module "' + arr[1] + '" not found')); + } + } + + }, + isInstanceExists: function(obj, name) + { + return (typeof obj[name] !== 'undefined'); + }, + callInstanceMethod: function(instance, method, args) + { + if (typeof instance[method] === 'function') + { + return instance[method].apply(instance, args); + } + } +}; +$R.add('mixin', 'formatter', { + + // public + buildArgs: function(args) + { + this.args = { + 'class': args['class'] || false, + 'style': args['style'] || false, + 'attr': args['attr'] || false + }; + + if (!this.args['class'] && !this.args['style'] && !this.args['attr']) + { + this.args = false; + } + }, + applyArgs: function(nodes, selection) + { + if (this.args) + { + nodes = this[this.type](this.args, false, nodes, selection); + } + else + { + nodes = this._clearAll(nodes, selection); + } + + return nodes; + }, + clearClass: function(tags, nodes) + { + this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags, true); + $elements.removeAttr('class'); + + nodes = this._unwrapSpanWithoutAttr($elements.getAll()); + + this.selection.restore(); + + return nodes; + }, + clearStyle: function(tags, nodes) + { + this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags, true); + $elements.removeAttr('style'); + + nodes = this._unwrapSpanWithoutAttr($elements.getAll()); + + this.selection.restore(); + + return nodes; + }, + clearAttr: function(tags, nodes) + { + this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags, true); + this._removeAllAttr($elements); + + nodes = this._unwrapSpanWithoutAttr($elements.getAll()); + + this.selection.restore(); + + return nodes; + }, + set: function(args, tags, nodes, selection) + { + if (selection !== false) this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags); + + if (args['class']) + { + $elements.removeAttr('class'); + $elements.addClass(args['class']); + } + + if (args['style']) + { + $elements.removeAttr('style'); + $elements.css(args['style']); + $elements.each(function(node) + { + var $node = $R.dom(node); + $node.attr('data-redactor-style-cache', $node.attr('style')); + }); + } + + if (args['attr']) + { + this._removeAllAttr($elements); + $elements.attr(args['attr']); + } + + if (selection !== false) this.selection.restore(); + + return $elements.getAll(); + }, + toggle: function(args, tags, nodes, selection) + { + if (selection !== false) this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags); + + if (args['class']) + { + $elements.toggleClass(args['class']); + } + + var params; + if (args['style']) + { + params = args['style']; + $elements.each(function(node) + { + var $node = $R.dom(node); + for (var key in params) + { + var newVal = params[key]; + var oldVal = $node.css(key); - // set up drag upload - this.opts.dragImageUpload = (this.opts.imageUpload === null) ? false : this.opts.dragImageUpload; - this.opts.dragFileUpload = (this.opts.fileUpload === null) ? false : this.opts.dragFileUpload; + oldVal = (this.utils.isRgb(oldVal)) ? this.utils.rgb2hex(oldVal) : oldVal.replace(/"/g, ''); + newVal = (this.utils.isRgb(newVal)) ? this.utils.rgb2hex(newVal) : newVal.replace(/"/g, ''); - // formatting storage - this.formatting = {}; + oldVal = this.utils.hex2long(oldVal); + newVal = this.utils.hex2long(newVal); - // load lang - this.lang.load(); + var compareNew = (typeof newVal === 'string') ? newVal.toLowerCase() : newVal; + var compareOld = (typeof oldVal === 'string') ? oldVal.toLowerCase() : oldVal; - // extend shortcuts - $.extend(this.opts.shortcuts, this.opts.shortcutsAdd); + if (compareNew === compareOld) $node.css(key, ''); + else $node.css(key, newVal); + } - // set editor - this.$editor = this.$element; + this._convertStyleQuotes($node); - // detect type of editor - this.detectType(); + if (this.utils.removeEmptyAttr(node, 'style')) + { + $node.removeAttr('data-redactor-style-cache'); + } + else + { + $node.attr('data-redactor-style-cache', $node.attr('style')); + } + + }.bind(this)); + } + + if (args['attr']) + { + params = args['attr']; + $elements.each(function(node) + { + var $node = $R.dom(node); + for (var key in params) + { + if ($node.attr(key)) $node.removeAttr(key); + else $node.attr(key, params[key]); + } + }); + + } + + if (selection !== false) this.selection.restore(); + + return $elements.getAll(); + }, + add: function(args, tags, nodes, selection) + { + if (selection !== false) this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags); + + if (args['class']) + { + $elements.addClass(args['class']); + } + + if (args['style']) + { + var params = args['style']; + $elements.each(function(node) + { + var $node = $R.dom(node); + $node.css(params); + $node.attr('data-redactor-style-cache', $node.attr('style')); + + this._convertStyleQuotes($node); + + }.bind(this)); + } + + if (args['attr']) + { + $elements.attr(args['attr']); + } + + if (selection !== false) this.selection.restore(); + + return $elements.getAll(); + }, + remove: function(args, tags, nodes, selection) + { + if (selection !== false) this.selection.save(); + + var $elements = (nodes) ? $R.dom(nodes) : this.getElements(tags); + + if (args['class']) + { + $elements.removeClass(args['class']); + } + + if (args['style']) + { + var name = args['style']; + $elements.each(function(node) + { + var $node = $R.dom(node); + $node.css(name, ''); + + if (this.utils.removeEmptyAttr(node, 'style')) + { + $node.removeAttr('data-redactor-style-cache'); + } + else + { + $node.attr('data-redactor-style-cache', $node.attr('style')); + } - // start callback - this.core.callback('start'); - this.core.callback('startToEdit'); + }.bind(this)); + } - // build - this.start = true; - this.build.start(); + if (args['attr']) + { + $elements.removeAttr(args['attr']); + } - }, - detectType: function() - { - if (this.build.isInline() || this.opts.inline) - { - this.opts.type = 'inline'; - } - else if (this.build.isTag('DIV')) - { - this.opts.type = 'div'; - } - else if (this.build.isTag('PRE')) - { - this.opts.type = 'pre'; - } - }, - loadToEdit: function(options) - { + nodes = this._unwrapSpanWithoutAttr($elements.getAll()); - this.$element.on('click.redactor-click-to-edit', $.proxy(function() - { - this.initToEdit(options); + if (selection !== false) this.selection.restore(); - }, this)); + return nodes; + }, - this.$element.addClass('redactor-click-to-edit'); - return; - }, - initToEdit: function(options) - { - $.extend(options.callbacks, { - startToEdit: function() - { - this.insert.node(this.marker.get(), false); - }, - initToEdit: function() - { - this.selection.restore(); - this.clickToCancelStorage = this.code.get(); - - // cancel - $(this.opts.clickToCancel).off('.redactor-click-to-edit'); - $(this.opts.clickToCancel).show().on('click.redactor-click-to-edit', $.proxy(function(e) - { - e.preventDefault(); - - this.core.destroy(); - this.events.syncFire = false; - this.$element.html(this.clickToCancelStorage); - this.core.callback('cancel', this.clickToCancelStorage); - this.events.syncFire = true; - this.clickToCancelStorage = ''; - $(this.opts.clickToCancel).hide(); - $(this.opts.clickToSave).hide(); - - this.$element.on('click.redactor-click-to-edit', $.proxy(function() - { - this.initToEdit(options); - }, this)); - - this.$element.addClass('redactor-click-to-edit'); - - }, this)); - - // save - $(this.opts.clickToSave).off('.redactor-click-to-edit'); - $(this.opts.clickToSave).show().on('click.redactor-click-to-edit', $.proxy(function(e) - { - e.preventDefault(); - - this.core.destroy(); - this.core.callback('save', this.code.get()); - $(this.opts.clickToCancel).hide(); - $(this.opts.clickToSave).hide(); - this.$element.on('click.redactor-click-to-edit', $.proxy(function() - { - this.initToEdit(options); - }, this)); - this.$element.addClass('redactor-click-to-edit'); - - }, this)); - } - - }); - - this.$element.redactor(options); - this.$element.off('.redactor-click-to-edit'); - - }, - loadOptions: function(options) - { - var settings = {}; - - // check namespace - if (typeof $.Redactor.settings.namespace !== 'undefined') - { - if (this.$element.hasClass($.Redactor.settings.namespace)) - { - settings = $.Redactor.settings; - } - } - else - { - settings = $.Redactor.settings; - } - - this.opts = $.extend( - {}, - $.extend(true, {}, $.Redactor.opts), - $.extend(true, {}, settings), - this.$element.data(), - options - ); - - }, - getModuleMethods: function(object) - { - return Object.getOwnPropertyNames(object).filter(function(property) - { - return typeof object[property] === 'function'; - }); - }, - loadModules: function() - { - var len = $.Redactor.modules.length; - for (var i = 0; i < len; i++) - { - this.bindModuleMethods($.Redactor.modules[i]); - } - }, - bindModuleMethods: function(module) - { - if (typeof this[module] === 'undefined') - { - return; - } - - // init module - this[module] = this[module](); - - var methods = this.getModuleMethods(this[module]); - var len = methods.length; - - // bind methods - for (var z = 0; z < len; z++) - { - this[module][methods[z]] = this[module][methods[z]].bind(this); - } - }, - - // =air - air: function() - { - return { - enabled: false, - collapsed: function() - { - if (this.opts.air) - { - this.selection.get().collapseToStart(); - } - }, - collapsedEnd: function() - { - if (this.opts.air) - { - this.selection.get().collapseToEnd(); - } - }, - build: function() - { - if (this.detect.isMobile()) - { - return; - } - - this.button.hideButtons(); - this.button.hideButtonsOnMobile(); - - if (this.opts.buttons.length === 0) - { - return; - } - - this.$air = this.air.createContainer(); - - if (this.opts.airWidth !== false) - { - this.$air.css('width', this.opts.airWidth); - } - - this.air.append(); - this.button.$toolbar = this.$air; - this.button.setFormatting(); - this.button.load(this.$air); - - this.core.editor().on('mouseup.redactor', this, $.proxy(function(e) - { - if (this.selection.text() !== '') - { - this.air.show(e); - } - }, this)); - - }, - append: function() - { - this.$air.appendTo('body'); - }, - createContainer: function() - { - return $('