- Timestamp:
- Jun 16, 2013, 1:09:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmiliesSupport/template/smiliessupport_admin.tpl
r23234 r23236 44 44 }); 45 45 46 // reset defaults 47 jQuery(".reset").click(function() { 48 var ok = confirm("{/literal}{'Are you sure?'|@translate}{literal}"); 49 if (!ok) return false; 50 51 jQuery.ajax({ 52 url: 'admin.php', 53 type: 'GET', 54 dataType: 'json', 55 data: { 56 action: 'ss_reset', 57 folder: jQuery("select[name='folder']").val(), 58 }, 59 success: function(result) { 60 data = result; 61 edited = false; 62 update(); 63 } 64 }); 65 66 return false; 67 }); 68 46 69 // display edit form before submit 47 70 jQuery("#smiliesupport").submit(function() { … … 57 80 dataType: 'json', 58 81 data: { 59 action: 'ss_ preview',82 action: 'ss_list', 60 83 folder: jQuery("select[name='folder']").val(), 61 84 }, … … 74 97 if (!edit) { 75 98 html+= '<tr>'; 99 76 100 var cols = parseInt(jQuery("input[name='cols']").val()); 77 101 var i=0; … … 80 104 var smiley = data.smilies[file]; 81 105 html+= '<td><a href="#" title="'+ smiley.title +'"><img src="'+ data.path + smiley.file +'"/></a></td>'; 82 if ((parseInt(i)+1)%cols == 0) html+= '</tr><tr>';106 html+= (i+1)%cols==0 ? '</tr><tr>' : ''; 83 107 i++; 84 108 } 85 109 86 110 html+= '</tr>'; 111 112 jQuery(".reset").hide(); 87 113 } 88 114 else { 89 115 {/literal} 90 116 html+= '<tr>' 91 +'<th> {'Smiley'|@translate}</th>'117 +'<th></th>' 92 118 +'<th>{'Name'|@translate}</th>' 93 119 +'<th>{'Shortcuts'|@translate}</th>' 94 +'</tr>'; 120 +'<th class="spacer"></th>' 121 +'<th></th>' 122 +'<th>{'Name'|@translate}</th>' 123 +'<th>{'Shortcuts'|@translate}</th>' 124 +'</tr>' 125 126 +'<tr>'; 95 127 {literal} 128 129 var i=0; 96 130 97 131 for (var file in data.smilies) { 98 132 var smiley = data.smilies[file]; 99 html+= '<tr data-file="'+ smiley.file +'">' 100 +'<td><img src="'+ data.path + smiley.file +'"/></td>' 101 +'<td>'+ smiley.title +'</td>' 102 +'<td>' 103 +'<select name="shortcuts['+ smiley.file +']" class="shortcuts">'; 133 134 html+= 135 '<td><img src="'+ data.path + smiley.file +'"/></td>' 136 +'<td>'+ smiley.title +'</td>' 137 +'<td data-file="'+ smiley.file +'">' 138 +'<select name="shortcuts['+ smiley.file +']" class="shortcuts">'; 139 140 for (var j in smiley.short) { 141 html+= '<option value="'+ smiley.short[j] +'" selected>'+ smiley.short[j] +'</option>'; 142 } 104 143 105 for (var j in smiley.short) { 106 html+= '<option value="'+ smiley.short[j] +'" selected>'+ smiley.short[j] +'</option>'; 107 } 108 109 html+= '</select>' 110 +'</td>' 111 +'</tr>'; 112 } 144 html+= 145 '</select>' 146 +'</td>'; 147 148 html+= (i+1)%2==0 ? '</tr><tr>' : '<td></td>'; 149 i++; 150 } 151 152 html+= '</tr>'; 153 154 jQuery(".reset").show(); 113 155 } 114 156 … … 128 170 onAdd: function(item) { 129 171 edited = true; 130 var file = $(this).parent s("tr").data("file");172 var file = $(this).parent("td").data("file"); 131 173 132 174 if (data.smilies[file].short == null) { … … 139 181 onDelete: function(item) { 140 182 edited = true; 141 var file = $(this).parent s("tr").data("file");183 var file = $(this).parent("td").data("file"); 142 184 143 185 for (var i in data.smilies[file].short) { … … 191 233 <a href="#" class="edit buttonLike">{'Edit shorcuts'|@translate}</a> 192 234 <table id="preview"></table> 235 <a href="#" class="reset buttonLike" style="display:none;">{'Reset defaults'|@translate}</a> 193 236 </fieldset> 194 237
Note: See TracChangeset
for help on using the changeset viewer.