I'm reading a book "single page web application" written by "Michael S. Mikowski".
In chapter3, there is a code using jQuery library "uriAnchor".
the book doesn't provide information much about this jquery library, so I took a look at the document of uriAnchor on github.
https://github.com/mmikowski/urianchor
This "uriAnchor" has a method "configModule()" that sets up the rule for validation.
I read the instruction for this method but I couldn't understand how to set up the config object.
This is the code from the instruction page.
Validation:
As of 1.0, the ability to optionally check the validity of the Anchor against a schema has been included. Since we don't expect the allowable schema to change during run-time, we use a module configuration to set the schema, like so:
$uriAnchor.configModule({
schema_map : {
page : { profile : true, pdf : true },
_page : {
uname : true,
online : { 'today','yesterday','earlier' }
},
slider : { confirm : 'deny' },
_slider : { text : 'goodbye' },
color : { red : true, green : true, blue : true }
}
});
I believe this configModule method set up the validation rule for urls like this below.
/#!page=profile:uname,true|online:today&slider=confirm:text,goodbye&color=red
but, what are these!?
for example,
page : { profile : true, pdf : true },
what does these boolean mean and where and how are they used?
They don't even show up in the url.
slider : { confirm : 'deny' },
and also, what is this!??
what is the role of the value "deny" for this method??
online : { 'today','yesterday','earlier' }
and what is this!? the value is not even an array!!
I have no idea.
I tried changing these setting and see what kind of different it would make but I couldn't figure out.
If you are familiar with this jquery library, please answer my question!
Thank you so much!!
I found this book "single page web application" is very stressful to read...
I've been spending 2 days to understand chapter 3...