This file contains 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 refreshEvery(secs) { | |
secs = typeof secs === 'undefined' && secs < 1 ? 1 : secs; | |
var now = new Date(); | |
var hours = now.getHours(); | |
var minutes = now.getMinutes(); | |
var seconds = now.getSeconds(); | |
seconds = seconds + (secs - (seconds % secs)) |
This file contains 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
String.prototype.obfuscate = function() | |
{ | |
var temp = ''; | |
for(i = 0; i < this.length; i++){temp += String.fromCharCode(this.charCodeAt(i)+parseInt((i+1)%5))}; | |
return temp; | |
} | |
String.prototype.deobfuscate = function() | |
{ | |
var temp = ''; |
This file contains 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 camelCaseCSS = function(property) { | |
property = property.replace(/^-ms-/gi, 'ms-'); | |
return property.replace(/-\w/g, function(match){ | |
return match.charAt(1).toUpperCase(); | |
}); | |
}; | |
var cssStyleToJS = function(cssStyles) | |
{ | |
var _cssStyles = {}; |
This file contains 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
String.prototype.encodeTag = function () { | |
return this.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, '''); | |
} |
This file contains 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
/* | |
TinyPNG - download all bookmarklet | |
Copyright (c) 2015 Dan White | |
Licensed under the MIT license. | |
*/ | |
javascript:(function(){[].forEach.call(document.getElementsByClassName('results')[0].getElementsByTagName('a'), function(e){e.click()});})(); |
This file contains 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
/* Font Poper */ | |
/* DanBrianWhite */ | |
/* Triggers a callback when a font pops in and is loaded. */ | |
/* This function enables you to register a callback to occur when a font is loaded an pops in. Hence the name font popper! Supply the font name and font style you want to watch. Then when the font pops in, the callback function will be run. This allows you to update views or any other layouts that utilize JavaScript for sizing or anything else. */ | |
/* currently requires jQuery */ | |
var fontPopper = function (fontName, fontStyle, callback) { |
This file contains 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 _numFilesLazyLoad; | |
var _loadedFilesLazyLoad; | |
var _lazyLoaded = true; | |
var lazyLoadFiles = function(fileList, noCache) | |
{ | |
if(_lazyLoaded) | |
{ | |
_lazyLoaded = false; | |
_numFilesLazyLoad = 0; | |
_loadedFilesLazyLoad = 0; |
This file contains 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 saveTextAsFile(filename, text) | |
{ | |
var textToWrite = text; | |
var textFileAsBlob = new Blob([textToWrite], {type:'text/html'}); | |
var fileNameToSaveAs = filename; | |
var downloadLink = document.createElement("a"); | |
downloadLink.href = window.URL.createObjectURL(textFileAsBlob); | |
downloadLink.download = fileNameToSaveAs; | |
downloadLink.click(); | |
} |
This file contains 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
$.ajax({url: filePath()+'/../../connectionTest.gif', cache: false} ).fail(function() { alert("Your connection to the internet has been lost. Please reconnect to the internet to continue this course."); }); |
This file contains 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 pixelToPercent = function(elements) | |
{ | |
var _patt=/px/; | |
for (var i = elements.length - 1; i >= 0; i--) | |
{ | |
var _this = elements[i]; | |
var _parentWidth = _this.parentNode.offsetWidth; | |
var _parentHeight = _this.parentNode.offsetHeight; | |
var _style = getStyle(_this); |
NewerOlder