Changeset 131:3aebed53fe73
- Timestamp:
- 05/03/11 13:22:07 (14 years ago)
- Branch:
- userprefs
- Children:
- 132:dece855f9b39, 144:c7ce5ceade9a
- Location:
- admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/common.js
r3 r131 6 6 handler.apply(this, arguments); 7 7 if (existingFunction) 8 existingFunction.apply(this, arguments); 8 existingFunction.apply(this, arguments); 9 9 }; 10 10 })(handlerName in obj ? obj[handlerName] : null); … … 45 45 else 46 46 range = trparent.prevUntil('#'+dotclear.lastclicked); 47 47 48 48 range.find('input[type=checkbox]').setChecked(dotclear.lastclickedstatus); 49 49 this.checked = dotclear.lastclickedstatus; … … 57 57 } 58 58 59 jQuery.fn.toggleWithLegend = function(target,s ) {59 jQuery.fn.toggleWithLegend = function(target,s, callback) { 60 60 var defaults = { 61 61 img_on_src: dotclear.img_plus_src, … … 71 71 }; 72 72 var p = jQuery.extend(defaults,s); 73 73 74 74 if (!target) { return this; } 75 75 76 76 var set_cookie = p.hide ^ p.reverse_cookie; 77 77 if (p.cookie && jQuery.cookie(p.cookie)) { 78 78 p.hide = p.reverse_cookie; 79 79 } 80 81 var toggle = function(i,speed ) {80 81 var toggle = function(i,speed, callback) { 82 82 speed = speed || 0; 83 83 if (p.hide) { 84 84 $(i).get(0).src = p.img_on_src; 85 85 $(i).get(0).alt = p.img_on_alt; 86 target.hide(speed );86 target.hide(speed, callback); 87 87 } else { 88 88 $(i).get(0).src = p.img_off_src; 89 89 $(i).get(0).alt = p.img_off_alt; 90 target.show(speed );90 target.show(speed, callback); 91 91 if (p.fn) { 92 92 p.fn.apply(target); … … 94 94 } 95 95 } 96 96 97 97 if (p.cookie && set_cookie) { 98 98 if (p.hide ^ p.reverse_cookie) { … … 102 102 } 103 103 } 104 104 105 105 p.hide = !p.hide; 106 106 }; 107 107 108 108 return this.each(function() { 109 109 var i = document.createElement('img'); … … 117 117 outline: 'none' 118 118 }); 119 119 120 120 var ctarget = p.legend_click ? this : a; 121 121 122 122 $(ctarget).css('cursor','pointer'); 123 123 $(ctarget).click(function() { 124 toggle(i,p.speed );125 return false; 126 }); 127 128 124 toggle(i,p.speed, callback); 125 return false; 126 }); 127 128 129 129 toggle($(i).get(0)); 130 130 $(this).prepend(' ').prepend(a); … … 136 136 return this; 137 137 } 138 138 139 139 var p = { 140 140 img_on_src: dotclear.img_plus_src, … … 156 156 return false; 157 157 }; 158 158 159 159 var sizeBox = function() { 160 160 This.css('height','auto'); … … 163 163 } 164 164 }; 165 165 166 166 var textToggler = function(o) { 167 167 var i = $('<img src="'+p.img_on_src+'" alt="'+p.img_on_alt+'" />'); 168 168 o.css('cursor','pointer'); 169 169 var hide = true; 170 170 171 171 o.prepend(' ').prepend(i); 172 172 o.click(function() { … … 188 188 }); 189 189 }; 190 190 191 191 this.addClass('help-box'); 192 192 this.find('>hr').remove(); 193 193 194 194 this.find('h3').each(function() { textToggler($(this)); }); 195 195 this.find('h3:first').nextAll('*:not(h3)').hide(); 196 196 sizeBox(); 197 197 198 198 var img = $('<span id="help-button">'+dotclear.msg.help+'</span>'); 199 199 var select = $(); 200 200 img.click(function() { return toggle(); }); 201 201 202 202 $('#content').append(img); 203 203 204 204 return this; 205 205 }; … … 209 209 var dotclear = { 210 210 msg: {}, 211 211 212 212 hideLockable: function() { 213 213 $('div.lockable').each(function() { … … 217 217 this.disabled = true; 218 218 $(this).width(($(this).width()-14) + 'px'); 219 219 220 220 var imgE = document.createElement('img'); 221 221 imgE.src = 'images/locker.png'; … … 224 224 imgE.style.left = ($(this).width()+4)+'px'; 225 225 $(imgE).css('cursor','pointer'); 226 226 227 227 $(imgE).click(function() { 228 228 $(this).hide(); … … 233 233 $(current_lockable_div).find('p.form-note').show(); 234 234 }); 235 235 236 236 $(this).parent().css('position','relative'); 237 237 $(this).after(imgE); … … 239 239 }); 240 240 }, 241 241 242 242 checkboxesHelpers: function(e) { 243 243 var a = document.createElement('a'); … … 249 249 }; 250 250 $(e).append(a); 251 251 252 252 $(e).append(document.createTextNode(' - ')); 253 253 254 254 a = document.createElement('a'); 255 255 a.href='#'; … … 260 260 }; 261 261 $(e).append(a); 262 262 263 263 $(e).append(document.createTextNode(' - ')); 264 264 265 265 a = document.createElement('a'); 266 266 a.href='#'; … … 272 272 $(e).append(a); 273 273 }, 274 274 275 275 postsActionsHelper: function() { 276 276 $('#form-entries').submit(function() { 277 277 var action = $(this).find('select[name="action"]').val(); 278 278 var checked = false; 279 279 280 280 $(this).find('input[name="entries[]"]').each(function() { 281 281 if (this.checked) { … … 283 283 } 284 284 }); 285 285 286 286 if (!checked) { return false; } 287 287 288 288 if (action == 'delete') { 289 289 return window.confirm(dotclear.msg.confirm_delete_posts.replace('%s',$('input[name="entries[]"]:checked').size())); 290 290 } 291 291 292 292 return true; 293 293 }); 294 294 }, 295 295 296 296 commentsActionsHelper: function() { 297 297 $('#form-comments').submit(function() { 298 298 var action = $(this).find('select[name="action"]').val(); 299 299 var checked = false; 300 300 301 301 $(this).find('input[name="comments[]"]').each(function() { 302 302 if (this.checked) { … … 304 304 } 305 305 }); 306 306 307 307 if (!checked) { return false; } 308 308 309 309 if (action == 'delete') { 310 310 return window.confirm(dotclear.msg.confirm_delete_comments.replace('%s',$('input[name="comments[]"]:checked').size())); 311 311 } 312 312 313 313 return true; 314 314 }); … … 323 323 this.form.submit(); 324 324 }); 325 325 326 326 var menu_settings = { 327 327 img_on_src: dotclear.img_menu_off, … … 331 331 } 332 332 $('#blog-menu h3:first').toggleWithLegend($('#blog-menu ul:first'), 333 $.extend({cookie:'dc_blog_menu',hide:false,reverse_cookie:true},menu_settings) 333 $.extend({cookie:'dc_blog_menu',hide:false,reverse_cookie:true},menu_settings), 334 positionFooter 334 335 ); 335 336 $('#system-menu h3:first').toggleWithLegend($('#system-menu ul:first'), 336 $.extend({cookie:'dc_system_menu'},menu_settings) 337 $.extend({cookie:'dc_system_menu'},menu_settings), 338 positionFooter 337 339 ); 338 340 $('#plugins-menu h3:first').toggleWithLegend($('#plugins-menu ul:first'), 339 $.extend({cookie:'dc_plugins_menu'},menu_settings) 341 $.extend({cookie:'dc_plugins_menu'},menu_settings), 342 positionFooter 340 343 ); 341 344 $('#favorites-menu h3:first').toggleWithLegend($('#favorites-menu ul:first'), 342 $.extend({cookie:'dc_favorites_menu'},menu_settings) 345 $.extend({cookie:'dc_favorites_menu'},menu_settings), 346 positionFooter 343 347 ); 344 348 345 349 $('#help').helpViewer(); 346 350 347 351 $('.message').backgroundFade({sColor:'#cccccc',eColor:'#666666',steps:20}); 348 352 $('.error').backgroundFade({sColor:'#f5e5e5',eColor:'#e5bfbf',steps:20}); 349 353 350 354 $('form:has(input[type=password][name=your_pwd])').submit(function() { 351 355 var e = this.elements['your_pwd']; … … 359 363 return true; 360 364 }); 365 366 367 // Sticky footer 368 positionFooter(); 369 function positionFooter() { 370 $("#wrapper").css({ overflow: "auto" }); 371 var page_height = $("#top").height() + $("#wrapper").height() - $("#footer").height(); 372 if( page_height < $(window).height() ){ 373 // calcul de la largeur 374 var page_width = $(document).width() - 30; 375 $("#footer").css({ 376 position: "absolute", 377 bottom: "10px", 378 width: page_width+"px", 379 padding: ".75em 0", 380 marginbottom: "0" 381 }); 382 } else { 383 $("#footer").css({ 384 position: "static", 385 padding: ".75em 0", 386 width: "auto", 387 }); 388 } 389 390 } 391 $(window).resize(positionFooter); 392 361 393 }); 362 394 -
admin/style/default.css
r116 r131 135 135 } 136 136 #info-box a img, #info-box2 a img { 137 vertical-align: middle; 137 vertical-align: middle; 138 138 padding-left: .3em; 139 139 } … … 217 217 218 218 /* favoris en haut */ 219 #fav-add { 219 #fav-add { 220 220 position: absolute; 221 221 top: 3.5em; … … 226 226 clear: both; 227 227 padding: .75em 2em; 228 margin: 6em 1 em .5em 1em;228 margin: 6em 15px .5em 15px; 229 229 -webkit-border-radius: .3em; 230 230 -moz-border-radius: .3em; … … 243 243 } 244 244 #footer p span.credit { 245 font-size: .85em; 245 font-size: .85em; 246 246 font-weight: normal; 247 247 } … … 996 996 } 997 997 .dragable tbody td { 998 998 999 999 } 1000 1000 .handle { … … 1111 1111 p.field { 1112 1112 position: relative; 1113 1113 1114 1114 } 1115 1115 p.field label { … … 1177 1177 } 1178 1178 /* commun */ 1179 input[type=submit], 1180 input[type=reset], 1181 input[type=button], 1179 input[type=submit], 1180 input[type=reset], 1181 input[type=button], 1182 1182 a.button, 1183 a.button.add, 1183 a.button.add, 1184 1184 a.back { 1185 1185 display: inline-block; … … 1190 1190 padding: .1em .75em .1em; 1191 1191 text-shadow: 0 1px 1px rgba(0,0,0,.3); 1192 -webkit-border-radius: .2em; 1192 -webkit-border-radius: .2em; 1193 1193 -moz-border-radius: .2em; 1194 1194 border-radius: .2em; … … 1196 1196 } 1197 1197 /* validation */ 1198 input[type=submit], 1198 input[type=submit], 1199 1199 input[type=button], 1200 1200 a.button.add { … … 1205 1205 background: -moz-linear-gradient(top, #2C8FD1, #2373A8); 1206 1206 } 1207 input[type=submit]:hover, 1208 input[type=reset]:hover, 1207 input[type=submit]:hover, 1208 input[type=reset]:hover, 1209 1209 input[type=button]:hover, 1210 input[type=submit]:focus, 1211 input[type=reset]:focus, 1210 input[type=submit]:focus, 1211 input[type=reset]:focus, 1212 1212 input[type=button]:focus, 1213 1213 a.button.add:hover, … … 1220 1220 } 1221 1221 /* suppression et reset */ 1222 a.button, 1223 a.back, 1224 input[type=submit].reset, 1222 a.button, 1223 a.back, 1224 input[type=submit].reset, 1225 1225 input[type=submit].delete { 1226 1226 border: 1px solid #999; … … 1231 1231 text-shadow: none; 1232 1232 } 1233 a.button:hover, 1234 a.back:hover, 1235 input[type=submit].reset:hover, 1233 a.button:hover, 1234 a.back:hover, 1235 input[type=submit].reset:hover, 1236 1236 input[type=submit].delete:hover, 1237 a.button:focus, 1238 a.back:focus, 1239 input[type=submit].reset:focus, 1237 a.button:focus, 1238 a.back:focus, 1239 input[type=submit].reset:focus, 1240 1240 input[type=submit].delete:focus { 1241 1241 background: #e5e5e5;
Note: See TracChangeset
for help on using the changeset viewer.