Changeset 3878:fd5264175804 for plugins/pages/js/list.js
- Timestamp:
- 09/17/18 16:46:35 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pages/js/list.js
r3709 r3878 2 2 'use strict'; 3 3 4 dotclear.viewPostContent = function(line, action ) {4 dotclear.viewPostContent = function(line, action, e) { 5 5 action = action || 'toggle'; 6 6 if ($(line).attr('id') == undefined) { … … 11 11 var tr = document.getElementById('pe' + postId); 12 12 13 if (!tr && (action == 'toggle' || action == 'open')) { 14 tr = document.createElement('tr'); 15 tr.id = 'pe' + postId; 16 var td = document.createElement('td'); 17 td.colSpan = 8; 18 td.className = 'expand'; 19 tr.appendChild(td); 20 21 // Get post content 22 $.get('services.php', { 23 f: 'getPostById', 24 id: postId, 25 post_type: '' 26 }, function(data) { 27 var rsp = $(data).children('rsp')[0]; 28 29 if (rsp.attributes[0].value == 'ok') { 30 var post = $(rsp).find('post_display_content').text(); 31 var post_excerpt = $(rsp).find('post_display_excerpt').text(); 32 var res = ''; 33 34 if (post) { 35 if (post_excerpt) { 36 res += post_excerpt + '<hr />'; 37 } 38 res += post; 39 $(td).append(res); 40 } 13 if (!tr) { 14 // Get post content if possible 15 dotclear.getEntryContent(postId, function(content) { 16 if (content) { 17 // Content found 18 tr = document.createElement('tr'); 19 tr.id = 'pe' + postId; 20 var td = document.createElement('td'); 21 td.colSpan = $(line).children('td').length; 22 td.className = 'expand'; 23 tr.appendChild(td); 24 $(td).append(content); 25 $(line).addClass('expand'); 26 line.parentNode.insertBefore(tr, line.nextSibling); 41 27 } else { 42 window.alert($(rsp).find('message').text());28 $(line).toggleClass('expand'); 43 29 } 30 }, { 31 type: 'page', 32 clean: (e.metaKey) 44 33 }); 45 46 $(line).addClass('expand'); 47 line.parentNode.insertBefore(tr, line.nextSibling); 48 } else if (tr && tr.style.display == 'none' && (action == 'toggle' || action == 'open')) { 49 $(tr).css('display', 'table-row'); 50 $(line).addClass('expand'); 51 } else if (tr && tr.style.display != 'none' && (action == 'toggle' || action == 'close')) { 52 $(tr).css('display', 'none'); 53 $(line).removeClass('expand'); 34 } else { 35 $(tr).toggle(); 36 $(line).toggleClass('expand'); 54 37 } 55 38 };
Note: See TracChangeset
for help on using the changeset viewer.