Skip to content
This repository
Browse code

fixed tooltip coloring

  • Loading branch information...
commit a6f84745260797948228f629ed1ca6724c19f374 1 parent de2e67e
Rob G authored January 23, 2012
11  README.markdown
Source Rendered
... ...
@@ -1,4 +1,4 @@
1  
-## WoWTalentNeeds (Recruit by talent) ##
  1
+## WoWTalentNeeds (Recruit by talent) - [Demo][1]
2 2
 
3 3
 Show your World of Warcraft recruitment status by displaying the specific talent needed for each class. Check out the [demo][1]!
4 4
 
@@ -93,7 +93,14 @@ warlock     : "x,x,x",
93 93
 warrior     : "x,x,x"
94 94
 ```
95 95
 
96  
-##Changelog##
  96
+##Changelog
  97
+
  98
+**Version 1.3.2 (1/23/2012)**
  99
+
  100
+* Fixed tooltip coloring.
  101
+ * Apparently, this plugin has been broken since the last update!
  102
+ * It was working fine in Firefox, but not in any other browser. 
  103
+ * Thank to kubiac37 for reporting it to me!
97 104
 
98 105
 **Version 1.3.1 (6/6/2011)**
99 106
 
2  index.html
@@ -4,7 +4,7 @@
4 4
  <title>WoW Talent Needs jQuery Plugin</title>
5 5
 
6 6
  <!-- Required jQuery -->
7  
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
  7
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
8 8
 
9 9
  <!-- Demo files (optional) -->
10 10
  <link rel="stylesheet" href="demo/demo.css">
315  js/wowtalents.js
... ...
@@ -1,178 +1,179 @@
1  
-/* World of Warcraft Recruit By Talent Widget Version 1.3.1
  1
+/* World of Warcraft Recruit By Talent Widget Version 1.3.2
2 2
  * by Rob G (Mottie) 2011
3 3
  * http://mottie.guildportal.com
4 4
  * Dual licensed under the MIT or GPL Version 2.
5 5
  */
6 6
 
7 7
 (function($){
8  
- $.wowTalents = function(el, options){
9  
-  // Avoid scope issues, use 'base' instead of 'this'
10  
-  var base = this, o;
  8
+	$.wowTalents = function(el, options){
  9
+		// Avoid scope issues, use 'base' instead of 'this'
  10
+		var base = this, o;
11 11
 
12  
-  // Access to jQuery and DOM versions of element
13  
-  base.$el = $(el).addClass('recruitTalent');
  12
+		// Access to jQuery and DOM versions of element
  13
+		base.$el = $(el).addClass('recruitTalent');
14 14
 
15  
-  // Add a reverse reference to the DOM object
16  
-  base.$el.data('wowTalents', base);
  15
+		// Add a reverse reference to the DOM object
  16
+		base.$el.data('wowTalents', base);
17 17
 
18  
-  base.init = function(){
19  
-   base.options = o = $.extend({}, $.wowTalents.defaultOptions, options);
  18
+		base.init = function(){
  19
+			base.options = o = $.extend({}, $.wowTalents.defaultOptions, options);
20 20
 
21  
-   // define variables
22  
-   var c,i,j,n,t,tal;
  21
+			// define variables
  22
+			var c,i,j,n,t,tal;
23 23
 
24  
-   // Validate defaultNeed class
25  
-   n = o.defaultNeed.toLowerCase();
26  
-   o.defaultNeed = "None";
27  
-   if (/^l/.test(n)) { o.defaultNeed = 'Low'; }
28  
-   if (/^m/.test(n)) { o.defaultNeed = 'Medium'; }
29  
-   if (/^h/.test(n)) { o.defaultNeed = 'High'; }
  24
+			// Validate defaultNeed class
  25
+			n = o.defaultNeed.toLowerCase();
  26
+			o.defaultNeed = "None";
  27
+			if (/^l/.test(n)) { o.defaultNeed = 'Low'; }
  28
+			if (/^m/.test(n)) { o.defaultNeed = 'Medium'; }
  29
+			if (/^h/.test(n)) { o.defaultNeed = 'High'; }
30 30
 
31  
-   // Find the tooltip background colors: we need set up objects
32  
-   // with the assigned class to get the CSS text color settings
33  
-   t = $('<div><p class="usebg"/><p class="none"/><p class="low"/><p class="medium"/><p class="high"/></div>');
34  
-   o.bg = t.find('.usebg').css('color'); // text color when tooltip background is colored
35  
-   o.cn = t.find('.none').css('color');
36  
-   o.cl = t.find('.low').css('color');
37  
-   o.cm = t.find('.medium').css('color');
38  
-   o.ch = t.find('.high').css('color');
39  
-   o.cd = t.find('.' + o.defaultNeed.toLowerCase()).css('color');
  31
+			// Find the tooltip background colors: we need set up objects
  32
+			// with the assigned class to get the CSS text color settings
  33
+			t = $('<div><p class="usebg"/><p class="none"/><p class="low"/><p class="medium"/><p class="high"/></div>').appendTo($('body'));
  34
+			o.bg = t.find('.usebg').css('color'); // text color when tooltip background is colored
  35
+			o.cn = t.find('.none').css('color');
  36
+			o.cl = t.find('.low').css('color');
  37
+			o.cm = t.find('.medium').css('color');
  38
+			o.ch = t.find('.high').css('color');
  39
+			o.cd = t.find('.' + o.defaultNeed.toLowerCase()).css('color');
  40
+			t.remove();
40 41
 
41  
-   // Make table
42  
-   // **********
43  
-   // define reuseable strings
44  
-   t = '<div>';
45  
-   tal = $.wowTalents.talents.root;
46  
-   for ( i=0; i < tal.length; i++ ) {
47  
-    n = o[tal[i].name.toLowerCase().replace(/\s+/g,'')].split(',');
48  
-    t += '<div class="wowclass"><span class="classIcon ' + tal[i].icon + '"><span';
49  
-    t += (o.useClassColors) ? ' style="color:' + tal[i].color + '">' : '>';
50  
-    t += tal[i].name + '</span></span><span class="talentIcons">';
  42
+			// Make table
  43
+			// **********
  44
+			// define reuseable strings
  45
+			t = '<div>';
  46
+			tal = $.wowTalents.talents.root;
  47
+			for ( i=0; i < tal.length; i++ ) {
  48
+				n = o[tal[i].name.toLowerCase().replace(/\s+/g,'')].split(',');
  49
+				t += '<div class="wowclass"><span class="classIcon ' + tal[i].icon + '"><span';
  50
+				t += (o.useClassColors) ? ' style="color:' + tal[i].color + '">' : '>';
  51
+				t += tal[i].name + '</span></span><span class="talentIcons">';
51 52
 
52  
-    // build tree x3 for each class
53  
-    for ( j=0; j<3; j++ ) {
54  
-     c = base.getStyle( n[j] || '' ); // get class c[0] & hex values c[1]
55  
-     // tooltip width, text color and background color added as metadata into the selected attribute
56  
-     t += '<span class="talentIcon ' + o.tooltipClass + ' ' + tal[i].tree[j][1] + ' ' + c[0].toLowerCase() +
57  
-      (o.tooltipMetadata === 'class' ? ' ' : '" ' + o.tooltipMetadata + '="') + '{width:' + o.tooltipWidth + 'px;color:' +
58  
-      (o.colorBackground ? o.bg + ';background:' : '') + c[1] + ';}" title="' + tal[i].tree[j][0] + ': ' + c[0] + '"></span> ';
59  
-    }
60  
-    t += '</span></div>';
61  
-   }
62  
-   t += '</div>';
63  
-   base.$el.html(t);
64  
-  };
  53
+				// build tree x3 for each class
  54
+				for ( j=0; j<3; j++ ) {
  55
+					c = base.getStyle( n[j] || '' ); // get class c[0] & hex values c[1]
  56
+					// tooltip width, text color and background color added as metadata into the selected attribute
  57
+					t += '<span class="talentIcon ' + o.tooltipClass + ' ' + tal[i].tree[j][1] + ' ' + c[0].toLowerCase() +
  58
+					(o.tooltipMetadata === 'class' ? ' ' : '" ' + o.tooltipMetadata + '="') + '{width:' + o.tooltipWidth + 'px;color:' +
  59
+					(o.colorBackground ? o.bg + ';background:' : '') + c[1] + ';}" title="' + tal[i].tree[j][0] + ': ' + c[0] + '"></span> ';
  60
+				}
  61
+				t += '</span></div>';
  62
+			}
  63
+			t += '</div>';
  64
+			base.$el.html(t);
  65
+		};
65 66
 
66  
-  // Return class & hex color
67  
-  base.getStyle = function(n){
68  
-   n = n.toLowerCase();
69  
-   if (/^n/.test(n)) { return ['None', o.cn]; }
70  
-   if (/^l/.test(n)) { return ['Low', o.cl]; }
71  
-   if (/^m/.test(n)) { return ['Medium', o.cm]; }
72  
-   if (/^h/.test(n)) { return ['High', o.ch]; }
73  
-   return [o.defaultNeed, o.cd];
74  
-  };
  67
+		// Return class & hex color
  68
+		base.getStyle = function(n){
  69
+			n = n.toLowerCase();
  70
+			if (/^n/.test(n)) { return ['None', o.cn]; }
  71
+			if (/^l/.test(n)) { return ['Low', o.cl]; }
  72
+			if (/^m/.test(n)) { return ['Medium', o.cm]; }
  73
+			if (/^h/.test(n)) { return ['High', o.ch]; }
  74
+			return [o.defaultNeed, o.cd];
  75
+		};
75 76
 
76  
-  // Run initializer
77  
-  base.init();
78  
- };
  77
+		// Run initializer
  78
+		base.init();
  79
+	};
79 80
 
80  
- $.wowTalents.defaultOptions = {
81  
-  defaultNeed     : 'Low',     // Default need that is set when no setting is found
82  
-  colorBackground : true,      // Adds need level color to the tooltip background (true) or the text (false)
83  
-  useClassColors  : true,      // Adds class color to the class name when true, otherwise defined in CSS
84  
-  tooltipClass    : 'tooltip', // Class added for tooltip script to target
85  
-  tooltipWidth    : 150,       // Tooltip width, added to the tooltip metadata
86  
-  tooltipMetadata : 'class',   // Location the tooltip meta data is added e.g. {width:150px;color:#ddd;background:#333;}
87  
-  deathknight     : "",        // The classes from here down are empty and will revert to the default need.
88  
-  druid           : "",
89  
-  hunter          : "",
90  
-  mage            : "",
91  
-  paladin         : "",
92  
-  priest          : "",
93  
-  rogue           : "",
94  
-  shaman          : "",
95  
-  warlock         : "",
96  
-  warrior         : ""
97  
- };
  81
+	$.wowTalents.defaultOptions = {
  82
+		defaultNeed     : 'Low',     // Default need that is set when no setting is found
  83
+		colorBackground : true,      // Adds need level color to the tooltip background (true) or the text (false)
  84
+		useClassColors  : true,      // Adds class color to the class name when true, otherwise defined in CSS
  85
+		tooltipClass    : 'tooltip', // Class added for tooltip script to target
  86
+		tooltipWidth    : 150,       // Tooltip width, added to the tooltip metadata
  87
+		tooltipMetadata : 'class',   // Location the tooltip meta data is added e.g. {width:150px;color:#ddd;background:#333;}
  88
+		deathknight     : "",        // The classes from here down are empty and will revert to the default need.
  89
+		druid           : "",
  90
+		hunter          : "",
  91
+		mage            : "",
  92
+		paladin         : "",
  93
+		priest          : "",
  94
+		rogue           : "",
  95
+		shaman          : "",
  96
+		warlock         : "",
  97
+		warrior         : ""
  98
+	};
98 99
 
99  
- $.wowTalents.talents = {"root": [{
100  
-  "name"  : "Death Knight",
101  
-  "icon"  : "icon_class_deathknight",
102  
-  "color" : "#c41f3b",
103  
-  "tree"  : [[ "Blood", "icon_deathknight_blood" ],
104  
-             [ "Frost", "icon_deathknight_frost" ],
105  
-             [ "Unholy", "icon_deathknight_unholy" ]]
106  
- },{
107  
-  "name"  : "Druid",
108  
-  "icon"  : "icon_class_druid",
109  
-  "color" : "#ff7d0a",
110  
-  "tree"  : [[ "Balance", "icon_druid_balance" ],
111  
-             [ "Feral", "icon_druid_feral" ],
112  
-             [ "Restoration", "icon_druid_restoration" ]]
113  
- },{
114  
-  "name"  : "Hunter",
115  
-  "icon"  : "icon_class_hunter",
116  
-  "color" : "#abd473",
117  
-  "tree"  : [[ "Beast Mastery", "icon_hunter_beast_mastery" ],
118  
-             [ "Marksmanship", "icon_hunter_marksmanship" ],
119  
-             [ "Survival", "icon_hunter_survival" ]]
120  
- },{
121  
-  "name"  : "Mage",
122  
-  "icon"  : "icon_class_mage",
123  
-  "color" : "#69ccf0",
124  
-  "tree"  : [[ "Arcane", "icon_mage_arcane" ],
125  
-             [ "Fire", "icon_mage_fire" ],
126  
-             [ "Frost", "icon_mage_frost" ]]
127  
- },{
128  
-  "name"  : "Paladin",
129  
-  "icon"  : "icon_class_paladin",
130  
-  "color" : "#f58cba",
131  
-  "tree"  : [[ "Holy", "icon_paladin_holy" ],
132  
-             [ "Protection", "icon_paladin_protection" ],
133  
-             [ "Retribution", "icon_paladin_retribution" ]]
134  
- },{
135  
-  "name"  : "Priest",
136  
-  "icon"  : "icon_class_priest",
137  
-  "color" : "#ffffff",
138  
-  "tree"  : [[ "Discipline", "icon_priest_discipline" ],
139  
-             [ "Holy", "icon_priest_holy" ],
140  
-             [ "Shadow", "icon_priest_shadow" ]]
141  
- },{
142  
-  "name"  : "Rogue",
143  
-  "icon"  : "icon_class_rogue",
144  
-  "color" : "#fff569",
145  
-  "tree"  : [[ "Assassination", "icon_rogue_assassination" ],
146  
-             [ "Combat", "icon_rogue_combat" ],
147  
-             [ "Subtlety", "icon_rogue_subtlety" ]]
148  
- },{
149  
-  "name"  : "Shaman",
150  
-  "icon"  : "icon_class_shaman",
151  
-  "color" : "#2459ff",
152  
-  "tree"  : [[ "Elemental", "icon_shaman_elemental" ],
153  
-             [ "Enhancement", "icon_shaman_enhancement" ],
154  
-             [ "Restoration", "icon_shaman_restoration" ]]
155  
- },{
156  
-  "name"  : "Warlock",
157  
-  "icon"  : "icon_class_warlock",
158  
-  "color" : "#9482c9",
159  
-  "tree"  : [[ "Affliction", "icon_warlock_affliction" ],
160  
-             [ "Demonology", "icon_warlock_demonology" ],
161  
-             [ "Destruction", "icon_warlock_destruction" ]]
162  
- },{
163  
-  "name"  : "Warrior",
164  
-  "icon"  : "icon_class_warrior",
165  
-  "color" : "#c79c6e",
166  
-  "tree"  : [[ "Arms", "icon_warrior_arms" ],
167  
-             [ "Fury", "icon_warrior_fury" ],
168  
-             [ "Protection", "icon_warrior_protection" ]]
169  
- }
170  
- ]};
  100
+	$.wowTalents.talents = {"root": [{
  101
+		"name"  : "Death Knight",
  102
+		"icon"  : "icon_class_deathknight",
  103
+		"color" : "#c41f3b",
  104
+		"tree"  : [[ "Blood", "icon_deathknight_blood" ],
  105
+		[ "Frost", "icon_deathknight_frost" ],
  106
+		[ "Unholy", "icon_deathknight_unholy" ]]
  107
+	},{
  108
+		"name"  : "Druid",
  109
+		"icon"  : "icon_class_druid",
  110
+		"color" : "#ff7d0a",
  111
+		"tree"  : [[ "Balance", "icon_druid_balance" ],
  112
+		[ "Feral", "icon_druid_feral" ],
  113
+		[ "Restoration", "icon_druid_restoration" ]]
  114
+	},{
  115
+		"name"  : "Hunter",
  116
+		"icon"  : "icon_class_hunter",
  117
+		"color" : "#abd473",
  118
+		"tree"  : [[ "Beast Mastery", "icon_hunter_beast_mastery" ],
  119
+		[ "Marksmanship", "icon_hunter_marksmanship" ],
  120
+		[ "Survival", "icon_hunter_survival" ]]
  121
+	},{
  122
+		"name"  : "Mage",
  123
+		"icon"  : "icon_class_mage",
  124
+		"color" : "#69ccf0",
  125
+		"tree"  : [[ "Arcane", "icon_mage_arcane" ],
  126
+		[ "Fire", "icon_mage_fire" ],
  127
+		[ "Frost", "icon_mage_frost" ]]
  128
+	},{
  129
+		"name"  : "Paladin",
  130
+		"icon"  : "icon_class_paladin",
  131
+		"color" : "#f58cba",
  132
+		"tree"  : [[ "Holy", "icon_paladin_holy" ],
  133
+		[ "Protection", "icon_paladin_protection" ],
  134
+		[ "Retribution", "icon_paladin_retribution" ]]
  135
+	},{
  136
+		"name"  : "Priest",
  137
+		"icon"  : "icon_class_priest",
  138
+		"color" : "#ffffff",
  139
+		"tree"  : [[ "Discipline", "icon_priest_discipline" ],
  140
+		[ "Holy", "icon_priest_holy" ],
  141
+		[ "Shadow", "icon_priest_shadow" ]]
  142
+	},{
  143
+		"name"  : "Rogue",
  144
+		"icon"  : "icon_class_rogue",
  145
+		"color" : "#fff569",
  146
+		"tree"  : [[ "Assassination", "icon_rogue_assassination" ],
  147
+		[ "Combat", "icon_rogue_combat" ],
  148
+		[ "Subtlety", "icon_rogue_subtlety" ]]
  149
+	},{
  150
+		"name"  : "Shaman",
  151
+		"icon"  : "icon_class_shaman",
  152
+		"color" : "#2459ff",
  153
+		"tree"  : [[ "Elemental", "icon_shaman_elemental" ],
  154
+		[ "Enhancement", "icon_shaman_enhancement" ],
  155
+		[ "Restoration", "icon_shaman_restoration" ]]
  156
+	},{
  157
+		"name"  : "Warlock",
  158
+		"icon"  : "icon_class_warlock",
  159
+		"color" : "#9482c9",
  160
+		"tree"  : [[ "Affliction", "icon_warlock_affliction" ],
  161
+		[ "Demonology", "icon_warlock_demonology" ],
  162
+		[ "Destruction", "icon_warlock_destruction" ]]
  163
+	},{
  164
+		"name"  : "Warrior",
  165
+		"icon"  : "icon_class_warrior",
  166
+		"color" : "#c79c6e",
  167
+		"tree"  : [[ "Arms", "icon_warrior_arms" ],
  168
+		[ "Fury", "icon_warrior_fury" ],
  169
+		[ "Protection", "icon_warrior_protection" ]]
  170
+	}
  171
+]};
171 172
 
172  
- $.fn.wowTalents = function(options){
173  
-  return this.each(function(){
174  
-   (new $.wowTalents(this, options));
175  
-  });
176  
- };
  173
+$.fn.wowTalents = function(options){
  174
+	return this.each(function(){
  175
+		(new $.wowTalents(this, options));
  176
+	});
  177
+};
177 178
 
178 179
 })(jQuery);
4  js/wowtalents.min.js
... ...
@@ -1,7 +1,7 @@
1  
-/* World of Warcraft Recruit By Talent Widget Version 1.3.1
  1
+/* World of Warcraft Recruit By Talent Widget Version 1.3.2
2 2
  * by Rob G (Mottie) 2011
3 3
  * http://mottie.guildportal.com
4 4
  * Dual licensed under the MIT or GPL Version 2.
5 5
  */
6 6
 
7  
-(function(d){d.wowTalents=function(j,k){var e=this,a;e.$el=d(j).addClass("recruitTalent");e.$el.data("wowTalents",e);e.init=function(){e.options=a=d.extend({},d.wowTalents.defaultOptions,k);var c,f,h,i,b,g;i=a.defaultNeed.toLowerCase();a.defaultNeed="None";if(/^l/.test(i))a.defaultNeed="Low";if(/^m/.test(i))a.defaultNeed="Medium";if(/^h/.test(i))a.defaultNeed="High";b=d('<div><p class="usebg"/><p class="none"/><p class="low"/><p class="medium"/><p class="high"/></div>');a.bg=b.find(".usebg").css("color"); a.cn=b.find(".none").css("color");a.cl=b.find(".low").css("color");a.cm=b.find(".medium").css("color");a.ch=b.find(".high").css("color");a.cd=b.find("."+a.defaultNeed.toLowerCase()).css("color");b="<div>";g=d.wowTalents.talents.root;for(f=0;f<g.length;f++){i=a[g[f].name.toLowerCase().replace(/\s+/g,"")].split(",");b+='<div class="wowclass"><span class="classIcon '+g[f].icon+'"><span';b+=a.useClassColors?' style="color:'+g[f].color+'">':">";b+=g[f].name+'</span></span><span class="talentIcons">';for(h= 0;h<3;h++)c=e.getStyle(i[h]||""),b+='<span class="talentIcon '+a.tooltipClass+" "+g[f].tree[h][1]+" "+c[0].toLowerCase()+(a.tooltipMetadata==="class"?" ":'" '+a.tooltipMetadata+'="')+"{width:"+a.tooltipWidth+"px;color:"+(a.colorBackground?a.bg+";background:":"")+c[1]+';}" title="'+g[f].tree[h][0]+": "+c[0]+'"></span> ';b+="</span></div>"}b+="</div>";e.$el.html(b)};e.getStyle=function(c){c=c.toLowerCase();if(/^n/.test(c))return["None",a.cn];if(/^l/.test(c))return["Low",a.cl];if(/^m/.test(c))return["Medium", a.cm];if(/^h/.test(c))return["High",a.ch];return[a.defaultNeed,a.cd]};e.init()};d.wowTalents.defaultOptions={defaultNeed:"Low",colorBackground:!0,useClassColors:!0,tooltipClass:"tooltip",tooltipWidth:150,tooltipMetadata:"class",deathknight:"",druid:"",hunter:"",mage:"",paladin:"",priest:"",rogue:"",shaman:"",warlock:"",warrior:""};d.wowTalents.talents={root:[{name:"Death Knight",icon:"icon_class_deathknight",color:"#c41f3b",tree:[["Blood","icon_deathknight_blood"],["Frost","icon_deathknight_frost"], ["Unholy","icon_deathknight_unholy"]]},{name:"Druid",icon:"icon_class_druid",color:"#ff7d0a",tree:[["Balance","icon_druid_balance"],["Feral","icon_druid_feral"],["Restoration","icon_druid_restoration"]]},{name:"Hunter",icon:"icon_class_hunter",color:"#abd473",tree:[["Beast Mastery","icon_hunter_beast_mastery"],["Marksmanship","icon_hunter_marksmanship"],["Survival","icon_hunter_survival"]]},{name:"Mage",icon:"icon_class_mage",color:"#69ccf0",tree:[["Arcane","icon_mage_arcane"],["Fire","icon_mage_fire"], ["Frost","icon_mage_frost"]]},{name:"Paladin",icon:"icon_class_paladin",color:"#f58cba",tree:[["Holy","icon_paladin_holy"],["Protection","icon_paladin_protection"],["Retribution","icon_paladin_retribution"]]},{name:"Priest",icon:"icon_class_priest",color:"#ffffff",tree:[["Discipline","icon_priest_discipline"],["Holy","icon_priest_holy"],["Shadow","icon_priest_shadow"]]},{name:"Rogue",icon:"icon_class_rogue",color:"#fff569",tree:[["Assassination","icon_rogue_assassination"],["Combat","icon_rogue_combat"], ["Subtlety","icon_rogue_subtlety"]]},{name:"Shaman",icon:"icon_class_shaman",color:"#2459ff",tree:[["Elemental","icon_shaman_elemental"],["Enhancement","icon_shaman_enhancement"],["Restoration","icon_shaman_restoration"]]},{name:"Warlock",icon:"icon_class_warlock",color:"#9482c9",tree:[["Affliction","icon_warlock_affliction"],["Demonology","icon_warlock_demonology"],["Destruction","icon_warlock_destruction"]]},{name:"Warrior",icon:"icon_class_warrior",color:"#c79c6e",tree:[["Arms","icon_warrior_arms"], ["Fury","icon_warrior_fury"],["Protection","icon_warrior_protection"]]}]};d.fn.wowTalents=function(j){return this.each(function(){new d.wowTalents(this,j)})}})(jQuery);
  7
+(function(c){c.wowTalents=function(j,k){var d=this,a;d.$el=c(j).addClass("recruitTalent");d.$el.data("wowTalents",d);d.init=function(){d.options=a=c.extend({},c.wowTalents.defaultOptions,k);var i,e,g,h,b,f;h=a.defaultNeed.toLowerCase();a.defaultNeed="None";if(/^l/.test(h))a.defaultNeed="Low";if(/^m/.test(h))a.defaultNeed="Medium";if(/^h/.test(h))a.defaultNeed="High";b=c('<div><p class="usebg"/><p class="none"/><p class="low"/><p class="medium"/><p class="high"/></div>').appendTo(c("body"));a.bg=b.find(".usebg").css("color"); a.cn=b.find(".none").css("color");a.cl=b.find(".low").css("color");a.cm=b.find(".medium").css("color");a.ch=b.find(".high").css("color");a.cd=b.find("."+a.defaultNeed.toLowerCase()).css("color");b.remove();b="<div>";f=c.wowTalents.talents.root;for(e=0;e<f.length;e++){h=a[f[e].name.toLowerCase().replace(/\s+/g,"")].split(",");b+='<div class="wowclass"><span class="classIcon '+f[e].icon+'"><span';b+=a.useClassColors?' style="color:'+f[e].color+'">':">";b+=f[e].name+'</span></span><span class="talentIcons">'; for(g=0;3>g;g++)i=d.getStyle(h[g]||""),b+='<span class="talentIcon '+a.tooltipClass+" "+f[e].tree[g][1]+" "+i[0].toLowerCase()+("class"===a.tooltipMetadata?" ":'" '+a.tooltipMetadata+'="')+"{width:"+a.tooltipWidth+"px;color:"+(a.colorBackground?a.bg+";background:":"")+i[1]+';}" title="'+f[e].tree[g][0]+": "+i[0]+'"></span> ';b+="</span></div>"}d.$el.html(b+"</div>")};d.getStyle=function(c){c=c.toLowerCase();return/^n/.test(c)?["None",a.cn]:/^l/.test(c)?["Low",a.cl]:/^m/.test(c)?["Medium",a.cm]:/^h/.test(c)? ["High",a.ch]:[a.defaultNeed,a.cd]};d.init()};c.wowTalents.defaultOptions={defaultNeed:"Low",colorBackground:!0,useClassColors:!0,tooltipClass:"tooltip",tooltipWidth:150,tooltipMetadata:"class",deathknight:"",druid:"",hunter:"",mage:"",paladin:"",priest:"",rogue:"",shaman:"",warlock:"",warrior:""};c.wowTalents.talents={root:[{name:"Death Knight",icon:"icon_class_deathknight",color:"#c41f3b",tree:[["Blood","icon_deathknight_blood"],["Frost","icon_deathknight_frost"],["Unholy","icon_deathknight_unholy"]]}, {name:"Druid",icon:"icon_class_druid",color:"#ff7d0a",tree:[["Balance","icon_druid_balance"],["Feral","icon_druid_feral"],["Restoration","icon_druid_restoration"]]},{name:"Hunter",icon:"icon_class_hunter",color:"#abd473",tree:[["Beast Mastery","icon_hunter_beast_mastery"],["Marksmanship","icon_hunter_marksmanship"],["Survival","icon_hunter_survival"]]},{name:"Mage",icon:"icon_class_mage",color:"#69ccf0",tree:[["Arcane","icon_mage_arcane"],["Fire","icon_mage_fire"],["Frost","icon_mage_frost"]]},{name:"Paladin", icon:"icon_class_paladin",color:"#f58cba",tree:[["Holy","icon_paladin_holy"],["Protection","icon_paladin_protection"],["Retribution","icon_paladin_retribution"]]},{name:"Priest",icon:"icon_class_priest",color:"#ffffff",tree:[["Discipline","icon_priest_discipline"],["Holy","icon_priest_holy"],["Shadow","icon_priest_shadow"]]},{name:"Rogue",icon:"icon_class_rogue",color:"#fff569",tree:[["Assassination","icon_rogue_assassination"],["Combat","icon_rogue_combat"],["Subtlety","icon_rogue_subtlety"]]},{name:"Shaman", icon:"icon_class_shaman",color:"#2459ff",tree:[["Elemental","icon_shaman_elemental"],["Enhancement","icon_shaman_enhancement"],["Restoration","icon_shaman_restoration"]]},{name:"Warlock",icon:"icon_class_warlock",color:"#9482c9",tree:[["Affliction","icon_warlock_affliction"],["Demonology","icon_warlock_demonology"],["Destruction","icon_warlock_destruction"]]},{name:"Warrior",icon:"icon_class_warrior",color:"#c79c6e",tree:[["Arms","icon_warrior_arms"],["Fury","icon_warrior_fury"],["Protection","icon_warrior_protection"]]}]}; c.fn.wowTalents=function(j){return this.each(function(){new c.wowTalents(this,j)})}})(jQuery);

0 notes on commit a6f8474

Please sign in to comment.
Something went wrong with that request. Please try again.