Hi all,
I have been working on a small VE plugin that provides the functionality of adding SMW annotations. I am mostly done with the script but need to understand some minor coding practices for VE plugins to complete it. Would appreciate some help on these questions.
When the script makes some changes to the document model, sometimes the "Save" button stays greyed out. Is there a way I should trigger the save button to become active? Or maybe I am doing something in the wrong way.
The "undo" doesn't seem to automatically work for my code, what's the best way to develop that functionality?
I have a couple more doubts, but these are the major ones right now. Here's my code if needed, its a mess right now and needs lot of refactoring, etc
https://en.wikipedia.org/wiki/User:Nischayn22/veSMW.js
Thanks and regards, Nischay Nahata
The save button should be enabled if your model is marked as having been modified - see ve.dm.Surface.prototype.hasBeenModified in VisualEditor/VisualEditor.git - it is at least partially based on the undo stack, so these two problems are almost certainly linked. I think you should be using transactions in some way to have that work properly, Ed would know the details.
On 17 July 2015 at 08:33, Nischay Nahata nischayn22@gmail.com wrote:
Hi all,
I have been working on a small VE plugin that provides the functionality of adding SMW annotations. I am mostly done with the script but need to understand some minor coding practices for VE plugins to complete it. Would appreciate some help on these questions.
When the script makes some changes to the document model, sometimes the "Save" button stays greyed out. Is there a way I should trigger the save button to become active? Or maybe I am doing something in the wrong way.
The "undo" doesn't seem to automatically work for my code, what's the best way to develop that functionality?
I have a couple more doubts, but these are the major ones right now. Here's my code if needed, its a mess right now and needs lot of refactoring, etc
https://en.wikipedia.org/wiki/User:Nischayn22/veSMW.js
Thanks and regards, Nischay Nahata _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org