This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//sortable-2d-array.js | |
exports = module.exports = sortable2DArray; | |
function sortable2DArray(data) { | |
this.data = data; | |
} | |
sortable2DArray.prototype.sortBy = function (o) { | |
var fields = o.fields || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
onerror = function (a, b, c) { | |
alert([a, b, c]); | |
}; | |
</script> | |
<script type="text/javascript"> | |
var x = { | |
"JsonResult": { | |
"List": [{ | |
"Subject": "My book report on J. K. Rowling's <u>Harry Potter</u> series.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<title>15 Puzzle</title> | |
<style type="text/css"> | |
body{color:black;background:white;font-family:Arial,Helvetica,sans-serif;font-size:20px;margin:0;} | |
table tr td{text-align:center;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var JSONCall = function(url,data, onLoad, onError){ | |
this.url = url; | |
this.data = data; | |
this.onLoad = onLoad; | |
this.onError = onError; | |
}; | |
JSONCall.prototype = { | |
call: function(){ | |
if(typeof JsonClient==='undefined'){ | |
JsonClient = Titanium.Network.createHTTPClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var valdiate = (function() { | |
var _p={};//toss all private members into a single object. | |
_p.list=[]; | |
_p.init=function(){ | |
_p.list=[]; | |
}; | |
var noDigits = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function capturePictureDialog(opts) { | |
var dialogCallback = (typeof opts.callback == "undefined") ? new Function("") : opts.callback; | |
function cropImageBlob(image, cropRect) { | |
var h = image.height; | |
var w = image.width; | |
var toH = cropRect.height; | |
if (toH > h) { | |
toH = h; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function capturePictureDialog(opts) | |
{ | |
var dialogCallback=(typeof opts.callback=="undefined")?new Function(""):opts.callback; | |
var scribblingEnabled=(typeof opts.scribbling=="undefined")?false:opts.scribbling; | |
if(scribblingEnabled) | |
{ | |
Titanium.Paint = require('ti.paint'); | |
Ti.Paint = Titanium.Paint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MemoryClean = function() { | |
var _window; | |
/* | |
Here we make our "auto-release" pool. It's simply a window. | |
We hide it upon creation so it won't interfere with our view hierarchy. | |
5/3/2011: It seems that the window does not need to be a subcontext, just a regular window will do. | |
*/ | |
this.init = function() { | |
//_window = Ti.UI.createWindow(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BinarySearchTree() { | |
this._root = null; | |
} | |
BinarySearchTree.prototype = { | |
constructor: BinarySearchTree, | |
add: function (value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CreditCardValidator() { | |
} | |
CreditCardValidator.prototype = { | |
isValid: function (identifier) { | |
var num, | |
sum = 0, | |
alt; | |
var myRegxp = /^([0-9]){13,19}$/; |
OlderNewer