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 loadScript(path, callback) { | |
var done = false; | |
var scr = document.createElement('script'); | |
scr.onload = handleLoad; |
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 getSelectionHtml() { | |
var html = ""; | |
if (typeof window.getSelection != "undefined") { | |
var sel = window.getSelection(); | |
if (sel.rangeCount) { | |
var container = document.createElement("div"); | |
for (var i = 0, len = sel.rangeCount; i < len; ++i) { | |
container.appendChild(sel.getRangeAt(i).cloneContents()); | |
} | |
html = container.innerHTML; |
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
<!-- html5 new tags --> | |
<article> New - Defines an article | |
<aside> New - Defines content aside from the page content | |
<audio> New - Defines sound content | |
<canvas> New - Defines graphics | |
<command> New - Defines a command button | |
<datalist> New - Defines a dropdown list | |
<details> New - Defines details of an element | |
<embed> New - Defines external interactive content or plugin | |
<figcaption> New - Defines the caption of a figure element |
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
var OnBeforeUnload = (function(){ | |
var | |
FDUM = new Function, | |
AFFIRM = function(){ return true; }; | |
var _reg = function(msg,opts){ | |
opts = opts || {}; | |
var |
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 hex2rgb( $colour ) { | |
if ( $colour[0] == '#' ) { | |
$colour = substr( $colour, 1 ); | |
} | |
if ( strlen( $colour ) == 6 ) { | |
list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] ); | |
} elseif ( strlen( $colour ) == 3 ) { | |
list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] ); | |
} else { | |
return false; |
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
$(document).ready(function(){ | |
$('div').bind('scroll',chk_scroll); | |
}); | |
function chk_scroll(e) | |
{ | |
var elem = $(e.currentTarget); | |
if (elem[0].scrollHeight - elem.scrollTop() == elem.outerHeight()) |
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
$.extend({ | |
debug:function(text, dir){ | |
var dir = dir || false; | |
if (window.console && window.console.log) { | |
(dir === true && window.console.dir) ? window.console.dir(text) : window.console.log(text); | |
} | |
} | |
}) | |
// $.debug('console.log test'); |
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 debug(text) { | |
if (window.console && window.console.log) { | |
window.console.log(text); | |
} | |
if (window.opera) { |
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
;q = { | |
w : 'www', | |
myFunction: function() | |
{ | |
var a = arguments[0] || "q"; | |
// alert('running MYNAMESPACE.myFunction...'+a+q.w); | |
} | |
} | |
q.myFunction(); //function call |
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
var myarray = []; | |
var myJSON = ""; | |
$.each(data.data,function(i,val) { | |
var item = { | |
"name": val.name, | |
"facebookId": val.id, | |
"picture": val.picture.data.url | |
}; | |
myarray.push(item); | |
}) |