code
stringlengths
1
2.08M
language
stringclasses
1 value
// DATA_TEMPLATE: empty_table oTest.fnStart( "sPaginationType" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Check two button paging ...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oSearch" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Default values should be blank",...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.sClass" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "By default the test cla...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.sName" ); /* This has no effect at all in DOM methods - so we just check that it has applied the name */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.tx...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnInitComplete" ); /* Fairly boring function compared to the others! */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnServerData for Ajax sourced data" ); $(document).ready( function () { var mPass; oTest.fnTest( "Argument length", function () { $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "fnServerData": function () { m...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sInfo" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Info language is 'Showin...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "sDom" ); /* This is going to be brutal on the browser! There is a lot that can be tested here... */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var o...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); oTest.fnWaitTest( "Default row striping is applied", null, function () { return $('#exa...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.bSeachable" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Columns are searcha...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnCreatedRow tests" ); $(document).ready( function () { var tmp = 0; var complete = false; $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", fnCreatedRow: function () { tmp++; } } ); oTest.fnWaitTest( "Row created is...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnHeaderCallback" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); var mPass, bInit; oTest.fnWaitTest( "Defa...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bPaginate" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); oTest.fnWaitTest( "Pagiantion div exists by default", null, function () { return document.getEle...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bAutoWidth" ); /* It's actually a little tricky to test this. We can't test absolute numbers because * different browsers and different platforms will render the width of the columns slightly * differently. However, we certainly can test the principle of what should happ...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "Custom data source property - array only" ); $(document).ready( function () { var oInit = { "sAjaxSource": "../../../examples/ajax/sources/array_only.txt", "sAjaxDataProp": "" }; $('#example').dataTable( oInit ); oTest.fnWaitTest( "10 rows shown on the first ...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bFilter" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); oTest.fnWaitTest( "Filtering div exists by default", null, function () { return document.getElemen...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sLoadingRecords" ); $(document).ready( function () { var tmp = false; oTest.fnTest( "Default loading text is 'Loading...'", function () { $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); tmp = $('#exam...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aaSorting" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Default sorting is single colu...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnDrawCallback" ); /* Fairly boring function compared to the others! */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sInfoEmpty" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Info empty language...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "sAjaxSource" ); /* Sanitfy check really - all the other tests blast this */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSett...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "iDisplayLength" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); oTest.fnWaitTest( "Default length is ten", null, function () { return $('#example tbody tr'...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bServerSide" ); /* Not interested in server-side processing here other than to check that it is off */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); va...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sZeroRecords" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Zero records lang...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "Sanity checks for DataTables with data from JS" ); oTest.fnTest( "jQuery.dataTable function", null, function () { return typeof jQuery().dataTable == "function"; } ); oTest.fnTest( "jQuery.dataTableSettings storage array", null, function () { return typeof jQuery()...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.oPaginate" ); /* Note that the paging language information only has relevence in full numbers */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "s...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.bSortable" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "All columns are sort...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bSort" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); oTest.fnWaitTest( "Sorting is on by default", null, function () { return $('#example tbody td:eq(0)'...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "Custom data source property - property given" ); $(document).ready( function () { var oInit = { "sAjaxSource": "../../../examples/ajax/sources/custom_prop.txt", "sAjaxDataProp": "demo" }; $('#example').dataTable( oInit ); oTest.fnWaitTest( "10 rows shown on t...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bInfo" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); oTest.fnWaitTest( "Info div exists by default", null, function () { return document.getElementById('...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoSearchCols" ); /* We could be here forever testing this one, so we test a limited subset on a couple of colums */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.t...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnCreatedCell tests" ); $(document).ready( function () { var tmp = 0; var complete = false; $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "aoColumnDefs": [ { fnCreatedCell: function () { tmp++; }, "aTargets": ["...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sLengthMenu" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Menu language is '...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sUrl" ); /* Note that we only test the internal storage of language information pulled form a file here * as the other language tests will check it goes into the DOM correctly */ $(document).ready( function () { /* Check the default */ var oTable = $('#examp...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aaSortingFixed" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "No fixed sorting by defau...
JavaScript
/** * Controls: Element CSS Wrapper plugin * * Depends on jWYSIWYG * * By Yotam Bar-On (https://github.com/tudmotu) */ (function ($) { if (undefined === $.wysiwyg) { throw "wysiwyg.cssWrap.js depends on $.wysiwyg"; } /* For core enhancements #143 $.wysiwyg.ui.addControl("cssWrap", { visible : false, ...
JavaScript
/** * Controls: Colorpicker plugin * * Depends on jWYSIWYG, (farbtastic || other colorpicker plugins) */ (function ($) { if (undefined === $.wysiwyg) { throw "wysiwyg.colorpicker.js depends on $.wysiwyg"; } if (!$.wysiwyg.controls) { $.wysiwyg.controls = {}; } /* * Wysiwyg namespace: public properties...
JavaScript
function unset(array, value){ var output=[]; for(var i in array){ if (array[i]!=value) output[i]=array[i]; } return output; } function displayType(item, id){ switch (item.type) { case "text": return ('<input type="text" id="'+id + item.name+'" name = "'+id + item.name+'"/>') break; case "co...
JavaScript
/** * Controls: Link plugin * * Depends on jWYSIWYG * * By: Esteban Beltran (academo) <sergies@gmail.com> */ (function ($) { if (undefined === $.wysiwyg) { throw "wysiwyg.link.js depends on $.wysiwyg"; } if (!$.wysiwyg.controls) { $.wysiwyg.controls = {}; } /* * Wysiwyg namespace: public properties an...
JavaScript
/** * WYSIWYG - jQuery plugin 0.97 * (0.97.2 - From infinity) * * Copyright (c) 2008-2009 Juan M Martinez, 2010-2011 Akzhan Abdulin and all contributors * https://github.com/akzhan/jwysiwyg * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.g...
JavaScript
/** * Controls: Table plugin * * Depends on jWYSIWYG */ (function ($) { if (undefined === $.wysiwyg) { throw "wysiwyg.table.js depends on $.wysiwyg"; } if (!$.wysiwyg.controls) { $.wysiwyg.controls = {}; } var insertTable = function (colCount, rowCount, filler) { if (isNaN(rowCount) || isNaN(colCount)...
JavaScript
jQuery.fn.extend({ findPos : function() { obj = jQuery(this).get(0); var curleft = obj.offsetLeft || 0; var curtop = obj.offsetTop || 0; var curheight = obj.offsetHeight; var curwidth = obj.offsetWidth; while (obj = obj.offsetParent) { curleft += obj.offsetLe...
JavaScript
/** * Controls: Image plugin * * Depends on jWYSIWYG */ (function ($) { "use strict"; if (undefined === $.wysiwyg) { throw "wysiwyg.image.js depends on $.wysiwyg"; } if (!$.wysiwyg.controls) { $.wysiwyg.controls = {}; } /* * Wysiwyg namespace: public properties and methods */ $.wysiwyg.controls.im...
JavaScript
(function($) { //Définition du plugin $.fn.abEmploiduTemps = function(options) { // définition des paramètres par défaut var settings = { title: "", callback: null }; // mélange des paramètres fournis et par défaut var opts = $.extend(settings, options); var l...
JavaScript
/** * Populates a given select element with * companies */ function populateCompanies(response, element) { // eval json to javascript companies = eval(response.responseText); $(element).options.length = 0; for(i=0; i < companies.length; i++) { $(element).options[i] = new Option(companie...
JavaScript
/* Copyright (c) 2011 Eli Grey, http://eligrey.com This file is based on: https://github.com/eligrey/FileSaver.js/blob/master/FileSaver.js , licensed under X11/MIT. See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md This file is part of SwitchySharp. SwitchySharp is free software: you can redist...
JavaScript
/* * JavaScript data: URI toolkit * 2010-11-06 * * By Eli Grey, http://eligrey.com * * Public Domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. */ // Update: The data: URI parser at http://shadow2531.com/opera/testcases/datauri/parse_data_uri.html // seems much more fully featured and complian...
JavaScript
/////////////////////////////////////////////////////////////////////////// // parseUri 1.2.2 // // (c) Steven Levithan <stevenlevithan.com> // // MIT License // ////////////...
JavaScript
/** * jQuery BASE64 functions * * <code> * Encodes the given data with base64. * String $.base64Encode ( String str ) * <br /> * Decodes a base64 encoded data. * String $.base64Decode ( String str ) * </code> * * Encodes and Decodes the given data in base64. * ...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
document.querySelector('#btnCancel').addEventListener('click', function () { window.close(); }, false); var url = 'chrome://extensions/?id=' + chrome.i18n.getMessage('@@extension_id'); document.querySelector('#btnManage').setAttribute('data-open-tab', url); document.addEventListener('click', function (e) { var url...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* /* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: yo...
JavaScript
window.shExpMatch = function shExpMatch(url, pattern) { var pCharCode; var isAggressive = false; var pIndex; var urlIndex = 0; var lastIndex; var patternLength = pattern.length; var urlLength = url.length; for (pIndex = 0; pIndex < patternLength; pIndex += 1) { pCharCode = patter...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
/* Copyright (c) 2011 Shyc2001 (http://twitter.com/shyc2001) This work is based on: *"Switchy! Chrome Proxy Manager and Switcher" (by Mohammad Hejazi (mohammadhi at gmail d0t com)) *"SwitchyPlus" by @ayanamist (http://twitter.com/ayanamist) This file is part of SwitchySharp. SwitchySharp is free software: you ca...
JavaScript
//** Featured Content Slider script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com. //** May 2nd, 08'- Script rewritten and updated to 2.0. //** June 12th, 08'- Script updated to v 2.3, which adds the following features: //1) Changed behavior of script to actually collapse the previous content...
JavaScript
/********************* //* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/ //* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering //* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/ *********************/ //Update: April 12th...
JavaScript
(function($) { // Compliant with jquery.noConflict() $.fn.jCarouselLite = function(o) { o = $.extend({ btnPrev: null, btnNext: null, btnGo: null, mouseWheel: false, auto: null, speed: 200, easing: null, ...
JavaScript
/*! * Flat UI's Gruntfile * http://designmodo.com/flat-free/ * Copyright 2013-2014 Designmodo, Inc. */ module.exports = function (grunt) { 'use strict'; // Force use of Unix newlines grunt.util.linefeed = '\n'; grunt.initConfig({ // Metadata. pkg: grunt.file.readJSON('package.json'), bower_c...
JavaScript
// Copyright (C) 2006 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
JavaScript
// Some general UI pack related JS // Extend JS String with repeat method String.prototype.repeat = function (num) { return new Array(Math.round(num) + 1).join(this); }; (function ($) { // Add segments to a slider $.fn.addSliderSegments = function () { return this.each(function () { var $this = $(this...
JavaScript
/* ============================================================ * flatui-radiocheck v0.1.0 * ============================================================ */ +function (global, $) { 'use strict'; var Radiocheck = function (element, options) { this.init('radiocheck', element, options); }; Radiocheck.DEFA...
JavaScript
(function (hijs) { // // hijs - JavaScript Syntax Highlighter // // Copyright (c) 2010 Alexis Sellier // // All elements which match this will be syntax highlighted. var selector = hijs || 'code'; var keywords = ('var function if else for while break switch case do new null in with void ' +'...
JavaScript
$(function(){ $( '#example' ).photobooth().on( "image", function( event, dataUrl ){ // $( "#gallery" ).show().html( '<img src="' + dataUrl + '" >'); $( "#img_url" ).html( dataUrl); }); /** * Tab boxes */ $( '.tab_container' ).each(function( i, elem ){ $( elem ).find( ".tabs li" ).click(function()...
JavaScript
var fCancelBubble = function( e ) { e.stopPropagation(); e.cancelBubble=true; };
JavaScript
var Slider = function( eContainer, fOnChange ) { eContainer.innerHTML = '<div class="submenu"><div class="tip"></div><div class="slider"><div class="track"></div><div class="handle" style="left:50px"><div></div></div></div></div>'; var pos = 50, left = 50, eHandle = eContainer.getElementsByClassName( "hand...
JavaScript
var Drag = function( element ) { this.startX = 0; this.startY = 0; element.addEventListener( "mousedown", this, false ); }; /** * functionality implemented after instantiation. * * @param x = number // x coordinate of drag event * @param y = number // y coordinate of drag event */ Drag.prototype...
JavaScript
Photobooth = function( container ) { /** * Make it jQuery friendlier */ if( container.length ) { container = container[ 0 ]; } var fGetUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.oGetUserMedia || navigator.msieGetUse...
JavaScript
var ResizeHandle = function( eContainer, maxWidth, maxHeight ) { this.setMax = function( width, height ) { maxWidth = width; maxHeight = height; }; this.getData = function() { return { x: left, y: top, width: width, height: height }; }; this.isActive = function() { r...
JavaScript
/* JPEGCam v1.0.9 */ /* Webcam library for capturing JPEG images and submitting to a server */ /* Copyright (c) 2008 - 2009 Joseph Huckaby <jhuckaby@goldcartridge.com> */ /* Licensed under the GNU Lesser Public License */ /* http://www.gnu.org/licenses/lgpl.html */ /* Usage: <script language="JavaScript"> d...
JavaScript
/* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * ...
JavaScript
$(document).ready(function(){ var camera = $('#camera'), photos = $('#photos'), screen = $('#screen'); var template = '<a href="uploads/original/{src}" rel="cam" ' +'style="background-image:url(uploads/thumbs/{src})"></a>'; /*---------------------------------- Setting up the web camera -----...
JavaScript
chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create( 'window.html', { 'bounds': { 'width': 480, 'height': 640 } } ); });
JavaScript
var WindowExtras = {}; WindowExtras.mainWebview = null; WindowExtras.init = function(){ WindowExtras.mainWebview = document.getElementById('the_webview'); WindowExtras.mainWebview.setAttribute('src', 'http://flatfull.com/themes/todo/index.html'); } window.addEventListener('load', WindowExtras.init, false);
JavaScript
!function ($) { $(function(){ var isRgbaSupport = function(){ var value = 'rgba(1,1,1,0.5)', el = document.createElement('p'), result = false; try { el.style.color = value; result = /^rgba/.test(el.style.color); } catch(e) {} el = null; return result; }; var toRgba = func...
JavaScript
var oCache = { iCacheLower: -1 }; function fnSetKey(aoData, sKey, mValue) { for (var i=0, iLen=aoData.length ; i<iLen ; i++) { if (aoData[i].name == sKey) { aoData[i].value = mValue; } } } function fnGetKey(aoData, sKey) { ...
JavaScript
/* * Flot plugin to order bars side by side. * * Released under the MIT license by Benjamin BUFFET, 20-Sep-2010. * * This plugin is an alpha version. * * To activate the plugin you must specify the parameter "order" for the specific serie : * * $.plot($("#placeholder"), [{ data: [ ... ], bars :{ order = null...
JavaScript
/* Flot plugin for automatically redrawing plots when the placeholder size changes, e.g. on window resizes. It works by listening for changes on the placeholder div (through the jQuery resize event plugin) - if the size changes, it will redraw the plot. There are no options. If you need to disable the plugin for some...
JavaScript
$(function(){ // var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var d1 = []; for (var i = 0; i <= 11; i += 1) { d1.push([i, parseInt((Math.floor(Math.random() * (1 + 20 - 10))) + 10)]); } var plot = $.plot($("#flot-color"), [{ ...
JavaScript
// Load the application once the DOM is ready, using `jQuery.ready`: $(function(){ // Note Model // ---------- var Note = Backbone.Model.extend({ // Default attributes for the item. defaults: function() { return { id : Notes.nextId(), name : "New note", description : ...
JavaScript
// Load the application once the DOM is ready, using `jQuery.ready`: $(function(){ // Task Model // ---------- var Comment = Backbone.Model.extend({ defaults: function() { return { _id : "", desc : "", date : Date.now() }; } }); CommentList = Backbone.Collection...
JavaScript
// Copyright 2006 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wr...
JavaScript
var opts = { basePath: '', theme: { base: 'js/markdown/epiceditor.css', preview: 'js/markdown/bartik.css', editor: 'js/markdown/epic-light.css' } } var editor = new EpicEditor(opts).load();
JavaScript
(function(document) { 'use strict'; var LightTableFilter = (function(Arr) { var _input; function _onInputEvent(e) { _input = e.target; var tables = document.getElementsByClassName(_input.getAttribute('data-table')); Arr.forEach.call(tables, function(table) { Arr.fo...
JavaScript
$(document).ready( function(){ theMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; theDays = ["S", "M", "T", "W", "T", "F", "S"]; $('#calendar').calendar({ months: theMonths, days: theDays, req_aj...
JavaScript
$(document).ready(function() { $('#docs pre code').each(function(){ var $this = $(this); var t = $this.html(); $this.html(t.replace(/</g, '&lt;').replace(/>/g, '&gt;')); }); function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }; $(document)....
JavaScript
$(function () { // Load images via flickr for demonstration purposes: $.ajax({ url: 'http://api.flickr.com/services/rest/', data: { format: 'json', method: 'flickr.interestingness.getList', api_key: 'f77cf83fcba4290ba3b0c54b36af5f3b', tags: 'natual...
JavaScript
/* * HTML5 Sortable jQuery Plugin * http://farhadi.ir/projects/html5sortable * * Copyright 2012, Ali Farhadi * Released under the MIT license. */ (function($) { var dragging, placeholders = $(); $.fn.sortable = function(options) { var method = String(options); options = $.extend({ connectWith: false }, opti...
JavaScript
/*! * GMaps.js v0.4.5 * http://hpneo.github.com/gmaps/ * * Copyright 2013, Gustavo Leon * Released under the MIT License. */ if (!(typeof window.google === 'object' && window.google.maps)) { throw 'Google Maps API is required. Please register the following JavaScript library http://maps.google.com/maps/api/js?...
JavaScript
!function ($) { $(function(){ gmap_markers = new GMaps({ el: '#gmap_marker', lat: 51.500902, lng: -0.124531, zoom: 2 }); gmap_markers.addMarker({ lat: 51.500891, lng: -0.123347, title: 'Marker', infoWindow: { content: 'Info content here...' } }); map = new ...
JavaScript
/* * jQuery appear plugin * * Copyright (c) 2012 Andrey Sidorov * licensed under MIT license. * * https://github.com/morr/jquery.appear/ * * Version: 0.3.3 */ (function($) { var selectors = []; var check_binded = false; var check_lock = false; var defaults = { interval: 250, force_process: fal...
JavaScript
/* * jQuery Hotkeys Plugin * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * * Based upon the plugin by Tzury Bar Yochay: * http://github.com/tzuryby/hotkeys * * Original idea by: * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ */ /* * One small cha...
JavaScript