Changeset 2354:d388f7fdcb4e for admin
- Timestamp:
- 10/13/13 21:55:41 (12 years ago)
- Branch:
- 2.6
- Location:
- admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_plugins.js
r2353 r2354 1 dotclear.moduleExpander = 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.viewModuleContent(this,this.line); };11 12 td.insertBefore(img,td.firstChild);13 };14 15 dotclear.modulesExpander = function(line,lines) {16 var td = line.firstChild;17 18 var img = document.createElement('img');19 img.src = dotclear.img_plus_src;20 img.alt = dotclear.img_plus_alt;21 img.className = 'expand';22 $(img).css('cursor','pointer');23 img.lines = lines;24 img.onclick = function() { dotclear.viewModulesContent(this,this.lines); };25 26 td.insertBefore(img,td.firstChild);27 };28 29 dotclear.viewModulesContent = function(img,lines) {30 31 action = 'toggle';32 33 if (img.alt == dotclear.img_plus_alt) {34 img.src = dotclear.img_minus_src;35 img.alt = dotclear.img_minus_alt;36 action = 'open';37 } else {38 img.src = dotclear.img_plus_src;39 img.alt = dotclear.img_plus_alt;40 action = 'close';41 }42 43 lines.each(function() {44 var td = this.firstChild;45 dotclear.viewModuleContent(td.firstChild,td.firstChild.line,action);46 });47 };48 49 dotclear.viewModuleContent = function(img,line,action) {50 51 var action = action || 'toggle';52 var cols = $('td',$(line)).length53 var sp = line.id.split('_m_');54 var listId=sp[0];55 var moduleId= sp[1];56 57 var tr = document.getElementById('pe'+moduleId);58 59 if ( !tr && ( action == 'toggle' || action == 'open' ) ) {60 tr = document.createElement('tr');61 tr.id = 'pe'+moduleId;62 63 var td = document.createElement('td');64 td.colSpan = cols;65 td.className = 'expand';66 tr.appendChild(td);67 68 img.src = dotclear.img_minus_src;69 img.alt = dotclear.img_minus_alt;70 71 // Get post content72 $.get('services.php',{f:'getModuleById', id: moduleId, list: listId},function(data) {73 var rsp = $(data).children('rsp')[0];74 75 if (rsp.attributes[0].value == 'ok') {76 var author = $(rsp).find('author').text();77 var details = $(rsp).find('details').text();78 var support = $(rsp).find('support').text();79 var box = document.createElement('div');80 var bloc = document.createElement('ul');81 bloc.className = "mod-more";82 83 if (author) {84 $(bloc).append($('<li class="module-author">'+dotclear.msg.module_author+' '+author+'</li>'));85 }86 if (details) {87 var dd = '';88 dd += '<a class="module-details" href="'+details+'">'+dotclear.msg.module_details+'</a>';89 if (support) {90 dd += ' - ';91 dd += '<a class="module-support" href="'+support+'">'+dotclear.msg.module_support+'</a>';92 }93 $(bloc).append($('<li>'+dd+'</li>'));94 }95 96 $(td).append($(box).append(bloc));97 98 var section = $(rsp).find('section').text();99 var tags = $(rsp).find('tags').text();100 101 var boxb = document.createElement('div');102 var blocb = document.createElement('ul');103 blocb.className = "mod-more";104 105 if (section) {106 $(blocb).append($('<li class="module-section">'+dotclear.msg.module_section+' '+section+'</li>'));107 }108 if (tags) {109 $(blocb).append($('<li class="module-tags">'+dotclear.msg.module_tags+' '+tags+'</li>'));110 }111 $(td).append($(boxb).append(blocb));112 } else {113 alert($(rsp).find('message').text());114 }115 });116 117 $(line).addClass('expand');118 line.parentNode.insertBefore(tr,line.nextSibling);119 }120 else if (tr && tr.style.display == 'none' && ( action == 'toggle' || action == 'open' ) )121 {122 $(tr).css('display', 'table-row');123 $(line).addClass('expand');124 img.src = dotclear.img_minus_src;125 img.alt = dotclear.img_minus_alt;126 }127 else if (tr && tr.style.display != 'none' && ( action == 'toggle' || action == 'close' ) )128 {129 $(tr).css('display', 'none');130 $(line).removeClass('expand');131 img.src = dotclear.img_plus_src;132 img.alt = dotclear.img_plus_alt;133 }134 135 parentTable = $(line).parents('table');136 if( parentTable.find('tr.expand').length == parentTable.find('tr.line').length ) {137 img = parentTable.find('tr:not(.line) th:first img');138 img.attr('src',dotclear.img_minus_src);139 img.attr('alt',dotclear.img_minus_alt);140 }141 142 if( parentTable.find('tr.expand').length == 0 ) {143 img = parentTable.find('tr:not(.line) th:first img');144 img.attr('src',dotclear.img_plus_src);145 img.attr('alt',dotclear.img_plus_alt);146 }147 148 };149 150 151 1 $(function() { 152 /*153 // expand all modules lines154 $('table.modules.expandable tr:not(.line)').each(function() {155 dotclear.modulesExpander(this,$('table.modules.expandable tr.line'));156 });157 */158 2 // expand a module line 159 $('table.modules.expandable tr.line').each(function() { 160 dotclear.moduleExpander(this); 3 $('table.modules.expandable tr.line').each(function(){ 4 $('td.module-name',this).toggleWithLegend($(this).next('.module-more'),{ 5 img_on_src: dotclear.img_plus_src, 6 img_on_alt: dotclear.img_plus_alt, 7 img_off_src: dotclear.img_minus_src, 8 img_off_alt: dotclear.img_minus_alt, 9 legend_click: true 10 }); 161 11 }); 162 12 -
admin/plugins.php
r2337 r2354 162 162 ->setModules($modules) 163 163 ->displayModules( 164 /* cols */ array('expander', 'icon', 'name', ' config', 'version', 'desc', 'distrib'),164 /* cols */ array('expander', 'icon', 'name', 'version', 'desc', 'distrib'), 165 165 /* actions */ array('deactivate', 'delete', 'behavior') 166 166 ); -
admin/style/default.css
r2352 r2354 2036 2036 padding: 4px 4px 0 20px; 2037 2037 } 2038 .modules a.module-config { 2039 /* todo: add icon here */ 2040 padding: 4px 4px 0 20px; 2041 } 2038 2042 #m_search { 2039 2043 background: transparent url(search.png) no-repeat 4px center;
Note: See TracChangeset
for help on using the changeset viewer.