Changeset 1812:39cc57b045d6
- Timestamp:
- 08/31/13 15:07:38 (10 years ago)
- Branch:
- Ticket #1539
- Location:
- admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_post.js
r1638 r1812 90 90 $(this).val(last_post_format); 91 91 } 92 93 $('.format_control > *').addClass('hide'); 94 if( $(this).val() == 'xhtml' ) { 95 $('.control_xhtml > *').removeClass('hide'); 96 } else if ( $(this).val() == 'wiki' ) { 97 $('.control_wiki > *').removeClass('hide'); 98 } 92 99 }); 93 100 … … 118 125 }); 119 126 120 // Hide some fields121 $('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{122 cookie: 'dcx_post_notes',123 legend_click:true,124 hide: $('#post_notes').val() == ''125 });126 $('#create_cat').toggleWithLegend($('#create_cat').parent().children().not('#create_cat'),{127 // no cookie on new category as we don't use this every day128 legend_click: true129 });130 $('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'),{131 cookie: 'dcx_post_lang',132 legend_click: true133 });134 $('#post_password').parent().children('label').toggleWithLegend($('#post_password'),{135 cookie: 'dcx_post_password',136 legend_click: true,137 hide: $('#post_password').val() == ''138 });139 $('#post_status').parent().children('label').toggleWithLegend($('#post_status'),{140 cookie: 'dcx_post_status',141 legend_click: true142 });143 $('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'),{144 cookie: 'dcx_post_dt',145 legend_click: true146 });147 $('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'),{148 cookie: 'dcx_post_format',149 legend_click: true150 });151 $('#cat_id').parent().children('label').toggleWithLegend($('#cat_id'),{152 cookie: 'cat_id',153 legend_click: true154 });155 $('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'),{156 cookie: 'post_url',157 legend_click: true158 });159 // We load toolbar on excerpt only when it's ready160 $('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{161 cookie: 'dcx_post_excerpt',162 legend_click: true,163 hide: $('#post_excerpt').val() == ''164 });165 166 // Load toolbars167 contentTb.switchMode(formatField.value);168 excerptTb.switchMode(formatField.value);169 170 // Replace attachment remove links by a POST form submit171 $('a.attachment-remove').click(function() {172 this.href = '';173 var m_name = $(this).parents('ul').find('li:first>a').attr('title');174 if (window.confirm(dotclear.msg.confirm_remove_attachment.replace('%s',m_name))) {175 var f = $('#attachment-remove-hide').get(0);176 f.elements['media_id'].value = this.id.substring(11);177 f.submit();178 }179 return false;180 });181 182 127 // Markup validator 183 var h = document.createElement('h4'); 184 var a = document.createElement('a'); 128 var v = $('<div class="format_control control_xhtml"><p><a id="a-validator"></a></p><div/>').get(0); 129 $('.control_wiki').before(v); 130 var a = $('#a-validator').get(0); 185 131 a.href = '#'; 186 a.className = 'button ';132 a.className = 'button '; 187 133 $(a).click(function() { 188 134 var params = { … … 211 157 $(p).addClass('message'); 212 158 $(p).text(dotclear.msg.xhtml_valid); 213 $( p).insertAfter(h);159 $(v).append(p); 214 160 $(p).backgroundFade({sColor:'#666666',eColor:'#ffcc00',steps:50},function() { 215 161 $(this).backgroundFade({sColor:'#ffcc00',eColor:'#666666'}); … … 225 171 $(div).addClass('error'); 226 172 $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text()); 227 $( div).insertAfter(h);173 $(v).append(div); 228 174 $(div).backgroundFade({sColor:'#ffffff',eColor:'#FFBABA',steps:50},function() { 229 175 $(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'}); … … 238 184 239 185 a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator)); 240 h.appendChild(a); 241 $(h).appendTo('#entry-content'); 186 187 $('.format_control > *').addClass('hide'); 188 if ( last_post_format == 'xhtml' ) { 189 $('.control_xhtml > *').removeClass('hide'); 190 } else if ( last_post_format == 'wiki' ) { 191 $('.control_wiki > *').removeClass('hide'); 192 } 193 194 // Hide some fields 195 $('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{ 196 cookie: 'dcx_post_notes', 197 legend_click:true, 198 hide: $('#post_notes').val() == '' 199 }); 200 $('#create_cat').toggleWithLegend($('#create_cat').parent().children().not('#create_cat'),{ 201 // no cookie on new category as we don't use this every day 202 legend_click: true 203 }); 204 $('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'),{ 205 cookie: 'dcx_post_lang', 206 legend_click: true 207 }); 208 $('#post_password').parent().children('label').toggleWithLegend($('#post_password'),{ 209 cookie: 'dcx_post_password', 210 legend_click: true, 211 hide: $('#post_password').val() == '' 212 }); 213 $('#post_status').parent().children('label').toggleWithLegend($('#post_status'),{ 214 cookie: 'dcx_post_status', 215 legend_click: true 216 }); 217 $('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'),{ 218 cookie: 'dcx_post_dt', 219 legend_click: true 220 }); 221 $('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'),{ 222 cookie: 'dcx_post_format', 223 legend_click: true 224 }); 225 $('#cat_id').parent().children('label').toggleWithLegend($('#cat_id'),{ 226 cookie: 'cat_id', 227 legend_click: true 228 }); 229 $('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'),{ 230 cookie: 'post_url', 231 legend_click: true 232 }); 233 // We load toolbar on excerpt only when it's ready 234 $('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{ 235 cookie: 'dcx_post_excerpt', 236 legend_click: true, 237 hide: $('#post_excerpt').val() == '' 238 }); 239 240 // Load toolbars 241 contentTb.switchMode(formatField.value); 242 excerptTb.switchMode(formatField.value); 243 244 // Replace attachment remove links by a POST form submit 245 $('a.attachment-remove').click(function() { 246 this.href = ''; 247 var m_name = $(this).parents('ul').find('li:first>a').attr('title'); 248 if (window.confirm(dotclear.msg.confirm_remove_attachment.replace('%s',m_name))) { 249 var f = $('#attachment-remove-hide').get(0); 250 f.elements['media_id'].value = this.id.substring(11); 251 f.submit(); 252 } 253 return false; 254 }); 242 255 243 256 // Check unsaved changes before XHTML conversion -
admin/post.php
r1625 r1812 445 445 '<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal'). 446 446 '</p>'. 447 '<p >'.($post_id && $post_format != 'xhtml' ?448 '<a id="convert-xhtml" class="button maximal " href="post.php?id='.$post_id.'&xconv=1">'.449 __('Convert to XHTML').'</a> ' : '').'</p></div>')),447 '<p class="format_control control_wiki">'. 448 '<a id="convert-xhtml" class="button maximal '.($post_id && $post_format != 'wiki' ? 'hide' : '').'" href="post.php?id='.$post_id.'&xconv=1">'. 449 __('Convert to XHTML').'</a></p></div>')), 450 450 'metas-box' => array( 451 451 'title' => __('Ordering'), -
admin/style/default.css
r1636 r1812 34 34 a:hover, a:active, a:focus { 35 35 text-decoration: underline; 36 } 37 a.hide, a.button.hide, a.submit.hide { 38 display: none; 36 39 } 37 40 a img, a:link img, a:visited img {
Note: See TracChangeset
for help on using the changeset viewer.