Open registerme1963 opened 3 years ago
Hi @registerme1963, to add a subgroup template, firstly you need to create its JSON data. There is a tool (/src/_devUtils/repositoryUtil/repItemSetter.html) for that task. Please open it in a web browser and then do the following steps (as in the attached image):
Then, in your own JS code, register the new subgroup:
Kekule.Editor.RepositoryData.subGroups.push({"inputTexts":["OTMS"],"dataFormat":"Kekule-JSON"...../* The JSON string generated above*/ });
After that, the new template subgroup will be displayed in the atom/subgroup panel of composer.
I want add these templates in the kekule moodle editor. Where will I add these subgroups? Sorry, I have little knowledge in javascript
The code to add new subgroups should be put at any time after Kekule.js is loaded. For the Kekule Moodle plugin, you may insert it inside the init()
function of [moodle dir]/local/kekulejs/amd/src/kekuleInitials.js and rebuild the moodle plugin (see https://docs.moodle.org/dev/Javascript_Modules),
After those steps, the subgroup buttons will be automatically added to the atom panel of editor:
@partridgejiang, I followed these steps, I was able to copy the JSON and also created a button with an onclick event to call
Kekule.Editor.RepositoryData.subGroups.push({"inputTexts":["OTMS"],"dataFormat":"Kekule-JSON"...../* The JSON string generated above*/ });
But when I checked the Subgroups, I do not see the Subgroup Abbr among the list.
After I click on the "Save Subgroup" button, and then check the Subgroup, I do not see the new subgroup I created
Any thing I am missing here?
Is there a way to add my own templates in the kekule Chem composer. I want to add templates of amino acids, sugars, polycycles, functional groups, reagents etc Thanks