Jump to content

Processwire.config (js)


3fingers
 Share

Recommended Posts

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

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 by kongondo
  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...