Ticket #5369: jquery-alerts.diff
File jquery-alerts.diff, 7.5 KB (added by , 17 years ago) |
---|
-
wp-includes/js/jquery/jquery.fade.js
1 /* 2 * jQuery fade anything plugin v1.0.1 3 * By rongjunXue (http://rongjunxue.viminta.com) 4 * Copyright 2007 rongjunXue 5 * Released under the MIT and GPL licenses. 6 */ 7 8 jQuery.fn.vkfade = function(color) { 9 var color = color ||"ff8000"; 10 this.addClass("fade-"+color); 11 Fat.fade_all(); 12 this.removeClass("fade-"+color); 13 return this; 14 }; 15 16 jQuery(document).ready(function(){ 17 jQuery(".fade.alert").vkfade(); 18 }); 19 20 // @name The Fade Anything Technique 21 // @namespace http://www.axentric.com/aside/fat/ 22 // @version 1.0-RC1 23 // @author Adam Michela 24 25 var Fat = { 26 make_hex : function (r,g,b) 27 { 28 r = r.toString(16); if (r.length == 1) r = '0' + r; 29 g = g.toString(16); if (g.length == 1) g = '0' + g; 30 b = b.toString(16); if (b.length == 1) b = '0' + b; 31 return "#" + r + g + b; 32 }, 33 fade_all : function (dur) 34 { 35 var a = document.getElementsByTagName("*"); 36 for (var i = 0; i < a.length; i++) 37 { 38 var o = a[i]; 39 var r = /fade-?(\w{3,6})?/.exec(o.className); 40 if (r) 41 { 42 if (!r[1]) r[1] = ""; 43 if (o.id) Fat.fade_element(o.id,null,dur,"#"+r[1]); 44 } 45 } 46 }, 47 fade_element : function (id, fps, duration, from, to) 48 { 49 if (!fps) fps = 30; 50 if (!duration) duration = 3000; 51 if (!from || from=="#") from = "#FFFF33"; 52 if (!to) to = this.get_bgcolor(id); 53 54 var frames = Math.round(fps * (duration / 1000)); 55 var interval = duration / frames; 56 var delay = interval; 57 var frame = 0; 58 59 if (from.length < 7) from += from.substr(1,3); 60 if (to.length < 7) to += to.substr(1,3); 61 62 var rf = parseInt(from.substr(1,2),16); 63 var gf = parseInt(from.substr(3,2),16); 64 var bf = parseInt(from.substr(5,2),16); 65 var rt = parseInt(to.substr(1,2),16); 66 var gt = parseInt(to.substr(3,2),16); 67 var bt = parseInt(to.substr(5,2),16); 68 69 var r,g,b,h; 70 while (frame < frames) 71 { 72 r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames)); 73 g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames)); 74 b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames)); 75 h = this.make_hex(r,g,b); 76 77 setTimeout("Fat.set_bgcolor('"+id+"','"+h+"')", delay); 78 79 frame++; 80 delay = interval * frame; 81 } 82 setTimeout("Fat.set_bgcolor('"+id+"','"+to+"')", delay); 83 }, 84 set_bgcolor : function (id, c) 85 { 86 var o = document.getElementById(id); 87 o.style.backgroundColor = c; 88 }, 89 get_bgcolor : function (id) 90 { 91 var o = document.getElementById(id); 92 while(o) 93 { 94 var c; 95 if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color"); 96 if (o.currentStyle) c = o.currentStyle.backgroundColor; 97 if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; } 98 o = o.parentNode; 99 } 100 if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF"; 101 var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/); 102 if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3])); 103 return c; 104 } 105 } -
wp-includes/js/fat.js
1 // @name The Fade Anything Technique2 // @namespace http://www.axentric.com/aside/fat/3 // @version 1.0-RC14 // @author Adam Michela5 6 var Fat = {7 make_hex : function (r,g,b)8 {9 r = r.toString(16); if (r.length == 1) r = '0' + r;10 g = g.toString(16); if (g.length == 1) g = '0' + g;11 b = b.toString(16); if (b.length == 1) b = '0' + b;12 return "#" + r + g + b;13 },14 fade_all : function (dur)15 {16 var a = document.getElementsByTagName("*");17 for (var i = 0; i < a.length; i++)18 {19 var o = a[i];20 var r = /fade-?(\w{3,6})?/.exec(o.className);21 if (r)22 {23 if (!r[1]) r[1] = "";24 if (o.id) Fat.fade_element(o.id,null,dur,"#"+r[1]);25 }26 }27 },28 fade_element : function (id, fps, duration, from, to)29 {30 if (!fps) fps = 30;31 if (!duration) duration = 3000;32 if (!from || from=="#") from = "#FFFF33";33 if (!to) to = this.get_bgcolor(id);34 35 var frames = Math.round(fps * (duration / 1000));36 var interval = duration / frames;37 var delay = interval;38 var frame = 0;39 40 if (from.length < 7) from += from.substr(1,3);41 if (to.length < 7) to += to.substr(1,3);42 43 var rf = parseInt(from.substr(1,2),16);44 var gf = parseInt(from.substr(3,2),16);45 var bf = parseInt(from.substr(5,2),16);46 var rt = parseInt(to.substr(1,2),16);47 var gt = parseInt(to.substr(3,2),16);48 var bt = parseInt(to.substr(5,2),16);49 50 var r,g,b,h;51 while (frame < frames)52 {53 r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames));54 g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames));55 b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames));56 h = this.make_hex(r,g,b);57 58 setTimeout("Fat.set_bgcolor('"+id+"','"+h+"')", delay);59 60 frame++;61 delay = interval * frame;62 }63 setTimeout("Fat.set_bgcolor('"+id+"','"+to+"')", delay);64 },65 set_bgcolor : function (id, c)66 {67 var o = document.getElementById(id);68 o.style.backgroundColor = c;69 },70 get_bgcolor : function (id)71 {72 var o = document.getElementById(id);73 while(o)74 {75 var c;76 if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color");77 if (o.currentStyle) c = o.currentStyle.backgroundColor;78 if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; }79 o = o.parentNode;80 }81 if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF";82 var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);83 if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3]));84 return c;85 }86 }87 88 addLoadEvent(function () {89 Fat.fade_all();90 }); -
wp-includes/script-loader.php
13 13 function default_scripts() { 14 14 $this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' ); 15 15 16 $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' );17 18 16 $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); 19 17 20 18 $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' ); … … 78 76 $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); 79 77 80 78 $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.4'); 79 $this->add( 'jquery-fade', '/wp-includes/js/jquery/jquery.fade.js', array('jquery'), '1.0.1'); 81 80 $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3'); 82 81 $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2'); 83 82 -
wp-admin/admin.php
26 26 27 27 wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback')); 28 28 29 wp_enqueue_script( ' fat' );29 wp_enqueue_script( 'jquery-fade' ); 30 30 31 31 $editing = false; 32 32