Skip to content

Instantly share code, notes, and snippets.

@frequent
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frequent/11400835 to your computer and use it in GitHub Desktop.
Save frequent/11400835 to your computer and use it in GitHub Desktop.
JSON-JQM example
[
{
"type": "i18n",
"set_on": "lang_dict",
"initializer": "init",
"handler": "language",
"property_dict": {
"use_browser_language": false
},
"scheme": [{
"property_dict": {
"lng": "fr-FR",
"load": "current",
"fallbackLng": "en-EN",
"resGetPath": "lang/__lng__/__ns__.json",
"ns": "dict",
"getAsync": false
}
}],
"children": []
},
{
"generate": "widget",
"type": "controlbar",
"property_dict": {
"wrap": "fragment",
"target": "document"
},
"children": [
{
"generate": "widget",
"type": "header",
"property_dict": {
"theme": "slapos-white",
"class_list": "override_header ",
"image": {
"src": "img/logo.jpg",
"alt": "Bip&Go"
}
},
"children": [{
"generate": "widget",
"type": "controlgroup",
"property_dict": {
"direction": "horizontal"
},
"children":[
{"type":"a", "direct": {"href": "#global-menu", "className":"responsive translate"}, "attributes": {"data-rel":"panel", "data-icon":"bars", "data-i18n":"global_dict.menu"}}
]
}, {
"generate": "widget",
"type": "controlgroup",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type":"select", "direct": {"id": "switch_language", "className":"responsive translate"}, "attributes": {"data-icon":"flag-fr"}, "logic": {"wrapper_class_list":"flag", "options": [{"value": "en-EN", "text_i18n":"global_dict.english"}, {"value": "fr-FR", "text_i18n":"global_dict.french", "selected": true}]}},
{"type":"a", "direct": {"href": "#", "className":"responsive translate"}, "attributes": {"data-icon":"envelope", "data-i18n":"global_dict.contact"}},
{"type":"a", "direct": {"href": "#global-user", "className":"responsive translate"}, "attributes": {"data-rel":"panel", "data-icon":"user", "data-i18n":"global_dict.login"}}
]
}, {
"generate": "widget",
"type": "controlbar",
"property_dict": {
"class_list": "responsive ui-subheader"
},
"children": [{
"type": "p",
"direct": {"className": "translate beeper_text"},
"attributes": {"data-i18n": "global_dict.badges"}
}, {
"type": "img",
"direct": {"src": "img/logo-libert-t.jpg", "alt": ""}
}
]
}
]
},
{
"generate": "widget",
"type": "panel",
"property_dict": {
"id": "global-menu",
"theme": "slapos-white",
"position": "left"
},
"children": [{
"generate": "widget",
"type": "header",
"property_dict": {
"id": "menu-header",
"theme": "slapos-black",
"class_list": "vert",
"add_content": 0,
"section_list":["last"],
"title_i18n": "global_dict.info"
},
"children":[{
"type": "a",
"direct": {
"href": "#",
"className": "ui-panel-close ui-icon-remove ui-btn ui-btn-icon-notext ui-shadow ui-corner-all"
},
"attributes": {
"data-enhanced": true,
"data-rel": "close"
}
}]
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text_i18n": "global_dict.our_offers",
"title_i18n": "global_dict.click",
"collapsed_icon": "caret-down",
"expanded_icon": "caret-up"
},
"children": [
{
"generate": "widget",
"type": "listview",
"property_dict": {
"theme": "slapos-white",
"map_children": "listItem"
},
"children": [
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n":"global_dict.fixed"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.pay_as_you_go"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.vacances"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.pro"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.comparison"}]}
]
}
]
}
]
},
{
"generate": "widget",
"type": "panel",
"property_dict": {
"id": "global-user",
"theme": "slapos-black",
"position": "right"
},
"children": [{
"generate": "widget",
"type": "header",
"property_dict": {
"id": "search-header",
"class_list": "vert",
"theme": "slapos-black",
"add_content": 0,
"section_list":["last"],
"title_i18n": "global_dict.login"
},
"children":[{
"type": "a",
"direct": {
"href": "#",
"className": "ui-panel-close ui-icon-remove ui-btn ui-btn-icon-notext ui-shadow ui-corner-all"
},
"attributes": {
"data-enhanced": true,
"data-rel": "close"
}
}]
}]
},
{
"generate":"widget",
"type": "footer",
"property_dict": {
"fixed": false,
"class_list": "custom_footer",
"theme": "slapos-black"
},
"children": [{
"generate": "widget",
"type": "listview",
"property_dict": {
"inset": true,
"theme": "slapos-black",
"map_children": "listItem"
},
"children": [
{"type": "divider", "center": [{"type": "h3", "text_i18n": "global_dict.about"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.about_beep"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.about_sanef"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.about_agents"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.about_partners"}]}
]
}, {
"generate": "widget",
"type": "listview",
"property_dict": {
"inset": true,
"theme": "slapos-black",
"map_children": "listItem"
},
"children": [
{"type": "divider", "center": [{"type": "h3", "text_i18n": "global_dict.understand"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.why"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.statutes"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.faq"}]}
]
}, {
"generate": "widget",
"type": "listview",
"property_dict": {
"inset": true,
"theme": "slapos-black",
"map_children": "listItem"
},
"children": [
{"type": "divider", "center": [{"type": "h3", "text_i18n": "global_dict.legal"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.conditions"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.sales"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.terms"}]},
{"type": "item", "href": "#", "center": [{"type": "h3", "text_i18n": "global_dict.sitemap"}]}
]
}]
}]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment