Marvin JS on MVC5 application...

User 82b20b535e

28-10-2014 14:58:32

I am building an web application with MVC5 and JQuery. I need to let users draw chemical structures and save. 


May I request to please guide me to an example where I could learn how to implement ChemAxon for Web application on ASP.NET MVC


I am looking for implementing a cleaner Marvin JS with MVC Bundling and minification.


Regards


DJ 

ChemAxon 7c2d26e5cf

29-10-2014 16:05:59

To tell the truth, we do not have ASP.NET demo project to demonstrate Marvin JS integration into such kind of web application. We only have pure JS examples.


Marvin JS library is obfuscated and minified. We are always focusing to minimize number of request at loading the Marvin JS editor.

User 82b20b535e

29-10-2014 16:48:10

Thanks for your response and I have a clarification.


I downloaded and extracted Marvin JS into ASP.NET MVC5 project. I copied the files to the Scripts and Content Folder respective JS and CSS file and copied the edior.html to the views folder. I went to the Bundle config and created chemaxon bundle. Application fails to load the marvin editor.


Now I blindly copy the folders ( JS , CSS folders ) to ASP.NET MVC project and I am able to get the Marvin Editor.


Looks like files are internally referencing the JS , CSS folders.


Other Question I have is what is use of gui folder? gui folder contains JS, CSS and JPG files. Can we separate these files to the respective CSS , JS folder?

ChemAxon 7c2d26e5cf

31-10-2014 18:11:53

Hi,


I recommend to download the marvinjs-VERSION-core.zip. It includes the minimal set of resources that Marvin JS requires. The gui folder is itself the Marvin JS library. gui/gui.nocache.js is the entry point. It loads the bundled resources from this folder.


Yes, the js and css folders contain certain essential resources that are also required for the application. They are not bundled automatically but they have to be loaded before instantiate the sketcher.


These resources are referred in editor.html and in editorws.html. These pages load the Marvin JS library with its dependencies and instantiate the sketch. (You can choose which page you prefer, the second one automatically register WS to get WS based features.)


In the near future, we plan a redesign in our API. The aim is to simplify the integration into the popular JS environments, reduce the number of external resources.