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 backupAllTheContacts() { | |
navigator.contacts.find(["*"], function(contacts) { | |
console.log("contacts.length = " + contacts.length); | |
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) { | |
fileSystem.root.getFile("contacts.bak", {create: true, exclusive: false}, function(fileEntry) { | |
fileEntry.createWriter(function(writer) { | |
writer.onwriteend = function() { | |
console.log("backup complete"); | |
}; | |
writer.write(JSON.stringify(contacts)); |
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
/* | |
* PhoneGap is available under *either* the terms of the modified BSD license *or* the | |
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. | |
* | |
* Copyright (c) 2005-2011, Nitobi Software Inc. | |
* Copyright (c) 2010-2011, IBM Corporation | |
*/ | |
package com.phonegap.plugins.childBrowser; | |
import java.io.IOException; |
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 saveAllTheContacts(contacts) { | |
var saveContacts = function() { | |
// No contacts left, stop saving | |
if (contacts.length == 0) { | |
return; | |
} | |
var contactData = contacts.pop(); | |
// if you are restoring from a backup make sure you remove the id's |
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
* { | |
text-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
-webkit-border-radius:0 !important; | |
-webkit-border-top-left-radius:0 !important; | |
-webkit-border-bottom-left-radius:0 !important; | |
-webkit-border-bottom-right-radius:0 !important; | |
-webkit-border-top-right-radius:0 !important; | |
} |
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
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { | |
final CallbackContext cbContext = callbackContext; | |
String imagePath = args.optString(0); | |
if ("".equals(imagePath)) { | |
Log.d(LOG_TAG, "No image path passed in"); | |
cbContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, 0)); | |
return true; | |
} | |
imagePath = stripFileProtocol(imagePath); |
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 ref = window.open('http://google.com', '_blank'); | |
ref.addEventListener('loadstart', function(event) { alert(event.type + ' - ' + event.url); } ); | |
ref.addEventListener('loadstop', function(event) { alert(event.type + ' - ' + event.url); } ); | |
ref.addEventListener('exit', function(event) { alert(event.type); } ); | |
// also, you can do ref.removeEventListener('loadstart', myfunc) .. etc |
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
<plugin name="TelephoneNumber" | |
value="com.simonmacdonald.cordova.plugins.TelephoneNumber"/> |
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
public boolean onContextItemSelected(MenuItem item) { | |
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); | |
switch (item.getItemId()) { | |
case R.id.settings: | |
this.startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS)); | |
return true; | |
case R.id.help: | |
this.appView.sendJavascript("navigator.notification.alert('No help')"); | |
return true; | |
default: |