Javascript And CSS Libraries

Download Javascript And CSS Libraries

Post on 13-May-2015




1 download


Learn how added an retrieve JavaScript libraries and CSS from PVLibraries in Prodigyview..


1.JavaScript Libraries JavaScript Makes Things Sexy2. OverviewObjectiveLearn the basics of adding JavaScript and CSS inProdigyView.Requirements Understanding of the DEFINESEstimated Time10 Minutes 3. Follow Along With Code Example1. Download a copy of the example code Install the system in an environment you feel comfortable testingin.3. Proceed to examples/system/Libraries_Javascript.php 4. Separation of LibrariesProdigyView natively support 5 different file types that can be addedto PVLibraries. 1 of them is CSS, and the others are variations ofJavaScript and JavaScript Frameworks.Prototype JQuery CSS JavascriptPVLibrariesMootools 5. Queuing LibrariesAdd JavaScript filesAdd JQuery FilesAdd Prototype FilesAdd Mootools FilesAdd CSS Files 6. Queued ScriptsQueuing a script does not actually add the script into thecode, but creates a reference to that script.It is up to the developer to tell where that script exist. Aneasy way of placing the scripts is using the definesdiscussed in an earlier tutorial. 7. Adding Open Script Unlike the other files that pertain to a certain type, open script is any type of content(JavaScript, meta tags, properties, etc). How you add your content to open script is exactly how it will be outputted later.1. Explicitly write the full script2. Add the script to the open script queue 8. Javascript LibrariesThe first library we are going to pull is the regularJavaScript files added. Technically any kind of JavaScriptfile can be queued and pulled, but any files queued to theJavaScript queue should be stored in the same locationas the PV_JAVASCRIPT define.1. Pull the queue and return an array2. Use the PV_JAVASCRIPT to set the location of your script 9. JQuery LibrariesSimilar to how we retrieved the JavaScript libraries, wecan also get the queued JQuery files. The JQuerydefine, PV_JQUERY, should be used in this instance asthe location where the file exist. 10. Prototype LibrariesOur next files to retrieve are the libraries specific toprototype. Prototype libraries used the PV_PROTOTYPEdefine for the location where the script exist. 11. Mootools LibrariesOur last natively supported JavaScript library files ismootools. The mootools files should correspond with thePV_MOOTOOLS define. 12. CSS FilesThe css files that were originally added to PVLibraries canbe retrieved at anytime as well. The PV_CSS defines setstheir location. 13. Retrieving Open ScriptOpen scripting, being that it is any information that you want topass the header, does not have a set location nor needs to beiterated through. It simply comes back as a string of text thatneeds to be printed out. 14. OutputIf you ran the example as a script, your output should looklike below. 15. Heads Up!The real importance of learning how to queue libraries isbecause these libraries are tightly integrated with thetemplate manager in ProdigyView.In the tutorials on the templating system, you will learnhow to pull these libraries directly into your html and havethem be formatted. 16. API ReferenceFor a better understanding of the libraries, visit the api byclicking on the link below.PVLibraries More TutorialsFor more tutorials, please visit: