-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix RSS URL rule error #2760
Fix RSS URL rule error #2760
Conversation
- 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 `plugin` object, some need to go into the `theWebUI` object, 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.
theWebUI.curRule = null; | ||
theWebUI.maxRuleNo = 0; | ||
plugin.curRule = null; | ||
plugin.maxRuleNo = 0; | ||
plugin.rules = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These attributes should be local to the plugin itself, instead of the global theWebUI
object.
theWebUI.showRules = function() | ||
{ | ||
theWebUI.request("?action=getrules",[theWebUI.loadRules, this]); | ||
function makeRuleListItem(rule, index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract this action for it to be reused in addNewRule()
and loadRules()
.
* on rule's textbox focus events, so the `this` keyword | ||
* refers to the event target, i.e. the focused rule item. | ||
*/ | ||
function selectRule() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is only going to be used as an event handler for focusing on a rule list item, so a local function will work fine.
@koblack Could you test this before I merge? I'm not an expert on the RSS elements of ruTorrent. |
- Fix scope of `maxRuleNo`` attribute.
Tested on 279f45b
|
I did some further adjustments towards the scope of plugin functions. The culprit was still the As a sidenote, it seems to me that the |
Everything seems to be working fine now! Thanks a lot! |
plugin
object, some need to go into thetheWebUI
object, 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: #2753