PDA

View Full Version : Referencing JavaScript libraries in Lianja WebViewWidgets



barrymavin
2012-10-24, 01:22
In Lianja App Builder Beta10 (if you have read the roadmap), you will see we have included quite a few industry standard open source JavaScript libraries in the distro which can be used to build WebViewWidgets.

Notably:
jquery
knockout (A MVVM HTML5 markup processor)
bootstrap
contentflow (Mac style image strip like you see in iTunes)
metroui (HTML5 CSS for building UIs with a Windows 8 look)
ckeditor (Full featured HTML5 editing component)


Also we have licensed the following which can be distributed with your Apps insofar as they are only used with Lianja developed Apps. You must adhere to this licensing requirement.
Redactor (a lightweight HTML5 mobile editor)
Droptiles (for building Windows 8-style tile UIs -- which we use in the new App Center)


To use any of these libraries in your HTML5 WebViews or WebViewWidgets just reference then in the "link" or "script" tags by prefixing them with "lib:/" and Lianja will substitute this at runtime as it loads the WebView, on both Desktop and Cloud.

e.g.



<head>
<link rel="stylesheet" type="text/css" href="lib:/jquery/css/smoothness/jquery-ui.css">
<script type="text/javascript" src="lib:/jquery/js/jquery.min.js></script>
<script type="text/javascript" src="lib:/jquery/js/jquery-ui.min.js></script>
</head>


Note that the "Lianja" system object is always available for you to interact with the Lianja Desktop or Cloud.

If you fire up Lianja App Builder Beta10, there is a new "Documentation" menuitem in the "NavBar" at the top of the screen. This page has links to all of the documentation that you should need to use any of these bundled libraries.

If you are targeting iOS then remember to add this into the "head" tags.



<meta name="apple-mobile-web-app-capable" content="yes" />


By including these in the distro rather than getting them from a CDN, your desktop Apps can work offline from the internet.

Have fun!