jinda_engine 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +173 -0
- data/Rakefile +32 -0
- data/app/assets/config/jinda_engine/manifest.js +4 -0
- data/app/assets/images/jinda_engine/4dcity-old.ico +0 -0
- data/app/assets/images/jinda_engine/4dcity.ico +0 -0
- data/app/assets/images/jinda_engine/account.png +0 -0
- data/app/assets/images/jinda_engine/add.png +0 -0
- data/app/assets/images/jinda_engine/ajax-loader-circle.gif +0 -0
- data/app/assets/images/jinda_engine/ajax-loader.gif +0 -0
- data/app/assets/images/jinda_engine/anchor.png +0 -0
- data/app/assets/images/jinda_engine/application_double.png +0 -0
- data/app/assets/images/jinda_engine/application_form_edit.png +0 -0
- data/app/assets/images/jinda_engine/arrow_left.png +0 -0
- data/app/assets/images/jinda_engine/arrow_right.png +0 -0
- data/app/assets/images/jinda_engine/arrow_turn_left.png +0 -0
- data/app/assets/images/jinda_engine/arrow_turn_right.png +0 -0
- data/app/assets/images/jinda_engine/calendar.png +0 -0
- data/app/assets/images/jinda_engine/cancel.png +0 -0
- data/app/assets/images/jinda_engine/chart_bar.png +0 -0
- data/app/assets/images/jinda_engine/clock.png +0 -0
- data/app/assets/images/jinda_engine/cog.png +0 -0
- data/app/assets/images/jinda_engine/control_fastforward.png +0 -0
- data/app/assets/images/jinda_engine/control_play.png +0 -0
- data/app/assets/images/jinda_engine/cross.png +0 -0
- data/app/assets/images/jinda_engine/delete.png +0 -0
- data/app/assets/images/jinda_engine/external-link.png +0 -0
- data/app/assets/images/jinda_engine/facebook-continue-button.png +0 -0
- data/app/assets/images/jinda_engine/facebooksmall.png +0 -0
- data/app/assets/images/jinda_engine/favicon.ico +0 -0
- data/app/assets/images/jinda_engine/freemind(mm).png +0 -0
- data/app/assets/images/jinda_engine/google-continue-button.png +0 -0
- data/app/assets/images/jinda_engine/help.png +0 -0
- data/app/assets/images/jinda_engine/highway-menu.png +0 -0
- data/app/assets/images/jinda_engine/highway.png +0 -0
- data/app/assets/images/jinda_engine/house.png +0 -0
- data/app/assets/images/jinda_engine/icons-18-black.png +0 -0
- data/app/assets/images/jinda_engine/icons-18-white.png +0 -0
- data/app/assets/images/jinda_engine/icons-36-black.png +0 -0
- data/app/assets/images/jinda_engine/icons-36-white.png +0 -0
- data/app/assets/images/jinda_engine/logo.png +0 -0
- data/app/assets/images/jinda_engine/logo_jinda.png +0 -0
- data/app/assets/images/jinda_engine/logout.png +0 -0
- data/app/assets/images/jinda_engine/new.gif +0 -0
- data/app/assets/images/jinda_engine/new.png +0 -0
- data/app/assets/images/jinda_engine/page.png +0 -0
- data/app/assets/images/jinda_engine/page_attach.png +0 -0
- data/app/assets/images/jinda_engine/page_green.png +0 -0
- data/app/assets/images/jinda_engine/page_output.png +0 -0
- data/app/assets/images/jinda_engine/page_pdf.png +0 -0
- data/app/assets/images/jinda_engine/pencil.png +0 -0
- data/app/assets/images/jinda_engine/printer.png +0 -0
- data/app/assets/images/jinda_engine/refresh.png +0 -0
- data/app/assets/images/jinda_engine/report.png +0 -0
- data/app/assets/images/jinda_engine/rssmall.png +0 -0
- data/app/assets/images/jinda_engine/tick.png +0 -0
- data/app/assets/images/jinda_engine/twittersmall.png +0 -0
- data/app/assets/images/jinda_engine/user.png +0 -0
- data/app/assets/images/jinda_engine/user_admin_gear.png +0 -0
- data/app/assets/images/jinda_engine/view_code.png +0 -0
- data/app/assets/javascripts/jinda_engine/application.js +24 -0
- data/app/assets/javascripts/jinda_engine/application.js-jqm +27 -0
- data/app/assets/javascripts/jinda_engine/cable.js +13 -0
- data/app/assets/javascripts/jinda_engine/disable_enter_key.js +10 -0
- data/app/assets/javascripts/jinda_engine/iscroll-wrapper.js +32 -0
- data/app/assets/javascripts/jinda_engine/iscroll.js +1084 -0
- data/app/assets/javascripts/jinda_engine/jinda.js +14 -0
- data/app/assets/javascripts/jinda_engine/jquery.mobile-1.2.1.js +9272 -0
- data/app/assets/javascripts/jinda_engine/jquery.mobile.datebox.js +1778 -0
- data/app/assets/javascripts/jinda_engine/jquery.mobile.splitview.js +695 -0
- data/app/assets/stylesheets/jinda_engine/app.scss +90 -0
- data/app/assets/stylesheets/jinda_engine/application.css.scss +34 -0
- data/app/assets/stylesheets/jinda_engine/articles.scss +94 -0
- data/app/assets/stylesheets/jinda_engine/fonts/sarabun.eot +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/sarabun.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/sarabun.woff +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/sarabun_bold.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/sarabun_bolditalic.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/sarabun_italic.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew-webfont.eot +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew-webfont.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew-webfont.woff +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew.css +47 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_bold-webfont.eot +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_bold-webfont.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_bold-webfont.woff +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_bolditalic-webfont.eot +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_bolditalic-webfont.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_bolditalic-webfont.woff +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_italic-webfont.eot +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_italic-webfont.ttf +0 -0
- data/app/assets/stylesheets/jinda_engine/fonts/thsarabunnew_italic-webfont.woff +0 -0
- data/app/assets/stylesheets/jinda_engine/images/ajax-loader.gif +0 -0
- data/app/assets/stylesheets/jinda_engine/images/button_black.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/button_blue.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/button_red.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/icons-18-black.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/icons-18-white.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/icons-36-black.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/icons-36-white.png +0 -0
- data/app/assets/stylesheets/jinda_engine/images/indicator.gif +0 -0
- data/app/assets/stylesheets/jinda_engine/jinda.css +52 -0
- data/app/assets/stylesheets/jinda_engine/jquery.mobile-1.2.1.css +2339 -0
- data/app/assets/stylesheets/jinda_engine/jquery.mobile.datebox.css +65 -0
- data/app/assets/stylesheets/jinda_engine/jquery.mobile.grids.collapsible.css +122 -0
- data/app/assets/stylesheets/jinda_engine/jquery.mobile.splitview.css +128 -0
- data/app/assets/stylesheets/jinda_engine/kul-4.2.css +1516 -0
- data/app/assets/stylesheets/jinda_engine/kul-4.2.min.css +11 -0
- data/app/assets/stylesheets/jinda_engine/modules.scss +84 -0
- data/app/assets/stylesheets/jinda_engine/sarabun.css +37 -0
- data/app/assets/stylesheets/jinda_engine/social.scss +133 -0
- data/app/controllers/jindra_engine/admins_controller.rb +9 -0
- data/app/controllers/jindra_engine/api/v1/notes_controller.rb +81 -0
- data/app/controllers/jindra_engine/application_controller.rb +44 -0
- data/app/controllers/jindra_engine/articles_controller.rb +112 -0
- data/app/controllers/jindra_engine/comments_controller.rb +21 -0
- data/app/controllers/jindra_engine/concerns/jinda_general_concern.rb +179 -0
- data/app/controllers/jindra_engine/concerns/jinda_run_concern.rb +365 -0
- data/app/controllers/jindra_engine/devs_controller.rb +4 -0
- data/app/controllers/jindra_engine/docs_controller.rb +59 -0
- data/app/controllers/jindra_engine/identities_controller.rb +7 -0
- data/app/controllers/jindra_engine/jinda_controller.rb +71 -0
- data/app/controllers/jindra_engine/notes_controller.rb +87 -0
- data/app/controllers/jindra_engine/password_resets.rb +30 -0
- data/app/controllers/jindra_engine/password_resets_controller.rb +35 -0
- data/app/controllers/jindra_engine/sessions_controller.rb +45 -0
- data/app/controllers/jindra_engine/sitemap_controller.rb +15 -0
- data/app/controllers/jindra_engine/users_controller.rb +35 -0
- data/app/helpers/jinda_engine/jinda_helper.rb +1005 -0
- data/app/jinda/index.mm +366 -0
- data/app/jinda/template/index.mm +366 -0
- data/app/jinda/template/linkview.haml +21 -0
- data/app/jinda/template/view.html.erb +26 -0
- data/app/mailers/jinda_engine/application_mailer.rb +4 -0
- data/app/mailers/jinda_engine/jinda_mailer.rb +7 -0
- data/app/mailers/jinda_engine/note_mailer.rb +10 -0
- data/app/mailers/jinda_engine/user_mailer.rb +15 -0
- data/app/views/jinda_engine/adminbsbs/content.haml +241 -0
- data/app/views/jinda_engine/admins/edit_role/edit_role.html.erb +7 -0
- data/app/views/jinda_engine/admins/edit_role/select_user.html.erb +4 -0
- data/app/views/jinda_engine/api/v1/note.haml +0 -0
- data/app/views/jinda_engine/articles/edit.haml +12 -0
- data/app/views/jinda_engine/articles/edit_article/edit_article.html.erb +13 -0
- data/app/views/jinda_engine/articles/edit_article/select_article.html.erb +12 -0
- data/app/views/jinda_engine/articles/index.haml +23 -0
- data/app/views/jinda_engine/articles/my.haml +20 -0
- data/app/views/jinda_engine/articles/new_article/form_article.html.erb +16 -0
- data/app/views/jinda_engine/articles/show.html.haml +25 -0
- data/app/views/jinda_engine/articles/xedit_article/edit_article.html.erb +13 -0
- data/app/views/jinda_engine/ctrs/vfolder1/viewfile1.html.erb +23 -0
- data/app/views/jinda_engine/ctrs/vfolder1/viewfile2.html.erb +23 -0
- data/app/views/jinda_engine/ctrs/vfolder2/viewfile2.html.erb +23 -0
- data/app/views/jinda_engine/custom/_adsense.haml +6 -0
- data/app/views/jinda_engine/docs/doc_edit/doc_edit.html.erb +21 -0
- data/app/views/jinda_engine/docs/doc_edit/doc_select.html.erb +14 -0
- data/app/views/jinda_engine/docs/doc_new/doc_form.html.erb +26 -0
- data/app/views/jinda_engine/docs/doc_new/doc_form.md +36 -0
- data/app/views/jinda_engine/docs/doc_xedit/doc_edit.html.erb +21 -0
- data/app/views/jinda_engine/docs/edit/select_note.html.erb +14 -0
- data/app/views/jinda_engine/docs/index.haml +21 -0
- data/app/views/jinda_engine/docs/my.haml +27 -0
- data/app/views/jinda_engine/identities/new.html.erb +32 -0
- data/app/views/jinda_engine/jinda/_activity.md +10 -0
- data/app/views/jinda_engine/jinda/_menu.haml +27 -0
- data/app/views/jinda_engine/jinda/_menu_mm.haml +44 -0
- data/app/views/jinda_engine/jinda/_model.md +5 -0
- data/app/views/jinda_engine/jinda/_modul.md +9 -0
- data/app/views/jinda_engine/jinda/_pending_home.haml +5 -0
- data/app/views/jinda_engine/jinda/_pending_page.haml +24 -0
- data/app/views/jinda_engine/jinda/_service.md +24 -0
- data/app/views/jinda_engine/jinda/_static.haml +13 -0
- data/app/views/jinda_engine/jinda/doc-thai.md +37 -0
- data/app/views/jinda_engine/jinda/doc.md +36 -0
- data/app/views/jinda_engine/jinda/error_logs.haml +22 -0
- data/app/views/jinda_engine/jinda/feed.rss.builder +27 -0
- data/app/views/jinda_engine/jinda/help.haml +20 -0
- data/app/views/jinda_engine/jinda/index.html.haml +53 -0
- data/app/views/jinda_engine/jinda/logs.haml +22 -0
- data/app/views/jinda_engine/jinda/notice_logs.haml +18 -0
- data/app/views/jinda_engine/jinda/pending.haml +1 -0
- data/app/views/jinda_engine/jinda/run_form.haml +42 -0
- data/app/views/jinda_engine/jinda/run_output.haml +38 -0
- data/app/views/jinda_engine/jinda/search.haml +20 -0
- data/app/views/jinda_engine/jinda/status.haml +61 -0
- data/app/views/jinda_engine/jinda_mailer/gmail.html.erb +9 -0
- data/app/views/jinda_engine/layouts/_head.html.erb +10 -0
- data/app/views/jinda_engine/layouts/_meta_tag.html.erb +19 -0
- data/app/views/jinda_engine/layouts/application.haml +4 -0
- data/app/views/jinda_engine/layouts/bsb/_footer.haml +7 -0
- data/app/views/jinda_engine/layouts/bsb/_header.haml +147 -0
- data/app/views/jinda_engine/layouts/bsb/_menu.haml +47 -0
- data/app/views/jinda_engine/layouts/bsb/_menu_mm.haml +34 -0
- data/app/views/jinda_engine/layouts/bsb/_rightbar.haml +123 -0
- data/app/views/jinda_engine/layouts/bsb/_sidebar.haml +155 -0
- data/app/views/jinda_engine/layouts/bsb/application.haml-bsb +47 -0
- data/app/views/jinda_engine/layouts/gmail.html.erb +9 -0
- data/app/views/jinda_engine/layouts/jqm/_full.haml +33 -0
- data/app/views/jinda_engine/layouts/jqm/_page.haml +16 -0
- data/app/views/jinda_engine/layouts/jqm/application.haml-jqm +4 -0
- data/app/views/jinda_engine/layouts/mailer.html.erb +13 -0
- data/app/views/jinda_engine/layouts/mailer.html.haml +3 -0
- data/app/views/jinda_engine/layouts/mailer.text.erb +1 -0
- data/app/views/jinda_engine/layouts/mailer.text.haml +1 -0
- data/app/views/jinda_engine/layouts/mobile.html.erb +13 -0
- data/app/views/jinda_engine/layouts/mobilejq.html.erb +31 -0
- data/app/views/jinda_engine/layouts/print.html.erb +22 -0
- data/app/views/jinda_engine/layouts/utf8.html.erb +22 -0
- data/app/views/jinda_engine/note_mailer/gmail.html.haml +7 -0
- data/app/views/jinda_engine/note_mailer/gmail.text.haml +8 -0
- data/app/views/jinda_engine/notes/delete/select_note.html.erb +14 -0
- data/app/views/jinda_engine/notes/edit/edit_note.html.erb +10 -0
- data/app/views/jinda_engine/notes/edit/select_note.html.erb +14 -0
- data/app/views/jinda_engine/notes/index.haml +71 -0
- data/app/views/jinda_engine/notes/mail/display_mail.html.erb +20 -0
- data/app/views/jinda_engine/notes/mail/select_note.html.erb +19 -0
- data/app/views/jinda_engine/notes/mail/show.html.haml +13 -0
- data/app/views/jinda_engine/notes/my.haml +21 -0
- data/app/views/jinda_engine/notes/new/new_note.html.erb +13 -0
- data/app/views/jinda_engine/notes/show.haml +10 -0
- data/app/views/jinda_engine/notes/xedit/edit_note.html.erb +10 -0
- data/app/views/jinda_engine/password_resets/edit.html.erb +21 -0
- data/app/views/jinda_engine/password_resets/new.html.erb +7 -0
- data/app/views/jinda_engine/sessions/new.html.erb +20 -0
- data/app/views/jinda_engine/sitemap/index.xml.haml +10 -0
- data/app/views/jinda_engine/user_mailer/password_reset.html.haml +3 -0
- data/app/views/jinda_engine/user_mailer/password_reset.text.erb +3 -0
- data/app/views/jinda_engine/user_mailer/password_reset.text.haml +3 -0
- data/app/views/jinda_engine/users/index.haml +13 -0
- data/app/views/jinda_engine/users/pwd/enter.html.erb +6 -0
- data/app/views/jinda_engine/users/user/enter_user.html.erb +8 -0
- data/config/application.rb +58 -0
- data/config/initializers/jinda_engine/assets.rb +14 -0
- data/config/initializers/jinda_engine/jinda.rb +13 -0
- data/config/initializers/jinda_engine/mongoid.rb +9 -0
- data/config/initializers/jinda_engine/mongoid.rb-org +9 -0
- data/config/initializers/jinda_engine/omniauth.rb-org +17 -0
- data/config/jinda_engine/cloudinary.yml +9 -0
- data/config/routes.rb +18 -0
- data/db/jinda_engine/seeds.rb +6 -0
- data/lib/generators/jinda_engine/USAGE +2 -0
- data/lib/generators/jinda_engine/config_generator.rb +95 -0
- data/lib/generators/jinda_engine/install_generator.rb +237 -0
- data/lib/generators/jinda_engine/minitest_generator.rb +30 -0
- data/lib/generators/jinda_engine/rspec_generator.rb +30 -0
- data/lib/generators/jinda_engine/templates/README.md +173 -0
- data/lib/generators/jinda_engine/templates/app/assets/config/manifest.js +4 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/4dcity-old.ico +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/4dcity.ico +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/account.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/add.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/ajax-loader-circle.gif +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/ajax-loader.gif +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/anchor.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/application_double.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/application_form_edit.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/arrow_left.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/arrow_right.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/arrow_turn_left.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/arrow_turn_right.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/calendar.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/cancel.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/chart_bar.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/clock.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/cog.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/control_fastforward.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/control_play.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/cross.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/delete.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/external-link.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/facebook-continue-button.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/facebooksmall.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/favicon.ico +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/freemind(mm).png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/google-continue-button.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/help.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/highway-menu.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/highway.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/house.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/icons-18-black.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/icons-18-white.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/icons-36-black.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/icons-36-white.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/logo.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/logo_jinda.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/logout.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/new.gif +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/new.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/page.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/page_attach.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/page_green.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/page_output.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/page_pdf.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/pencil.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/printer.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/refresh.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/report.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/rssmall.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/tick.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/twittersmall.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/user.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/user_admin_gear.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/images/view_code.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/application.js +24 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/application.js-jqm +27 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/cable.js +13 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/disable_enter_key.js +10 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/iscroll-wrapper.js +32 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/iscroll.js +1084 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/jinda.js +14 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/jquery.mobile-1.2.1.js +9272 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/jquery.mobile.datebox.js +1778 -0
- data/lib/generators/jinda_engine/templates/app/assets/javascripts/jquery.mobile.splitview.js +695 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/app.scss +90 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/application.css.scss +34 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/articles.scss +94 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/sarabun.eot +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/sarabun.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/sarabun.woff +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/sarabun_bold.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/sarabun_bolditalic.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/sarabun_italic.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.eot +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew-webfont.woff +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew.css +47 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.eot +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_bold-webfont.woff +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.eot +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_bolditalic-webfont.woff +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.eot +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.ttf +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/fonts/thsarabunnew_italic-webfont.woff +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/ajax-loader.gif +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/button_black.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/button_blue.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/button_red.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/icons-18-black.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/icons-18-white.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/icons-36-black.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/icons-36-white.png +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/images/indicator.gif +0 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/jinda.css +52 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/jquery.mobile-1.2.1.css +2339 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/jquery.mobile.datebox.css +65 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/jquery.mobile.grids.collapsible.css +122 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/jquery.mobile.splitview.css +128 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/kul-4.2.css +1516 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/kul-4.2.min.css +11 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/modules.scss +84 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/sarabun.css +37 -0
- data/lib/generators/jinda_engine/templates/app/assets/stylesheets/social.scss +133 -0
- data/lib/generators/jinda_engine/templates/app/channels/application_cable/channel.rb +4 -0
- data/lib/generators/jinda_engine/templates/app/channels/application_cable/connection.rb +4 -0
- data/lib/generators/jinda_engine/templates/app/controllers/api/v1/notes_controller.rb +81 -0
- data/lib/generators/jinda_engine/templates/app/controllers/concerns/jinda_general_concern.rb-org +179 -0
- data/lib/generators/jinda_engine/templates/app/controllers/concerns/jinda_run_concern.rb-org +365 -0
- data/lib/generators/jinda_engine/templates/app/helpers/admins_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/application_helper.rb +33 -0
- data/lib/generators/jinda_engine/templates/app/helpers/articles_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/basic_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/comments_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/ctrs_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/devs_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/pictures_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/sitemap_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/helpers/users_helper.rb +2 -0
- data/lib/generators/jinda_engine/templates/app/jinda/index.mm +366 -0
- data/lib/generators/jinda_engine/templates/app/jinda/template/index.mm +366 -0
- data/lib/generators/jinda_engine/templates/app/jinda/template/linkview.haml +21 -0
- data/lib/generators/jinda_engine/templates/app/jinda/template/view.html.erb +26 -0
- data/lib/generators/jinda_engine/templates/app/mailers/application_mailer.rb +4 -0
- data/lib/generators/jinda_engine/templates/app/mailers/jinda_mailer.rb +7 -0
- data/lib/generators/jinda_engine/templates/app/mailers/note_mailer.rb +10 -0
- data/lib/generators/jinda_engine/templates/app/mailers/user_mailer.rb +15 -0
- data/lib/generators/jinda_engine/templates/app/models/address.rb +14 -0
- data/lib/generators/jinda_engine/templates/app/models/article.rb +14 -0
- data/lib/generators/jinda_engine/templates/app/models/comment.rb +11 -0
- data/lib/generators/jinda_engine/templates/app/models/identity.rb +18 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/doc.rb +36 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/module.rb +11 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/notice.rb +14 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/role.rb +8 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/runseq.rb +24 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/service.rb +17 -0
- data/lib/generators/jinda_engine/templates/app/models/jinda/xmain.rb +38 -0
- data/lib/generators/jinda_engine/templates/app/models/note.rb +22 -0
- data/lib/generators/jinda_engine/templates/app/models/param.rb +41 -0
- data/lib/generators/jinda_engine/templates/app/models/person.rb +14 -0
- data/lib/generators/jinda_engine/templates/app/models/user.rb +66 -0
- data/lib/generators/jinda_engine/templates/app/views/adminbsbs/content.haml +241 -0
- data/lib/generators/jinda_engine/templates/app/views/admins/edit_role/edit_role.html.erb +7 -0
- data/lib/generators/jinda_engine/templates/app/views/admins/edit_role/select_user.html.erb +4 -0
- data/lib/generators/jinda_engine/templates/app/views/api/v1/note.haml +0 -0
- data/lib/generators/jinda_engine/templates/app/views/ctrs/vfolder1/viewfile1.html.erb +23 -0
- data/lib/generators/jinda_engine/templates/app/views/ctrs/vfolder1/viewfile2.html.erb +23 -0
- data/lib/generators/jinda_engine/templates/app/views/ctrs/vfolder2/viewfile2.html.erb +23 -0
- data/lib/generators/jinda_engine/templates/app/views/custom/_adsense.haml +6 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/doc_edit/doc_edit.html.erb +21 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/doc_edit/doc_select.html.erb +14 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/doc_new/doc_form.html.erb +26 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/doc_new/doc_form.md +36 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/doc_xedit/doc_edit.html.erb +21 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/edit/select_note.html.erb +14 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/index.haml +21 -0
- data/lib/generators/jinda_engine/templates/app/views/docs/my.haml +27 -0
- data/lib/generators/jinda_engine/templates/app/views/identities/new.html.erb +32 -0
- data/lib/generators/jinda_engine/templates/app/views/jinda_mailer/gmail.html.erb +9 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/_head.html.erb +10 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/_meta_tag.html.erb +19 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/application.haml +4 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/_footer.haml +7 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/_header.haml +147 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/_menu.haml +47 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/_menu_mm.haml +34 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/_rightbar.haml +123 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/_sidebar.haml +155 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/bsb/application.haml-bsb +47 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/gmail.html.erb +9 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/jqm/_full.haml +33 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/jqm/_page.haml +16 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/jqm/application.haml-jqm +4 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/mailer.html.erb +13 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/mailer.html.haml +3 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/mailer.text.erb +1 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/mailer.text.haml +1 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/mobile.html.erb +13 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/mobilejq.html.erb +31 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/print.html.erb +22 -0
- data/lib/generators/jinda_engine/templates/app/views/layouts/utf8.html.erb +22 -0
- data/lib/generators/jinda_engine/templates/app/views/note_mailer/gmail.html.haml +7 -0
- data/lib/generators/jinda_engine/templates/app/views/note_mailer/gmail.text.haml +8 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/delete/select_note.html.erb +14 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/edit/edit_note.html.erb +10 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/edit/select_note.html.erb +14 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/index.haml +71 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/mail/display_mail.html.erb +20 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/mail/select_note.html.erb +19 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/mail/show.html.haml +13 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/my.haml +21 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/new/new_note.html.erb +13 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/show.haml +10 -0
- data/lib/generators/jinda_engine/templates/app/views/notes/xedit/edit_note.html.erb +10 -0
- data/lib/generators/jinda_engine/templates/app/views/password_resets/edit.html.erb +21 -0
- data/lib/generators/jinda_engine/templates/app/views/password_resets/new.html.erb +7 -0
- data/lib/generators/jinda_engine/templates/app/views/sessions/new.html.erb +20 -0
- data/lib/generators/jinda_engine/templates/app/views/sitemap/index.xml.haml +10 -0
- data/lib/generators/jinda_engine/templates/app/views/user_mailer/password_reset.html.haml +3 -0
- data/lib/generators/jinda_engine/templates/app/views/user_mailer/password_reset.text.erb +3 -0
- data/lib/generators/jinda_engine/templates/app/views/user_mailer/password_reset.text.haml +3 -0
- data/lib/generators/jinda_engine/templates/app/views/users/index.haml +13 -0
- data/lib/generators/jinda_engine/templates/app/views/users/pwd/enter.html.erb +6 -0
- data/lib/generators/jinda_engine/templates/app/views/users/user/enter_user.html.erb +8 -0
- data/lib/generators/jinda_engine/templates/config/cloudinary.yml +9 -0
- data/lib/generators/jinda_engine/templates/db/seeds.rb +6 -0
- data/lib/generators/jinda_engine/templates/dot/dot.env +2 -0
- data/lib/generators/jinda_engine/templates/dotrspec +3 -0
- data/lib/generators/jinda_engine/templates/jinda.yml +10 -0
- data/lib/generators/jinda_engine/templates/public/404.html +67 -0
- data/lib/generators/jinda_engine/templates/public/422.html +67 -0
- data/lib/generators/jinda_engine/templates/public/500.html +66 -0
- data/lib/generators/jinda_engine/templates/public/assets/images/logo.png +0 -0
- data/lib/generators/jinda_engine/templates/public/favicon.ico +0 -0
- data/lib/generators/jinda_engine/templates/public/robots.txt +3 -0
- data/lib/generators/jinda_engine/templates/spec/controllers/api/v1_get_index_spec.rb +23 -0
- data/lib/generators/jinda_engine/templates/spec/controllers/api/v1_get_my_spec.rb +14 -0
- data/lib/generators/jinda_engine/templates/spec/controllers/api/v1_post_spec.rb +19 -0
- data/lib/generators/jinda_engine/templates/spec/controllers/sessions_controller_spec.rb +96 -0
- data/lib/generators/jinda_engine/templates/spec/features/userlogins_spec.rb +23 -0
- data/lib/generators/jinda_engine/templates/spec/mailers/note_spec.rb +24 -0
- data/lib/generators/jinda_engine/templates/spec/mailers/previews/note_preview.rb +9 -0
- data/lib/generators/jinda_engine/templates/spec/models/note_spec.rb +41 -0
- data/lib/generators/jinda_engine/templates/spec/models/user_spec.rb +12 -0
- data/lib/generators/jinda_engine/templates/spec/rails_helper.rb +44 -0
- data/lib/generators/jinda_engine/templates/spec/spec_helper.rb +77 -0
- data/lib/generators/jinda_engine/templates/spec/support/authentication_helper.rb +20 -0
- data/lib/generators/jinda_engine/templates/spec/support/factory_bot.rb +12 -0
- data/lib/generators/jinda_engine/templates/spec/support/omniauth_macros.rb +38 -0
- data/lib/generators/jinda_engine/templates/spec/support/request_spec_helper.rb +8 -0
- data/lib/generators/jinda_engine/templates/spec/views/articles/_article.html.erb_spec.rbx +14 -0
- data/lib/generators/jinda_engine/templates/test/application_system_test_case.rb +5 -0
- data/lib/generators/jinda_engine/templates/test/integration/jinda_routes_test.rb +42 -0
- data/lib/generators/jinda_engine/templates/test/test_helper.rb +6 -0
- data/lib/jinda_engine.rb +7 -0
- data/lib/jinda_engine/engine.rb +6 -0
- data/lib/jinda_engine/gemhelpers.rb +50 -0
- data/lib/jinda_engine/helpers.rb +1005 -0
- data/lib/jinda_engine/version.rb +3 -0
- data/lib/tasks/jinda_engine.rake +33 -0
- metadata +1203 -0
@@ -0,0 +1,695 @@
|
|
1
|
+
// TODO: fix all the position: absolute issues caused by getScreenHeight and newResetActivePageHeight. these two need fixin.
|
2
|
+
// TODO: need to check for tablets performance - using overflow: auto instead of position:fixed. these will probably need fixin as well.
|
3
|
+
|
4
|
+
// TODO: reinstate replaceBackBtn - to include the case where people actually really want the back btn
|
5
|
+
(function($,window,undefined){
|
6
|
+
$( window.document ).bind('mobileinit', function(){
|
7
|
+
$.mobile = $.extend( {}, {
|
8
|
+
menuWidth: '25%',
|
9
|
+
menuMinWidth: '250px',
|
10
|
+
menuBtnSide: 'left',
|
11
|
+
}, $.mobile );
|
12
|
+
|
13
|
+
//some class for css to detect touchscreens
|
14
|
+
if($.support.touch){
|
15
|
+
$('html').addClass('touch');
|
16
|
+
}
|
17
|
+
var $query = $.mobile.media('screen and (min-width: 480px)') && ($.mobile.media('(-webkit-max-device-pixel-ratio: 3.0)') || $.mobile.media('(max--moz-device-pixel-ratio: 3.0)'));
|
18
|
+
$.support.splitview = ($query || ($.mobile.browser.ie && $(this).width() >= 480)) && $.mobile.ajaxEnabled;
|
19
|
+
if ($.support.splitview) {
|
20
|
+
$('html').addClass('splitview');
|
21
|
+
//on window.ready() execution:
|
22
|
+
$(function() {
|
23
|
+
// TODO: cleanup if all is ok
|
24
|
+
// $.mobile.linkBindingEnabled = false;
|
25
|
+
// $(document).unbind('.toolbar');
|
26
|
+
// $('.ui-page').off('.toolbar');
|
27
|
+
$('div:jqmData(role="panel")').addClass('ui-mobile-viewport ui-panel');
|
28
|
+
var firstPageMain=$('div:jqmData(id="main") > div:jqmData(role="page"):first');
|
29
|
+
if( !$.mobile.hashListeningEnabled || !$.mobile.path.stripHash( location.hash ) ){
|
30
|
+
var $container=$('div:jqmData(id="main")');
|
31
|
+
$.mobile.firstPage = firstPageMain;
|
32
|
+
$.mobile.pageContainer = $container;
|
33
|
+
$(window).trigger('pagecontainercreate');
|
34
|
+
$.mobile.changePage(firstPageMain, {transition:'none', changeHash:false, pageContainer:$container});
|
35
|
+
$.mobile.activePage=undefined;
|
36
|
+
} //no need to trigger a hashchange here cause the other page is handled by core.
|
37
|
+
|
38
|
+
// setup the layout for splitview and jquerymobile will handle first page init
|
39
|
+
$(window).trigger('orientationchange');
|
40
|
+
setTimeout(function(){
|
41
|
+
$.mobile.firstPage = firstPageMain;
|
42
|
+
}, 100)
|
43
|
+
}); //end window.ready()
|
44
|
+
|
45
|
+
//----------------------------------------------------------------------------------
|
46
|
+
//Main event bindings: click, form submits, hashchange and orientationchange/resize(popover)
|
47
|
+
//----------------------------------------------------------------------------------
|
48
|
+
//existing base tag?
|
49
|
+
var $window = $( window ),
|
50
|
+
$html = $( 'html' ),
|
51
|
+
$head = $( 'head' ),
|
52
|
+
$base = $head.children( "base" ),
|
53
|
+
$activeClickedLink = null,
|
54
|
+
//tuck away the original document URL minus any fragment.
|
55
|
+
documentUrl = $.mobile.path.parseUrl( location.href ),
|
56
|
+
|
57
|
+
//if the document has an embedded base tag, documentBase is set to its
|
58
|
+
//initial value. If a base tag does not exist, then we default to the documentUrl.
|
59
|
+
documentBase = $base.length ? $.mobile.path.parseUrl( $.mobile.path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
|
60
|
+
getScreenHeight = $.mobile.getScreenHeight;
|
61
|
+
|
62
|
+
//remove active classes after page transition or error
|
63
|
+
function removeActiveLinkClass( forceRemoval ) {
|
64
|
+
if ( !!$activeClickedLink && ( !$activeClickedLink.closest( "." + $.mobile.activePageClass ).length || forceRemoval ) ) {
|
65
|
+
$activeClickedLink.removeClass( $.mobile.activeBtnClass );
|
66
|
+
}
|
67
|
+
$activeClickedLink = null;
|
68
|
+
}
|
69
|
+
|
70
|
+
function findClosestLink(ele)
|
71
|
+
{
|
72
|
+
while (ele){
|
73
|
+
if ( ( typeof ele.nodeName === "string") && ele.nodeName.toLowerCase() == "a"){
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
ele = ele.parentNode;
|
77
|
+
}
|
78
|
+
return ele;
|
79
|
+
}
|
80
|
+
|
81
|
+
// The base URL for any given element depends on the page it resides in.
|
82
|
+
function getClosestBaseUrl( ele )
|
83
|
+
{
|
84
|
+
// Find the closest page and extract out its url.
|
85
|
+
var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
|
86
|
+
base = documentBase.hrefNoHash;
|
87
|
+
|
88
|
+
if ( !url || !$.mobile.path.isPath( url ) ) {
|
89
|
+
url = base;
|
90
|
+
}
|
91
|
+
|
92
|
+
return $.mobile.path.makeUrlAbsolute( url, base);
|
93
|
+
}
|
94
|
+
|
95
|
+
function ResetActivePageHeight(container){
|
96
|
+
var aPage;
|
97
|
+
// aPagePadT = parseFloat( aPage.css( "padding-top" ) ),
|
98
|
+
// aPagePadB = parseFloat( aPage.css( "padding-bottom" ) ),
|
99
|
+
// aPageBorderT = parseFloat( aPage.css( "border-top-width" ) ),
|
100
|
+
// aPageBorderB = parseFloat( aPage.css( "border-bottom-width" ) );
|
101
|
+
|
102
|
+
if(container !== null && typeof container !== 'undefined') {
|
103
|
+
aPage = container.find("." + $.mobile.activePageClass);
|
104
|
+
} else {
|
105
|
+
aPage = $( "." + $.mobile.activePageClass );
|
106
|
+
}
|
107
|
+
|
108
|
+
aPage.each(function(i, page){
|
109
|
+
page = $(page)
|
110
|
+
var pagePadT = parseFloat( page.css( "padding-top" )),
|
111
|
+
pagePadB = parseFloat( page.css( "padding-bottom" )),
|
112
|
+
pageBorderT = parseFloat( page.css( "border-top-width" )),
|
113
|
+
pageBorderB = parseFloat( page.css( "border-bottom-width" ));
|
114
|
+
page.css( "min-height", getScreenHeight() - pagePadT - pagePadB - pageBorderT - pageBorderB );
|
115
|
+
})
|
116
|
+
}
|
117
|
+
|
118
|
+
//override _registerInternalEvents to bind to new methods below
|
119
|
+
$.mobile._registerInternalEvents = function(){
|
120
|
+
//DONE: bind form submit with this plugin
|
121
|
+
$( document ).delegate("form", "submit", function(event){
|
122
|
+
var $this = $( this );
|
123
|
+
|
124
|
+
if( !$.mobile.ajaxEnabled ||
|
125
|
+
$this.is( ":jqmData(ajax='false')" ) ||
|
126
|
+
!$this.jqmHijackable().length ){
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
|
130
|
+
var type = $this.attr("method"),
|
131
|
+
target = $this.attr("target"),
|
132
|
+
url = $this.attr( "action" );
|
133
|
+
|
134
|
+
// If the form has a data-panel attribute, load the page in that panel instead.
|
135
|
+
var $targetPanel = null;
|
136
|
+
var $targetPanelId = $this.jqmData("panel");
|
137
|
+
if ($targetPanelId === undefined) {
|
138
|
+
$targetPanel = $this.parents('div:jqmData(role="panel")');
|
139
|
+
} else {
|
140
|
+
$targetPanel = $('div:jqmData(id="' + $targetPanelId + '")');
|
141
|
+
}
|
142
|
+
var $targetPanelActivePage=$targetPanel.children('div.'+$.mobile.activePageClass);
|
143
|
+
|
144
|
+
// If no action is specified, browsers default to using the
|
145
|
+
// URL of the document containing the form. Since we dynamically
|
146
|
+
// pull in pages from external documents, the form should submit
|
147
|
+
// to the URL for the source document of the page containing
|
148
|
+
// the form.
|
149
|
+
if ( !url ) {
|
150
|
+
// Get the @data-url for the page containing the form.
|
151
|
+
url = getClosestBaseUrl( $this );
|
152
|
+
if ( url === documentBase.hrefNoHash ) {
|
153
|
+
// The url we got back matches the document base,
|
154
|
+
// which means the page must be an internal/embedded page,
|
155
|
+
// so default to using the actual document url as a browser
|
156
|
+
// would.
|
157
|
+
url = documentUrl.hrefNoSearch;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
url = $.mobile.path.makeUrlAbsolute( url, getClosestBaseUrl($this) );
|
162
|
+
|
163
|
+
//external submits use regular HTTP
|
164
|
+
if( ( $.mobile.path.isExternal( url ) && !path.isPermittedCrossDomainRequest( documentUrl, url ) ) || target ) {
|
165
|
+
return;
|
166
|
+
}
|
167
|
+
|
168
|
+
//temporarily put this here- eventually shud just set it immediately instead of an interim var.
|
169
|
+
$.mobile.activePage=$targetPanelActivePage;
|
170
|
+
// $.mobile.pageContainer=$targetPanel;
|
171
|
+
$.mobile.changePage(
|
172
|
+
url,
|
173
|
+
{
|
174
|
+
type: type && type.length && type.toLowerCase() || "get",
|
175
|
+
data: $this.serialize(),
|
176
|
+
transition: $this.jqmData("transition"),
|
177
|
+
reverse: $this.jqmData("direction") === "reverse",
|
178
|
+
reloadPage: true,
|
179
|
+
pageContainer:$targetPanel
|
180
|
+
}
|
181
|
+
);
|
182
|
+
event.preventDefault();
|
183
|
+
});
|
184
|
+
|
185
|
+
//add active state on vclick
|
186
|
+
|
187
|
+
$( document ).bind( "vclick", function( event ) {
|
188
|
+
if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
|
189
|
+
return;
|
190
|
+
}
|
191
|
+
|
192
|
+
var link = findClosestLink( event.target );
|
193
|
+
|
194
|
+
if ( !$( link ).jqmHijackable().length ) {
|
195
|
+
return;
|
196
|
+
}
|
197
|
+
|
198
|
+
if ( link ) {
|
199
|
+
if ( $.mobile.path.parseUrl( link.getAttribute( "href" ) || "#" ).hash !== "#" ) {
|
200
|
+
removeActiveLinkClass( true );
|
201
|
+
$activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" )
|
202
|
+
$activeClickedLink.addClass( $.mobile.activeBtnClass );
|
203
|
+
// $( "." + $.mobile.activePageClass + " .ui-btn" ).not( link ).blur();
|
204
|
+
}
|
205
|
+
}
|
206
|
+
});
|
207
|
+
|
208
|
+
//DONE: link click event binding for changePage
|
209
|
+
//click routing - direct to HTTP or Ajax, accordingly
|
210
|
+
$(document).bind( "click", function(event) {
|
211
|
+
if ( !$.mobile.linkBindingEnabled ) {
|
212
|
+
return;
|
213
|
+
}
|
214
|
+
|
215
|
+
var link = findClosestLink(event.target),
|
216
|
+
$link = $( link ),
|
217
|
+
httpCleanup;
|
218
|
+
|
219
|
+
if (!link || event.which > 1 || !$link.jqmHijackable().length ){
|
220
|
+
return;
|
221
|
+
}
|
222
|
+
|
223
|
+
httpCleanup = function() {
|
224
|
+
window.setTimeout(function() { removeActiveLinkClass( true ); })
|
225
|
+
}
|
226
|
+
|
227
|
+
//if there's a data-rel=back attr, go back in history
|
228
|
+
if( $link.is( ":jqmData(rel='back')" ) ) {
|
229
|
+
$.mobile.back();
|
230
|
+
return false;
|
231
|
+
}
|
232
|
+
|
233
|
+
var baseUrl = getClosestBaseUrl( $link ),
|
234
|
+
|
235
|
+
//get href, if defined, otherwise fall to null #
|
236
|
+
href = $.mobile.path.makeUrlAbsolute( $link.attr( "href" ) || "#", baseUrl );
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
//if ajax is disabled, exit early
|
241
|
+
if( !$.mobile.ajaxEnabled && !$.mobile.path.isEmbeddedPage( href ) ) {
|
242
|
+
httpCleanup();
|
243
|
+
//use default click handling
|
244
|
+
return;
|
245
|
+
}
|
246
|
+
|
247
|
+
// XXX_jblas: Ideally links to application pages should be specified as
|
248
|
+
// an url to the application document with a hash that is either
|
249
|
+
// the site relative path or id to the page. But some of the
|
250
|
+
// internal code that dynamically generates sub-pages for nested
|
251
|
+
// lists and select dialogs, just write a hash in the link they
|
252
|
+
// create. This means the actual URL path is based on whatever
|
253
|
+
// the current value of the base tag is at the time this code
|
254
|
+
// is called. For now we are just assuming that any url with a
|
255
|
+
// hash in it is an application page reference.
|
256
|
+
if ( href.search( "#" ) !== -1 ) {
|
257
|
+
href = href.replace( /[^#]*#/, "" );
|
258
|
+
if ( !href ) {
|
259
|
+
//link was an empty hash meant purely
|
260
|
+
//for interaction, so we ignore it.
|
261
|
+
event.preventDefault();
|
262
|
+
return;
|
263
|
+
} else if ( $.mobile.path.isPath( href ) ) {
|
264
|
+
//we have apath so make it the href we want to load.
|
265
|
+
href = $.mobile.path.makeUrlAbsolute( href, baseUrl );
|
266
|
+
} else {
|
267
|
+
//we have a simple id so use the documentUrl as its base.
|
268
|
+
href = $.mobile.path.makeUrlAbsolute( "#" + href, documentUrl.hrefNoHash );
|
269
|
+
}
|
270
|
+
}
|
271
|
+
|
272
|
+
// Should we handle this link, or let the browser deal with it?
|
273
|
+
var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ),
|
274
|
+
// Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR
|
275
|
+
// requests if the document doing the request was loaded via the file:// protocol.
|
276
|
+
// This is usually to allow the application to "phone home" and fetch app specific
|
277
|
+
// data. We normally let the browser handle external/cross-domain urls, but if the
|
278
|
+
// allowCrossDomainPages option is true, we will allow cross-domain http/https
|
279
|
+
// requests to go through our page loading logic.
|
280
|
+
//isCrossDomainPageLoad = ( $.mobile.allowCrossDomainPages && documentUrl.protocol === "file:" && href.search( /^https?:/ ) != -1 ),
|
281
|
+
|
282
|
+
//check for protocol or rel and its not an embedded page
|
283
|
+
//TODO overlap in logic from isExternal, rel=external check should be
|
284
|
+
// moved into more comprehensive isExternalLink
|
285
|
+
isExternal = useDefaultUrlHandling || ( $.mobile.path.isExternal( href ) && !$.mobile.path.isPermittedCrossDomainRequest( documentUrl, href ) ),
|
286
|
+
|
287
|
+
isRefresh=$link.jqmData('refresh'),
|
288
|
+
$targetPanel=$link.jqmData('panel'),
|
289
|
+
$targetContainer=$('div:jqmData(id="'+$targetPanel+'")'),
|
290
|
+
$targetPanelActivePage=$targetContainer.children('div.'+$.mobile.activePageClass),
|
291
|
+
$currPanel=$link.parents('div:jqmData(role="panel")'),
|
292
|
+
//not sure we need this. if you want the container of the element that triggered this event, $currPanel
|
293
|
+
$currContainer=$.mobile.pageContainer,
|
294
|
+
$currPanelActivePage=$currPanel.children('div.'+$.mobile.activePageClass),
|
295
|
+
url=$.mobile.path.stripHash($link.attr("href")),
|
296
|
+
from = null;
|
297
|
+
|
298
|
+
//still need this hack apparently:
|
299
|
+
$('.ui-btn.'+$.mobile.activeBtnClass).removeClass($.mobile.activeBtnClass);
|
300
|
+
$activeClickedLink = $link.closest( ".ui-btn" ).addClass($.mobile.activeBtnClass);
|
301
|
+
|
302
|
+
if( isExternal ) {
|
303
|
+
httpCleanup();
|
304
|
+
//use default click handling
|
305
|
+
return;
|
306
|
+
}
|
307
|
+
|
308
|
+
//use ajax
|
309
|
+
var transitionVal = $link.jqmData( "transition" ),
|
310
|
+
reverseVal = $link.jqmData("direction") === "reverse" ||
|
311
|
+
// deprecated - remove by 1.0
|
312
|
+
$link.jqmData( "back" ),
|
313
|
+
//this may need to be more specific as we use data-rel more
|
314
|
+
role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined,
|
315
|
+
hash = $currPanel.jqmData('hash');
|
316
|
+
|
317
|
+
//if link refers to an already active panel, stop default action and return
|
318
|
+
if ($targetPanelActivePage.attr('data-url') == url || $currPanelActivePage.attr('data-url') == url) {
|
319
|
+
if (isRefresh) { //then changePage below because it's a pageRefresh request
|
320
|
+
$.mobile.changePage(href, {fromPage:from, transition:'fade', reverse:reverseVal, changeHash:false, pageContainer:$targetContainer, reloadPage:isRefresh, role:role, link:$link});
|
321
|
+
}
|
322
|
+
else { //else preventDefault and return
|
323
|
+
event.preventDefault();
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
//if link refers to a page on another panel, changePage on that panel
|
328
|
+
else if ($targetPanel && $targetPanel!=$link.parents('div:jqmData(role="panel")')) {
|
329
|
+
var from=$targetPanelActivePage;
|
330
|
+
$.mobile.pageContainer=$targetContainer;
|
331
|
+
$.mobile.changePage(href, {fromPage:from, transition:transitionVal, reverse:reverseVal, pageContainer:$targetContainer, role:role, link:$link});
|
332
|
+
}
|
333
|
+
//if link refers to a page inside the same panel, changePage on that panel
|
334
|
+
else {
|
335
|
+
var from=$currPanelActivePage;
|
336
|
+
$.mobile.pageContainer=$currPanel;
|
337
|
+
var hashChange= (hash == 'false' || hash == 'crumbs')? false : true;
|
338
|
+
$.mobile.changePage(href, {fromPage:from, transition:transitionVal, reverse:reverseVal, changeHash:hashChange, pageContainer:$currPanel, role: role, link: $link});
|
339
|
+
//active page must always point to the active page in main - for history purposes.
|
340
|
+
$.mobile.activePage=$('div:jqmData(id="main") > div.'+$.mobile.activePageClass);
|
341
|
+
}
|
342
|
+
event.preventDefault();
|
343
|
+
event.stopPropagation();
|
344
|
+
});
|
345
|
+
|
346
|
+
//prefetch pages when anchors with data-prefetch are encountered
|
347
|
+
//TODO: insert pageContainer in here!
|
348
|
+
$( document ).delegate( ".ui-page", "pageshow.prefetch", function(){
|
349
|
+
var urls = [],
|
350
|
+
$thisPageContainer = $(this).parents('div:jqmData(role="panel")');
|
351
|
+
$( this ).find( "a:jqmData(prefetch)" ).each(function(){
|
352
|
+
var url = $( this ).attr( "href" ),
|
353
|
+
panel = $(this).jqmData('panel'),
|
354
|
+
container = panel.length? $('div:jqmData(id="'+panel+'")') : $thisPageContainer;
|
355
|
+
if ( url && $.inArray( url, urls ) === -1 ) {
|
356
|
+
urls.push( url );
|
357
|
+
$.mobile.loadPage( url, {pageContainer: container} );
|
358
|
+
}
|
359
|
+
});
|
360
|
+
});
|
361
|
+
|
362
|
+
//DONE: bind hashchange with this plugin
|
363
|
+
//hashchanges are defined only for the main panel - other panels should not support hashchanges to avoid ambiguity
|
364
|
+
$.mobile._handleHashChange = function( hash ) {
|
365
|
+
var to = $.mobile.path.stripHash( hash ),
|
366
|
+
transition = $.mobile.urlHistory.stack.length === 0 ? "none" : undefined,
|
367
|
+
navEvent = new $.Event( "navigate" ),
|
368
|
+
$mainPanel=$('div:jqmData(id="main")'),
|
369
|
+
$mainPanelFirstPage=$mainPanel.children('div:jqmData(role="page"):first'),
|
370
|
+
$mainPanelActivePage=$mainPanel.children('div.ui-page-active'),
|
371
|
+
$menuPanel=$('div:jqmData(id="menu")'),
|
372
|
+
$menuPanelFirstPage=$menuPanel.children('div:jqmData(role="page"):first'),
|
373
|
+
$menuPanelActivePage=$menuPanel.children('div.ui-page-active'),
|
374
|
+
//FIX: temp var for dialogHashKey
|
375
|
+
dialogHashKey = "&ui-state=dialog",
|
376
|
+
|
377
|
+
// default options for the changPage calls made after examining the current state
|
378
|
+
// of the page and the hash
|
379
|
+
changePageOptions = {
|
380
|
+
transition: transition,
|
381
|
+
changeHash: false,
|
382
|
+
fromHashChange: true,
|
383
|
+
pageContainer: $mainPanel
|
384
|
+
};
|
385
|
+
|
386
|
+
if ( 0 === $.mobile.urlHistory.stack.length ) {
|
387
|
+
$.mobile.urlHistory.initialDst = to;
|
388
|
+
}
|
389
|
+
|
390
|
+
// We should probably fire the "navigate" event from those places that make calls to _handleHashChange,
|
391
|
+
// and have _handleHashChange hook into the "navigate" event instead of triggering it here
|
392
|
+
$.mobile.pageContainer.trigger( navEvent );
|
393
|
+
if ( navEvent.isDefaultPrevented() ) {
|
394
|
+
return;
|
395
|
+
}
|
396
|
+
|
397
|
+
if( !$.mobile.hashListeningEnabled || $.mobile.urlHistory.ignoreNextHashChange ){
|
398
|
+
$.mobile.urlHistory.ignoreNextHashChange = false;
|
399
|
+
return;
|
400
|
+
}
|
401
|
+
|
402
|
+
// special case for dialogs
|
403
|
+
if( $.mobile.urlHistory.stack.length > 1 && to.indexOf( dialogHashKey ) > -1 && $.mobile.urlHistory.initialDst !== to ) {
|
404
|
+
|
405
|
+
// If current active page is not a dialog skip the dialog and continue
|
406
|
+
// in the same direction
|
407
|
+
if(!$.mobile.activePage.is( ".ui-dialog" )) {
|
408
|
+
//determine if we're heading forward or backward and continue accordingly past
|
409
|
+
//the current dialog
|
410
|
+
$.mobile.urlHistory.directHashChange({
|
411
|
+
currentUrl: to,
|
412
|
+
isBack: function() { window.history.back(); },
|
413
|
+
isForward: function() { window.history.forward(); }
|
414
|
+
});
|
415
|
+
|
416
|
+
// prevent changepage
|
417
|
+
return;
|
418
|
+
} else {
|
419
|
+
// var setTo = function() { to = $.mobile.urlHistory.getActive().pageUrl; };
|
420
|
+
// if the current active page is a dialog and we're navigating
|
421
|
+
// to a dialog use the dialog objected saved in the stack
|
422
|
+
// urlHistory.directHashChange({ currentUrl: to, isBack: setTo, isForward: setTo });
|
423
|
+
urlHistory.directHashChange({
|
424
|
+
currentUrl: to,
|
425
|
+
|
426
|
+
// regardless of the direction of the history change
|
427
|
+
// do the following
|
428
|
+
either: function( isBack ) {
|
429
|
+
var active = $.mobile.urlHistory.getActive();
|
430
|
+
|
431
|
+
to = active.pageUrl;
|
432
|
+
|
433
|
+
// make sure to set the role, transition and reversal
|
434
|
+
// as most of this is lost by the domCache cleaning
|
435
|
+
$.extend( changePageOptions, {
|
436
|
+
role: active.role,
|
437
|
+
transition: active.transition,
|
438
|
+
reverse: isBack
|
439
|
+
});
|
440
|
+
}
|
441
|
+
});
|
442
|
+
}
|
443
|
+
}
|
444
|
+
|
445
|
+
//if to is defined, load it
|
446
|
+
if ( to ){
|
447
|
+
to = ( typeof to === "string" && !$.mobile.path.isPath( to ) ) ? ( $.mobile.path.makeUrlAbsolute( '#' + to, documentBase ) ) : to;
|
448
|
+
//if this is initial deep-linked page setup, then changePage sidemenu as well
|
449
|
+
if (!$('div.ui-page-active').length) {
|
450
|
+
$menuPanelFirstPage='#'+$menuPanelFirstPage.attr('id');
|
451
|
+
$.mobile.changePage($menuPanelFirstPage, {transition:'none', reverse:true, changeHash:false, fromHashChange:false, pageContainer:$menuPanel});
|
452
|
+
$.mobile.activePage=undefined;
|
453
|
+
}
|
454
|
+
$.mobile.activePage=$mainPanelActivePage.length? $mainPanelActivePage : undefined;
|
455
|
+
$.mobile.changePage(to, changePageOptions );
|
456
|
+
} else {
|
457
|
+
//there's no hash, go to the first page in the main panel.
|
458
|
+
$.mobile.activePage=$mainPanelActivePage? $mainPanelActivePage : undefined;
|
459
|
+
$.mobile.changePage( $mainPanelFirstPage, changePageOptions );
|
460
|
+
}
|
461
|
+
};
|
462
|
+
|
463
|
+
//hashchange event handler
|
464
|
+
$(window).bind( "hashchange", function( e, triggered ) {
|
465
|
+
$.mobile._handleHashChange( location.hash );
|
466
|
+
});
|
467
|
+
|
468
|
+
//set page min-heights to be device specific
|
469
|
+
$( document ).bind( "pageshow.resetPageHeight", function(e){
|
470
|
+
var container = $(e.target).parents('div:jqmData(role="panel")');
|
471
|
+
ResetActivePageHeight(container);
|
472
|
+
});
|
473
|
+
$( window ).bind( "throttledresize.resetPageHeight", ResetActivePageHeight() );
|
474
|
+
|
475
|
+
}; //end _registerInternalEvents
|
476
|
+
|
477
|
+
//DONE: bind orientationchange and resize - the popover
|
478
|
+
_orientationHandler = function(event){
|
479
|
+
var $menu=$('div:jqmData(id="menu")'),
|
480
|
+
$main=$('div:jqmData(id="main")'),
|
481
|
+
$mainHeader=$main.find('div.'+$.mobile.activePageClass+'> div:jqmData(role="header")'),
|
482
|
+
$window=$(window);
|
483
|
+
|
484
|
+
function popoverBtn(header) {
|
485
|
+
if(!header.children('.popover-btn').length){
|
486
|
+
if(header.children('a.ui-btn-'+$.mobile.menuBtnSide).length){
|
487
|
+
header.children('a.ui-btn-'+$.mobile.menuBtnSide).replaceWith('<a class="popover-btn">Menu</a>');
|
488
|
+
header.children('a.popover-btn').addClass('ui-btn-'+$.mobile.menuBtnSide).buttonMarkup();
|
489
|
+
}
|
490
|
+
else{
|
491
|
+
header.prepend('<a class="popover-btn">Menu</a>');
|
492
|
+
header.children('a.popover-btn').addClass('ui-btn-'+$.mobile.menuBtnSide).buttonMarkup()
|
493
|
+
}
|
494
|
+
}
|
495
|
+
}
|
496
|
+
|
497
|
+
function replaceBackBtn(header) {
|
498
|
+
if($.mobile.urlHistory.stack.length > 1 && !header.children('a:jqmData(rel="back")').length && header.jqmData('backbtn')!=false){
|
499
|
+
header.prepend("<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>Back</a>" );
|
500
|
+
header.children('a:jqmData(rel="back")').buttonMarkup();
|
501
|
+
}
|
502
|
+
};
|
503
|
+
|
504
|
+
function popover(){
|
505
|
+
$menu.addClass('panel-popover')
|
506
|
+
.removeClass('ui-panel-left')
|
507
|
+
.css({'width':$.mobile.menuWidth, 'min-width':$.mobile.menuMinWidth, 'display':'', 'overflow-x':'visible'})
|
508
|
+
.css($.mobile.menuBtnSide, '10px');
|
509
|
+
if(!$menu.children('.popover_triangle').length){
|
510
|
+
$menu.prepend('<div class="popover_triangle" style="'+$.mobile.menuBtnSide+':7px"></div>');
|
511
|
+
}
|
512
|
+
$menu.children('div:jqmData(role="page")').css('min-height', '100%');
|
513
|
+
$main.removeClass('ui-panel-right')
|
514
|
+
.css('width', '');
|
515
|
+
popoverBtn($mainHeader);
|
516
|
+
|
517
|
+
$main.undelegate('div:jqmData(role="page")', 'pagebeforeshow.splitview');
|
518
|
+
$main.delegate('div:jqmData(role="page")','pagebeforeshow.popover', function(){
|
519
|
+
var $thisHeader=$(this).children('div:jqmData(role="header")');
|
520
|
+
popoverBtn($thisHeader);
|
521
|
+
});
|
522
|
+
$( document ).unbind('pageshow.resetPageHeight');
|
523
|
+
// TODO: unbind resetActivePageHeight for popover pages
|
524
|
+
|
525
|
+
};
|
526
|
+
|
527
|
+
function splitView(){
|
528
|
+
$menu.removeClass('panel-popover')
|
529
|
+
.addClass('ui-panel-left')
|
530
|
+
.css({'width':$.mobile.menuWidth, 'min-width':$.mobile.menuMinWidth, 'display':''});
|
531
|
+
$menu.children('.popover_triangle').remove();
|
532
|
+
$main.addClass('ui-panel-right')
|
533
|
+
.width(function(){
|
534
|
+
return $(window).width()-$('div:jqmData(id="menu")').width();
|
535
|
+
});
|
536
|
+
$mainHeader.children('.popover-btn').remove();
|
537
|
+
|
538
|
+
// replaceBackBtn($mainHeader);
|
539
|
+
|
540
|
+
$main.undelegate('div:jqmData(role="page")', 'pagebeforeshow.popover');
|
541
|
+
$main.delegate('div:jqmData(role="page")', 'pagebeforeshow.splitview', function(){
|
542
|
+
var $thisHeader=$(this).children('div:jqmData(role="header")');
|
543
|
+
$thisHeader.children('.popover-btn').remove();
|
544
|
+
// replaceBackBtn($thisHeader);
|
545
|
+
});
|
546
|
+
|
547
|
+
}
|
548
|
+
|
549
|
+
if(event.orientation){
|
550
|
+
if(event.orientation == 'portrait'){
|
551
|
+
popover();
|
552
|
+
}
|
553
|
+
else if(event.orientation == 'landscape') {
|
554
|
+
splitView();
|
555
|
+
}
|
556
|
+
}
|
557
|
+
else if($window.width() < 1280 && $window.width() > 480){
|
558
|
+
popover();
|
559
|
+
}
|
560
|
+
else if($window.width() > 1280){
|
561
|
+
splitView();
|
562
|
+
}
|
563
|
+
};
|
564
|
+
|
565
|
+
$(window).bind('orientationchange', _orientationHandler);
|
566
|
+
$(window).bind('throttledresize', _orientationHandler);
|
567
|
+
|
568
|
+
//popover button click handler - from http://www.cagintranet.com/archive/create-an-ipad-like-dropdown-popover/
|
569
|
+
$(document).on('click', '.popover-btn', function(e){
|
570
|
+
e.preventDefault();
|
571
|
+
$('.panel-popover').fadeToggle('fast');
|
572
|
+
if ($('.popover-btn').hasClass($.mobile.activeBtnClass)) {
|
573
|
+
$('.popover-btn').removeClass($.mobile.activeBtnClass);
|
574
|
+
} else {
|
575
|
+
$('.popover-btn').addClass($.mobile.activeBtnClass);
|
576
|
+
}
|
577
|
+
});
|
578
|
+
|
579
|
+
$(document).on('click', 'body', function(event) {
|
580
|
+
if (!$(event.target).closest('.panel-popover').length && !$(event.target).closest('.popover-btn').length) {
|
581
|
+
$(".panel-popover").stop(true, true).hide();
|
582
|
+
$('.popover-btn').removeClass($.mobile.activeBtnClass);
|
583
|
+
};
|
584
|
+
});
|
585
|
+
|
586
|
+
|
587
|
+
//----------------------------------------------------------------------------------
|
588
|
+
//Other event bindings: scrollview, crumbs, data-context and content height adjustments
|
589
|
+
//----------------------------------------------------------------------------------
|
590
|
+
|
591
|
+
// TODO:cleanup if all is ok
|
592
|
+
// DONE: pageshow binding for scrollview - now using IScroll4! hell yeah!
|
593
|
+
// $('div:jqmData(role="page")').live('pagebeforeshow.scroll', function(event, ui){
|
594
|
+
// if ($.support.touch && !$.support.touchOverflow) {
|
595
|
+
|
596
|
+
// var $page = $(this),
|
597
|
+
// $scrollArea = $page.find('div:jqmData(role="content")');
|
598
|
+
// $scrAreaChildren = $scrollArea.children();
|
599
|
+
|
600
|
+
// if ($scrAreaChildren.length > 1) {
|
601
|
+
// $scrAreaChildren = $scrollArea.wrapInner("<div class='scrollable vertical'></div>").children();
|
602
|
+
// }
|
603
|
+
// $scrollArea.css({ 'width':'auto',
|
604
|
+
// 'height':'auto',
|
605
|
+
// 'overflow':'hidden'});
|
606
|
+
// //TODO: if too many pages are in the DOM that have iscroll on, this might slow down the browser significantly,
|
607
|
+
// //in which case we'll need to destroy() the iscroll as the page hides.
|
608
|
+
// $scrollArea.iscroll();
|
609
|
+
// }
|
610
|
+
// });
|
611
|
+
|
612
|
+
//data-hash 'crumbs' handler
|
613
|
+
//now that data-backbtn is no longer defaulting to true, lets set crumbs to create itself even when backbtn is not available
|
614
|
+
$(document).on("pagebeforeshow.crumbs", 'div:jqmData(role="page")', function(event, data){
|
615
|
+
var $this = $(this);
|
616
|
+
if($this.jqmData('hash') == 'crumbs' || $this.parents('div:jqmData(role="panel")').data('hash') == 'crumbs'){
|
617
|
+
if($this.jqmData('hash')!=false && $this.find('.ui-crumbs').length < 1){
|
618
|
+
var $header=$this.find('div:jqmData(role="header")');
|
619
|
+
backBtn = $this.find('a:jqmData(rel="back")');
|
620
|
+
|
621
|
+
if(data.prevPage.jqmData('url') == $this.jqmData('url')){ //if it's a page refresh
|
622
|
+
var prevCrumb = data.prevPage.find('.ui-crumbs');
|
623
|
+
crumbify(backBtn, prevCrumb.attr('href'), prevCrumb.find('.ui-btn-text').html());
|
624
|
+
}
|
625
|
+
else if($.mobile.urlHistory.stack.length > 0) {
|
626
|
+
var text = data.prevPage.find('div:jqmData(role="header") .ui-title').html();
|
627
|
+
crumbify(backBtn, '#'+data.prevPage.jqmData('url'), text);
|
628
|
+
}
|
629
|
+
else if(backBtn.length && $.mobile.urlHistory.stack.length <= 1) {
|
630
|
+
backBtn.remove();
|
631
|
+
}
|
632
|
+
}
|
633
|
+
}
|
634
|
+
|
635
|
+
function crumbify(button, href, text){
|
636
|
+
if(!button.length) {
|
637
|
+
$this.find('div:jqmData(role="header")').prepend('<a class="ui-crumbs ui-btn-left" data-icon="arrow-l"></a>');
|
638
|
+
button=$header.children('.ui-crumbs').buttonMarkup();
|
639
|
+
}
|
640
|
+
button.removeAttr('data-rel')
|
641
|
+
.jqmData('direction','reverse')
|
642
|
+
.addClass('ui-crumbs')
|
643
|
+
.attr('href',href);
|
644
|
+
button.find('.ui-btn-text').html(text);
|
645
|
+
}
|
646
|
+
});
|
647
|
+
|
648
|
+
//data-context handler - a page with a link that has a data-context attribute will load that page after this page loads
|
649
|
+
//this still needs work - pageTransitionQueue messes everything up.
|
650
|
+
$(document).on('pagechange.context', 'div:jqmData(role="panel")', function(){
|
651
|
+
var $this=$(this),
|
652
|
+
$currPanelActivePage = $this.children('.' + $.mobile.activePageClass),
|
653
|
+
panelContextSelector = $this.jqmData('context'),
|
654
|
+
pageContextSelector = $currPanelActivePage.jqmData('context'),
|
655
|
+
contextSelector= pageContextSelector ? pageContextSelector : panelContextSelector;
|
656
|
+
//if you pass a hash into data-context, you need to specify panel, url and a boolean value for refresh
|
657
|
+
if($.type(contextSelector) === 'object') {
|
658
|
+
var $targetContainer=$('div:jqmData(id="'+contextSelector.panel+'")'),
|
659
|
+
$targetPanelActivePage=$targetContainer.children('div.'+$.mobile.activePageClass),
|
660
|
+
isRefresh = contextSelector.refresh === undefined ? false : contextSelector.refresh;
|
661
|
+
if(($targetPanelActivePage.jqmData('url') == contextSelector.url && contextSelector.refresh)||(!contextSelector.refresh && $targetPanelActivePage.jqmData('url') != contextSelector.url)){
|
662
|
+
$.mobile.changePage(contextSelector.url, options={transition:'fade', changeHash:false, pageContainer:$targetContainer, reloadPage:isRefresh});
|
663
|
+
}
|
664
|
+
}
|
665
|
+
else if(contextSelector && $currPanelActivePage.find(contextSelector).length){
|
666
|
+
$currPanelActivePage.find(contextSelector).trigger('click');
|
667
|
+
}
|
668
|
+
});
|
669
|
+
|
670
|
+
//TODO: cleanup if all is ok
|
671
|
+
// this measures the height of header and footer and sets content to the appropriate height so
|
672
|
+
// that no content is concealed behind header and footer
|
673
|
+
// $('div:jqmData(role="page")').live('pageshow.contentHeight', function(){
|
674
|
+
// var $this=$(this),
|
675
|
+
// $header=$this.children(':jqmData(role="header")'),
|
676
|
+
// $footer=$this.children(':jqmData(role="footer")'),
|
677
|
+
// thisHeaderHeight=$header.css('display') == 'none' ? 0 : $header.outerHeight(),
|
678
|
+
// thisFooterHeight=$footer.css('display') == 'none' ? 0 : $footer.outerHeight();
|
679
|
+
// // $this.children(':jqmData(role="content")').css({'top':thisHeaderHeight, 'bottom':thisFooterHeight});
|
680
|
+
// })
|
681
|
+
|
682
|
+
//this allows panels to change their widths upon changepage - useful for pages that need a different width than the ones provided.
|
683
|
+
// $('div:jqmData(role="page")').live('')
|
684
|
+
}
|
685
|
+
else {
|
686
|
+
//removes all panels so the page behaves like a single panel jqm
|
687
|
+
$(function(){
|
688
|
+
$('div:jqmData(role="panel")').each(function(){
|
689
|
+
var $this = $(this);
|
690
|
+
$this.replaceWith($this.html());
|
691
|
+
})
|
692
|
+
});
|
693
|
+
}
|
694
|
+
});
|
695
|
+
})(jQuery,window);
|