code stringlengths 1 2.08M | language stringclasses 1
value |
|---|---|
/*nifty corners layout*/
window.onload=function(){
Nifty("div#menu a","small transparent top");
Nifty("ul#intro li","same-height");
Nifty("div.date");
Nifty("div#content,div#side","same-height");
Nifty("div.comments div");
Nifty("div#footer");
Nifty("div#container","bottom");
} | JavaScript |
$page.Assign("paramForm.lastMessegeId.value", "$lastMessegeId")
$page.InsertHtml('bottom', 'messeges', "%{partial='Messege/_messege'}")
| JavaScript |
myGetAttribute = function (elt, attribute) {
if (attribute == "class") attribute = "className";
return elt[attribute];
}
mySetAttribute = function (elt, attribute, value) {
if (attribute == "class") attribute = "className";
elt[attribute] = value;
}
function setHidingLinks() {
onloadDoc();
}
funct... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
(function() {
var eventNames = ['blur', 'focus', 'load', 'unload', 'beforetransition', 'aftertransition' ];
// Using DOMContentLoaded so... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
iui.ts = {
themeSelect: function(select)
{
var curTheme = iui.ts.getTheme();
var index = select.selectedIndex;
var newTheme = select.options[index].value;
iui.ts.setTheme(newTheme);
return false;
},
getTheme: func... | JavaScript |
/*
copyright:
Copyright (c) 2007-10, iUI Project Members.
See LICENSE.txt for licensing terms.
Version @VERSION@
*/
/* note:
This version of iUI has a partial implementation of the `busy` flag for Issue #191,
it will not work with webapps that call `iui.showPage()` or `iui.showPageByHref()` directly... | JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires iui.js
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
// requires DOMContentLoaded event
/*
Portions Copyright (c) 2009, Masabi Ltd
http://www.masabi.com/
*/
(func... | JavaScript |
/*
Copyright (c) 2010, iUI Project Members
See LICENSE.txt for licensing terms
(derived from Apple Sample code)
*/
function addVideoLoggers(vid)
{
/* add logVideoEvent for all events for HTML5 media element events */
vid.addEventListener('loadstart', function(evt) { logVideoEvent(evt,'#000099'... | JavaScript |
/*
Copyright (c) 2010, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
(function() {
var vidEventLogging = true;
var waitForPlayThrough = false;
iui.Extension('iui-video', {
aftertransition: function(e) {
... | JavaScript |
var myView = {
onload: function(e) {
window.logEvent(e);
},
onunload: function(e) {
window.logEvent(e);
},
onfocus: function(e) {
window.logEvent(e);
},
onblur: function(e) {
window.logEvent(e);
},
onbeforetransition: function(e) {
window.logEvent(e);
},
onaftertransition: function(e) {
window.lo... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires iui.js
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
// requires DOMContentLoaded event
(function() {
// global, byClass, and byID need to be setup at page load time and b... | JavaScript |
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
* @license Use it if you like it
*/
function RGBColor(color_string)
{
this.ok = false;
// strip any leading #
if (color_string.charAt(0) == '#') { ... | JavaScript |
/*
* canvg.js - Javascript SVG parser and renderer on Canvas
* MIT Licensed
* Gabe Lerner (gabelerner@gmail.com)
* http://code.google.com/p/canvg/
*
* Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
*/
if(!window.console) {
window.console = {};
window.console.log = func... | JavaScript |
/*
Copyright (c) 2010, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires HTML <canvas> support, but does *not* require SVG
iui.Extension('iui-canvg', {
load: function() {
console.log("onLoad: " + this);
var aNode = this.querySelector("a[rel='iuicanvg']");
if (aNode && !iui.has... | JavaScript |
function f1(who)
{
return "Hello " + who + "!";
}
function sub1()
{
return f1("sub1") + " " + new Date();
}
function sub2()
{
return f1("sub2") + " " + new Date();
}
| JavaScript |
<ul id="jstest" title="Test">
<li><a href="#sub1">Sub1</a></li>
<li><a href="#sub2">Sub2</a></li>
</ul>
<div id="sub1" title="Sub1">
<div id="s1"></div>
</div>
<div id="sub2" title="Sub2">
<div id="s2"></div>
</div>
<script id="jstest1-js" src="jstest1.js"></script>
<script id="jstest2-js" src="jstest2.js"></scr... | JavaScript |
<ul id="gmap" title="GMap">
<li><a href="#default_map">Default map</a></li>
<li><a href="#geo_map">Geolocalisation</a></li>
</ul>
<div id="default_map" title="Default Map">
<div id="dmap"></div>
</div>
<div id="geo_map" title="Geolocalisation">
<div id="geomap"></div>
</div>
<script id="gmap-js1" type="applicati... | JavaScript |
var map;
function loadGMAP(divID)
{
map = new GMap2(document.getElementById(divID));
map.setCenter(new GLatLng(52,-5), 5);
map.setUIToDefault();
}
function loadGeoMAP(divID)
{
document.getElementById(divID).style.visibility="hidden";
map = new GMap2(document.getElementById(divID));
map.setCenter(new GLatLng(52,-5... | JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
// iUI Just In Time (JavaScript) Loader
//
// Based on work submitted by C.W. Zachary for Issue #128
// and Wayne Pan for Issue #102
//
// This is a work-in-progress and that's why it's in the "sandbox"
// This version should l... | JavaScript |
function runJS()
{
var elsub1 = document.getElementById('sub1');
var elsub2 = document.getElementById('sub2');
var els1 = document.getElementById('s1');
var els2 = document.getElementById('s2');
elsub1.addEventListener("focus", function()
{
els1.innerText = sub1()
}, false);
elsub2.addEventListener("focus", f... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
(function() {
var eventNames = ['blur', 'focus'/*, 'load', 'unload', 'beforetransition', 'aftertransition' */];
// Using DOMConten... | JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
//
// For an example see web-app/index.html
//
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
//
// Assumes that Google Analytics has been installed in the page in asynchronous mode
// ... | JavaScript |
<div id="ajax" title="Ajax Frag">
<h2>Ajax Fragment</h2>
<p>This should be unloaded when you hit the back button</p>
</div>
| JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
//
// iui-unloader.js
//
// An iUI extension that will remove any iUI fragment or view (aka "page") when it receives
// an 'unload' event from iUI core.
//
// This will prevent your DOM from getting overloaded. It can also be ... | JavaScript |
/* iui.Extension
* @author Adam Freidin
* @coded_at SHDH 44
*/
iui.Extension = function(name, handlers) {
var selector;
var event_handlers = {};
var default_adapter = iui.Extension.adapters._;
for(var key in handlers) switch(key) {
case "selector":
selector = handlers.selector;
break;
default:
... | JavaScript |
// iUI Reachability Extension
//
// Requires DOMContentLoaded event
// Requires document.querySelector()
//
//
//
(function() {
var endPoints = [];
var errFunc = null;
addEventListener("DOMContentLoaded", function(event)
{
if (errFunc == null)
{
errFunc = defErrFunc;
}
iui.ajaxErrHandler = errFunc;
// conso... | JavaScript |
// iUI Cache Manager Extension
//
// Requires DOMContentLoaded event
// Requires document.querySelector()
//
(function() {
var cache = window.applicationCache;
var cacheStatusStrings = { 0: 'UNCACHED', 1:'IDLE', 2:'CHECKING', 3:'DOWNLOADING', 4:'UPDATEREADY', 5:'OBSOLETE' };
var updateButton;
var swapButton;
addEv... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
(function() {
var eventNames = ['blur', 'focus', 'load', 'unload', 'beforetransition', 'aftertransition' ];
// Using DOMContentLoaded so... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
iui.ts = {
themeSelect: function(select)
{
var curTheme = iui.ts.getTheme();
var index = select.selectedIndex;
var newTheme = select.options[index].value;
iui.ts.setTheme(newTheme);
return false;
},
getTheme: func... | JavaScript |
/*
copyright:
Copyright (c) 2007-10, iUI Project Members.
See LICENSE.txt for licensing terms.
Version @VERSION@
*/
/* note:
This version of iUI has a partial implementation of the `busy` flag for Issue #191,
it will not work with webapps that call `iui.showPage()` or `iui.showPageByHref()` directly... | JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires iui.js
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
// requires DOMContentLoaded event
/*
Portions Copyright (c) 2009, Masabi Ltd
http://www.masabi.com/
*/
(func... | JavaScript |
/*
Copyright (c) 2010, iUI Project Members
See LICENSE.txt for licensing terms
(derived from Apple Sample code)
*/
function addVideoLoggers(vid)
{
/* add logVideoEvent for all events for HTML5 media element events */
vid.addEventListener('loadstart', function(evt) { logVideoEvent(evt,'#000099'... | JavaScript |
/*
Copyright (c) 2010, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
(function() {
var vidEventLogging = true;
var waitForPlayThrough = false;
iui.Extension('iui-video', {
aftertransition: function(e) {
... | JavaScript |
var myView = {
onload: function(e) {
window.logEvent(e);
},
onunload: function(e) {
window.logEvent(e);
},
onfocus: function(e) {
window.logEvent(e);
},
onblur: function(e) {
window.logEvent(e);
},
onbeforetransition: function(e) {
window.logEvent(e);
},
onaftertransition: function(e) {
window.lo... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires iui.js
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
// requires DOMContentLoaded event
(function() {
// global, byClass, and byID need to be setup at page load time and b... | JavaScript |
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
* @license Use it if you like it
*/
function RGBColor(color_string)
{
this.ok = false;
// strip any leading #
if (color_string.charAt(0) == '#') { ... | JavaScript |
/*
* canvg.js - Javascript SVG parser and renderer on Canvas
* MIT Licensed
* Gabe Lerner (gabelerner@gmail.com)
* http://code.google.com/p/canvg/
*
* Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
*/
if(!window.console) {
window.console = {};
window.console.log = func... | JavaScript |
/*
Copyright (c) 2010, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires HTML <canvas> support, but does *not* require SVG
iui.Extension('iui-canvg', {
load: function() {
console.log("onLoad: " + this);
var aNode = this.querySelector("a[rel='iuicanvg']");
if (aNode && !iui.has... | JavaScript |
function f1(who)
{
return "Hello " + who + "!";
}
function sub1()
{
return f1("sub1") + " " + new Date();
}
function sub2()
{
return f1("sub2") + " " + new Date();
}
| JavaScript |
<ul id="jstest" title="Test">
<li><a href="#sub1">Sub1</a></li>
<li><a href="#sub2">Sub2</a></li>
</ul>
<div id="sub1" title="Sub1">
<div id="s1"></div>
</div>
<div id="sub2" title="Sub2">
<div id="s2"></div>
</div>
<script id="jstest1-js" src="jstest1.js"></script>
<script id="jstest2-js" src="jstest2.js"></scr... | JavaScript |
<ul id="gmap" title="GMap">
<li><a href="#default_map">Default map</a></li>
<li><a href="#geo_map">Geolocalisation</a></li>
</ul>
<div id="default_map" title="Default Map">
<div id="dmap"></div>
</div>
<div id="geo_map" title="Geolocalisation">
<div id="geomap"></div>
</div>
<script id="gmap-js1" type="applicati... | JavaScript |
var map;
function loadGMAP(divID)
{
map = new GMap2(document.getElementById(divID));
map.setCenter(new GLatLng(52,-5), 5);
map.setUIToDefault();
}
function loadGeoMAP(divID)
{
document.getElementById(divID).style.visibility="hidden";
map = new GMap2(document.getElementById(divID));
map.setCenter(new GLatLng(52,-5... | JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
// iUI Just In Time (JavaScript) Loader
//
// Based on work submitted by C.W. Zachary for Issue #128
// and Wayne Pan for Issue #102
//
// This is a work-in-progress and that's why it's in the "sandbox"
// This version should l... | JavaScript |
function runJS()
{
var elsub1 = document.getElementById('sub1');
var elsub2 = document.getElementById('sub2');
var els1 = document.getElementById('s1');
var els2 = document.getElementById('s2');
elsub1.addEventListener("focus", function()
{
els1.innerText = sub1()
}, false);
elsub2.addEventListener("focus", f... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
(function() {
var eventNames = ['blur', 'focus'/*, 'load', 'unload', 'beforetransition', 'aftertransition' */];
// Using DOMConten... | JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
//
// For an example see web-app/index.html
//
// requires querySelectorAll, therefore iPhone OS 2.x or later
// or Safari 3.x or later
//
// Assumes that Google Analytics has been installed in the page in asynchronous mode
// ... | JavaScript |
<div id="ajax" title="Ajax Frag">
<h2>Ajax Fragment</h2>
<p>This should be unloaded when you hit the back button</p>
</div>
| JavaScript |
/*
Copyright (c) 2007-10, iUI Project Members
See LICENSE.txt for licensing terms
*/
//
// iui-unloader.js
//
// An iUI extension that will remove any iUI fragment or view (aka "page") when it receives
// an 'unload' event from iUI core.
//
// This will prevent your DOM from getting overloaded. It can also be ... | JavaScript |
/* iui.Extension
* @author Adam Freidin
* @coded_at SHDH 44
*/
iui.Extension = function(name, handlers) {
var selector;
var event_handlers = {};
var default_adapter = iui.Extension.adapters._;
for(var key in handlers) switch(key) {
case "selector":
selector = handlers.selector;
break;
default:
... | JavaScript |
// iUI Reachability Extension
//
// Requires DOMContentLoaded event
// Requires document.querySelector()
//
//
//
(function() {
var endPoints = [];
var errFunc = null;
addEventListener("DOMContentLoaded", function(event)
{
if (errFunc == null)
{
errFunc = defErrFunc;
}
iui.ajaxErrHandler = errFunc;
// conso... | JavaScript |
// iUI Cache Manager Extension
//
// Requires DOMContentLoaded event
// Requires document.querySelector()
//
(function() {
var cache = window.applicationCache;
var cacheStatusStrings = { 0: 'UNCACHED', 1:'IDLE', 2:'CHECKING', 3:'DOWNLOADING', 4:'UPDATEREADY', 5:'OBSOLETE' };
var updateButton;
var swapButton;
addEv... | JavaScript |
function show(elmId) {
document.getElementById(elmId).style.display='block';
}
function hide(elmId) {
document.getElementById(elmId).style.display='none';
}
function empty(elmId) {
document.getElementById(elmId).value='';
}
function checkHeaderSearch() {
(document.getElementById('search_q').value.length!=0)?show('... | JavaScript |
/*
Copyright (c) 2009, Masabi Ltd
http://www.masabi.com/
*/
(function() {
// *************************************************************************************************
window.ticketsales =
{
destination: function()
{
var s=document.getElementById("az__buy_fromStation");
s.name=document.getEleme... | JavaScript |
/*
* QUnit - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2009 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*/
(function(window) {
var QUnit = {
// Initialize the configuration options
init: funct... | JavaScript |
/*
Copyright (c) 2007-9, iUI Project Members
See LICENSE.txt for licensing terms
*/
// Custom app javascript code goes here | JavaScript |
<div id="frag" title="Ajax Panel" class="panel">
<h2>Ajax Panel</h2>
</div>
| JavaScript |
<div id="long-list" class="panel">
<fieldset style="text-align:left">
<ul>
<li>Tom</li>
<li>Dick</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>Harry</li>
<li>H... | JavaScript |
<li>Replacement 1</li>
<li>Replacement 2</li>
<li><a target="_replace" href="replacingFrag2.frag">Load 2 more (_replace)</a></li>
| JavaScript |
<li>Replacement 3</li>
<li>Replacement 4</li>
| JavaScript |
// DB No Seconds Format: 2007-12-05 12:00
Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; }
Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? ho... | JavaScript |
// American Format: 12/31/2000 5:00 pm
// Thanks, Wes Hays
Date.prototype.toFormattedString = function(include_time){
str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear();
if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPad... | JavaScript |
Date.prototype.toFormattedString = function(include_time){
str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate());
if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
return str;
}
... | JavaScript |
Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; }
Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) }
Date.prototype.getAMPM =... | JavaScript |
// CalendarDateSelect version 1.10.2 - a prototype based date picker
// Questions, comments, bugs? - email the Author - Tim Harper <"timseeharper@gmail.seeom".gsub("see", "c")>
if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's l... | JavaScript |
Date.prototype.toFormattedString = function(include_time) {
var hour;
var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate());
if (include_time) {
hour = this.getHours();
str += " " + this.getHours() + ":" + this.getPaddedMinutes();
}
r... | JavaScript |
// Formats date and time as "01 January 2000 17:00"
Date.prototype.toFormattedString = function(include_time)
{
str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear();
if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() }
return str;
} | JavaScript |
Date.weekdays = $w('P W Ś C P S N');
Date.months = $w('Styczeń Luty Marzec Kwiecień Maj Czerwiec Lipiec Sierpień Wrzesień Październik Listopad Grudzień');
Date.first_day_of_week = 1
_translations = {
"OK": "OK",
"Now": "Teraz",
"Today": "Dziś"
} | JavaScript |
// Italian Format: 31/12/2000 23:00
// Thanks, Bigonazzi!
Date.prototype.toFormattedString = function(include_time){
str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear();
if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() }
return st... | JavaScript |
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function mark_for_destroy(element) {
$(element).parentNode.next('.should_destroy').value = 1
$(element).up('.note_type').hide();
}
function fix_positions(){
col... | JavaScript |
var ServerState = {
WAITING_FOR_START: 0,
INIT1: 1,
INIT2: 2,
PLAYING_GAME: 3,
GAME_ENDED: 4
};
var CatanClient = function (name, display) {
// typedef GameInfo {{ id:int, num_players:int }}
var log = function(s) {
window.log('[ client ' + this.name + ' ] ' + ... | JavaScript |
/*
http://www.JSON.org/json2.js
2010-03-20
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE... | JavaScript |
var SERVER_URL = 'ws://localhost:1337/game';
var server;
var GameID; // game id to join, for testing
var log = function(str) {
var msg = document.createElement('div');
msg.innerHTML = str
document.getElementById('debug').appendChild(msg);
};
var Renderer = Display;
var webui = new Renderer('webui ', 'game')... | JavaScript |
// this class keeps track of the state of the game
var Display = function(name, id, server, width, height) {
var log = function(s) {
window.log('[ display ' + name + ' ] ' + s);
};
log('creating Display');
var autowired = [
'host_game',
'join_game'
];
this.MODES = [
'none',
'place_... | JavaScript |
// Create the classes needed to play the game
function Enum() {}
NUM_EDGES = 72;
NUM_VERTICES = 54;
DEBUG = false;
placing_settlement = false;
placing_city = false;
placing_road = false;
actions_enabled = false;
Enum.ResourceType = {0:"grain", 1:"sheep", 2:"forest", 3:"ore", 4:"brick", 5:"desert"}
Enum.BuildingType =... | JavaScript |
var GameCanvas = function(canvas_id, width, height) {
log('creating GameCanvas in element: ' + canvas_id + ' w:' + width + ' h:' + height);
this.canvas = document.getElementById(canvas_id);
var context = this.canvas.getContext('2d');
context.fillStyle = 'black';
context.strokeStyle = 'green';
context.fillRect(0... | JavaScript |
var TestGame = {
num_players: 2,
init1: [ { road: 43, sett: 35 },
{ road: 15, sett: 9 } ],
init2: [ { road: 44, sett: 30 },
{ road: 16, sett: 14 } ],
turns: [
[ { dice: 1, actions: { roads: [51, 36], setts: [35] } },
{ dice: 2, actions: { roads: [13, 14], setts: [13... | JavaScript |
var CatanServer = function (name, client, url) {
var log = function(s) {
window.log('[ server ' + name + ' ] ' + s);
};
log('creating CatanServer with url ' + url);
var ws = new WebSocket(url);
var server = this;
this.send = function(type, data) {
data = data || {}
data.token = this.toke... | JavaScript |
var adblock = false;
<div class="a">
<!-- Reklam Kodunuz -->
</div>
<script type="text/javascript">
<!--
if(adblock === undefined) {
var allElements = document.getElementsByTagName('div');
for (var i = 0; i < allElements.length; i++) {
if (allElements[i].className == 'a') {
allElements[i].innerHTML = '<s... | 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 |
/*!
* jQuery Cycle Plugin (with Transition Definitions)
* Examples and documentation at: http://jquery.malsup.com/cycle/
* Copyright (c) 2007-2013 M. Alsup
* Version: 3.0.2 (19-APR-2013)
* Dual licensed under the MIT and GPL licenses.
* http://jquery.malsup.com/license.html
* Requires: jQuery v1.7.1 or later
*/... | JavaScript |
jQuery(document).ready(function() {
/* How to Handle Hashtags */
jQuery(window).hashchange(function(){
var hash = location.hash;
jQuery('a[href='+hash+']').trigger('click');
});
jQuery('section.content.hide').hide();
/* Main Navigation Clicks */
jQuery('.main-nav ul li a').click(function() {
var link = jQu... | JavaScript |
/* --------------------------------------------------------------------
MaxImage 2.0 (Fullscreen Slideshow for use with jQuery Cycle Plugin)
--------------------------------------------------------------------
Examples and documentation at: http://www.aaronvanderzwan.com/maximage/2.0/
Copyright (c) 2007-2012 Aaro... | JavaScript |
/*!
* jQuery hashchange event - v1.3 - 7/21/2010
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Script: jQuery hashchange event
//
// *Version: 1.3, Last updated: 7/21/... | JavaScript |
/**
* @preserve jquery.fullscreen 1.1.4
* https://github.com/kayahr/jquery-fullscreen-plugin
* Copyright (C) 2012 Klaus Reimer <k@ailis.de>
* Licensed under the MIT license
* (See http://www.opensource.org/licenses/mit-license)
*/
(function() {
/**
* Sets or gets the fullscreen state.
*
* @param {boolean=}... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/*
* Copyright 2012 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 ... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/*
* Copyright (c) 2012 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 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/*
* Copyright (c) 2012 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 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/*
* Copyright (c) 2012 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 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
... | JavaScript |
/*
* Copyright (c) 2012 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 |
var moduleCode;
var topicId;
var userId;
var token;
// for coundown timer
var myTimer;
var start, now, future;
var questionHistoryArray;
var answerArray;
var choiceArray=["A", "B", "C", "D"];
var myModuleInfo = null;
var D, L, H, R;
var questionId, questionSequence;
var trai... | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.