⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
jQuery.download = function(url, data, method){ | |
//url and data options required | |
if( url && data ){ | |
//data can be string of parameters or array/object | |
data = typeof data == 'string' ? data : jQuery.param(data); | |
//split params into form inputs | |
var inputs = ''; | |
jQuery.each(data.split('&'), function(){ | |
var pair = this.split('='); | |
inputs+='<input type="hidden" name="'+ pair[0] +'" value="'+ pair[1] +'" />'; |
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
if (!console) { | |
var console = {}, | |
func = function () { return false; }; | |
console.log = func; | |
console.info = func; | |
console.warn = func; | |
console.error = func; |
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
$().SPServices({ | |
operation: "GetListItems", | |
async: false, | |
listName: '{FBD720B1-5DBB-4864-930A-5B76FE0C6D51}', | |
CAMLQuery:'<Query><OrderBy><FieldRef Name="Title" Ascending="True" /></OrderBy></Query>', | |
CAMLViewFields: "<ViewFields><FieldRef Name='LinkTitle' /></ViewFields>", | |
completefunc: function (xData, Status) { | |
$(xData.responseXML).SPFilterNode("z:row").each(function() { | |
//$(this).attr('ows_LinkTitle') |
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
$().SPServices({ | |
operation: "UpdateListItems", | |
async: false, | |
batchCmd: "New", | |
listName: '{FBD720B1-5DBB-4864-930A-5B76FE0C6D51}', | |
valuepairs: [["Title", title], ["Types", type]], | |
completefunc: function (xData, Status) { | |
} | |
}); |
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 removeHash(value) | |
{ | |
if(value != undefined) | |
{ | |
if(value.indexOf('#') != -1) | |
{ | |
value = value.split('#'); | |
value = value[1]; | |
return 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
window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, gotFS, fail); | |
function fail(error) { | |
console.log(error) | |
} | |
function gotFS(fileSystem) { | |
fileSystem.root.getDirectory("data", {create: true, exclusive: false}, gotDir, fail); | |
} |
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
/* | |
* adds "remove" event triggered when a DOMNode is removed, | |
* allowing to register DOM elements to be removed when a | |
* given other element is removed from dom. | |
* | |
* (last tested with jQuery 1.4.4) | |
*/ | |
(function($,undefined){ | |
// register node to be removed when the base node is removed |
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
/** | |
* Prepare the App Folder | |
*/ | |
(function(){ | |
window.appRootDirName = ".myapp"; | |
document.addEventListener("deviceready", onDeviceReady, false); | |
function onDeviceReady() { | |
console.log("device is ready"); | |
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; |
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 fileTransfer = new FileTransfer(); | |
fileTransfer.onprogress = function(result){ | |
var percent = result.loaded / result.total * 100; | |
percent = Math.round(percent); | |
console.log('Downloaded: ' + percent + '%'); | |
}; | |
fileTransfer.download(remoteFile, localPath, successCallback, errorCallback); |
OlderNewer