Changes in [3951:d068f8063442:3952:96be74a39545]
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/index.php
r3918 r3947 149 149 # Dashboard drag'n'drop switch for its elements 150 150 $core->auth->user_prefs->addWorkspace('accessibility'); 151 $dragndrop = ''; 151 $dragndrop = ''; 152 $dragndrop_head = ''; 153 $dragndrop_msg = [ 154 'dragndrop_off' => __('Dashboard area\'s drag and drop is disabled'), 155 'dragndrop_on' => __('Dashboard area\'s drag and drop is enabled') 156 ]; 152 157 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 153 $dragndrop = 154 '<script type="text/javascript">' . "\n" . 155 dcPage::jsVar('dotclear.dragndrop_off', __('Dashboard area\'s drag and drop is disabled')) . "\n" . 156 dcPage::jsVar('dotclear.dragndrop_on', __('Dashboard area\'s drag and drop is enabled')) . "\n" . 157 "</script>\n" . 158 '<input type="checkbox" id="dragndrop" class="sr-only" title="' . 159 __('Dashboard area\'s drag and drop is disabled') . '" />' . 158 $dragndrop_head = dcPage::jsJson('dotclear_dragndrop', $dragndrop_msg); 159 $dragndrop = 160 '<input type="checkbox" id="dragndrop" class="sr-only" title="' . $dragndrop_msg['dragndrop_off'] . '" />' . 160 161 '<label for="dragndrop">' . 161 162 '<svg aria-hidden="true" focusable="false" class="dragndrop-svg">' . 162 163 '<use xlink:href="images/dragndrop.svg#mask"></use>' . 163 164 '</svg>' . 164 '<span id="dragndrop-label" class="sr-only">' . __('Dashboard area\'s drag and drop is disabled'). '</span>' .165 '</label>';165 '<span id="dragndrop-label" class="sr-only">' . $dragndrop_msg['dragndrop_off'] . '</span>' . 166 '</label>'; 166 167 } 167 168 … … 172 173 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . 173 174 dcPage::jsLoad('js/_index.js') . 175 $dragndrop_head . 174 176 $admin_post_behavior . 175 177 # --BEHAVIOR-- adminDashboardHeaders -
admin/js/_index.js
r3936 r3947 1 /*global $, dotclear, jsToolBar */1 /*global $, dotclear, jsToolBar, getData */ 2 2 'use strict'; 3 3 … … 249 249 // Set or reset sortable depending on #dragndrop checbkox value 250 250 $('#dragndrop').click(function() { 251 Object.assign(dotclear, getData('dotclear_dragndrop')); 251 252 if ($(this).is(':checked')) { 252 253 // Activate sorting feature -
admin/js/prepend.js
r3930 r3945 1 /*exported getData */1 /*exported getData, isObject, mergeDeep */ 2 2 'use strict'; 3 3 … … 18 18 return data; 19 19 } 20 21 function isObject(item) { 22 return (item && typeof item === 'object' && !Array.isArray(item)); 23 } 24 25 /** 26 * Deep merge two objects. 27 * @param target 28 * @param ...sources 29 */ 30 function mergeDeep(target, ...sources) { 31 if (!sources.length) return target; 32 const source = sources.shift(); 33 if (isObject(target) && isObject(source)) { 34 for (const key in source) { 35 if (isObject(source[key])) { 36 if (!target[key]) Object.assign(target, { [key]: {} }); 37 mergeDeep(target[key], source[key]); 38 } else { 39 Object.assign(target, { [key]: source[key] }); 40 } 41 } 42 } 43 return mergeDeep(target, ...sources); 44 } -
admin/style/default-dark.css
r3935 r3943 3247 3247 background-color: #4c4d4f; } 3248 3248 3249 .ui-sortable-handle {3249 div.ui-sortable-handle { 3250 3250 border: 1px dashed currentColor !important; 3251 3251 border-radius: .75em !important; } -
admin/style/default.css
r3935 r3943 3247 3247 background-color: #f3f3f3; } 3248 3248 3249 .ui-sortable-handle {3249 div.ui-sortable-handle { 3250 3250 border: 1px dashed currentColor !important; 3251 3251 border-radius: .75em !important; } -
admin/style/scss/partials/_utils.scss
r3935 r3943 8 8 } 9 9 10 .ui-sortable-handle {10 div.ui-sortable-handle { 11 11 border: 1px dashed currentColor !important; 12 12 border-radius: .75em !important; -
inc/admin/lib.dc.page.php
r3934 r3946 75 75 $blog_box = '<p><label for="switchblog" class="classic">' . __('Blogs:') . '</label> ' . 76 76 $core->formNonce() . form::combo('switchblog', $blogs, $core->blog->id) . 77 form::hidden(['redir'], $_SERVER['REQUEST_URI']) . 77 78 '<input type="submit" value="' . __('ok') . '" class="hidden-if-js" /></p>'; 78 79 } -
inc/admin/prepend.php
r3923 r3946 135 135 } 136 136 137 # Removing switchblog from URL 138 $redir = $_SERVER['REQUEST_URI']; 139 $redir = preg_replace('/switchblog=(.*?)(&|$)/', '', $redir); 140 $redir = preg_replace('/\?$/', '', $redir); 137 if (!empty($_REQUEST['redir'])) { 138 # Keep context as far as possible 139 $redir = $_REQUEST['redir']; 140 } else { 141 # Removing switchblog from URL 142 $redir = $_SERVER['REQUEST_URI']; 143 $redir = preg_replace('/switchblog=(.*?)(&|$)/', '', $redir); 144 $redir = preg_replace('/\?$/', '', $redir); 145 } 141 146 http::redirect($redir); 142 147 exit; -
inc/public/default-templates/dotty/_top.html
r3246 r3949 1 <header class="header"> 2 <nav role="navigation"> 1 <div class="header"> 3 2 <ul class="skip-links" id="prelude"> 4 3 <li><a href="#main">{{tpl:lang To content}}</a></li> … … 6 5 <li><a href="#search">{{tpl:lang To search}}</a></li> 7 6 </ul> 8 </nav>9 7 10 < divclass="banner" role="banner">8 <header class="banner" role="banner"> 11 9 <h1 class="site-title"><a class="site-title__link" 12 10 href="{{tpl:BlogURL}}"><span class="site-title__text">{{tpl:BlogName encode_html="1"}}</span></a></h1> 13 11 <p class="site-baseline">{{tpl:BlogDescription}}</p> 14 </ div>12 </header> 15 13 16 14 <!-- # --BEHAVIOR-- publicTopAfterContent --> … … 18 16 19 17 {{tpl:SimpleMenu class="nav header__nav"}} 20 </ header>18 </div> -
plugins/dcLegacyEditor/inc/dc.legacy.editor.behaviors.php
r3915 r3945 26 26 if (empty($editor) || $editor != 'dcLegacyEditor') {return;} 27 27 28 $js = [ 29 'legacy_editor_context' => $context, 30 'legacy_editor_syntax' => $syntax, 31 'legacy_editor_tags_context' => [$context => $tags] 32 ]; 33 28 34 return 29 35 self::jsToolBar() . 30 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/_post_editor.js')) . 31 '<script type="text/javascript">' . "\n" . 32 dcPage::jsVar('dotclear.legacy_editor_context', $context) . 33 dcPage::jsVar('dotclear.legacy_editor_syntax', $syntax) . 34 'dotclear.legacy_editor_tags_context = ' . sprintf('{%s:["%s"]};' . "\n", $context, implode('","', $tags)) . "\n" . 35 "</script>\n"; 36 dcPage::jsJson('legacy_editor_ctx', $js) . 37 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/_post_editor.js')); 36 38 } 37 39 … … 59 61 protected static function jsToolBar() 60 62 { 63 $rtl = l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction: rtl;' : ''; 64 $css = <<<EOT 65 body { 66 color: #000; 67 background: #f9f9f9; 68 margin: 0; 69 padding: 2px; 70 border: none; 71 $rtl 72 } 73 code { 74 color: #666; 75 font-weight: bold; 76 } 77 body > p:first-child { 78 margin-top: 0; 79 } 80 EOT; 81 $js = [ 82 'dialog_url' => 'popup.php', 83 'iframe_css' => $css, 84 'base_url' => $GLOBALS['core']->blog->host, 85 'switcher_visual_title' => __('visual'), 86 'switcher_source_title' => __('source'), 87 'legend_msg' => __('You can use the following shortcuts to format your text.'), 88 'elements' => [ 89 'blocks' => ['options' => [ 90 'none' => __('-- none --'), 91 'nonebis' => __('-- block format --'), 92 'p' => __('Paragraph'), 93 'h1' => __('Level 1 header'), 94 'h2' => __('Level 2 header'), 95 'h3' => __('Level 3 header'), 96 'h4' => __('Level 4 header'), 97 'h5' => __('Level 5 header'), 98 'h6' => __('Level 6 header'), 99 ]], 100 101 'strong' => ['title' => __('Strong emphasis')], 102 'em' => ['title' => __('Emphasis')], 103 'ins' => ['title' => __('Inserted')], 104 'del' => ['title' => __('Deleted')], 105 'quote' => ['title' => __('Inline quote')], 106 'code' => ['title' => __('Code')], 107 'mark' => ['title' => __('Mark')], 108 'br' => ['title' => __('Line break')], 109 'blockquote' => ['title' => __('Blockquote')], 110 'pre' => ['title' => __('Preformated text')], 111 'ul' => ['title' => __('Unordered list')], 112 'ol' => ['title' => __('Ordered list')], 113 114 'link' => [ 115 'title' => __('Link'), 116 'accesskey' => __('l'), 117 'href_prompt' => __('URL?'), 118 'hreflang_prompt' => __('Language?') 119 ], 120 121 'img' => [ 122 'title' => __('External image'), 123 'src_prompt' => __('URL?') 124 ], 125 126 'img_select' => [ 127 'title' => __('Media chooser'), 128 'accesskey' => __('m') 129 ], 130 131 'post_link' => ['title' => __('Link to an entry')], 132 'removeFormat' => ['title' => __('Remove text formating')] 133 ], 134 'toolbar_bottom' => (boolean) isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('toolbar_bottom') 135 ]; 136 if (!$GLOBALS['core']->auth->check('media,media_admin', $GLOBALS['core']->blog->id)) { 137 $js['elements']['img_select']['disabled'] = true; 138 } 139 61 140 $res = 141 dcPage::jsJson('legacy_editor', $js) . 62 142 dcPage::cssLoad(dcPage::getPF('dcLegacyEditor/css/jsToolBar/jsToolBar.css')) . 63 143 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.js')); … … 69 149 $res .= 70 150 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.dotclear.js')) . 71 '<script type="text/javascript">' . "\n" . 72 "jsToolBar.prototype.dialog_url = 'popup.php'; " . "\n" . 73 "jsToolBar.prototype.iframe_css = '" . 74 'body {' . 75 ' color: #000;' . 76 ' background: #f9f9f9;' . 77 ' margin: 0;' . 78 ' padding: 2px;' . 79 ' border: none;' . 80 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? ' direction: rtl;' : '') . 81 '}' . 82 'code {' . 83 ' color: #666;' . 84 ' font-weight: bold;' . 85 '}' . 86 'body > p:first-child {' . 87 ' margin-top: 0;' . 88 '}' . 89 "'; " . "\n" . 90 "jsToolBar.prototype.base_url = '" . html::escapeJS($GLOBALS['core']->blog->host) . "'; " . "\n" . 91 "jsToolBar.prototype.switcher_visual_title = '" . html::escapeJS(__('visual')) . "'; " . "\n" . 92 "jsToolBar.prototype.switcher_source_title = '" . html::escapeJS(__('source')) . "'; " . "\n" . 93 "jsToolBar.prototype.legend_msg = '" . 94 html::escapeJS(__('You can use the following shortcuts to format your text.')) . "'; " . "\n" . 95 "jsToolBar.prototype.elements.blocks.options.none = '" . html::escapeJS(__('-- none --')) . "'; " . "\n" . 96 "jsToolBar.prototype.elements.blocks.options.nonebis = '" . html::escapeJS(__('-- block format --')) . "'; " . "\n" . 97 "jsToolBar.prototype.elements.blocks.options.p = '" . html::escapeJS(__('Paragraph')) . "'; " . "\n" . 98 "jsToolBar.prototype.elements.blocks.options.h1 = '" . html::escapeJS(__('Level 1 header')) . "'; " . "\n" . 99 "jsToolBar.prototype.elements.blocks.options.h2 = '" . html::escapeJS(__('Level 2 header')) . "'; " . "\n" . 100 "jsToolBar.prototype.elements.blocks.options.h3 = '" . html::escapeJS(__('Level 3 header')) . "'; " . "\n" . 101 "jsToolBar.prototype.elements.blocks.options.h4 = '" . html::escapeJS(__('Level 4 header')) . "'; " . "\n" . 102 "jsToolBar.prototype.elements.blocks.options.h5 = '" . html::escapeJS(__('Level 5 header')) . "'; " . "\n" . 103 "jsToolBar.prototype.elements.blocks.options.h6 = '" . html::escapeJS(__('Level 6 header')) . "'; " . "\n" . 104 "jsToolBar.prototype.elements.strong.title = '" . html::escapeJS(__('Strong emphasis')) . "'; " . "\n" . 105 "jsToolBar.prototype.elements.em.title = '" . html::escapeJS(__('Emphasis')) . "'; " . "\n" . 106 "jsToolBar.prototype.elements.ins.title = '" . html::escapeJS(__('Inserted')) . "'; " . "\n" . 107 "jsToolBar.prototype.elements.del.title = '" . html::escapeJS(__('Deleted')) . "'; " . "\n" . 108 "jsToolBar.prototype.elements.quote.title = '" . html::escapeJS(__('Inline quote')) . "'; " . "\n" . 109 "jsToolBar.prototype.elements.code.title = '" . html::escapeJS(__('Code')) . "'; " . "\n" . 110 "jsToolBar.prototype.elements.mark.title = '" . html::escapeJS(__('Mark')) . "'; " . "\n" . 111 "jsToolBar.prototype.elements.br.title = '" . html::escapeJS(__('Line break')) . "'; " . "\n" . 112 "jsToolBar.prototype.elements.blockquote.title = '" . html::escapeJS(__('Blockquote')) . "'; " . "\n" . 113 "jsToolBar.prototype.elements.pre.title = '" . html::escapeJS(__('Preformated text')) . "'; " . "\n" . 114 "jsToolBar.prototype.elements.ul.title = '" . html::escapeJS(__('Unordered list')) . "'; " . "\n" . 115 "jsToolBar.prototype.elements.ol.title = '" . html::escapeJS(__('Ordered list')) . "'; " . "\n" . 116 117 "jsToolBar.prototype.elements.link.title = '" . html::escapeJS(__('Link')) . "'; " . "\n" . 118 "jsToolBar.prototype.elements.link.accesskey = '" . html::escapeJS(__('l')) . "'; " . "\n" . 119 "jsToolBar.prototype.elements.link.href_prompt = '" . html::escapeJS(__('URL?')) . "'; " . "\n" . 120 "jsToolBar.prototype.elements.link.hreflang_prompt = '" . html::escapeJS(__('Language?')) . "'; " . "\n" . 121 122 "jsToolBar.prototype.elements.img.title = '" . html::escapeJS(__('External image')) . "'; " . "\n" . 123 "jsToolBar.prototype.elements.img.src_prompt = '" . html::escapeJS(__('URL?')) . "'; " . "\n" . 124 125 "jsToolBar.prototype.elements.img_select.title = '" . html::escapeJS(__('Media chooser')) . "'; " . "\n" . 126 "jsToolBar.prototype.elements.img_select.accesskey = '" . html::escapeJS(__('m')) . "'; " . "\n" . 127 "jsToolBar.prototype.elements.post_link.title = '" . html::escapeJS(__('Link to an entry')) . "'; " . "\n" . 128 "jsToolBar.prototype.elements.removeFormat = jsToolBar.prototype.elements.removeFormat || {}; " . "\n" . 129 "jsToolBar.prototype.elements.removeFormat.title = '" . html::escapeJS(__('Remove text formating')) . "'; " . "\n"; 130 131 if (!$GLOBALS['core']->auth->check('media,media_admin', $GLOBALS['core']->blog->id)) { 132 $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 133 } 134 135 $res .= "jsToolBar.prototype.toolbar_bottom = " . 136 (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('toolbar_bottom') ? 'true' : 'false') . ";\n"; 137 138 $res .= 139 "</script>\n"; 151 dcPage::jsLoad(dcPage::getPF('dcLegacyEditor/js/jsToolBar/jsToolBar.config.js')); 140 152 141 153 return $res; -
plugins/dcLegacyEditor/js/_post_editor.js
r3880 r3945 1 /*global $, dotclear, jsToolBar */1 /*global $, dotclear, jsToolBar, getData */ 2 2 'use strict'; 3 4 // Get context 5 Object.assign(dotclear, getData('legacy_editor_ctx')); 3 6 4 7 $(function() { … … 6 9 return; 7 10 } 11 8 12 if (dotclear.legacy_editor_context === undefined || 9 13 dotclear.legacy_editor_tags_context[dotclear.legacy_editor_context] === undefined) { -
plugins/importExport/inc/class.dc.ieModule.php
r3874 r3944 10 10 */ 11 11 12 if (!defined('DC_RC_PATH')) {return;} 12 if (!defined('DC_RC_PATH')) { 13 return; 14 } 13 15 14 16 abstract class dcIeModule … … 74 76 '<h3>' . __('Congratulation!') . '</h3>' . 75 77 '<p class="success">' . __('Your blog has been successfully imported. Welcome on Dotclear 2!') . '</p>' . 76 '<ul><li><strong><a href="' . $this->core-> decode('admin.post') . '">' . __('Why don\'t you blog this now?') . '</a></strong></li>' .77 '<li>' . __('or') . ' <a href="' . $this->core-> decode('admin.home') . '">' . __('visit your dashboard') . '</a></li></ul>';78 '<ul><li><strong><a href="' . $this->core->adminurl->decode('admin.post') . '">' . __('Why don\'t you blog this now?') . '</a></strong></li>' . 79 '<li>' . __('or') . ' <a href="' . $this->core->adminurl->decode('admin.home') . '">' . __('visit your dashboard') . '</a></li></ul>'; 78 80 } 79 81 } -
plugins/widgets/_widgets_functions.php
r3874 r3948 36 36 ($w->title ? $w->renderTitle('<label for="q">' . html::escapeHTML($w->title) . '</label>') : '') . 37 37 '<form action="' . $core->blog->url . '" method="get" role="search">' . 38 '<fieldset>' .39 38 '<p><input type="text" size="10" maxlength="255" id="q" name="q" value="' . $value . '" ' . 40 39 ($w->placeholder ? 'placeholder="' . html::escapeHTML($w->placeholder) . '"' : '') . 41 40 ' aria-label="' . __('Search') . '"/> ' . 42 '<input type="submit" class="submit" value="ok" /></p>' . 43 '</fieldset>' . 41 '<input type="submit" class="submit" value="ok" title="' . __('Search') . '" /></p>' . 44 42 '</form>'); 45 43 }
Note: See TracChangeset
for help on using the changeset viewer.