Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

load.js 948B

1234567891011121314151617181920212223242526272829303132
  1. window.fn = {};
  2. window.fn.toggleMenu = function () {
  3. document.getElementById('appSplitter').right.toggle();
  4. };
  5. window.fn.loadView = function (index) {
  6. document.getElementById('appTabbar').setActiveTab(index);
  7. document.getElementById('sidemenu').close();
  8. };
  9. window.fn.loadLink = function (url) {
  10. window.open(url, '_blank');
  11. };
  12. window.fn.pushPage = function (page, anim) {
  13. //Open and send json file that is equivalent with the especification.
  14. var request = new XMLHttpRequest();
  15. request.open("GET", "Server/" + page.title.toUpperCase() + ".json", false);
  16. request.send(null)
  17. var artesanos = JSON.parse(request.responseText);
  18. if (anim) {
  19. document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
  20. } else {
  21. document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
  22. }
  23. };