code
stringlengths
1
2.08M
language
stringclasses
1 value
function getXMLHttpRequest () { var xmlhttp = false; var arr = [ function(){return new XMLHttpRequest();}, function(){return new ActiveXObject("Microsoft.XMLHTTP");}, function(){return new ActiveXObject("Msxml2.XMLHTTP");} ] for (var i=0; i!=arr.length; ++i) { try { xmlhttp = arr[i]() break } catch (e){}...
JavaScript
/** * apply function `func` to each element (not key) * of the hash `hash` */ function for_in (hash, func) { for (var i in hash) { func(i,hash[i]) } } if (!Array.prototype.push){ Array.prototype.push = function (elem) { this[this.length]=elem } } if (!Array.prototype.each) { Array.prototype.each = fu...
JavaScript
/** * usage: g = new Geometry(x0,y0,x1,y1) */ var Geometry = function (x0,y0,x1,y1) { this.geom = [x0,y0,x1,y1] function getArr () { return this.geom } function toString () { return "["+this.geom[0]+","+this.geom[1]+","+this.geom[2]+","+this.geom[3]+"]" } } var CanvasGeometry = function () { // these three ...
JavaScript
/* TODO: * session handling: generate new cookie(?) each time recording starts? * handle geometry changes: onscroll, onresize, ... ? * flush event buffer every n secs regardless how many events have been captured. Possible optimizations: * use 1/100 sec accuracy instead of milliseconds, and bundle events...
JavaScript
// Flash Player Version Detection - Rev 1.6 // Detect Client Browser type // Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved. var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var...
JavaScript
BrowserHistoryUtils = { addEvent: function(elm, evType, fn, useCapture) { useCapture = useCapture || false; if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent) { var r = elm.att...
JavaScript
/** * @version $Id: menu.js 14401 2010-01-26 14:10:00Z louis $ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includ...
JavaScript
/** * @version $Id: index.js 14401 2010-01-26 14:10:00Z louis $ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it inclu...
JavaScript
/** * @version $Id: mediamanager.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Pu...
JavaScript
/** * @version $Id: popup-imagemanager.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public Lice...
JavaScript
// directory of where all the images are var cmThemeOfficeBase = '../includes/js/ThemeOffice/'; var cmThemeOffice = { // main menu display attributes // // Note. When the menu bar is horizontal, // mainFolderLeft and mainFolderRight are // put in <span></span>. When the menu // bar is vertical, th...
JavaScript
// directory of where all the images are var cmThemeOfficeBase = '../includes/js/ThemeOffice/'; var cmThemeOffice = { // main menu display attributes // // Note. When the menu bar is horizontal, // mainFolderLeft and mainFolderRight are // put in <span></span>. When the menu // bar is vertical, th...
JavaScript
var prefsLoaded = false; var defaultFontSize =100; var currentFontSize = defaultFontSize; function revertStyles(){ currentFontSize = defaultFontSize; changeFontSize(0); } function toggleColors(){ if(currentStyle == "White"){ setColor("Black"); }else{ setColor("White"); } } function changeFontSize(sizeDiff...
JavaScript
if (typeof(MooTools) != 'undefined'){ var subnav = new Array(); Element.extend( { hide: function(timeout) { this.status = 'hide'; clearTimeout (this.timeout); if (timeout) { this.timeout = setTimeout (this.anim.bind(this), timeout); }else{ this.anim(); } }, show: f...
JavaScript
//JS script for Joomla template var JA_Collapse_Mod = new Class({ initialize: function(myElements) { options = Object.extend({ transition: Fx.Transitions.quadOut }, {}); this.myElements = myElements; var exModules = excludeModules.split(','); exModules.each(function(el,i){exModules[i]='Mod'+el}); myEl...
JavaScript
//JS script for Joomla template var siteurl = ''; function fixIEPNG(el, bgimgdf, sizingMethod, type, offset){ var objs = el; if(!objs) return; if ($type(objs) != 'array') objs = [objs]; if(!sizingMethod) sizingMethod = 'crop'; if(!offset) offset = 0; var blankimg = siteurl + 'images/blank.png'; objs.each(functi...
JavaScript
sfHover = function() { var sfEls = document.getElementById("ja-mainnav").getElementsByTagName("li"); for (var i=0; i<sfEls.length; ++i) { sfEls[i].onmouseover=function() { clearTimeout(this.timer); if(this.className.indexOf(" sfhover") == -1) this.className+=" sfhover"; } sfEls[i].onmouseout=function...
JavaScript
function Xajax() { if (xajaxDebug) this.DebugMessage = function(text) { alert("Xajax Debug:\n " + text) }; this.workId = 'xajaxWork'+ new Date().getTime(); this.depth = 0; //Get the XMLHttpRequest Object this.getRequestObject = function() { if (xajaxDebug) this.DebugMessage("Initializing Request Object.."); ...
JavaScript
/*** @version $Id: install.js 966 2005-11-11 01:37:07Z Jinx $* @package Joomla* @subpackage Installation* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.* @license GNU/GPL*/ /** * @param object A form element * @param string The name of the element to find */ function getElementByName...
JavaScript
function Xajax() { if (xajaxDebug) this.DebugMessage = function(text) { alert("Xajax Debug:\n " + text) }; this.workId = 'xajaxWork'+ new Date().getTime(); this.depth = 0; //Get the XMLHttpRequest Object this.getRequestObject = function() { if (xajaxDebug) this.DebugMessage("Initializing Request Object.."); ...
JavaScript
/** * @version $Id: validation.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant...
JavaScript
/** * @version $Id: cookie.js 6138 2007-01-02 03:44:18Z eddiea $ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it incl...
JavaScript
/** * @version $Id: caption.js 5263 2006-10-02 01:25:24Z webImagery $ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it...
JavaScript
/** * @version $Id: modal.js 5263 2006-10-02 01:25:24Z webImagery $ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it i...
JavaScript
/* Script: mootree.js My Object Oriented Tree - Developed by Rasmus Schultz, <http://www.mindplay.dk> - Tested with MooTools release 1.11, under Firefox 2 and Internet Explorer 6 and 7. License: MIT-style license. Credits: Inspired by: - WebFX xTree, <http://webfx.eae.net/dhtml/xtree/> - Destroydrop dTree, <ht...
JavaScript
/** * @version $Id: modal.js 5263 2006-10-02 01:25:24Z webImagery $ * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it i...
JavaScript
/** * SqueezeBox - Expandable Lightbox * * Allows to open various content as modal, * centered and animated box. * * Inspired by * ... Lokesh Dhakar - The original Lightbox v2 * ... Cody Lindley - ThickBox * * @version 1.0rc1 * * @license MIT-style license * @author Harald Kirschner <mail [at] digitar...
JavaScript
/** * @version $Id: validate.js 7401 2007-05-14 04:12:55Z eddieajau $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant...
JavaScript
/* Script: Core.js Mootools - My Object Oriented javascript. License: MIT-style license. MooTools Copyright: copyright (c) 2007 Valerio Proietti, <http://mad4milk.net> MooTools Credits: - Class is slightly based on Base.js <http://dean.edwards.name/weblog/2006/03/base/> (c) 2006 Dean Edwards, License <http://cre...
JavaScript
/** * @version $Id: switcher.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @subpackage Config * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General P...
JavaScript
/* Script: Swiff.Base.js Contains <Swiff>, <Swiff.getVersion>, <Swiff.remote> Author: Valerio Proietti, <http://mad4milk.net> enhanced by Harald Kirschner <http://digitarald.de> Credits: Flash detection 'borrowed' from SWFObject. License: MIT-style license. */ /* Function: Swiff creates a flash object with su...
JavaScript
/** * FancyUpload - Flash meets Ajax for beauty uploads * * Based on Swiff.Base and Swiff.Uploader. * * Its intended that you edit this class to add your * own queue layout/text/effects. This is NO include * and forget class. If you want custom effects or * more output, use Swiff.Uploader as interface * for yo...
JavaScript
/** * @version $Id: popup-imagemanager.js 8656 2007-08-30 22:40:39Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public Licen...
JavaScript
// directory of where all the images are var cmThemeOfficeBase = 'includes/js/ThemeOffice/'; var cmThemeOffice = { // main menu display attributes // // Note. When the menu bar is horizontal, // mainFolderLeft and mainFolderRight are // put in <span></span>. When the menu // bar is vertical, they ...
JavaScript
/* Copyright Mihai Bazon, 2002 | http://students.infoiasi.ro/~mishoo * --------------------------------------------------------------------- * * The DHTML Calendar, version 0.9.2 "The art of date selection" * * Details and latest version at: * http://students.infoiasi.ro/~mishoo/site/calendar.epl * * Feel fr...
JavaScript
// ** I18N Calendar._DN = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); Calendar._MN = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); // tooltips Calendar._TT =...
JavaScript
//\///// //\ overLIB Hide Form Plugin //\ //\ Uses an iframe shim to mask system controls for IE v5.5 or higher as suggested in //\ http://dotnetjunkies.com/weblog/jking/posts/488.aspx //\ This file requires overLIB 4.10 or later. //\ //\ overLIB 4.05 - You may not remove or change this notice. //\ Copyright Erik...
JavaScript
/* JSCookMenu v1.4.3. (c) Copyright 2002-2005 by Heng Yuan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
JavaScript
/* This notice must be untouched at all times. wz_tooltip.js v. 3.34 The latest version is available at http://www.walterzorn.com or http://www.devira.com or http://www.walterzorn.de Copyright (c) 2002-2004 Walter Zorn. All rights reserved. Created 1. 12. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) Last...
JavaScript
// <?php !! This fools phpdocumentor into parsing this file /** * @version $Id: mambojavascript.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL * Joomla! is Free Software */ // general utility for browsing a ...
JavaScript
/* JSCookMenu v1.4.3. (c) Copyright 2002-2005 by Heng Yuan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
JavaScript
/*--------------------------------------------------| | dTree 2.05 | www.destroydrop.com/javascript/tree/ | |---------------------------------------------------| | Copyright (c) 2002-2003 Geir Landr? | | | | This script can be used freely as long as all ...
JavaScript
/*----------------------------------------------------------------------------\ | Tab Pane 1.02 | |-----------------------------------------------------------------------------| | Created by Erik Arvidsson | ...
JavaScript
// <?php !! This fools phpdocumentor into parsing this file /** * @version $Id: joomla.javascript.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL * Joomla! is Free Software */ /** * Overlib Styling Declarati...
JavaScript
// ** I18N // Calendar EN language // Author: Mihai Bazon, <mishoo@infoiasi.ro> // Encoding: any // Translator : Niko <nikoused@gmail.com> // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internat...
JavaScript
// ** I18N // Calendar EN language // Author: Mihai Bazon, <mihai_bazon@yahoo.com> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // includ...
JavaScript
/** * Tinymce template_list.js sample file * @version tinymce 3.2.6 * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License...
JavaScript
/** * @version $Id: xstandard.js 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License...
JavaScript
/* --- name: Core description: The core of MooTools, contains all the base functions and the Native and Hash implementations. Required by all the other scripts. license: MIT-style license. copyright: Copyright (c) 2006-2008 [Valerio Proietti](http://mad4milk.net/). authors: The MooTools production team (http://moo...
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
jQuery(document).ready(function() { /* Background slideshow */ $.backstretch([ "http://azmind.com/demo/fullscreen-contact-form/assets/img/backgrounds/3.jpg", "http://azmind.com/demo/fullscreen-contact-form/assets/img/backgrounds/2.jpg", "http://azmind.com/demo/fullscreen-contact-form/assets/img/bac...
JavaScript
/** * borderMenu.js v1.0.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2013, Codrops * http://www.codrops.com */ (function() { // http://stackoverflow.com/a/11381730/989439 function mobilecheck() { var check = false; (...
JavaScript
/*! * classie - class helper functions * from bonzo https://github.com/ded/bonzo * * classie.has( elem, 'my-class' ) -> true/false * classie.add( elem, 'my-new-class' ) * classie.remove( elem, 'my-unwanted-class' ) * classie.toggle( elem, 'my-class' ) */ /*jshint browser: true, strict: true, undef: true */ /*...
JavaScript
(function($) { var aux = { // navigates left / right navigate : function( dir, $el, $wrapper, opts, cache ) { var scroll = opts.scroll, factor = 1, idxClicked = 0; if( cache.expanded ) { scroll = 1; // scroll is always 1 in full mode factor = 3; // the width of the exp...
JavaScript
/** * mlpushmenu.js v1.0.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2013, Codrops * http://www.codrops.com */ ;( function( window ) { 'use strict'; function extend( a, b ) { for( var key in b ) { if( b.hasOwnProp...
JavaScript
/* Copyright 2010 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 writing,...
JavaScript
/* Copyright 2010 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 writing,...
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
// uniTip - written by Nathan Ford for Unit Interactive // // uniTip is based on qTip: // qTip - CSS Tool Tips - by Craig Erskine // http://qrayg.com var uniTipTag = "a,img,div,ul,input"; //Which tag do you want to uniTip-ize? Keep it lowercase. No spaces around commas.// var uniTipClass = ""; //Which classes do you w...
JavaScript
function getCookie( name ) { var start = document.cookie.indexOf( name + "=" ); var len = start + name.length + 1; if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) { return null; } if ( start == -1 ) return null; var end = docum...
JavaScript
(function($) { $.fn.slide = function(settings){ var _link = $(this); var _parent = _link.parent(); var _slide_selector = settings.slide_selector; var _auto = settings.auto || false; var _time = settings.time || 5000; var _index = 0; var _max_index = $(this).length; var _interval; ...
JavaScript
// For an introduction to the Blank template, see the following documentation: // http://go.microsoft.com/fwlink/?LinkId=232509 (function () { "use strict"; WinJS.Binding.optimizeBindingReferences = true; var app = WinJS.Application; var activation = Windows.ApplicationModel.Activation; var canvas, context; ...
JavaScript
$(function(){ var multipleSupport = typeof $('<input/>')[0].multiple !== 'undefined', isIE = /msie/i.test( navigator.userAgent ); $.fn.raycod = function() { return this.each(function() { var $file = $(this).addClass('raycod'), $wrap = $('<div class="raycod-wrap">'), $input = $('<input type="text" readonly="readonly" cl...
JavaScript
/** * @fileOverview Database class * @author Albin Poignot * @version 1.0 */ (function(){ // Start of local scope /** * @namespace * @extends CRM4Pro */ CRM4Pro.Data = CRM4Pro.Data || {}; // Create a subnamespace or nothing /*function nullHandler() { }*/ /** * @extends CRM4Pro.Data * @para...
JavaScript
/* * jQuery Mobile Framework 1.0 * http://jquerymobile.com * * Copyright 2011 (c) jQuery Project * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * */ /*! * jQuery UI Widget @VERSION * * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL ...
JavaScript
document.addEventListener("deviceready", getProfile, false); function getProfile() { //Step 1 : create a new DB object var db = new CRM4Pro.Data.Database("crm4rpo", "CRM4Pro", "1.0", 200000); // Step 2 db.setFctSucQuery( function(tx, results) { bouton = document.getElementById('boutonMenu1'); ...
JavaScript
// A self-executing anonymous function, // standard technique for developing jQuery plugins. (function($){ $.fn.splashScreen = function(settings){ // Providing default options: settings = $.extend({ textLayers : [], textShowTime : 1500, textTopOffset : 80 },settings); var promoIMG = this; // ...
JavaScript
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the...
JavaScript
/** * @namespace */ var CRM4Pro = { author : "CRM4Pro" };
JavaScript
/** * @Fichier syncCRMDevice * @role - permet d'effectuer la synchronisation des contacts entre la base de donnees local et le device * grace a l'appel de la fonction synchro() * - les contacts deja present dans la base du device sont ignores. * - la gestion des "conflits" se fait, pour l'instant, sur l...
JavaScript
(function(){ // Start of local scope /** * @namespace * @extends CRM4Pro */ CRM4Pro.Admin = CRM4Pro.Admin || {}; // Create a subnamespace or nothing CRM4Pro.Admin.getConfig = function() { var databasess = new CRM4Pro.Data.Database("crm4rpo", "CRM4Pro", "1.0", 200000); // Step 2 databasess.setFct...
JavaScript
/* * mobile support unit tests */ (function( $ ) { $.testHelper = { excludeFileProtocol: function(callback){ var message = "Tests require script reload and cannot be run via file: protocol"; if (location.protocol == "file:") { test(message, function(){ ok(false, message); }); } else { c...
JavaScript
/* * mobile checkboxradio unit tests */ (function($){ module( 'vertical controlgroup, no refresh' , { setup: function() { this.vcontrolgroup = $( "#vertical-controlgroup" ); } }); test( "vertical controlgroup classes", function() { var buttons = this.vcontrolgroup.find( ".ui-btn" ), middlebuttons = bu...
JavaScript
/* * mobile core unit tests */ (function($){ var libName = "jquery.mobile.core.js", scrollTimeout = 20, // TODO expose timing as an attribute scrollStartEnabledTimeout = 150; module(libName, { setup: function(){ $("<div id='scroll-testing' style='height: 1000px'></div>").appendTo("body"); }, teard...
JavaScript
/* * mobile core unit tests */ (function($){ var libName = "jquery.mobile.core.js", setGradeA = function(value, version) { $.support.mediaquery = value; $.mobile.browser.ie = version; }, extendFn = $.extend; module(libName, { setup: function(){ // NOTE reset for gradeA tests $('html').rem...
JavaScript
/* * mobile select unit tests */ (function($){ var resetHash; resetHash = function(timeout){ $.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" ); }; // https://github.com/jquery/jquery-mobile/issues/2181 asyncTest( "dialog sized select should alter the value of its parent sele...
JavaScript
/* * mobile select unit tests */ (function($){ module("jquery.mobile.forms.select native"); test( "native menu selections alter the button text", function(){ var select = $( "#native-select-choice-few" ), setAndCheck; setAndCheck = function(key){ var text; select.val( key ).selectmenu( 'refresh' )...
JavaScript
/* * mobile select unit tests */ (function($){ var libName = "jquery.mobile.forms.select.js"; $(document).bind('mobileinit', function(){ $.mobile.selectmenu.prototype.options.nativeMenu = false; }); module(libName,{ setup: function(){ $.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" :...
JavaScript
/* * mobile select unit tests */ (function($){ var libName = "jquery.mobile.forms.select.js", originalDefaultDialogTrans = $.mobile.defaultDialogTransition, originalDefTransitionHandler = $.mobile.defaultTransitionHandler, originalGetEncodedText = $.fn.getEncodedText, resetHash, closeDialog; resetHash = f...
JavaScript
/* * mobile init tests */ (function($){ test( "page element is generated when not present in initial markup", function(){ ok( $( ".ui-page" ).length, 1 ); }); })(jQuery);
JavaScript
/* * mobile init tests */ (function($){ var mobilePage = undefined, libName = 'jquery.mobile.init.js', coreLib = 'jquery.mobile.core.js', extendFn = $.extend, setGradeA = function(value) { $.mobile.gradeA = function(){ return value; }; }, reloadCoreNSandInit = function(){ $.testHelper.reloadLib(co...
JavaScript
/* * mobile page unit tests */ (function($){ var libName = 'jquery.mobile.page.sections.js', themedefault = $.mobile.page.prototype.options.theme, keepNative = $.mobile.page.prototype.options.keepNative; module(libName, { setup: function() { $.mobile.page.prototype.options.keepNative = keepNative; } })...
JavaScript
/* * mobile event unit tests */ (function($){ var libName = "jquery.mobile.event.js", absFn = Math.abs, originalEventFn = $.Event.prototype.originalEvent, preventDefaultFn = $.Event.prototype.preventDefault, events = ("touchstart touchmove touchend orientationchange tap taphold " + "swipe swipel...
JavaScript
/* * mobile dialog unit tests */ (function($){ module('jquery.mobile.fieldContain.js'); test( "Field container contains appropriate css styles", function(){ ok($('#test-fieldcontain').hasClass('ui-field-contain ui-body ui-br'), 'A fieldcontain element must contain styles "ui-field-contain ui-body ui-br"'); });...
JavaScript
/* * mobile button unit tests */ (function($){ $.mobile.page.prototype.options.keepNative = "button.should-be-native"; test( "button elements in the keepNative set shouldn't be enhanced", function() { same( $("button.should-be-native").siblings("div.ui-slider").length, 0 ); }); test( "button elements should b...
JavaScript
/* * mobile media unit tests */ (function($){ var cssFn = $.fn.css, widthFn = $.fn.width; // make sure original definitions are reset module('jquery.mobile.media.js', { setup: function(){ $(document).trigger('mobileinit.htmlclass'); }, teardown: function(){ $.fn.css = cssFn; $.fn.width = widthF...
JavaScript
(function($) { asyncTest( "nested pages hash key is always in the hash on default page with no id (replaceState) ", function(){ $.testHelper.pageSequence([ function(){ // Click on the link of the third li element $('.ui-page-active li:eq(2) a:eq(0)').click(); }, function(){ ok( location.hash.se...
JavaScript
/* * mobile listview unit tests */ // TODO split out into seperate test files (function($){ var home = $.mobile.path.parseUrl( location.href ).pathname; $.mobile.defaultTransition = "none"; module( "Basic Linked list", { setup: function(){ $.testHelper.openPage( "#basic-linked-test" ); } }); asyncTes...
JavaScript
/* * mobile slider unit tests */ (function($){ var onChangeCnt = 0; window.onChangeCounter = function() { onChangeCnt++; } module('jquery.mobile.slider.js'); var keypressTest = function(opts){ var slider = $(opts.selector), val = window.parseFloat(slider.val()), handle = slider.siblings('.ui-slid...
JavaScript
/* * mobile slider unit tests */ (function($){ $.mobile.page.prototype.options.keepNative = "input.should-be-native"; // not testing the positive case here since's it's obviously tested elsewhere test( "slider elements in the keepNative set shouldn't be enhanced", function() { same( $("input.should-be-native")....
JavaScript
/* * mobile page unit tests */ (function($){ var libName = 'jquery.mobile.page.js'; module(libName); test( "nested header anchors aren't altered", function(){ ok(!$('.ui-header > div > a').hasClass('ui-btn')); }); test( "nested footer anchors aren't altered", function(){ ok(!$('.ui-footer > div > a').hasC...
JavaScript
//set namespace for unit test markp $( document ).bind( "mobileinit", function(){ $.mobile.ns = "nstest-"; });
JavaScript
(function($) { asyncTest( "dialog ui-state should be part of the hash", function(){ $.testHelper.sequence([ function() { // open the test page $.mobile.activePage.find( "a" ).click(); }, function() { // verify that the hash contains the dialogHashKey ok( location.hash.search($.mobile.dialog...
JavaScript
/* * mobile navigation base tag unit tests */ (function($){ var baseDir = $.mobile.path.parseUrl($("base").attr("href")).directory, contentDir = $.mobile.path.makePathAbsolute("../content/", baseDir); module('jquery.mobile.navigation.js - base tag', { setup: function(){ if ( location.hash ) { stop(); ...
JavaScript
/* * mobile navigation path unit tests */ (function($){ var url = $.mobile.path.parseUrl( location.href ), home = location.href.replace( url.domain, "" ); var testPageLoad = function(testPageAnchorSelector, expectedTextValue){ expect( 2 ); $.testHelper.pageSequence([ function(){ // reset before each ...
JavaScript
/* * mobile navigation unit tests */ (function($){ var siteDirectory = location.pathname.replace(/[^/]+$/, ""); module('jquery.mobile.navigation.js', { setup: function(){ if ( location.hash ) { stop(); $(document).one("pagechange", function() { start(); } ); location.hash = ""; } } ...
JavaScript
/* * mobile navigation unit tests */ (function($){ var perspective = "viewport-flip", transitioning = "ui-mobile-viewport-transitioning", animationCompleteFn = $.fn.animationComplete, //TODO centralize class names? transitionTypes = "in out fade slide flip reverse pop", isTransitioning = function(pa...
JavaScript
/* * mobile navigation unit tests */ (function($){ // TODO move siteDirectory over to the nav path helper var changePageFn = $.mobile.changePage, originalTitle = document.title, originalLinkBinding = $.mobile.linkBindingEnabled, siteDirectory = location.pathname.replace( /[^/]+$/, "" ), home = $.mobile.path...
JavaScript
/* * mobile buttonMarkup tests */ (function($){ module("jquery.mobile.buttonMarkup.js"); test( "control group buttons should be enhanced inside a footer", function(){ var group, linkCount; group = $("#control-group-footer"); linkCount = group.find( "a" ).length; same( group.find("a.ui-btn").length, linkC...
JavaScript
/* * mobile widget unit tests */ (function($){ module('jquery.mobile.widget.js'); test( "getting data from creation options", function(){ var expected = "bizzle"; $.mobile.widget.prototype.options = { "fooBar" : true }; $.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">"); same($.m...
JavaScript