This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function.implement({ | |
| 'when': function(check, interval, bind) | |
| { | |
| var bind = bind || this, | |
| timer = setInterval(function() { | |
| if (check.apply(bind)) | |
| { | |
| clearInterval(timer); | |
| this.apply(bind); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function.prototype.when = function(check, interval, bind) | |
| { | |
| var bind = bind || this, | |
| timer = setInterval(function() { | |
| if (check.apply(bind)) | |
| { | |
| clearInterval(timer); | |
| this.apply(bind); | |
| } | |
| }, (interval || 100)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toArray($result) | |
| { | |
| $array = array(); | |
| foreach ($result as $key => $value) | |
| { | |
| if (is_object($value)) | |
| { | |
| $array[$key] = toArray($value); | |
| } | |
| else if (is_array($value)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.when = function(fn, check, interval, bind) | |
| { | |
| var bind = bind || this, | |
| timer = setInterval(function() { | |
| if (check.apply(bind)) | |
| { | |
| clearInterval(timer); | |
| fn.apply(bind); | |
| } | |
| }, (interval || 100)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function trim(str) | |
| { | |
| // immediate return! | |
| if(!str)return ''; | |
| // markers | |
| var modified = false, start = -1, end = str.length; | |
| // traverse from beginning and from end for markers... | |
| while(str.charCodeAt(--end) < 33 || str.charCodeAt(end) == 65279) modified = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| <div id="foo" data-timepicker-pad="true" data-timepicker-labels-hours="HR" data-modal-color="#333"></div> | |
| http://www.jsfiddle.net/sixtyseconds/bxcLj/3/ | |
| */ | |
| function _walk(parts, value, stack) { | |
| var part = parts.shift(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEvent('domready', function() { | |
| // expand/collapse (with delegation) | |
| var accordion = document.getElement('.zoopy-content-left-accordion'), | |
| groups = accordion.getElements('.zoopy-content-left-accordion-group'); | |
| function toggle() { | |
| var content = this.getElement('.zoopy-content-left-accordion-group-content'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Orignal: | |
| setOptions: function(){ | |
| var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments)); | |
| if (!this.addEvent) return this; | |
| for (var option in options){ | |
| if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue; | |
| this.addEvent(option, options[option]); | |
| delete options[option]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| --- | |
| license: MIT-style | |
| authors: [Christopher Pitt] | |
| ... | |
| */ | |
| (function(){ | |
| var template = | |
| '<div class="item">'+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.combine = function (keys, values) { | |
| if (!keys.length || !values.length || keys.length != values.length) { | |
| return null; | |
| } | |
| var index = null, | |
| length = keys.length, | |
| results = {}; | |
| for (index = 0; index < length; index++) { |
OlderNewer