3fingers Posted March 30, 2016 Share Posted March 30, 2016 Hello all, today I was looking (just for curiosity and for learning sake) at PageFrontEdit core module, specifically at PageFrontEdit.js file. I cannot uderstand this line of code (among others ) where loadCSS function is calling Processwire.config object's method. (I know what is trying to do....load a css file defined by that object and its methods). That Object is not initialized anywhere in the file and could not find a reference whatsoever. I'm sure it's my fault (honestly I'm not so experienced in Javascript) but if anyone could point me in the right direction would be very appreciated! Thanks! Link to comment Share on other sites More sharing options...
kongondo Posted March 30, 2016 Share Posted March 30, 2016 (edited) Just guessing...probably has been spat out similar to what happens in ProcessWire admin...Look at the admin source...You'll see something like this: <script type="text/javascript"> var config = { "modals": { "large": "15,15,30,30,draggable=false,resizable=true,hide=250,show=100", "medium": "50,49,100,100", "small": "100,100,200,200", "full": "0,0,0,0" }, "ProcessPageList": { "containerID": "PageListContainer", "ajaxURL": "/processwire/page/list/", "ajaxMoveURL": "/processwire/page/sort/", "rootPageID": 0, "openPageIDs": [ ], // etc. } } </script> @soma talks about the technique here (@see Communicating with PHP). Edited March 30, 2016 by kongondo 2 Link to comment Share on other sites More sharing options...
3fingers Posted March 30, 2016 Author Share Posted March 30, 2016 Ok got it. That Object (indeed an array) and its methods are defined here. Very useful advice and link you gave me @kongondo (and thanks @soma too). (Y) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now