Last modified: 2014-08-29 08:30:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72160, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70160 - Writing extensions in JS
Writing extensions in JS
Status: NEW
Product: Huggle
Classification: Unclassified
Application (Other open bugs)
unspecified
All All
: Lowest enhancement
: ---
Assigned To: Peter Bena
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-29 08:15 UTC by Eran Roz
Modified: 2014-08-29 08:30 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Eran Roz 2014-08-29 08:15:03 UTC
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
});
Comment 1 Peter Bena 2014-08-29 08:23:13 UTC
some suggestion how would that be done? is there some open source cross platform JS interpretor library for C or C++?
Comment 2 Eran Roz 2014-08-29 08:30:18 UTC
https://code.google.com/p/v8/ ?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links