Skip to content

Instantly share code, notes, and snippets.

View frequent's full-sized avatar

Sven Franck frequent

View GitHub Profile
loading > index.html#{"level 1 - module"}/{"level 2 - item"}
[
// level 1:
{
"property_dict": {
"title": "Servers"
},
"view_dict": {
"default": [{"href": "network_overview"}],
@frequent
frequent / gist:8937596
Created February 11, 2014 15:52
pour cedric
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({
@frequent
frequent / Current_version
Last active August 29, 2015 13:57
Retrieving Networks - comparing current and offline version
/*
* 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) {
@frequent
frequent / gist:9914224
Created April 1, 2014 13:43
I would like to be async
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);
@frequent
frequent / gist:11400835
Last active August 29, 2015 14:00
JSON-JQM example
[
{
"type": "i18n",
"set_on": "lang_dict",
"initializer": "init",
"handler": "language",
"property_dict": {
"use_browser_language": false
},
"scheme": [{
@frequent
frequent / gist:11402276
Last active August 29, 2015 14:00
uuid this
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 +
/*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;
@frequent
frequent / gist:6b7a20ed2be52a6b0040
Created May 20, 2014 18:39
RenderJS - retrieve method from subgadget on "main" gadget
/*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 () {
@frequent
frequent / gist:48507187ef8c006c6d15
Created May 27, 2014 17:17
how to drop a gadget?
/*jslint indent: 2, maxlen: 80, nomen: true */
/*global console, window, document, rJS, RSVP, $ */
(function (window, document, rJS) {
"use strict";
rJS(window)
/**
* Override navigation of jQuery Mobile and allow deeplinking. Missing
* pages will now be loaded and added to the DOM as new gadgets - and
@frequent
frequent / navigation.js
Created July 1, 2014 07:51
JQM navigation gadget, which allows deeplinking and (uri encoded) query parameters
/*jslint indent: 2, maxlen: 80, nomen: true */
/*global console, window, document, rJS, RSVP, $ */
(function (window, document, rJS) {
"use strict";
rJS(window)
/**
* Override navigation of jQuery Mobile and allow deeplinking. Missing
* pages will now be loaded and added to the DOM as new page-gadgets -