User:PetraMagna/HotCat.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
PetraMagna (talk | contribs) m auto "click" add button after enter is pressed in edit box |
PetraMagna (talk | contribs) previous one doesn't work; insanely ugly solution that fixes it; whatever |
||
Line 1,566: | Line 1,566: | ||
const result = self.accept( evt ); |
const result = self.accept( evt ); |
||
// if save_button exists, we are in multiinput mode |
// if save_button exists, we are in multiinput mode |
||
setTimeout(function() { |
|||
const save_button = document.querySelector("#mw-normal-catlinks input[value='Save']"); |
const save_button = document.querySelector("#mw-normal-catlinks input[value='Save']"); |
||
⚫ | |||
if (save_button) { |
|||
// automatically click the add button |
|||
const |
const add_buttons = document.querySelectorAll("#mw-normal-catlinks a[title='Add a new category']"); |
||
if (add_button) { |
|||
if (add_buttons.length == 0) { |
|||
⚫ | |||
return; |
|||
} |
|||
const add_button = add_buttons[add_buttons.length - 1] |
|||
⚫ | |||
⚫ | |||
} |
|||
} |
} |
||
} |
}, 100); |
||
return result; |
return result; |
||
} |
} |