This file contains hidden or 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
/*jslint indent: 2, maxlen: 80, nomen: true */ | |
/*global console, window, document, rJS, RSVP, $ */ | |
(function (window, document, rJS) { | |
"use strict"; | |
var TRANSLATION_GADGET = "./html/translations.html"; | |
// prevent JQM autoinit | |
$(document) | |
.on("mobileinit", function () { |
This file contains hidden or 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
/*global console */ | |
(function (window, rJS) { | |
"use strict"; | |
// event listener | |
function startListenTo(obj, type, fn) { | |
if (obj.addEventListener) { | |
obj.addEventListener(type, fn, false); | |
} else if (obj.attachEvent) { | |
obj["e" + type + fn] = fn; |
This file contains hidden or 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
util.uuid = function () { | |
var snap, snip; | |
snap = "-"; | |
snip = function (str, end) { | |
return (Math.random().toString(16) + str).slice(2, end); | |
}; | |
return snip("00000000", 10) + snap + | |
snip("0000", 6) + snap + | |
snip("0000", 6) + snap + |
This file contains hidden or 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
[ | |
{ | |
"type": "i18n", | |
"set_on": "lang_dict", | |
"initializer": "init", | |
"handler": "language", | |
"property_dict": { | |
"use_browser_language": false | |
}, | |
"scheme": [{ |
This file contains hidden or 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 frame = document.getElementsByTagName("iframe")[0]; | |
var $frame = $(frame); | |
var d = frame.contentDocument; | |
var w = frame.contentWindow; | |
var $i = w.$(d); | |
var test_log = 0; | |
var $body = w.$("body"); | |
$.testHelper.eventTarget = $frame; | |
$.testHelper.stepSequence = function (fns) { | |
$.testHelper.eventSequence("step", fns); |
This file contains hidden or 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
/* | |
* called inside app-code file | |
*/ | |
// custom code for "networks" | |
"networks": function (reply) { | |
var config, property, query, href, i, reply, uri, pass = reply.pass; | |
if (storage) { |
This file contains hidden or 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
DropboxStorage.prototype.allDocs = function (command, param, options) { | |
var list_url, result, my_storage; | |
my_storage = this; | |
result = []; | |
list_url = 'https://api.dropbox.com/1/metadata/sandbox/' + "?list=true" + | |
'&access_token=' + this._access_token; | |
// Fetch all documents | |
jIO.util.ajax({ |
This file contains hidden or 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
loading > index.html#{"level 1 - module"}/{"level 2 - item"} | |
[ | |
// level 1: | |
{ | |
"property_dict": { | |
"title": "Servers" | |
}, | |
"view_dict": { | |
"default": [{"href": "network_overview"}], |
This file contains hidden or 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 container = document.createDocumentFragment(); | |
var foo = document.createElement("div") | |
foo.id = "mh"; | |
var bar = document.createElement("div") | |
bar.id = "ha"; | |
foo.appendChild(bar); | |
container.appendChild(foo); | |
var x = { | |
"fragment": container, |
This file contains hidden or 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 util = {}; | |
/** | |
* IE8 compatible custom event listener | |
* @method listenToCustomEvents | |
* @param {string} eventName Event to listen for | |
* @param {method} callback Method to run on event | |
*/ | |
util.listenToCustomEvents = function (event_name, callback) { | |
if (document.addEventListener) { |