Skip to content

bainco/NLModels-CKEditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLModels Browser Plugin for CKEditor

A new CKEditor Plugin that allows users to browse and embed any NetLogo Web model that is currently available in the official NLW Models Library.

How to Use

Functionality is pretty simple:

  1. There's a new CKEditor toolbar button (for Page editor and Question editor) (see settings.py) Screen Shot 2020-12-04 at 12 28 58 PM

  2. When a user clicks on the toolbar button, they're presented with the usual CKEditor dialog pop-up with a single Selector. This selector is populated directly from www.netlogoweb.org/model/models.json (for NLW models) and from www.github.com/NetLogo/nt-models/library.json (for NetTango models) on plugin load. This means each time the plugin is instantiated, we get the live, most-up-to-date versions of each model from the libraries (and prune those that don't compile in NLW currently -- this is also live updated so no manual updating as NLW features are added).Screen Shot 2021-04-05 at 10 34 17 AM

  3. As of v2, there are now 2 tabs, one for the NetLogo Web Models Library (default) and one for the NetTango models library.

  4. A searchbox in each tab is populated with all available models in each library. Users can type into each searchbox using any keyword that might appear in the model's title (or in the case of the NLW models, the folder in which the model lives). This means, users looking for Biology models need only type Biology and see what models are available. Screen Shot 2021-04-05 at 10 34 28 AM

  5. When you select one, the dialog resizes and allows you to preview the model. NetLogo Web Screen Shot 2021-04-05 at 10 35 02 AM NetTango Screen Shot 2021-04-05 at 10 35 33 AM

  6. When the user clicks Insert Model, the model is embedded as an iframe into the appropriate CKEditor at the cursor point. Note, it directly embeds a link to the live versions of the library models rather than uploading the model to the CT-STEM site. This has the advantage that every time the model loads, you get the newest version of both the model and NLW.

Installation

This has been tested and deployed on CKEditor 4 (specifically on Django-CKEditor). Note, that it also requires the ajax and iframedialog plugins to be installed and enabled on your CKEditor deployment.

To install, make sure to place the plugin inside your static hosted files or directly into your CKEditor package. As with all CKEditor plugins, the plugin must be in a folder with the NLModels name exactly.

Finally, add the plugin to your toolbar using the NLModels tool.

Questions or Issues?

Feel free to open an issue on this repo or send me an email at [email protected] with [NLW CKEditor] in the subject line.

About

NLW Models Library browser plugin for CKEditor

Resources

Stars

Watchers

Forks

Packages

No packages published