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
// get xml file & publish | |
km.core = { | |
url: 'someDir/someFile', | |
fetch: $.get(url, function(xml) { | |
$.publish('xmlFetch', [xml]); | |
}) | |
}; | |
// subscribe to xml file and do stuff | |
km.widget.edVolGraph = { |
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
/** | |
* Gets the current cursor position in a textfield | |
* to determine where to delete/update a character. | |
* @param {Element} field The raw field to get the cursor pos from. | |
* @return {Number} The index for the position of the cursor. | |
*/ | |
function getCursorPosition( field ) { | |
if ( field != null ) { | |
// IE | |
if ( document.selection ) { |
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( $ ) { | |
$.fn.keyframe = function(){ | |
if (arguments.length == 0) { | |
return this; | |
} | |
var self = this, | |
args = Array.prototype.slice.call( arguments ), | |
// List of keyframes |
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
/** | |
* Internal page management | |
* Add selector-dependent js to the array | |
* or call page to execute all js relevant to the current page | |
* @param {String} selector A jQuery selector | |
* @param {Function} fn A function to execute if sel is present on the page | |
*/ | |
var pages = []; | |
var page = function( selector, fn ) { |
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.fn.hasAttr() | |
* | |
* Copyright 2011, Rick Waldron | |
* Licensed under MIT license. | |
* | |
*/ | |
(function( jQuery ) { | |
jQuery.fn.hasAttr = function( name ) { | |
for ( var i = 0, l = this.length; i < l; i++ ) { |
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
if ( gotoEnd || t >= options.duration + this.startTime ) { | |
this.now = this.end; | |
this.pos = this.state = 1; | |
this.update(); | |
options.animatedProperties[ this.prop ] = true; | |
for ( p in options.animatedProperties ) { | |
if ( options.animatedProperties[ p ] !== true ) { | |
done = 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
$('#open-menu').click(function() { | |
// No more .stop( true, true ) | |
// jQuery will remember state automatically | |
$someMenu.stop().slideToggle(1000); | |
}); |
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 xml = $.parseXML('<crazy><element>asdf</element><div>asdf</div></crazy>'), | |
counter = 0; | |
console.log( xml, $(xml).find('*') ); | |
$(xml).find('*').andSelf().each(function( i, elem ) { | |
if ( elem.getElementsByTagName ) { | |
counter++; | |
} | |
}); |
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
// This could be compatible with jQuery's Deferred implementation, | |
// futures.js (slightly different syntax) or any one of a number | |
// of other implementations | |
define(['lib/Deferred'], function( Deferred ){ | |
var defer = new Deferred(); | |
require(['lib/templates/?index.html','lib/data/?stats'], | |
function( template, data ){ | |
defer.resolve({ template: template, data:data }); | |
} | |
); |
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 avaya.js | |
* Load avaya webchat lightbox with iframe | |
* Copyright (c) 2011 EPB | |
*/ | |
define([ 'jquery', 'jquery-plugins/minLight' ], | |
function( $ ) { | |
"use strict"; |
OlderNewer