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
/*! | |
* URL Highlighter by Christopher Ciampoli (2014) | |
* | |
! | |
*/ | |
(function($) { | |
$.fn.highlightit = function() { | |
$this = this; | |
var debug = false; | |
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 List() { | |
this.listSize = 0; | |
this.pos = 0; | |
this.dataStore = []; // initializes an empty array to store list elements | |
this.clear = clear; | |
this.find = find; | |
this.toString = toString; | |
this.insert = insert; | |
this.append = append; | |
this.remove = remove; |
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: url, | |
type: type, | |
dataType: dataType, | |
data: data, | |
beforeSend: function(data) { | |
beforeSend(data); | |
}, | |
success: function(data) { | |
success(data); |
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
/** | |
* Creates scaled version of source image, optionally cropping. | |
* Handles scaling and centering in target size properly. | |
* | |
* $options = array( | |
* 'upload_dir' => thumbnail destination directory (required) | |
* 'thumb_name' => thumbnail filename in destination directory (required) | |
* 'dst_width' => target image width (required) | |
* 'dst_height' => target image height (required) | |
* 'target_format' => format to save to, defaults to source format, one of 'imagejpeg','imagegif','imagepng' |
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 getMeta(url, fn) { | |
var sizes = {}; | |
$('<img />').attr("src", url).load(function() { | |
var dims = { | |
w: this.width, | |
h: this.height | |
}; | |
$(this).trigger({ | |
type: "imgLoaded", | |
height: dims.h, |
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
sctr.addModule('calendar', function() { | |
/** | |
Creates a 7 day week | |
@param prev | |
@param next | |
TODO: move prev, next into their own methods to update curr | |
*/ | |
var bindSortable, checkImage, checkWeek, initWeek, processResults, renderWeek, saveSchedule, updatePool; |
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
/** | |
The basic premise of this plugin is that you start out with a header | |
which displays the month/week, and the next/prev buttons. You are | |
then free to setup you own rendering of the actual calendar week | |
in a div of your choosing. Sample usage as follows: | |
Your calendar control header: <div id="cal-header"><h4 id="week-title"></h4></div> | |
Calendar initialize: $('#cal-header').chriscal({ | |
'body': define your calendar body here, | |
'next_btn': define your next button to change to next week, |
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 AngleCalc() { | |
function fromTime(min, hour){ | |
var minPercent = minutesToPercent(min), | |
hrPercent = hoursToPercent(hour, minPercent), | |
minDegree = percentageToDegree(minPercent), | |
hrDegree = percentageToDegree(hrPercent), | |
smallAngle = smAngle(minDegree, hrDegree), | |
largeAngle = lgAngle(minDegree, hrDegree); |
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 downloadables = document.getElementsByClassName('download-links'); | |
for (var op = 0;op < downloadables.length;++op) { | |
var list = downloadables[op]; | |
var items = list.childNodes | |
console.log(items); | |
var itemsArr = []; | |
for (var i in items) { | |
if (items[i].nodeType == 1) { |
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
private function fix_keys($array) { | |
$numberCheck = false; | |
foreach ($array as $k => $val) { | |
if (is_array($val)){ | |
$array[$k] = $this->fix_keys($val); | |
} | |
if(is_numeric($k)){ | |
$numberCheck = true; | |
} | |
} |
OlderNewer