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
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:true, browser:true, indent:2, maxerr:50 */ | |
(function (document) { | |
"use strict"; | |
if (!document.getElementsByClassName) { | |
document.getElementsByClassName = function (match) { | |
var result = [], | |
elements = document.body.getElementsByTagName('*'), | |
i, elem; | |
match = " " + match + " "; | |
for (i = 0; i < elements.length; i++) { |
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
/* modified from https://codingwithspike.wordpress.com/2014/12/29/using-deferreds-with-the-cordova-file-api/ */ | |
/* requires rsvp.js */ | |
/* tested and working in iOS and Android on latest Cordova (5.2.0) and File plugin (4.0.0) */ | |
/* uses dataDirectory which is not synced to iCloud on iOS. You can replace each reference to syncedDataDirectory, but then you will need to set cordova.file.syncedDataDirectory = cordova.file.dataDirectory on Android to maintain compatibility */ | |
window.fileStorage = { | |
write: function (name, data) { | |
var name_arr = name.split('/'); | |
var name_index = 0; |