diff --git a/application/controllers/images.php b/application/controllers/images.php index 380e458a..4d8e38d7 100644 --- a/application/controllers/images.php +++ b/application/controllers/images.php @@ -131,25 +131,39 @@ public function save_image($img_id){ /** * upload image - called from redactor */ - public function post_upload(){ + public function post_upload() + { $model = $this->model; + $rules = array( 'image' => 'required|mimes:jpg|max:1000', 'name' => '' ); + + // jiggle the uploaded data into the format we'd like + $uploaded_img = Input::file('image'); + + $img = array(); + $img['name'] = $uploaded_img['name'][0]; + $img['type'] = $uploaded_img['type'][0]; + $img['tmp_name'] = $uploaded_img['tmp_name'][0]; + $img['error'] = $uploaded_img['error'][0]; + $img['size'] = $uploaded_img['size'][0]; + + $uploaded_input = array(); + $uploaded_input['image'] = $img; - if(!$model::is_valid($rules)){ + if (!$model::is_valid($rules, $uploaded_input)) { return static::json(array('error'=>'invalid input','errors'=> $model::$validation->errors->all()), 422); } - $img = Input::file('image'); - if(isset( $img['error']) && $img['error'] === 0){ - $name = explode('.',$img['name']); + if (isset($img['error']) && $img['error'] === 0) { + $name = explode('.', $img['name']); array_pop($name); - $name = implode('.',$name); - }else{ + $name = implode('.', $name); + } else { return static::json(array('error'=>'invalid input'), 422); } @@ -159,20 +173,22 @@ public function post_upload(){ $new->name = $name; $new->height = $size[1]; $new->width = $size[0]; - $new->populate_from_input(); + + // FIXME - why was this even unsetting the image element?? + $new->populate_from_input($uploaded_input); $new->save(); - $img = Input::file('image'); - if(isset( $img['error']) && $img['error'] === 0){ - if(!$this->save_image($new->id)){ + + if (isset($img['error']) && $img['error'] === 0) { + if (!$this->save_image($new->id)) { $new->raw_delete(); } - }else{ + } else { $new->raw_delete(); } - - return static::json(API::get_data_single('image',$new->id)); + + return static::json(API::get_data_single('image', $new->id)); } /** diff --git a/application/models/image.php b/application/models/image.php index c1ff6851..84e66512 100644 --- a/application/models/image.php +++ b/application/models/image.php @@ -1,6 +1,11 @@ 'mimes:jpg|max:1000' ); - public function populate_from_input() + //FIXME because clearly this is terrible - cfc + /** + * Validates input for Field. Overrides parent method + * + * @param array $input The input in Laravel input format. + * @param array $rules An array of Laravel validations which will overwrite the defaults for the class. + * @return $validaton The Laravel validation object. + */ + public static function is_valid($rules = null, $input = null) + { + if (!is_null($rules)) { + static::$rules = array_merge(static::$rules, $rules); + } + + if (!$input) { + $input = Input::all(); + } + + static::$validation = Validator::make($input, static::$rules); + + return static::$validation->passes(); + } + + + + + /** + * Populates the model from Input or an array + * + * @param array $input + * @return void + */ + public function populate_from_input($input = null) { if (is_null(static::$validation)) { throw new NoValidationException('No validation'); } - $input = Input::all(); + if (!$input) { + $input = Input::all(); + } // Remove _wysihtml5_mode entirely. unset($input['image']); diff --git a/application/models/simpledata.php b/application/models/simpledata.php index 2f5a89e7..29aa6266 100644 --- a/application/models/simpledata.php +++ b/application/models/simpledata.php @@ -181,7 +181,7 @@ public static function clear_all_as_list_cache($year = false) public function save() { $saved = $this->raw_save(); - + xdebug_break(); if ($saved) { static::clear_all_as_list_cache($this->year); diff --git a/application/views/admin/inc/scripts.php b/application/views/admin/inc/scripts.php index bab3517a..55df1e20 100644 --- a/application/views/admin/inc/scripts.php +++ b/application/views/admin/inc/scripts.php @@ -14,6 +14,7 @@ + diff --git a/paths.php b/paths.php index bbf240f0..7da03d7a 100755 --- a/paths.php +++ b/paths.php @@ -22,7 +22,7 @@ */ $environments = array( - 'local' => array('http://localhost*', '*.dev', '*.local', '*.local:9000', '192.168*', '*.vg'), + 'local' => array('http://plant.test:8080*', '*.test:8080', '*.test', '*.dev', '*.local', '*.local:9000', '192.168*', '*.vg'), 'test' => array('') ); 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/8AAAF4AAAkQGhlYWQPMte3AAAluAAAADZoaGVhB7gD6wAAJfAAAAAkaG10eK4BD60AACYUAAAAuGxvY2GyjqiGAAAmzAAAAF5tYXhwADkBcwAAJywAAAAgbmFtZVDOJQoAACdMAAABknBvc3QAAwAAAAAo4AAAACAAAwP0AZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpKQPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Sn//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAADAAAAgAQAAwAAEgAoADwAABMhMhYVMRUUBiMhIiY1MTU0NjMDITIWFTEVFAYjITgBMSImPQE0NjMxEyEyFhUxFRQGIzEhIiY1MTU0NjO7AooZIiIZ/XYZIiIZgAOKGSIiG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ZGFjdG9yAFIAZQBkAGEAYwB0AG8AclZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMFJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AclJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AclJlZ3VsYXIAUgBlAGcAdQBsAGEAclJlZGFjdG9yAFIAZQBkAGEAYwB0AG8AckZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") 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/css/redactor_kent.css b/public/css/redactor_kent.css index 0b375ba1..822ddea8 100644 --- a/public/css/redactor_kent.css +++ b/public/css/redactor_kent.css @@ -1,41 +1,41 @@ @font-face{font-family:Century Schoolbook;src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/CenturySchoolbook.eot);src:local("Century Schoolbook"),local("CenturySchoolbook"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/CenturySchoolbook.eot?#iefix) format("embedded-opentype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/CenturySchoolbook.woff2) format("woff2"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/CenturySchoolbook.woff) format("woff"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/CenturySchoolbook.ttf) format("truetype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/CenturySchoolbook.svg#CenturySchoolbook) format("svg");font-weight:400;font-style:normal}@font-face{font-family:ArialLight;src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-light-webfont.eot);src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-light-webfont.eot?#iefix) format("embedded-opentype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-light-webfont.woff) format("woff"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-light-webfont.ttf) format("truetype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-mtlight-webfont.svg#arial_mtmt_light) format("svg");font-weight:400;font-style:normal}@font-face{font-family:ArialLight;src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-lightitalic-webfont.eot);src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-lightitalic-webfont.eot?#iefix) format("embedded-opentype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-lightitalic-webfont.woff) format("woff"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-lightitalic-webfont.ttf) format("truetype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-lightitalic-webfont.svg#arial_mtlight_italic) format("svg");font-weight:400;font-style:italic}@font-face{font-family:ArialLight;src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-medium-webfont.eot);src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-medium-webfont.eot?#iefix) format("embedded-opentype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-medium-webfont.woff) format("woff"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-medium-webfont.ttf) format("truetype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-medium-webfont.svg#arial_mtmedium) format("svg");font-weight:700;font-style:normal}@font-face{font-family:ArialLight;src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-mediumitalic-webfont.eot);src:url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-mediumitalic-webfont.eot?#iefix) format("embedded-opentype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-mediumitalic-webfont.woff) format("woff"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-mediumitalic-webfont.ttf) format("truetype"),url(https://beta.kent.ac.uk/pantheon/kent-theme-assets/assets/fonts/arialmt/arialmt-mediumitalic-webfont.svg#arial_mtmedium_italic) format("svg");font-weight:700;font-style:italic} -.redactor-dropdown-box-format .redactor-dropdown-blockquote, -.redactor-dropdown-box-format .redactor-dropdown-pullquote{ +.redactor-dropdown .redactor-dropdown-item-blockquote, +.redactor-dropdown .redactor-dropdown-item-pullquote{ font-family: "Century Schoolbook", Georgia, "Times New Roman", Times, serif; font-size: 19px; font-style: italic; color: #05345C; } -.redactor-dropdown-box-format .redactor-dropdown-pullquote span{ +.redactor-dropdown .redactor-dropdown-item-pullquote span{ padding: 5px 0; border-color:#05345C; border-style: solid; border-width: 1px 0; } -.redactor-dropdown-box-format .redactor-dropdown-p{ +.redactor-dropdown .redactor-dropdown-item-p{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size: 16px; color: #171717; } -.redactor-dropdown-box-format .redactor-dropdown-impact{ +.redactor-dropdown .redactor-dropdown-item-impact{ font-family: "Century Schoolbook", Georgia, "Times New Roman", Times, serif; font-size: 19px; color: #937227; } -.redactor-dropdown-box-format .redactor-dropdown-h2{ +.redactor-dropdown .redactor-dropdown-item-h2{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size: 25.632px; color: #05345C; } -.redactor-dropdown-box-format .redactor-dropdown-h3{ +.redactor-dropdown .redactor-dropdown-item-h3{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size:20.256px; color: #05345C; } -.redactor-dropdown-box-format .redactor-dropdown-h4{ +.redactor-dropdown .redactor-dropdown-item-h4{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size:18px; color: #05345C; @@ -44,39 +44,39 @@ .redactor-box{ max-width: 725px; } -.redactor-editor{ +.redactor-styles{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size: 16px; color: #171717; line-height: 1.5; } -.redactor-editor h2{ +.redactor-styles h2{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size: 25.632px; color: #05345C; } -.redactor-editor h3{ +.redactor-styles h3{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size:20.256px; color: #05345C; } -.redactor-editor h4{ +.redactor-styles h4{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size:18px; color: #05345C; } -.redactor-editor a{ +.redactor-styles a{ color: #005689; text-decoration: none; border-bottom: 1px solid #CCCCCC; } -.redactor-editor a:hover { +.redactor-styles a:hover { border-bottom: 1px solid #00263d; } -.redactor-editor p.impact-statement{ +.redactor-styles p.impact-statement{ font-size: 28.8px; font-family: "Century Schoolbook", Georgia, "Times New Roman", Times, serif; text-align: center; @@ -85,7 +85,7 @@ } -.redactor-editor blockquote.simple{ +.redactor-styles blockquote.simple{ padding: 16px; font-family: "Century Schoolbook", Georgia, "Times New Roman", Times, serif; font-size: 20.8px; @@ -94,14 +94,14 @@ border:0; } -.redactor-editor blockquote.simple:before{ +.redactor-styles blockquote.simple:before{ font-size: 1.3em; content: '\201C'; line-height: 16px; line-height: calc(1rem); } -.redactor-editor blockquote.simple:after{ +.redactor-styles blockquote.simple:after{ font-size: 1.3em; content: '\201D'; line-height: 16px; @@ -109,23 +109,23 @@ line-height: calc(1rem); } -.redactor-editor blockquote.pull-quote{ +.redactor-styles blockquote.pull-quote{ border: 1px solid #05345C; border-width: 1px 0; padding: 2rem; margin: 16px 0; } -.redactor-editor figure{ +.redactor-styles figure{ clear:both; } -.redactor-editor figure:hover .media-wrap{ +.redactor-styles figure:hover .media-wrap{ overflow: hidden; } -.redactor-editor figure:hover img{ +.redactor-styles figure:hover img{ filter: blur(3px); } -.redactor-editor figure:hover .media-wrap:after{ +.redactor-styles figure:hover .media-wrap:after{ content: "Edit"; display: block; position: absolute; @@ -137,15 +137,15 @@ pointer-events: none; } -.redactor-editor figure .media-wrap img{ +.redactor-styles figure .media-wrap img{ max-width: 100%; height: auto; } -.redactor-editor figure .media-wrap{ +.redactor-styles figure .media-wrap{ position:relative; } -.redactor-editor figure .attribution { +.redactor-styles figure .attribution { position: absolute; bottom: 0; right: 0; @@ -156,21 +156,21 @@ font-size: 0; } -.redactor-editor figure figcaption{ +.redactor-styles figure figcaption{ font-family: 'ArialLight', Arial, "Helvetica Neue", Helvetica, Tahoma, sans-serif; font-size: .9rem; color: #636c72; font-style: normal; } -.redactor-editor figure.figure-center{ +.redactor-styles figure.figure-center{ display: block; text-align: center; margin:auto; } -.redactor-editor figure.figure-right, -.redactor-editor figure.figure-pull-right{ +.redactor-styles figure.figure-right, +.redactor-styles figure.figure-pull-right{ float:right; clear:right; max-width: 50%; @@ -178,8 +178,8 @@ margin-bottom: 2rem; } -.redactor-editor figure.figure-left, -.redactor-editor figure.figure-pull-left +.redactor-styles figure.figure-left, +.redactor-styles figure.figure-pull-left { float:left; clear:left; @@ -264,7 +264,7 @@ margin-bottom: 15px; } -.img-picker .redactor-editor{ +.img-picker .redactor-styles{ min-height: 20px !important; height: 20px !important; padding: 4px 6px; @@ -273,7 +273,7 @@ overflow: hidden; border: 1px solid #ccc; } -.img-picker .redactor-editor p{ +.img-picker .redactor-styles p{ margin:0; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 14px; diff --git a/public/js/imagemanager.js b/public/js/imagemanager.js new file mode 100644 index 00000000..4ac91945 --- /dev/null +++ b/public/js/imagemanager.js @@ -0,0 +1,82 @@ +(function($R) +{ + $R.add('plugin', 'imagemanager', { + translations: { + en: { + "choose": "Choose" + } + }, + init: function(app) + { + this.app = app; + this.lang = app.lang; + this.opts = app.opts; + }, + // messages + onmodal: { + image: { + open: function($modal, $form) + { + if (!this.opts.imageManagerJson) return; + this._load($modal) + } + } + }, + + // private + _load: function($modal) + { + var $body = $modal.getBody(); + + this.$box = $R.dom('
', - 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 $('<\/p>$/i, ''); + var htmlLen = this.getHtml(false).length; + var outputLen = output.length; + + if (htmlLen !== outputLen) + { + return false; + } + } + + // editor empty or collapsed + if ((isEditor && this.editor.isEmpty()) || this.isCollapsed()) + { + return false; + } + + // all + var offset = this.offset.get(node, true); + var size = this.offset.size(node, true); + + // pre, table, or pre/code in figure + if (!isEditor && data.isComponentType('code')) + { + size = this.getText().trim().length; + } + + if (offset && offset.start === 0 && offset.end === size) + { + return true; + } + + return false; + }, + + // has + hasNonEditable: function() + { + var selected = this.getHtml(); + var $wrapper = $R.dom('