Created
November 22, 2008 00:25
-
-
Save greatseth/27706 to your computer and use it in GitHub Desktop.
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
// form posts to a different url | |
// change 'subscribe' callback to 'unsubscribe' | |
// change loading | |
var form_element = obj.down('form'); | |
var onsubmit = form_element.getAttribute('onsubmit').toString(); | |
var onloading = 'onLoading:function(request){subscription_loading_unsubscribed(\'' + container_id + '\')}'; | |
var new_onsubmit = onsubmit.gsub(/'\/subscriptions\/[\d]+'/, "'\/subscriptions'").gsub(/\{unsubscribe\(/, '{subscribe(').gsub(/onLoading:function\(request\)\{[^}]+\}/, onloading); | |
form_element.setAttribute('onsubmit', new_onsubmit); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment