Fix RSS URL rule error
- Fix error when trying to add new RSS rules using the add button. This error probably was probably introduced when the dialog was rewritten with jQuery.
- The scope of functions defined in this plugin (rssurlrewrite) seemed a little messy. Some functions need to go into the
pluginobject, some need to go into thetheWebUIobject, and others need to stay local. I moved some of these functions a bit, but that's still not perfect yet. Some further fine tunings are still required.
Related: https://github.com/Novik/ruTorrent/issues/2753
@koblack Could you test this before I merge? I'm not an expert on the RSS elements of ruTorrent.
Tested on 279f45b69604961a0cc58506a9af753d4e8e41f4 Test button "?" returns error
Uncaught TypeError: this.request is not a function from TypeError: this.request is not a function
at theWebUI.checkCurrentRule (<anonymous>:1151:87)
at HTMLButtonElement.dispatch (http://xxx/ruTorrent-jevenski/js/jquery.js?v=51B2:2:40035)
at v.handle (http://xxx/ruTorrent-jevenski/js/jquery.js?v=51B2:2:38006)
I did some further adjustments towards the scope of plugin functions. The culprit was still the this keyword in JavsScript.
As a sidenote, it seems to me that the checkCurrentRule() function sends the Regexp tests to the server and retrieves the test result from it. The PHP code block does nothing server-specific but running the Regexp tests and spitting the results. It looks like a waste of resources because this can be done perfectly on the client side. Correct me if I missed anything.
@koblack Could you confirm this PR is ready to merge?
@jevenski We can adjust checkCurrentRule() in v5.2. I would also like to drop support for Internet Explorer in v5.2 as well. Everything is perfectly functional right now. Let's keep it "as is" so we can release this version in the near future!
Everything seems to be working fine now! Thanks a lot!