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
| // warning, jQuery code below | |
| $(document).ready(function() { | |
| var $a = $("a"); | |
| $a.click(function(x) { | |
| x.preventDefault(); | |
| var url = $(this).attr('href'); | |
| launchUrl(url); // where launchUrl is your function that calls window.open, etc | |
| }); |
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
| function getFileEntry(localFileSystem, filePath, onGetFileWin, onGetFileFail) | |
| { | |
| var onFSWin = function(fileSystem) { | |
| fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail); | |
| } | |
| var onFSFail = function(evt) { | |
| console.log(evt.target.error.code); | |
| } |
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
| 1. Create a new project | |
| 2. Copy in your www assets (keep the cordova.js that is in the new) | |
| 3. Update your .html pages that reference the cordova.js to the new one | |
| 4. Copy in your Plugin source files into the Plugins group in Xcode | |
| 5. Update config.xml with your plugin mappings, access tags (whitelist), and application preferences | |
| 6. Copy in any [App]-Info.plist settings that you had before (99.99999% of the cases you can just copy it over if you created the new project with the same settings) | |
| 7. localization files - copy those folder over and register them in XCode - as we have the app in 4 languages | |
| 8. icons - overwrite the cordova ones and re-register them in XCode | |
| 9. splashscreens - ditto |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="format-detection" content="telephone=no" /> | |
| <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> | |
| <link rel="stylesheet" type="text/css" href="css/index.css" /> | |
| <title>Hello World</title> | |
| </head> | |
| <body> |
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
| requirejs(['cordova.js'], | |
| function () { | |
| // start of require | |
| // cordova is now available globally | |
| var exec = cordova.require('cordova/exec'); | |
| var app = { | |
| // Application Constructor |
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
| #if __has_feature(objc_arc) | |
| AudioServicesCreateSystemSoundID((__bridge CFURLRef)audioPath, &completeSound); | |
| #else | |
| AudioServicesCreateSystemSoundID((CFURLRef)audioPath, &completeSound); | |
| #endif |
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
| <div class="wrap"> | |
| <input type="checkbox" id="s1" /> | |
| <label class="slider-v1" for="s1"></label> | |
| <input type="checkbox" id="s2" checked="" /> | |
| <label class="slider-v1" for="s2"></label> | |
| </div><!--/wrap--> | |
| <div class="wrap"> |
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
| #!/bin/bash | |
| # You could also launch Xcode Organizer directly to the Provisioning Profiles section (to check for validity) by running: | |
| # open ~/Library/MobileDevice/Provisioning\ Profiles/* | |
| # | |
| # In Xcode 5, you can't get a whole list anymore in Xcode Organizer - you will need to download the iPhone Configuration Utility. | |
| SAVEIFS=$IFS | |
| IFS=$(echo -en "\n\b") | |
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
| #!/bin/bash | |
| # Run this in the same location as your .xcodeproj file | |
| plutil -convert json -r -o - `xcodebuild -showBuildSettings | grep PRODUCT_SETTINGS_PATH | awk -F ' = ' '{print $2}'` | grep CFBundleIdentifier | awk -F ' : ' '{print $2}' | cut -d'"' -f2 |
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
| #!/bin/bash | |
| security find-identity | sed -n 's/.*\("[^"]*"\).*/\1/p' | grep 'iPhone' |