https://bugzilla.wikimedia.org/show_bug.cgi?id=70160
Bug ID: 70160
Summary: Writing extensions in JS
Product: Huggle
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Application
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Web browser: ---
Mobile Platform: ---
It should be possible to write extensions to Huggle also in JS rather than c++
and python. Some advantages of doing so:
1. It could be awesome to reuse gadgets and user-scripts code. (such as
twinkle)
2. It can be deployed/installed in much more dynamic sense
Design
1. User:MyUseName/huggle3.css - add some section for "JS extensions"
2. On application load those extensions JS
3. Use some JS engine (V8??) to run them independently of the view (or
dependently with the browser object?) and once regular extensions are called,
evaluate in the JS engine to call the scripts.
An example to JS:
huggle.hook('delete').add(function(e){
var api=new mw.Api({...});//or huggle.Api that already fills the tokens?
api.post({
action: 'edit',
...
text: e.title,
token: e.token
})
});
e.preventDefault();//override default behavior of huggle delete
});
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l