-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.js
2721 lines (2364 loc) · 66.8 KB
/
base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*!
* Bright JavaScript Library v1.2
* Author: Ryan Clough
*/
(function( window, undefined ) {
var version = 1.2,
isReady = false,
queue = [],
document = window.document,
navigator = window.navigator,
location = window.location,
rmsPrefix = /^-ms-/,
// regedit values
rdashAlpha = /-([a-z]|[0-9])/ig,
rmsPrefix = /^-ms-/,
isSimple = /^.[^:#\[\.,]*$/,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf,
w3c = !!document.addEventListener,
fns = [],
toplevel = false;
// Used by bright.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return ( letter + "" ).toUpperCase();
},
bright = function( selector, context ) {
return new bright.fn.init(selector, context);
};
//intial ready function
bright.fn = bright.prototype = {
init:function(selector, context)
{
/* *\
Selector
\* */
//Initialize....
//the selectors
if (!selector) {
return this;
}
var elementArray = Array(); //houses the multiple elements
if (selector === "body" && !context && document.body) {
elementArray.push(document.body);
this[0] = elementArray;
return this;
}
//first off we, will test the selector varible to see if its empty
if (selector)
{
//lets see if its a string...
if (typeof selector === 'string'){
if (selector.indexOf(',') !== -1)
{
//well, it has a comma in the string, so split it on the commas
var commaSplit = selector.split(',');
var returnArray = [];
for (var i = 0; i < commaSplit.length; i++)
{
var NewSelector = commaSplit[i].replace(" ",'');
returnArray.push(bright(NewSelector)[0]);
}
//since returnArray will have multi-dimensional arrays we need to sort that out....
for (var i = 0; i < returnArray.length; i++)
{
if (returnArray[i].length)
{
//well array..
for (var inner = 0; inner < returnArray[i].length; inner++)
{
elementArray.push(returnArray[i][inner]);
}
}
else
{
break;
}
}
if (!elementArray.length)
elementArray = returnArray;
this[0] = elementArray;
this.context = document;
this.selector = selector;
this.length = elementArray.length;
return this;
}
else if (selector.indexOf(' ') !== -1)
{
//it has spaces...
var spaceSplit = selector.split(/[ :]+?/g);
if (spaceSplit[0].charAt(0) == '#')
{
var IDselector = spaceSplit[0].replace("#", ''),
element = document.getElementById(IDselector);
if (spaceSplit[1].length > 0){
if (spaceSplit[1].indexOf('.') != -1){
var allElements = element.getElementsByTagName('*');
for (var i = 0; i < allElements.length; i++)
{
if (allElements[i].ClassName)
{
if (allElements[i].ClassName == selector.substr(1, selector.length))
{
elementArray.push(allElements[i]);
}
}
}
}
else
{
var allElements = element.getElementsByTagName('*');
for (var i = 0; i < allElements.length; i++)
{
if (allElements[i].tagName)
{
if (allElements[i].tagName == spaceSplit[1].toUpperCase())
{
elementArray.push(allElements[i]);
}
}
}
}
}
if (spaceSplit[2])
{
//hmmm... well it has a :nth-Child value
spaceSplit[2] = spaceSplit[2].replace('nth-child(', '');
spaceSplit[2] = spaceSplit[2].replace(')', '');
var number = parseInt(spaceSplit[2]);
elementArray = [elementArray[number]];
}
this[0] = elementArray;
this.context = document;
this.selector = selector;
this.length = elementArray.length;
return this;
}
else
{
//hmmm className... hmm this would be like bright(".elem li")
var baseSelector = Array();
var allElements = document.getElementsByTagName('*');
for (var i = 0; i < allElements.length; i++)
{
if (allElements[i].className)
{
if (allElements[i].className == spaceSplit[0].substr(1, selector.length))
{
baseSelector.push(allElements[i]);
}
}
}
if (spaceSplit[1])
{
for (var i = 0; i < baseSelector.length; i++){
var elements = baseSelector[i].getElementsByTagName(spaceSplit[1]);
for (var s = 0; s < elements.length; s++)
{
elementArray.push(elements[s]);
}
}
}
this[0] = elementArray;
this.context = document;
this.selector = selector;
this.length = elementArray.length;
return this;
}
}
else if (selector.charAt(0) == '#')
{
//well its an id...
var IDselector = selector.replace("#", '');
var element = document.getElementById(IDselector);
elementArray.push(element);
this[0] = elementArray;
this.length = elementArray.length;
this.context = document;
this.selector = selector;
return this;
}
else if (selector.charAt(0) == '.')
{
//class so bright(".test")
var allElements = document.getElementsByTagName('*');
for (var i = 0; i < allElements.length; i++)
{
if (allElements[i].className)
{
if (allElements[i].className == selector.substr(1, selector.length))
{
elementArray.push(allElements[i]);
}
}
}
this[0] = elementArray;
this.context = document;
this.selector = selector;
this.length = elementArray.length;
return this;
}
}
else if (typeof selector == 'object')
{
//must be an object
if (selector.length > 0)
{
//hmm well this has some stuff in it...
if ((selector.nodeType == 1) && (typeof selector.style == "object") && (typeof selector.ownerDocument == "object"))
{
//hmm now this is just an element
alert('element');
}
else
{
if (selector.selector)
{
//this is a previous selector... lets just get the data from it...
this[0] = selector[0];
this.length = selector[0].length;
this.selector = selector[0];
this.context = document.body;
return this;
}
else
{
//must just be a object array...
this[0] = selector;
this.length = selector.length;
this.selector = selector;
this.context = document.body;
return this;
}
}
}
else
{
elementArray.push(selector);
this[0] = elementArray;
this.context = document;
this.selector = selector;
this.length = elementArray.length;
return this;
}
}
}
else
{
this.length = 0;
this.context = window;
this.selector = "";
return this;
}
},
constructor: function (selector, context)
{
return new bright.fn.init(selector, context);
},
ready: function(fn)
{
if (!isReady)
{
//my own implementation of jQuerys DomReady function
bright.bindReady();
}
return (isReady)? fn.call(document): fns.push(fn);
},
show: function()
{
if (this[0].length > 0)
{
var ele = this[0];
for (var i = 0; i < ele.length; i++)
{
ele[i].style.display = "block";
}
}
else
{
//the base toggle function for just one element...
this[0].style.display = "block";
}
return this;
},
hide: function()
{
if (this[0].length > 0)
{
var ele = this[0];
for (var i = 0; i < ele.length; i++)
{
ele[i].style.display = "none";
}
}
else
{
//the base toggle function for just one element...
this[0].style.display = "none";
}
return this;
},
toggle:function()
{
if (this[0].length > 0)
{
var ele = this[0];
for (var i = 0; i < ele.length; i++)
{
if (ele[i].style.display != "none")
{
ele[i].style.display = "none";
}
else
{
ele[i].style.display = "block";
}
}
}
else
{
//the base toggle function for just one element...
if (ele.style.display != "none")
{
this.style.display = "none";
}
else
{
this.style.display = "block";
}
}
return this;
},
click: function(e)
{
bright(this[0]).each(function(i, elem){
if (elem.addEventListener) {
elem.addEventListener('click', e, false);
} else {
//for ie8 due to ie not working with addEventListener
elem.attachEvent('onclick', e);
}
});
},
slideDown: function (e) {
//its kind of self expantry it makes an element slide down...
//default options now we merge them with the $.extend function to get the right results
if (this[0].length > 0)
{
var e = this[0];
for (var i = 0; i < e.length; i++)
{
bright(e[i]).slideDown(e);
}
}
else
{
var ele = this[0]; //work on easing, with a formular with the speed
var options = {
'speed': 500,
'maxHei': 500,
'minHei': 20,
'padding': false,
'border': false
}
var e = bright("").extend(options, e); //mainly internal use
var time = e.speed;
if (!e.padding) {
ele.style.padding = "0px";
}
if (!e.border) {
ele.style.border = "0px";
}
//this is the object
var slider = ele;
var timer = null;
var maxheight = ((e.minHeight = !undefined) ? e.maxHei : e.minHei); //20
if (slider.style.height == '' && slider.style.display == '') {
slider.style.display = 'block';
slider.style.height = slider.offsetHeight + 'px';
}
function SlideDown() {
var instanceheight = parseInt(slider.style.height);
var init = (new Date()).getTime();
var height = maxheight;
var disp = height - parseInt(slider.style.height);
timer = setInterval(function () {
var instance = (new Date()).getTime() - init;
if (instance < time) {
var pos = Math.floor(disp * instance / time);
result = instanceheight + pos;
slider.style.height = result + 'px';
} else {
slider.style.height = height + 'px'; //safety side ^^
clearInterval(timer);
}
}, 1);
}
SlideDown();
}
return this;
},
slideUp: function (e) {
//its kind of self expantry it makes an element slide Up...
var ele = this[0];
if (!ele)
{
return; //something went wrong... their is no selector...
}
else
{
if (ele.length > 1)
{
for (var i = 0; i < ele.length; i++)
{
bright(ele[i]).slideDown(); //
}
}
}
var options = {
'speed': 500,
'maxHei': 500,
'minHei': 20,
'padding': false,
'border': false
}
var e = bright.extend(options, e);
var time = e.speed;
if (!e.padding) {
//this removes the padding, if the user selects it.
ele.style.padding = "0px";
}
if (!e.border) {
ele.style.border = "0px";
}
var time = e.speed;
//this is the object
var slider = ele;
var timer = null;
var maxheight = ((e.minHeight = !undefined) ? e.minHei : e.maxHei); //20
if (slider.style.height == '' && slider.style.display == '') {
slider.style.display = 'block';
slider.style.height = slider.offsetHeight + 'px';
}
function SlideUp() {
clearInterval(timer);
var instanceheight = parseInt(slider.style.height);
var init = (new Date()).getTime();
var height = maxheight;
var disp = height - parseInt(slider.style.height);
timer = setInterval(function () {
var instance = (new Date()).getTime() - init;
if (instance < time) {
var pos = Math.floor(disp * instance / time);
result = instanceheight + pos;
slider.style.height = result + 'px';
} else {
slider.style.height = height + 'px'; //safety side ^^
clearInterval(timer);
}
}, 1);
}
SlideUp();
return this;
},
slideToggle: function (e) {
//its kind of self expantry it just toggles both slideup and slide down...
if (!e) {
//the will be the defualt values, just in case
var e = {
'speed': 500,
'maxHei': 500,
'minHei': 0,
'padding': false,
'border': false
}
}
var ele = this[0];
if (this[0].length > 0){
for (var i = 0; i < this[0].length; i++)
{
if (parseInt(ele[i].offsetHeight) <= e.minHei || ele[i].style.height == "") {
$(ele[i]).slideDown(e);
} else {
$(ele[i]).slideUp(e);
}
}
}
else
{
if (parseInt(ele.offsetHeight) <= e.minHei || ele.style.height == "") {
$(ele).slideDown(e);
} else {
$(ele).slideUp(e);
}
}
return this;
},
fadeOut: function()
{
bright(this[0]).each(function(i, element){
var op = 1.0; // initial opacity
var FadeOutTimer = setInterval(function () {
if (op <= 0.1){
clearInterval(FadeOutTimer);
element.style.display = 'none';
element.style.opacity = 0;
element.style.filter = 'alpha(opacity=' + 0 + ")";
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op -= 0.1;
}, 100);
});
return this;
},
fadeIn: function()
{
if (this[0].length > 1)
{
var e = this[0];
for (var i = 0; i < e.length; i++)
{
bright(e[i]).fadeOut();
}
}
var element = this[0][0];
var op = 0; // initial opacity
element.style.display = 'inherit';
var timer = setInterval(function () {
if (op >= 1.0){
clearInterval(timer);
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op += 0.1;
}, 100);
return this;
},
fadeToggle: function()
{
if (this[0].length > 1)
{
var e = this[0];
for (var i = 0; i < e.length; i++)
{
if (e[i].style.opacity >= 1.0 || !e[i].style.opacity)
{
bright(e[i]).fadeOut();
}
else
{
bright(e[i]).fadeIn();
}
}
}
else
{
if (this[0].style.opacity >= 1.0 || !e[i].style.opacity)
{
bright(this[0]).fadeOut();
}
else
{
bright(this[0]).fadeIn();
}
}
},
val: function(e)
{
if (this[0].length > 0)
{
var value = [];
for (var i = 0; i < 6; i++){
if (e)
{
this[0][i].value = e;
}
else
{
value.push(this[0][i].value);
}
}
return value;
}
else
{
if (e)
{
this[0].value = e;
}
else
{
return this[0].value;
}
}
return this;
},
wait: function(ms)
{
//makes the function wait....
return this;
},
placeholder: function(text)
{
var eleList = Array();
//we will create spans to span over the elements...
if (this[0].length > 0){
var ele = this[0];
for (var i = 0; i < ele.length; i++){
bright(ele[i]).placeholder(text);
}
}
else
{
var inners = this[0].cloneNode(true);
var parentEle = this[0].parentNode;
var ele = document.createElement('div');
ele.className = "brightInputHolder";
ele.style.position = "relative";
ele.style.display = "inline-block";
parentEle.insertBefore(ele, this[0].nextSibling);
parentEle.removeChild(this[0]);
ele.appendChild(inners);
var s = document.createElement('span');
s.className = "brightPlaceholder";
s.innerHTML = text;
s.style.color = "#adadad";
s.style.position = "absolute";
s.style.left = "8px";
s.style.top = "4px";
ele.appendChild(s);
s.onclick = function()
{
bright(s).hide();
inners.focus();
}
inners.onfocus = function()
{
bright(s).hide();
}
inners.onblur = function()
{
if (inners.value == "")
bright(s).show();
}
}
return this;
},
validate: function(borders, options, fun)
{
var border = false,
color = "";
if ((typeof borders == "boolean") && borders)
{
//wants a border and stuff...
border = true;
color = options.color;
}
//this will validate any form that gets inserted into it... it will be able to check if the user has put some values in... Simple Validate
bright.each(this[0], function(i, elem)
{
var follow = true;
var inputsElements = Array();
var inputs = elem.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++){
var type = inputs[i].type.toUpperCase();
inputsElements.push(inputs[i]);
if (type == "SUBMIT"){
bright(inputs[i]).click(function(e){
//the base click function...
var returnElements = [];
e.preventDefault();
for (var s = 0; s < inputsElements.length;s++)
{
type = inputsElements[s].type.toUpperCase();
var filter = ((type == "CHECKBOX") || (type == "RADIO") || (type == "SUBMIT"));//filters out the ones we cant check...
if (!filter) //checks if all the filtering worked
{
if ((inputsElements[s].value == undefined)||(inputsElements[s].value == "")){
if (inputsElements[s].value.length < 1)
{
if (border)
{
bright(inputsElements[s]).css('border', '2px inset '+color+'');
}
returnElements.push(inputsElements[s]);
}
else
{
if (border)
{
bright(inputsElements[s]).css('border', '2px inset');
}
}
}
else
{
if (border)
{
bright(inputsElements[s]).css('border', '2px inset');
}
}
}
}
if (typeof fun == "function")
{
if (returnElements.length > 0)
fun(returnElements);
}
});
}
}
});
return this;
},
html: function(text)
{
if (this[0].length > 0)
{
var ele = this[0];
for (var i = 0; i < ele.length; i++){
bright(ele[i]).html(text);
}
}
else
{
if (text){
this[0].innerHTML = text;
}
else
{
return this[0].innerHTML;
}
}
return this;
},
lightbox: function()
{
lightbox(this);
return this;
},
removeClass: function(value)
{
var name = "";
if (value && typeof value === "string") {
bright(this[0]).each(function(i, element){
if (element.className)
{
var splitName = element.className.split(' '); //split on the space
for (var i = 0; i < splitName.length; i++)
{
if (splitName[i] != value)
{
name += splitName[i]+" ";
}
}
element.className = name;
}
});
}
return this;
},
is: function (selector) {
return !!selector && (typeof selector === "string" ? bright.filter(selector, this).length > 0 : this.filter(selector).length > 0);
},
filter: function (selector) {
return this.pushStack(winnow(this, selector, true), "filter", selector);
},
animate: function(prop, speed, easing, callback)
{
var optall = bright.speed( speed, easing, callback );
if ( bright.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
}
// Do not change referenced properties as per-property easing will be lost
prop = bright.extend( {}, prop );
function doAnimation()
{
// XXX 'this' does not always have a nodeName when running the
// test suite
if ( optall.queue === false ) {
bright._mark( this );
}
var opt = bright.extend( {}, optall ),
isElement = this.nodeType === 1,
hidden = isElement && bright(this[0]).is(":hidden"),
name, val, p, e, hooks, replace,
parts, start, end, unit,
method;
// will store per property easing and be used to determine when an animation is complete
opt.animatedProperties = {};
// first pass over propertys to expand / normalize
for ( p in prop ) {
name = bright.camelCase( p );
if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
}
if ( ( hooks = bright.cssHooks[ name ] ) && "expand" in hooks ) {
replace = hooks.expand( prop[ name ] );
delete prop[ name ];
// not quite $.extend, this wont overwrite keys already present.
// also - reusing 'p' from above because we have the correct "name"
for ( p in replace ) {
if ( ! ( p in prop ) ) {
prop[ p ] = replace[ p ];
}
}
}
}
for ( name in prop ) {
val = prop[ name ];
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
if ( bright.isArray( val ) ) {
opt.animatedProperties[ name ] = val[ 1 ];
val = prop[ name ] = val[ 0 ];
} else {
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
}
if ( val === "hide" && hidden || val === "show" && !hidden ) {
return opt.complete.call( this );
}
if ( isElement && ( name === "height" || name === "width" ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
if ( bright.css( this, "display" ) === "inline" &&
bright.css( this, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !bright.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.zoom = 1;
}
}
}
}
if ( opt.overflow != null ) {
this.style.overflow = "hidden";
}
for ( p in prop ) {
e = new bright.fx( this, opt, p );
val = prop[ p ];
if ( rfxtypes.test( val ) ) {
// Tracks whether to show or hide based on private
// data attached to the element
method = bright._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
if ( method ) {
bright._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
e[ method ]();
} else {
e[ val ]();
}
} else {
parts = rfxnum.exec( val );
start = e.cur();
if ( parts ) {
end = parseFloat( parts[2] );
unit = parts[3] || ( bright.cssNumber[ p ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" ) {
bright.style( this, p, (end || 1) + unit);
start = ( (end || 1) / e.cur() ) * start;
bright.style( this, p, start + unit);
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] ) {
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
}
e.custom( start, end, unit );
} else {
e.custom( start, val, "" );
}
}
}
return true;
}
return optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation );
},
parent: function()
{
var ElementArray = [];
if (this[0].length > 0)
{
for (var i = 0; i < this[0].length; i++)
{
ElementArray.push(this[0][i].parentNode);
}
}
else
{
ElementArray.push(this[0].parentNode);
}
this[0] = ElementArray;
return this;