Changeset 2609:c26642f775e2 for admin/js
- Timestamp:
- 12/10/13 09:00:09 (12 years ago)
- Branch:
- twig
- Parents:
- 2468:d7fda5a0bd39 (diff), 2608:3365c9df16a6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_post.js
r2313 r2593 1 dotclear.commentExpander = function(line) { 2 var td = line.firstChild; 3 4 var img = document.createElement('img'); 5 img.src = dotclear.img_plus_src; 6 img.alt = dotclear.img_plus_alt; 7 img.className = 'expand'; 8 $(img).css('cursor','pointer'); 9 img.line = line; 10 img.onclick = function() { dotclear.viewCommentContent(this,this.line); }; 11 12 td.insertBefore(img,td.firstChild); 13 }; 14 15 dotclear.viewCommentContent = function(img,line) { 16 var commentId = line.id.substr(1); 17 1 dotclear.viewCommentContent = function(line,action) { 2 var commentId = $(line).attr('id').substr(1); 18 3 var tr = document.getElementById('ce'+commentId); 19 4 … … 26 11 tr.appendChild(td); 27 12 28 img.src = dotclear.img_minus_src;29 img.alt = dotclear.img_minus_alt;30 31 13 // Get comment content 32 14 $.get('services.php',{f:'getCommentById',id: commentId},function(data) { … … 60 42 $(tr).toggle(); 61 43 $(line).toggleClass('expand'); 62 img.src = dotclear.img_minus_src;63 img.alt = dotclear.img_minus_alt;64 44 } 65 45 else … … 67 47 $(tr).toggle(); 68 48 $(line).toggleClass('expand'); 69 img.src = dotclear.img_plus_src;70 img.alt = dotclear.img_plus_alt;71 49 } 72 50 }; … … 90 68 $(this).val(last_post_format); 91 69 } 92 70 93 71 $('.format_control > *').addClass('hide'); 94 72 $('.format_control:not(.control_no_'+$(this).val()+') > *').removeClass('hide'); … … 102 80 if (document.getElementById('comment_content')) { 103 81 var commentTb = new jsToolBar(document.getElementById('comment_content')); 82 commentTb.draw('xhtml'); 104 83 } 105 84 … … 128 107 a.className = 'button '; 129 108 $(a).click(function() { 130 109 131 110 excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html(); 132 post_content 133 111 post_content = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html(); 112 134 113 var params = { 135 114 xd_check: dotclear.nonce, … … 146 125 return false; 147 126 } 148 127 149 128 $('.message, .success, .error, .warning-msg').remove(); 150 129 … … 152 131 var p = document.createElement('p'); 153 132 p.id = 'markup-validator'; 154 133 155 134 $(p).addClass('success'); 156 135 $(p).text(dotclear.msg.xhtml_valid); … … 162 141 var div = document.createElement('div'); 163 142 div.id = 'markup-validator'; 164 143 165 144 $(div).addClass('error'); 166 145 $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text()); … … 185 164 186 165 a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator)); 187 166 188 167 $('.format_control > *').addClass('hide'); 189 168 $('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide'); … … 266 245 267 246 $('#comments').onetabload(function() { 268 $('#form-comments .comments-list tr.line').each(function() { 269 dotclear.commentExpander(this); 247 $.expandContent({ 248 lines:$('#form-comments .comments-list tr.line'), 249 callback:dotclear.viewCommentContent 270 250 }); 271 251 $('#form-comments .checkboxes-helpers').each(function() { … … 277 257 278 258 $('#trackbacks').onetabload(function() { 279 $('#form-trackbacks .comments-list tr.line').each(function() { 280 dotclear.commentExpander(this); 259 $.expandContent({ 260 lines:$('#form-trackbacks .comments-list tr.line'), 261 callback:dotclear.viewCommentContent 281 262 }); 282 263 $('#form-trackbacks .checkboxes-helpers').each(function() {
Note: See TracChangeset
for help on using the changeset viewer.