code
stringlengths
1
2.08M
language
stringclasses
1 value
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.View * @extends Ext.util.Observable * Create a "View" for an element based on a data model or Updater and the supplied DomHelper template. * This class also sup...
JavaScript
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.grid.AbstractGridView = function(){ this.grid = null; this.events = { "beforerowremoved" : true, "beforerowsinserted" : true, "beforerefresh" : true, ...
JavaScript
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.JsonView * @extends Ext.View * Shortcut class to create a JSON + {@link Ext.Updater} template view. Usage: <pre><code> var view = new Ext.JsonView("my-element",...
JavaScript
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.MasterTemplate * @extends Ext.Template * Provides a template that can have child templates. The syntax is: <pre><code> var t = new Ext.MasterTemplate( '&lt;se...
JavaScript
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.BasicDialog * @extends Ext.util.Observable * Lightweight Dialog Class. The code below shows the creation of a typical dialog using existing HTML markup: * <pre...
JavaScript
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.DomHelper = function(){ var tempTableEl = null; var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i; var tableRe = /^table|tbod...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /* AIRAliases.js - Revision: 0.15 */ // Copyright (c) 2007. Adobe Systems Incorporated. // All rights reserved. // // Redistribution and use in source and binary forms, with or wit...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // Initialize the state provider Ext.state.Manager.setProvider(new Ext.air.FileProvider({ file: 'tasks.state', // if first time running defaultState : { mainWindow : { widt...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.onReady(function(){ var win = window.nativeWindow; var opener = Ext.air.NativeWindow.getRootHtmlWindow(); var d = new Date().clearTime(true); d = d.add('mi', opener.Ext.st...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /* * Ext JS Library 2.0.1 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.namespace('Ext.air', 'Ext.sql'); Ext.Templ...
JavaScript
<?xml version="1.0" encoding="utf-8"?> <project path="" name="Ext - JS Lib" author="Ext JS, LLC" version="2.0.1" copyright="Ext JS Library $version&#xD;&#xA;Copyright(c) 2006-2008, $author.&#xD;&#xA;licensing@extjs.com&#xD;&#xA;&#xD;&#xA;http://extjs.com/license" output="$project\..\samples\tasks\ext-air\resources\" ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /* * Ext JS Library 2.0.1 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.namespace('Ext.air', 'Ext.sql'); Ext.Templ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ tx.data.ListStore = Ext.extend(Ext.data.Store, { constructor: function(){ tx.data.ListStore.superclass.constructor.call(this, { sortInfo:{field: 'listName', direction: "...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // Implementation class for created the tree powered form field ListSelector = Ext.extend(Ext.ux.TreeSelector, { maxHeight:200, listenForLoad: false, initComponent : function()...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ tx.Importer = function(){ function chooseFile(callback){ var file = new air.File(air.File.documentsDirectory.nativePath); var filter = new air.FileFilter("Tasks XML File", "*.xml...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // generates a renderer function to be used for textual date groups Ext.util.Format.createTextDateRenderer = function(){ // create the cache of ranges to be reused var today =...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.SwitchButton = Ext.extend(Ext.Component, { initComponent : function(){ Ext.SwitchButton.superclass.initComponent.call(this); var mc = new Ext.util.MixedCollection(); m...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ ListTree = function(config){ ListTree.superclass.constructor.call(this, Ext.apply({ id:'list-tree', animate:false, //rootVisible:false, region:'west', width:200, spli...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // Unique task ids, if the time isn't unique enough, the addition // of random chars should be Ext.uniqueId = function(){ var t = String(new Date().getTime()).substr(4); var s = '...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.air.NativeWindowManager.getTaskWindow = function(taskId){ var win, winId = 'task' + taskId; if(win = this.get(winId)) { win.instance.orderToFront(); } else { win = new Ex...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ TaskGrid = function(){ // custom columns var completeColumn = new CompleteColumn(); var reminderColumn = new ReminderColumn(); TaskGrid.superclass.constructor.call(this, { ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // custom menu item to contain Ext trees Ext.menu.TreeItem = Ext.extend(Ext.menu.Adapter, { constructor : function(config){ Ext.menu.TreeItem.superclass.constructor.call(this...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.BLANK_IMAGE_URL = 'images/s.gif'; tx = {data:{}, ui: {}}; // work around for broken cross frame Dates in Safari function fixDate(d){ return d ? new Date(d.getTime()) : d; }...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ tx.Exporter = function(){ var lists = tx.data.conn.query('select * from list'); var doc = new runtime.flash.xml.XMLDocument(); var root = doc.createElement('simple-tasks'); ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ ListLoader = function(config){ Ext.apply(this, config); }; Ext.extend(ListLoader, Ext.util.Observable, { keyAttribute: 'id', keyField: 'parentId', load: function(node, cal...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * Makes a ComboBox more closely mimic an HTML SELECT. Supports clicking and dragging * through the list, with item selection occurring when the mouse button is released. * Whe...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // In AIR, XTemplates must be created at load time Templates = { categoryCombo: new Ext.XTemplate( '<tpl for="."><div class="x-combo-list-item">{listName}</div></tpl>' ), timeF...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.namespace('Ext.ux.form'); /** * Ext.ux.form.DateTime Extension Class for Ext 2.x Library * * @author Ing. Jozef Sakalos * @copyright (c) 2008, Ing. Jozef Sakalos ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ tx.data.TaskStore = Ext.extend(Ext.data.GroupingStore, { constructor: function(){ tx.data.TaskStore.superclass.constructor.call(this, { sortInfo:{field: 'dueDate', direc...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // Grid column plugin that does the complete/active button in the left-most column CompleteColumn = function(){ var grid; function getRecord(t){ var index = grid.ge...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ tx.ReminderManager = function(){ var table; var run = function(){ var rs = table.selectBy('where completed = 0 AND reminder <> \'\' AND reminder <= ?', [new Date()]); for(va...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.onReady(function(){ var win = window.nativeWindow; var opener = Ext.air.NativeWindow.getRootHtmlWindow(); var taskId = String(window.location).split('=')[1]; var store = o...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.onReady(function(){ Ext.QuickTips.init(); var win = window.nativeWindow; var opener = Ext.air.NativeWindow.getRootHtmlWindow(); var taskId = String(window.location...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.DomHelper = function(){ var tempTableEl ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /* * Ext JS Library 2.0.1 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext = {version: '2.0.1'}; window["undefined"]...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.air.SystemMenu * * Provides platform independent handling of adding item to the application menu, creating the menu or * items as needed. <br/><br/> * * T...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.air.Sound * * @singleton */ Ext.air.Sound = { /** * Play a sound. * @param {String} file The file to be played. The path is resolved against applicatio...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.air.NativeWindow * @extends Ext.air.NativeObservable * * Wraps the AIR NativeWindow class to give an Ext friendly API. <br/><br/>This class also adds * autom...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.air.FileProvider * @extends Ext.state.Provider * * An Ext state provider implementation for Adobe AIR that stores state in the application * storage director...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.sql.Proxy = function(conn, table, keyName, store, readonly){ Ext.sql.Proxy.superclass.constructor.call(this); this.conn = conn; this.table = this.conn.getTable(table, ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.sql.AirConnection = Ext.extend(Ext.sql.Connection, { // abstract methods open : function(db){ this.conn = new air.SQLConnection(); var file = air.File.application...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.sql.Table = function(conn, name, keyName){ this.conn = conn; this.name = name; this.keyName = keyName; }; Ext.sql.Table.prototype = { update : function(o){ var clause ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ // Asbtract base class for Connection classes Ext.sql.Connection = function(config){ Ext.apply(this, config); Ext.sql.Connection.superclass.constructor.call(this); this.addEvent...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.air.SystemTray = function(){ var app = air.NativeApplication.nativeApplication; var icon, isWindows = false, bitmaps; // windows if(air.NativeApplication.supportsSystemTra...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.air.NativeObservable * @extends Ext.util.Observable * * Adds ability for Ext Observable functionality to proxy events for native (AIR) object wrappers * * ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /* * This file corrects air eval issues and other issues found in the AIR application sandbox */ Ext.namespace('Ext.air', 'Ext.sql'); Ext.Template.prototype.compile = function()...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.air.DragType * * Drag drop type constants * * @singleton */ Ext.air.DragType = { /** * Constant for text data */ TEXT : 'text/plain', /** ...
JavaScript
/* * Ext JS Library 0.20 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.namespace('Ext.air', 'Ext.sql'); Ext.Template.prototype.compile = function() { var fm = Ext.util.Format; var useF = this.disableFormats !== true; var prevOffset = 0; v...
JavaScript
/* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.DomHelper = function(){ var tempTableEl = null; var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i; var tableRe = /^table|tbod...
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 "License"); you may not use...
JavaScript
/* jQuery TextAreaResizer plugin Created on 17th January 2008 by Ryan O'Dell Version 1.0.4 Converted from Drupal -> textarea.js Found source: http://plugins.jquery.com/misc/textarea.js $Id: textarea.js,v 1.11.2.1 2007/04/18 02:41:19 drumm Exp $ 1.0.1 Updates to missing global 'var', added extra glo...
JavaScript
// TODO: Proper use of namespaces if (typeof (QP) == "undefined" || !QP) { var QP = {} }; (function() { /* Draws the lines linking nodes in query plan diagram. root - The document element in which the diagram is contained. */ QP.drawLines = function(root) { if (root === null || root...
JavaScript
DataExplorer.SiteSwitcher = (function () { var additional, template, input; function init(target, url) { template = url; input = $(target); input.one('focus', function () { $.get('/sites', prepareAutocomplete); }); } function update(data) { ...
JavaScript
/* Simple OpenID Plugin http://code.google.com/p/openid-selector/ This code is licenced under the New BSD License. */ var providers_large = { stackexchange: { name: 'StackExchange', url: 'https://openid.stackexchange.com/', x: -1, y: -518 }, google: { ...
JavaScript
/* * jQuery Autocomplete plugin 1.1 * * Copyright (c) 2009 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ */ ;(...
JavaScript
CodeMirror.runMode = function(string, modespec, callback) { var mode = CodeMirror.getMode({indentUnit: 2}, modespec); var isNode = callback.nodeType == 1; if (isNode) { var node = callback, accum = []; callback = function(string, style) { if (string == "\n") accum.push("<br>"); else if...
JavaScript
// CodeMirror version 2.2 // // All functions that need access to the editor's state live inside // the CodeMirror function. Below that, at the bottom of the file, // some utilities are defined. // CodeMirror is the only global var we claim var CodeMirror = (function() { // This is the function that produces an edit...
JavaScript
// See https://github.com/myape/CodeMirror2/blob/0b109319eda1e12f9d1a7024c7be640eda21ae36/mode/sql/sql.js CodeMirror.defineMode("sql", function (config, parserConfig) { var indentUnit = config.indentUnit, keywords = parserConfig.keywords, functions = parserConfig.functions, types = par...
JavaScript
var DataExplorer = (function () { var deferred = new $.Deferred(), options = { 'User': {}, 'Site': {} }; function init(settings) { if (typeof settings === 'object') { for (var setting in settings) { if (settings.hasOwnProper...
JavaScript
DataExplorer.QueryEditor = (function () { var editor, field, params = {}, query, options = { 'mode': 'text/x-t-sql' }; function exists() { return !!editor || !!query; } function create(target, callback) { if (typeof target === 'string') { ...
JavaScript
DataExplorer.TableHelpers = (function () { var tables, infoTemplate = document.create('span', { className: 'button table-data', text: 'show table', title: 'show the contents of this table' }), closeTemplate = document.create('span', { ...
JavaScript
/* Flot plugin for selecting regions. The plugin defines the following options: selection: { mode: null or "x" or "y" or "xy", color: color } Selection support is enabled by setting the mode to one of "x", "y" or "xy". In "x" mode, the user will only be able to specify the x range, similarly for "y" mode...
JavaScript
/* Flot plugin for showing crosshairs, thin lines, when the mouse hovers over the plot. crosshair: { mode: null or "x" or "y" or "xy" color: color lineWidth: number } Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical crosshair that lets you trace the values on the x axis, "y" en...
JavaScript
/* Flot plugin for plotting textual data or categories. Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin allows you to plot such a dataset directly. To enable it, you must specify mode: "categories" on the axis with the textual labels, e.g. $.plot("#placeholder", data, { xaxis: { mode: "c...
JavaScript
/* Flot plugin for computing bottoms for filled line and bar charts. The case: you've got two series that you want to fill the area between. In Flot terms, you need to use one as the fill bottom of the other. You can specify the bottom of each data point as the third coordinate manually, or you can use this plugin to ...
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
/* Flot plugin for thresholding data. Controlled through the option "threshold" in either the global series options series: { threshold: { below: number color: colorspec } } or in a specific series $.plot($("#placeholder"), [{ data: [ ... ], threshold: { ... }}]) An array can be passed f...
JavaScript
/* Flot plugin that adds some extra symbols for plotting points. The symbols are accessed as strings through the standard symbol choice: series: { points: { symbol: "square" // or "diamond", "triangle", "cross" } } */ (function ($) { function processRawData(plot, series, datapoints) { ...
JavaScript
/* Plugin for jQuery for working with colors. * * Version 1.1. * * Inspiration from jQuery color animation plugin by John Resig. * * Released under the MIT license by Ole Laursen, October 2009. * * Examples: * * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString() * var c = $.color.extrac...
JavaScript
/* Flot plugin for stacking data sets, i.e. putting them on top of each other, for accumulative graphs. The plugin assumes the data is sorted on x (or y if stacking horizontally). For line charts, it is assumed that if a line has an undefined gap (from a null point), then the line above it should have the same gap - i...
JavaScript
/* Flot plugin for rendering pie charts. The plugin assumes the data is coming is as a single data value for each series, and each of those values is a positive value or zero (negative numbers don't make any sense and will cause strange effects). The data values do NOT need to be passed in as percentage values...
JavaScript
/* Flot plugin for adding panning and zooming capabilities to a plot. The default behaviour is double click and scrollwheel up/down to zoom in, drag to pan. The plugin defines plot.zoom({ center }), plot.zoomOut() and plot.pan(offset) so you easily can add custom controls. It also fires a "plotpan" and "plotzoom" even...
JavaScript
/*! Javascript plotting library for jQuery, v. 0.7. * * Released under the MIT license by IOLA, December 2007. * */ // first an inline dependency, jquery.colorhelpers.js, we inline it here // for convenience /* Plugin for jQuery for working with colors. * * Version 1.1. * * Inspiration from jQuery color ani...
JavaScript
/* Flot plugin for plotting images, e.g. useful for putting ticks on a prerendered complex visualization. The data syntax is [[image, x1, y1, x2, y2], ...] where (x1, y1) and (x2, y2) are where you intend the two opposite corners of the image to end up in the plot. Image must be a fully loaded Javascript image (you ca...
JavaScript
/// <reference path="third-party/jquery-1.3.2-vsdoc2.js"/> $(function() { var loader = '<img class="ajax-loader" src="http://sstatic.net/img/progress-dots.gif" title="loading..." alt="loading..." width="11" height="11" />'; var removeLoader = function() { $('.ajax-loader').fadeOut('fast'); }; ...
JavaScript
// Copyright (C) 2010 The Android Open Source Project // // 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 ...
JavaScript
var availKeys = [ "backspace", "tab", "enter", "shift", "ctrl", "alt", "space", "pageup", "pagedown", "end", "home", "left", "up", "right", "down", "insert", "delete", "multiply", "add", "subtract", "decimalpoint", "divide", "nu...
JavaScript
function $_GET(q) { var s = window.location.search; var re = new RegExp('&'+q+'(?:=([^&]*))?(?=&|$)','i'); return (s=s.replace(/^\?/,'&').match(re)) ? (typeof s[1] == 'undefined' ? '' : decodeURIComponent(s[1])) : undefined; } function getXmlHttp() { if (window.XMLHttpRequest) {// code for IE7+...
JavaScript
function getXmlHttp() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } else {// code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } } function highScoresOnLoad() { // div called id=highScoreDiv var xmlhttp = g...
JavaScript
function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = n...
JavaScript
var Background = function (config) { var x, y, curTile; config = config || {}; this.originX = (config.x || 0) + FIELD_OFFSET_X; this.originY = (config.y || 0) + FIELD_OFFSET_Y; this.width = 10; this.height = 20; this.tiles = []; for (x = 0; x < this.width; x += 1) { for (y = 0;...
JavaScript
function PreviewGroup(baseX, baseY) { var i; this.blocks = []; this.shape = null; // create the blocks for (i = 0; i < 4; i += 1) { this.blocks.push(new Block({ boardOriginX: baseX, boardOriginY: baseY, blockX: 0, blockY: 0, shape: 'i' })); } } /** * Sets the s...
JavaScript
function TtyBlock (divName, numLines, rollOverLength, rollOverRemove) { var i; this.elem = document.getElementById(divName); // slow scorlling effect variables this.curPos = 0; this.cursorShown = false; // TODO: make these random starting values this.timePassedType = 0; this.timePass...
JavaScript
/** * @returns {[Number]} the line numbers of all the completed rows */ Game.prototype.getRows = function () { var i, rows = [], res = [], curRow; // initialize the rows to 0 for (i = 0; i < 20; i += 1) { rows[i] = 0; } // for each block for (i = 0; i < this.blocks.length; i += 1...
JavaScript
var SHAPES = { i: { spin: 'corner', startX: 5, startY: 0, pos: [ { x: -2, y: -1 }, { x: -1, y: -1}, { x: 0, y: -1 }, { x: 1, y: -1 } ], image: 'media/cyanblock.png', kickType: 'i_block' }, o: { spin: 'corner', startX: 5, startY: -1, pos: [ { x: -1, y: 0 }, { x: 0, y:...
JavaScript
function Button(config) { var parent = new jaws.Sprite(config), key; for (key in parent) { this[key] = parent[key]; } } Button.prototype.isClicked = function(x, y) { return this.rect().collidePoint(x, y); };
JavaScript
function Game(inputMapping, autoRepeat, threshold) { var thisObject = this, i; this.firstLoop = true; this.blocks = []; this.controlGroup = null; // make the preview blocks this.previewBlocks = []; for (i = 0; i < 4; i += 1) { this.previewBlocks.push(new Block({blockX: -10, block...
JavaScript
// default input assignments var inputAssignments = { shiftLeft: ['left'], shiftRight: ['right'], softDrop: ['down'], rotateLeft: ['z'], rotateRight: ['x', 'up'], swap: ['shift', 'c'], hardDrop: ['space'] }; var autoRepeatConfig = 50; var thresholdConfig = 200; function loadGameControls()...
JavaScript
/** * The blocks that can be moved nby the user * @param {Array} blocks - an array of [Block] of size 4 that can be operated on * @param {Char} shape - the block type: i, o, j, l, s, z, t * @param {function({Number}x, {Number}y)} isLegalCallback - a function that retursn true if a block can be moved * to the new posit...
JavaScript
FIELD_OFFSET_X = 180; FIELD_OFFSET_Y = 12; function TetrisControl() { var tetris = new Tetris(this); this.setup = function () { tetris.setup(); }; this.update = function () { tetris.update(); }; this.draw = function () { tetris.draw(); }; this.restart = function() { // create a n...
JavaScript
var WALL_KICK_OFFSETS = {}; /* 0 -> starting orientation 1 -> 1 turn cw 2 -> 2 turns 3-> 1 turn ccw non-I blocks L->2 ( 0, 0) (-1, 0) (-1,-1) ( 0,+2) (-1,+2) L->0 ( 0, 0) (-1, 0) (-1,-1) ( 0,+2) (-1,+2) 2->R ( 0, 0) (-1, 0) (-1,+1) ( 0,-2) (-1,-2) 2->L ( 0, 0) (+1, 0) (+1,+1) ( 0,-2) (+1,-2) R->0 ( 0, 0) (+1, 0) (+1,...
JavaScript
function ScoreTracker(scoreOutput, linesOutput, levelOutput, tickerOutput) { this.level = 1; this.score = 0; this.linesRemaining = ScoreTracker.levelLines(this.level); this.scoreOutput = scoreOutput; this.linesOutput = linesOutput; this.levelOutput = levelOutput; this.tickerOutput = tickerO...
JavaScript
/* * * Jaws - a HTML5 canvas/javascript 2D game development framework * * Homepage: http://jawsjs.com/ * Works with: Chrome 6.0+, Firefox 3.6+, 4+, IE 9+ * License: LGPL - http://www.gnu.org/licenses/lgpl.html * * Formating guide: * * jaws.oneFunction() * jaws.one_variable = 1 * new jaws.OneConstr...
JavaScript
// TODO: constants file??? var BLOCK_WIDTH = 24; function Block(config) { var parent, key; config = config || {}; this.boX = (config.boardOriginX || 0) + FIELD_OFFSET_X; this.boY = (config.boardOriginY || 0) + FIELD_OFFSET_Y; this.blockX = config.blockX; this.blockY = config.blockY; thi...
JavaScript
function RandomBag(queueSize) { // start off empty this.available = []; this.queue = []; // initialize by refilling the queue while (this.queue.length < queueSize) { this.queue.push(this.nextAvailable()); } } RandomBag.initialList = ['i', 'o', 'j', 'l', 'z', 's', 't']; /** * Returns the lett...
JavaScript
try { var pageTracker = _gat._getTracker("UA-18761191-1"); pageTracker._trackPageview(); } catch(err) {}
JavaScript
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
JavaScript
// Copyright 2008 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 ...
JavaScript
/* * Autocomplete - jQuery plugin 1.0.2 * * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.autocomplete....
JavaScript
/** * Ajax Queue Plugin * * Homepage: http://jquery.com/plugins/project/ajaxqueue * Documentation: http://docs.jquery.com/AjaxQueue */ /** <script> $(function(){ jQuery.ajaxQueue({ url: "test.php", success: function(html){ jQuery("ul").append(html); } }); jQuery.ajaxQueue({ url: "test.p...
JavaScript