Changes in [1749:5b81895af165:1823:6dea7b458fb9]
- Files:
-
- 8 edited
-
admin/js/_post.js (modified) (3 diffs)
-
admin/js/common.js (modified) (3 diffs)
-
admin/js/meta-editor.js (modified) (5 diffs)
-
admin/post.php (modified) (2 diffs)
-
admin/style/default.css (modified) (1 diff)
-
plugins/pings/lib.pings.php (modified) (1 diff)
-
plugins/pings/post.js (modified) (1 diff)
-
plugins/tags/style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_post.js
r1717 r1817 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 … … 117 124 return window.confirm(dotclear.msg.confirm_delete_post); 118 125 }); 126 127 // Markup validator 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); 131 a.href = '#'; 132 a.className = 'button '; 133 $(a).click(function() { 134 135 excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html(); 136 post_content = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html(); 137 138 excerpt_content = excerpt_content.split('<p><br></p>').join(''); 139 post_content = post_content.split('<p><br></p>').join(''); 140 141 var params = { 142 xd_check: dotclear.nonce, 143 f: 'validatePostMarkup', 144 excerpt: excerpt_content, 145 content: post_content, 146 format: $('#post_format').get(0).value, 147 lang: $('#post_lang').get(0).value 148 }; 149 150 $.post('services.php',params,function(data) { 151 if ($(data).find('rsp').attr('status') != 'ok') { 152 alert($(data).find('rsp message').text()); 153 return false; 154 } 155 156 if ($(data).find('valid').text() == 1) { 157 var p = document.createElement('p'); 158 p.id = 'markup-validator'; 159 160 if ($('#markup-validator').length > 0) { 161 $('#markup-validator').remove(); 162 } 163 164 $(p).addClass('message'); 165 $(p).text(dotclear.msg.xhtml_valid); 166 $('#entry-content h3').after(p); 167 $(p).backgroundFade({sColor:'#666666',eColor:'#ffcc00',steps:50},function() { 168 $(this).backgroundFade({sColor:'#ffcc00',eColor:'#666666'}); 169 }); 170 } else { 171 var div = document.createElement('div'); 172 div.id = 'markup-validator'; 173 174 if ($('#markup-validator').length > 0) { 175 $('#markup-validator').remove(); 176 } 177 178 $(div).addClass('error'); 179 $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text()); 180 $('#entry-content h3').after(div); 181 $(div).backgroundFade({sColor:'#ffffff',eColor:'#FFBABA',steps:50},function() { 182 $(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'}); 183 }); 184 } 185 186 return false; 187 }); 188 189 return false; 190 }); 191 192 a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator)); 193 194 $('.format_control > *').addClass('hide'); 195 if ( last_post_format == 'xhtml' ) { 196 $('.control_xhtml > *').removeClass('hide'); 197 } else if ( last_post_format == 'wiki' ) { 198 $('.control_wiki > *').removeClass('hide'); 199 } 119 200 120 201 // Hide some fields … … 184 265 }); 185 266 186 // Markup validator187 var h = document.createElement('h4');188 var a = document.createElement('a');189 a.href = '#';190 a.className = 'button';191 $(a).click(function() {192 var params = {193 xd_check: dotclear.nonce,194 f: 'validatePostMarkup',195 excerpt: $('#post_excerpt').text(),196 content: $('#post_content').text(),197 format: $('#post_format').get(0).value,198 lang: $('#post_lang').get(0).value199 };200 201 $.post('services.php',params,function(data) {202 if ($(data).find('rsp').attr('status') != 'ok') {203 alert($(data).find('rsp message').text());204 return false;205 }206 207 if ($(data).find('valid').text() == 1) {208 var p = document.createElement('p');209 p.id = 'markup-validator';210 211 if ($('#markup-validator').length > 0) {212 $('#markup-validator').remove();213 }214 215 $(p).addClass('message');216 $(p).text(dotclear.msg.xhtml_valid);217 $(p).insertAfter(h);218 $(p).backgroundFade({sColor:'#666666',eColor:'#ffcc00',steps:50},function() {219 $(this).backgroundFade({sColor:'#ffcc00',eColor:'#666666'});220 });221 } else {222 var div = document.createElement('div');223 div.id = 'markup-validator';224 225 if ($('#markup-validator').length > 0) {226 $('#markup-validator').remove();227 }228 229 $(div).addClass('error');230 $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text());231 $(div).insertAfter(h);232 $(div).backgroundFade({sColor:'#ffffff',eColor:'#FFBABA',steps:50},function() {233 $(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'});234 });235 }236 237 return false;238 });239 240 return false;241 });242 243 a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator));244 h.appendChild(a);245 $(h).appendTo('#entry-content');246 247 267 // Check unsaved changes before XHTML conversion 248 268 var excerpt = $('#post_excerpt').val(); -
admin/js/common.js
r1699 r1818 263 263 }, 264 264 265 checkboxesHelpers: function(e ) {265 checkboxesHelpers: function(e, target) { 266 266 $(e).append(document.createTextNode(dotclear.msg.to_select)); 267 267 $(e).append(document.createTextNode(' ')); 268 268 269 target = target || $(e).parents('form').find('input[type="checkbox"]'); 270 269 271 var a = document.createElement('a'); 270 272 a.href='#'; 271 273 $(a).append(document.createTextNode(dotclear.msg.select_all)); 272 274 a.onclick = function() { 273 $(this).parents('form').find('input[type="checkbox"]').check();275 target.check(); 274 276 return false; 275 277 }; … … 282 284 $(a).append(document.createTextNode(dotclear.msg.no_selection)); 283 285 a.onclick = function() { 284 $(this).parents('form').find('input[type="checkbox"]').unCheck();286 target.unCheck(); 285 287 return false; 286 288 }; … … 293 295 $(a).append(document.createTextNode(dotclear.msg.invert_sel)); 294 296 a.onclick = function() { 295 $(this).parents('form').find('input[type="checkbox"]').toggleCheck();297 target.toggleCheck(); 296 298 return false; 297 299 }; -
admin/js/meta-editor.js
r1741 r1819 113 113 114 114 addMetaDialog: function() { 115 var This = this;116 115 117 116 if (this.submit_button == null) { … … 121 120 } 122 121 123 // View meta list124 var a = $('<a href="#">' + this.text_choose + '</a>');125 a.click(function() {126 This.showMetaList(metaEditor.prototype.meta_type,$(this).parent());127 return false;128 });129 122 if (this.text_separation != '') { 130 123 this.target.append($('<p></p>').addClass('form-note').append(this.text_separation.replace(/%s/,this.meta_type))); 131 124 } 132 this.target.append($('<p></p>').append(a)); 125 126 this.showMetaList(metaEditor.prototype.meta_type,this.target); 127 133 128 }, 134 129 135 130 showMetaList: function(type,target) { 136 target.empty();137 target.append('...');138 target.addClass('addMeta');139 131 140 132 var params = { … … 151 143 152 144 $.get(this.service_uri,params,function(data) { 145 146 var pl = $('<p class="addMeta"></p>'); 147 148 $('.addMeta').remove(); 149 153 150 if ($(data).find('meta').length > 0) { 154 target.empty();151 pl.empty(); 155 152 var meta_link; 156 153 … … 165 162 166 163 if (i>0) { 167 target.append(', ');164 pl.append(', '); 168 165 } 169 target.append(meta_link);166 pl.append(meta_link); 170 167 }); 171 168 … … 177 174 return false; 178 175 }); 179 target.append(', ').append(a_more); 180 } 176 pl.append(', ').append(a_more); 177 178 pl.addClass('hide'); 179 180 var pa = $('<p></p>'); 181 target.append(pa); 182 183 var a = $('<a href="#" class="metaGetList">' + This.text_choose + '</a>'); 184 a.click(function() { 185 $('.addMeta').removeClass('hide'); 186 $('.metaGetList').remove(); 187 return false; 188 }); 189 190 pa.append(a); 191 } 192 193 target.append(pl); 194 181 195 } else { 182 target.empty();196 pl.empty(); 183 197 } 184 198 }); -
admin/post.php
r1741 r1822 413 413 '<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal'). 414 414 '</p>'. 415 '<p >'.($post_id && $post_format != 'xhtml' ?416 '<a id="convert-xhtml" class="button " href="post.php?id='.$post_id.'&xconv=1">'.417 __('Convert to XHTML').'</a> ' : '').'</p></div>')),415 '<p class="format_control control_wiki">'. 416 '<a id="convert-xhtml" class="button'.($post_id && $post_format != 'wiki' ? 'hide' : '').'" href="post.php?id='.$post_id.'&xconv=1">'. 417 __('Convert to XHTML').'</a></p></div>')), 418 418 'metas-box' => array( 419 419 'title' => __('Ordering'), … … 491 491 492 492 "post_content" => 493 '<p class="area" ><label class="required" '.493 '<p class="area" id="content-area"><label class="required" '. 494 494 'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '. 495 495 form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)). -
admin/style/default.css
r1749 r1823 1910 1910 } 1911 1911 /* caché pour tout le monde */ 1912 .hide {1912 .hide, .button.hide { 1913 1913 display: none; 1914 1914 } -
plugins/pings/lib.pings.php
r1398 r1818 65 65 $item .= 66 66 '<p class="ping-services"><label for="pings_do-'.$i.'" class="classic">'. 67 form::checkbox(array('pings_do[]','pings_do-'.$i),html::escapeHTML($v),in_array($v,$pings_do) ).' '.67 form::checkbox(array('pings_do[]','pings_do-'.$i),html::escapeHTML($v),in_array($v,$pings_do), 'check-ping-services').' '. 68 68 html::escapeHTML($k).'</label></p>'; 69 69 $i++; -
plugins/pings/post.js
r1699 r1818 4 4 p = $('<p></p>'); 5 5 p.addClass('ping-services'); 6 a = $('<a href="#"></a>'); 7 a.text(dotclear.msg.check_all); 8 a.click(function() { 9 $('p.ping-services input[type="checkbox"]').attr('checked','checked'); 10 return false; 11 }); 12 $('p.ping-services:last').after(p.append(a)); 6 $('p.ping-services:last').after(p); 7 dotclear.checkboxesHelpers($('p.ping-services:last').get(0), $('.check-ping-services')); 13 8 } 14 9 $('h5.ping-services').toggleWithLegend($('p.ping-services'),{ -
plugins/tags/style.css
r0 r1820 99 99 color: white; 100 100 } 101 #post_meta_input { 102 margin: 0 0.5em 0 0; 103 width: 13em; 104 } 105 #post_meta_input:focus { 106 -moz-box-sizing: content-box; 107 } 108 #tags-edit input[type=button] { 109 width: 3.5em; 110 }
Note: See TracChangeset
for help on using the changeset viewer.
