-
-
Save jjthrash/8c5eb2773b68aa22ed18 to your computer and use it in GitHub Desktop.
Provide hooks for a client (like UIWebView) to interact with
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 PlatformIntegration = { | |
submitForm: function() { | |
var args = $A(arguments); | |
var selector = 'form'; | |
if (args.size() > 0) | |
selector = args[0]; | |
$$(selector)[0].submit(); | |
}, | |
setFormValue: function(field_id, value) { | |
$(field_id).setValue(value); | |
}, | |
observe: function() { | |
$$('form').each(function(f) { | |
new Form.Observer(f, 0.3, function(form, value) { | |
window.location = 'platformintegration:formchanged'; | |
}); | |
}); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment