diff --git a/app/assets/images/plaquettes/Capture d’écran 2013-03-07 à 11.58.00.png b/app/assets/images/plaquettes/Capture d’écran 2013-03-07 à 11.58.00.png deleted file mode 100644 index 0b56e6d..0000000 Binary files a/app/assets/images/plaquettes/Capture d’écran 2013-03-07 à 11.58.00.png and /dev/null differ diff --git a/app/assets/images/plaquettes/arbre.jpg b/app/assets/images/plaquettes/arbre.jpg new file mode 100644 index 0000000..860edb4 Binary files /dev/null and b/app/assets/images/plaquettes/arbre.jpg differ diff --git a/app/assets/images/plaquettes/arbres/chandelle.jpg b/app/assets/images/plaquettes/arbres/chandelle.jpg new file mode 100755 index 0000000..72b9bc1 Binary files /dev/null and b/app/assets/images/plaquettes/arbres/chandelle.jpg differ diff --git a/app/assets/images/plaquettes/arbres/lierre.jpg b/app/assets/images/plaquettes/arbres/lierre.jpg new file mode 100755 index 0000000..7a6a01b Binary files /dev/null and b/app/assets/images/plaquettes/arbres/lierre.jpg differ diff --git a/app/assets/images/plaquettes/arbres/pic.jpg b/app/assets/images/plaquettes/arbres/pic.jpg new file mode 100755 index 0000000..5fbf34e Binary files /dev/null and b/app/assets/images/plaquettes/arbres/pic.jpg differ diff --git a/app/assets/images/plaquettes/arbres/texte.jpg b/app/assets/images/plaquettes/arbres/texte.jpg new file mode 100755 index 0000000..22a9116 Binary files /dev/null and b/app/assets/images/plaquettes/arbres/texte.jpg differ diff --git a/app/assets/images/plaquettes/chauve-souri-jeu.jpg b/app/assets/images/plaquettes/chauve-souri-jeu.jpg new file mode 100755 index 0000000..2d86ec5 Binary files /dev/null and b/app/assets/images/plaquettes/chauve-souri-jeu.jpg differ diff --git a/app/assets/images/plaquettes/chauve-souri-jeuold.jpg b/app/assets/images/plaquettes/chauve-souri-jeuold.jpg new file mode 100755 index 0000000..e13aeff Binary files /dev/null and b/app/assets/images/plaquettes/chauve-souri-jeuold.jpg differ diff --git a/app/assets/images/plaquettes/chauve-souri.jpg b/app/assets/images/plaquettes/chauve-souri.jpg new file mode 100755 index 0000000..74296ea Binary files /dev/null and b/app/assets/images/plaquettes/chauve-souri.jpg differ diff --git a/app/assets/images/plaquettes/feuille/1.jpg b/app/assets/images/plaquettes/feuille/1.jpg new file mode 100644 index 0000000..d8445d7 Binary files /dev/null and b/app/assets/images/plaquettes/feuille/1.jpg differ diff --git a/app/assets/images/plaquettes/feuille/2.jpg b/app/assets/images/plaquettes/feuille/2.jpg new file mode 100644 index 0000000..e30862a Binary files /dev/null and b/app/assets/images/plaquettes/feuille/2.jpg differ diff --git a/app/assets/images/plaquettes/feuille/3.jpg b/app/assets/images/plaquettes/feuille/3.jpg new file mode 100644 index 0000000..ba7354f Binary files /dev/null and b/app/assets/images/plaquettes/feuille/3.jpg differ diff --git a/app/assets/images/plaquettes/feuille/4.jpg b/app/assets/images/plaquettes/feuille/4.jpg new file mode 100644 index 0000000..a974f8f Binary files /dev/null and b/app/assets/images/plaquettes/feuille/4.jpg differ diff --git a/app/assets/images/plaquettes/feuille/5.jpg b/app/assets/images/plaquettes/feuille/5.jpg new file mode 100644 index 0000000..712c5e9 Binary files /dev/null and b/app/assets/images/plaquettes/feuille/5.jpg differ diff --git a/app/assets/images/plaquettes/fond.jpg b/app/assets/images/plaquettes/fond.jpg new file mode 100644 index 0000000..a93af0b Binary files /dev/null and b/app/assets/images/plaquettes/fond.jpg differ diff --git a/app/assets/images/plaquettes/insectes/chrysope.jpg b/app/assets/images/plaquettes/insectes/chrysope.jpg new file mode 100755 index 0000000..3086730 Binary files /dev/null and b/app/assets/images/plaquettes/insectes/chrysope.jpg differ diff --git a/app/assets/images/plaquettes/insectes/coccinelle.jpg b/app/assets/images/plaquettes/insectes/coccinelle.jpg new file mode 100755 index 0000000..db7e6a1 Binary files /dev/null and b/app/assets/images/plaquettes/insectes/coccinelle.jpg differ diff --git a/app/assets/images/plaquettes/insectes/puceron.jpg b/app/assets/images/plaquettes/insectes/puceron.jpg new file mode 100755 index 0000000..1422e6d Binary files /dev/null and b/app/assets/images/plaquettes/insectes/puceron.jpg differ diff --git a/app/assets/images/plaquettes/insectes/texte.jpg b/app/assets/images/plaquettes/insectes/texte.jpg new file mode 100755 index 0000000..0428403 Binary files /dev/null and b/app/assets/images/plaquettes/insectes/texte.jpg differ diff --git a/app/assets/images/plaquettes/insectes_01.jpg b/app/assets/images/plaquettes/insectes_01.jpg deleted file mode 100644 index efb9f7d..0000000 Binary files a/app/assets/images/plaquettes/insectes_01.jpg and /dev/null differ diff --git a/app/assets/images/plaquettes/jardin/campagnol.jpg b/app/assets/images/plaquettes/jardin/campagnol.jpg new file mode 100755 index 0000000..0a449a9 Binary files /dev/null and b/app/assets/images/plaquettes/jardin/campagnol.jpg differ diff --git a/app/assets/images/plaquettes/jardin/humus.jpg b/app/assets/images/plaquettes/jardin/humus.jpg new file mode 100755 index 0000000..a9e6774 Binary files /dev/null and b/app/assets/images/plaquettes/jardin/humus.jpg differ diff --git a/app/assets/images/plaquettes/jardin/piege.jpg b/app/assets/images/plaquettes/jardin/piege.jpg new file mode 100755 index 0000000..4af2de2 Binary files /dev/null and b/app/assets/images/plaquettes/jardin/piege.jpg differ diff --git a/app/assets/images/plaquettes/jardin/sac.jpg b/app/assets/images/plaquettes/jardin/sac.jpg new file mode 100755 index 0000000..83e8c1b Binary files /dev/null and b/app/assets/images/plaquettes/jardin/sac.jpg differ diff --git a/app/assets/images/plaquettes/jardin/tas.jpg b/app/assets/images/plaquettes/jardin/tas.jpg new file mode 100755 index 0000000..bac94da Binary files /dev/null and b/app/assets/images/plaquettes/jardin/tas.jpg differ diff --git a/app/assets/images/plaquettes/jeu-arbre/1.jpg b/app/assets/images/plaquettes/jeu-arbre/1.jpg new file mode 100755 index 0000000..603b772 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-arbre/1.jpg differ diff --git a/app/assets/images/plaquettes/jeu-arbre/2.jpg b/app/assets/images/plaquettes/jeu-arbre/2.jpg new file mode 100755 index 0000000..77f5c82 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-arbre/2.jpg differ diff --git a/app/assets/images/plaquettes/jeu-arbre/3.jpg b/app/assets/images/plaquettes/jeu-arbre/3.jpg new file mode 100755 index 0000000..b0d4c9e Binary files /dev/null and b/app/assets/images/plaquettes/jeu-arbre/3.jpg differ diff --git a/app/assets/images/plaquettes/jeu-arbre/4.jpg b/app/assets/images/plaquettes/jeu-arbre/4.jpg new file mode 100755 index 0000000..8e8f90e Binary files /dev/null and b/app/assets/images/plaquettes/jeu-arbre/4.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/1.jpg b/app/assets/images/plaquettes/jeu-batiment/1.jpg new file mode 100755 index 0000000..7847ae0 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/1.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/2.jpg b/app/assets/images/plaquettes/jeu-batiment/2.jpg new file mode 100755 index 0000000..2108d39 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/2.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/3.jpg b/app/assets/images/plaquettes/jeu-batiment/3.jpg new file mode 100755 index 0000000..442f455 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/3.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/4.jpg b/app/assets/images/plaquettes/jeu-batiment/4.jpg new file mode 100755 index 0000000..9e002d1 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/4.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/5.jpg b/app/assets/images/plaquettes/jeu-batiment/5.jpg new file mode 100755 index 0000000..4e06e4d Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/5.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/6.jpg b/app/assets/images/plaquettes/jeu-batiment/6.jpg new file mode 100755 index 0000000..f720f3c Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/6.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/7.jpg b/app/assets/images/plaquettes/jeu-batiment/7.jpg new file mode 100755 index 0000000..74296ea Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/7.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/batiment-jeu-1.jpg b/app/assets/images/plaquettes/jeu-batiment/batiment-jeu-1.jpg new file mode 100644 index 0000000..f14adf9 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/batiment-jeu-1.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/batiment-jeu-2.jpg b/app/assets/images/plaquettes/jeu-batiment/batiment-jeu-2.jpg new file mode 100644 index 0000000..00bf8e1 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/batiment-jeu-2.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/batiment-jeu.jpg b/app/assets/images/plaquettes/jeu-batiment/batiment-jeu.jpg new file mode 100644 index 0000000..a28bd7d Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/batiment-jeu.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/batiment.jpg b/app/assets/images/plaquettes/jeu-batiment/batiment.jpg new file mode 100755 index 0000000..6df9391 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/batiment.jpg differ diff --git a/app/assets/images/plaquettes/jeu-batiment/merle.jpg b/app/assets/images/plaquettes/jeu-batiment/merle.jpg new file mode 100755 index 0000000..a952f63 Binary files /dev/null and b/app/assets/images/plaquettes/jeu-batiment/merle.jpg differ diff --git a/app/assets/images/plaquettes/logos/Logo CAPV.jpg b/app/assets/images/plaquettes/logos/Logo CAPV.jpg new file mode 100644 index 0000000..44083c5 Binary files /dev/null and b/app/assets/images/plaquettes/logos/Logo CAPV.jpg differ diff --git a/app/assets/images/plaquettes/logos/logo pic vert.png b/app/assets/images/plaquettes/logos/logo pic vert.png new file mode 100644 index 0000000..2bf6f1a Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo pic vert.png differ diff --git a/app/assets/images/plaquettes/logos/logoRA_Feader.jpg b/app/assets/images/plaquettes/logos/logoRA_Feader.jpg new file mode 100644 index 0000000..cb98d47 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logoRA_Feader.jpg differ diff --git a/app/assets/images/plaquettes/logos/logo_CAPV.jpg b/app/assets/images/plaquettes/logos/logo_CAPV.jpg new file mode 100644 index 0000000..44083c5 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_CAPV.jpg differ diff --git a/app/assets/images/plaquettes/logos/logo_feader.jpg b/app/assets/images/plaquettes/logos/logo_feader.jpg new file mode 100644 index 0000000..cb98d47 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_feader.jpg differ diff --git a/app/assets/images/plaquettes/logos/logo_leader.jpg b/app/assets/images/plaquettes/logos/logo_leader.jpg new file mode 100644 index 0000000..d24bc71 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_leader.jpg differ diff --git a/app/assets/images/plaquettes/logos/logo_longpra.jpg b/app/assets/images/plaquettes/logos/logo_longpra.jpg new file mode 100644 index 0000000..8aee557 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_longpra.jpg differ diff --git a/app/assets/images/plaquettes/logos/logo_longpra.png b/app/assets/images/plaquettes/logos/logo_longpra.png new file mode 100644 index 0000000..431bd85 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_longpra.png differ diff --git a/app/assets/images/plaquettes/logos/logo_nb.png b/app/assets/images/plaquettes/logos/logo_nb.png new file mode 100644 index 0000000..eb992f3 Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_nb.png differ diff --git a/app/assets/images/plaquettes/logos/logo_pic_vert.png b/app/assets/images/plaquettes/logos/logo_pic_vert.png new file mode 100644 index 0000000..2bf6f1a Binary files /dev/null and b/app/assets/images/plaquettes/logos/logo_pic_vert.png differ diff --git a/app/assets/images/plaquettes/mur-insectes/abeille-sol.jpg b/app/assets/images/plaquettes/mur-insectes/abeille-sol.jpg new file mode 100755 index 0000000..c361578 Binary files /dev/null and b/app/assets/images/plaquettes/mur-insectes/abeille-sol.jpg differ diff --git a/app/assets/images/plaquettes/mur-insectes/chrysope.jpg b/app/assets/images/plaquettes/mur-insectes/chrysope.jpg new file mode 100755 index 0000000..7f824dd Binary files /dev/null and b/app/assets/images/plaquettes/mur-insectes/chrysope.jpg differ diff --git a/app/assets/images/plaquettes/mur-insectes/coccinelle.jpg b/app/assets/images/plaquettes/mur-insectes/coccinelle.jpg new file mode 100755 index 0000000..074fb4c Binary files /dev/null and b/app/assets/images/plaquettes/mur-insectes/coccinelle.jpg differ diff --git a/app/assets/images/plaquettes/mur-insectes/hotel.jpg b/app/assets/images/plaquettes/mur-insectes/hotel.jpg new file mode 100755 index 0000000..4a3535b Binary files /dev/null and b/app/assets/images/plaquettes/mur-insectes/hotel.jpg differ diff --git a/app/assets/images/plaquettes/mur-insectes/perce-oreille.jpg b/app/assets/images/plaquettes/mur-insectes/perce-oreille.jpg new file mode 100755 index 0000000..4f5d645 Binary files /dev/null and b/app/assets/images/plaquettes/mur-insectes/perce-oreille.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/abeille.jpg b/app/assets/images/plaquettes/quizzs/abeille.jpg new file mode 100755 index 0000000..2de3bf2 Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/abeille.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/campagnol.jpg b/app/assets/images/plaquettes/quizzs/campagnol.jpg new file mode 100755 index 0000000..2e22eb2 Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/campagnol.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/chouette.jpg b/app/assets/images/plaquettes/quizzs/chouette.jpg new file mode 100755 index 0000000..83336b7 Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/chouette.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/fond_jardin.jpg b/app/assets/images/plaquettes/quizzs/fond_jardin.jpg new file mode 100755 index 0000000..67117a3 Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/fond_jardin.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/hirondelle.jpg b/app/assets/images/plaquettes/quizzs/hirondelle.jpg new file mode 100755 index 0000000..c2f7403 Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/hirondelle.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/lezard.jpg b/app/assets/images/plaquettes/quizzs/lezard.jpg new file mode 100755 index 0000000..c7b438d Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/lezard.jpg differ diff --git a/app/assets/images/plaquettes/quizzs/pic.jpg b/app/assets/images/plaquettes/quizzs/pic.jpg new file mode 100755 index 0000000..c01077d Binary files /dev/null and b/app/assets/images/plaquettes/quizzs/pic.jpg differ diff --git a/app/assets/images/plaquettes/vie-arbre/1.jpg b/app/assets/images/plaquettes/vie-arbre/1.jpg new file mode 100644 index 0000000..f9d15d6 Binary files /dev/null and b/app/assets/images/plaquettes/vie-arbre/1.jpg differ diff --git a/app/assets/images/plaquettes/vie-arbre/2.jpg b/app/assets/images/plaquettes/vie-arbre/2.jpg new file mode 100644 index 0000000..27d6c3c Binary files /dev/null and b/app/assets/images/plaquettes/vie-arbre/2.jpg differ diff --git a/app/assets/images/plaquettes/vie-arbre/3.jpg b/app/assets/images/plaquettes/vie-arbre/3.jpg new file mode 100644 index 0000000..594612f Binary files /dev/null and b/app/assets/images/plaquettes/vie-arbre/3.jpg differ diff --git a/app/assets/images/plaquettes/vie-arbre/4.jpg b/app/assets/images/plaquettes/vie-arbre/4.jpg new file mode 100644 index 0000000..11587c8 Binary files /dev/null and b/app/assets/images/plaquettes/vie-arbre/4.jpg differ diff --git a/app/assets/images/plaquettes/vie-arbre/5.jpg b/app/assets/images/plaquettes/vie-arbre/5.jpg new file mode 100644 index 0000000..f30f125 Binary files /dev/null and b/app/assets/images/plaquettes/vie-arbre/5.jpg differ diff --git a/app/assets/images/plaquettes/vie-sol/bacterie.jpg b/app/assets/images/plaquettes/vie-sol/bacterie.jpg new file mode 100644 index 0000000..5d89ed2 Binary files /dev/null and b/app/assets/images/plaquettes/vie-sol/bacterie.jpg differ diff --git a/app/assets/images/plaquettes/vie-sol/bousier.jpg b/app/assets/images/plaquettes/vie-sol/bousier.jpg new file mode 100755 index 0000000..4bf1a08 Binary files /dev/null and b/app/assets/images/plaquettes/vie-sol/bousier.jpg differ diff --git a/app/assets/images/plaquettes/vie-sol/champignon.jpg b/app/assets/images/plaquettes/vie-sol/champignon.jpg new file mode 100755 index 0000000..1324b97 Binary files /dev/null and b/app/assets/images/plaquettes/vie-sol/champignon.jpg differ diff --git a/app/assets/images/plaquettes/vie-sol/cloporte.jpg b/app/assets/images/plaquettes/vie-sol/cloporte.jpg new file mode 100755 index 0000000..1bd1a9d Binary files /dev/null and b/app/assets/images/plaquettes/vie-sol/cloporte.jpg differ diff --git a/app/assets/images/plaquettes/vie-sol/fourmi.jpg b/app/assets/images/plaquettes/vie-sol/fourmi.jpg new file mode 100755 index 0000000..607ba9a Binary files /dev/null and b/app/assets/images/plaquettes/vie-sol/fourmi.jpg differ diff --git a/app/assets/images/plaquettes/vie-sol/lombric.jpg b/app/assets/images/plaquettes/vie-sol/lombric.jpg new file mode 100755 index 0000000..f009e96 Binary files /dev/null and b/app/assets/images/plaquettes/vie-sol/lombric.jpg differ diff --git a/app/assets/javascripts/plaquettes.coffee b/app/assets/javascripts/plaquettes.coffee new file mode 100644 index 0000000..fae0b55 --- /dev/null +++ b/app/assets/javascripts/plaquettes.coffee @@ -0,0 +1,315 @@ +#= require jquery +#= require jquery_ujs +#= require jquery-ui +#= require ./shared/jquery.ui.touch-punch +#= require ./shared/jquery-jPuzzle + + + + +test_question = (question) -> + $(".info").hide() + $(".quizz_img").hide() + + + rep = question.find("input[type='radio']:checked").closest("div") + rep.find(".info").show() + rep.find(".quizz_img").show() + if question.find(".response input:checked")[0] + question.find(".success").show(); + question.find(".fail").hide(); + rep = true + else + question.find(".fail").show(); + question.find(".success").hide(); + rep =false + return rep + + + + +$ -> + + $("a.def").click -> + + r = "

"+$(this).html()+"

"+$(this).data("def")+"

" + + + + + $("body").append(r) + + $(".pane_hover").click -> + $(this).remove(); + + + $(document).on "click", ".receptable img", -> + + r = "

"+$(this).data("legend")+"

" + + + + + $("body").append(r) + + $(".pane_hover").click -> + $(this).remove(); + + + $("a.img").click -> + + r = "
" + + if ($(this).data("legend")) + r+= "

"+$(this).data("legend")+"

" + + if ($(this).data("desc")) + r+= "

"+$(this).data("desc")+"

" + r += "
" + + + + $("body").append(r) + + $(".pane_hover").click -> + $(this).remove(); + + $(".page").hide() + $(".page:first").show() + + $(".prev_slide").click -> + + $(this).closest(".page").hide() + $(this).closest(".page").prev(".page").show() + + + $(".next_slide").click -> + + $(this).closest(".page").hide() + $(this).closest(".page").next(".page").show() + + + + + + + + + + $(".places_jeu").each -> + $(this).find(".receptable").droppable + tolerance: "touch" + accept: (e) -> + if e.data("rep") == $(this).data("rep") + true + drop: ( event, ui ) -> + + $( this ).append(ui.draggable) + ui.draggable.attr("style", "") + + if $(this).closest(".places_jeu").find(".vignettes img").size() == 0 + $(this).closest(".places_jeu").find(".success").show() + + $(this).find(".vignettes img").draggable + #connectWith: ".receptable" + tolerance: "pointer" + revert: "invalid" + + + + + + + + + + + + $(".quizz").each -> + + $(this).find("input").change -> + test_question($(this).closest(".question")) + + + $(this).find(".fail, .success").hide() + + $(this).find(".question").hide() + $(this).find(".question:first").show() + + $(this).find(".prev").click -> + test_question($(this).closest(".question")) + $(this).closest(".question").hide() + $(this).closest(".question").prev(".question").show() + + $(this).find(".next").click -> + if test_question($(this).closest(".question")) == true + + $(this).closest(".question").fadeOut(0) + $(this).closest(".question").next(".question").fadeIn(0) + + + $(this).find(".check").click -> + test_question($(this).closest(".question")) + + + +intialize_puzzle = () -> + $(".puzzle").each -> + archive = $(this).html() + $(this).find(".piece_place").droppable + tolerance: "touch" + accept: (e) -> + if e.data("rep") == $(this).data("rep") + true + drop: ( event, ui ) -> + + $( this ).append(ui.draggable) + ui.draggable.attr("style", "") + if $(this).closest(".puzzle").find(".pieces .piece").size() == 0 + + $(this).closest(".puzzle").find(".success").show() + $(this).draggable( 'disable' ); + + + $(this).find(".piece").draggable + tolerance: "pointer" + revert: "invalid" + + $(this).find(".reset").click -> + $(this).closest(".puzzle").html archive + $(this).closest(".puzzle").find(".success").hide() + intialize_puzzle() + +intialize_arbre = () -> + archive = $(".vie-arbre.story").closest(".sortable_quizz").html() + $(".vie-arbre.story").sortable + items: 'td' + stop:() -> + + win = true + i = 0 + $(this).find("td").each -> + i = i + 1 + win = false unless i is $(this).data("order") + + if win is true + $(".success").show() + + $(".vie-arbre.story").closest(".sortable_quizz").find(".reset").click -> + $(".vie-arbre.story").closest(".sortable_quizz").html archive + intialize_arbre() + +initialize_vie_sol = () -> + + archive = $(".t_sortable").closest(".animaux_sol").html() + $(".t_sortable").sortable + items: 'tr' + stop:() -> + + win = true + i = 0 + $(this).find("tr").each -> + i = i + 1 + win = false unless i is $(this).data("order") + + if win is true + $(".success").show() + + $(".t_sortable").closest(".animaux_sol").find(".reset").click -> + $(".t_sortable").closest(".animaux_sol").html archive + initialize_vie_sol() + + + + +$(document).ready -> + + intialize_arbre() + + initialize_vie_sol() + + + + + + + + + intialize_puzzle() + + + + + #$.backstretch(["/assets/plaquettes/fond.jpg"]); + initialize_jeu_1 = -> + + $(".sortable_quizz").each -> + + element = $(this) + + html = element.find(".sortable").html() + element.find(".sortable").sortable + stop: () -> + win = true + i = 0 + element.find("img").each -> + i = i + 1 + win = false unless i is $(this).data("order") + + if win is true + element.find(".win").show() + element.find(".loose").hide() + + + element.find(".sortable").disableSelection() + + + element.find(".reset").click -> + element.find(".sortable").html html + element.find(".sortable").sortable "refresh" + element.find(".win").hide() + element.find(".loose").hide() + + initialize_jeu_2 = -> + element = $("#insectes_jeu_2") + html = element.find(".sortable").html() + element.find(".receptable").sortable + connectWith: ".labels,.receptable" + items: ".label" + tolerance: "pointer" + receive: (event, ui) -> + if $(this).children().length > 1 + child = $(this).children().not(ui.item)[0] + element.find(".labels").append child + + element.find(".receptable ul").disableSelection() + element.find(".labels").sortable + connectWith: ".receptable" + tolerance: "pointer" + items: ".label" + receive: (event, ui) -> + ui.item.attr "style", "" + + element.find(".labels").disableSelection() + element.find(".verif").bind "click", -> + win = true + i = 0 + element.find("img").each -> + i = i + 1 + win = false unless i is $(this).data("order") + + if win is true + element.find(".win").show() + element.find(".loose").hide() + else + element.find(".win").hide() + element.find(".loose").show() + + element.find(".reset").click -> + element.find(".sortable").html html + element.find(".sortable").sortable "refresh" + element.find(".win").hide() + element.find(".loose").hide() + + initialize_jeu_1() + initialize_jeu_2() diff --git a/app/assets/javascripts/plaquettes.js b/app/assets/javascripts/plaquettes.js deleted file mode 100644 index 084949a..0000000 --- a/app/assets/javascripts/plaquettes.js +++ /dev/null @@ -1,135 +0,0 @@ -//= require jquery -//= require jquery_ujs -//= require jquery-ui - - - - - -$(document).ready(function(){ - - function initialize_jeu_1(){ - var element = $("#insectes_jeu_1") - - var html = element.find(".sortable").html(); - - element.find(".sortable").sortable(); - element.find(".sortable").disableSelection(); - - element.find(".verif").bind("click", function(){ - - var win = true; - - var i = 0; - - element.find("img").each(function(){ - i = i+1; - if(i != $(this).data("order")){ - win = false; - } - - - - }); - if(win == true){ - element.find(".win").show(); - element.find(".loose").hide(); - }else{ - element.find(".win").hide(); - element.find(".loose").show(); - } - }); - - - - element.find(".reset").click(function(){ - element.find(".sortable").html(html); - element.find(".sortable").sortable("refresh"); - element.find(".win").hide(); - element.find(".loose").hide(); - - }); - - } - - - function initialize_jeu_2(){ - var element = $("#insectes_jeu_2") - - var html = element.find(".sortable").html(); - - - element.find(".receptable").sortable({ - connectWith: '.labels,.receptable', - items: '.label', - tolerance:"pointer", - receive: function(event, ui) { - - if ($(this).children().length > 1) { - var child = $(this).children().not(ui.item)[0] - - element.find(".labels").append(child); - - } - } - }); - element.find(".receptable ul").disableSelection(); - - element.find(".labels").sortable({ - connectWith: '.receptable', - tolerance:"pointer", - items: '.label', - receive: function(event, ui){ui.item.attr('style','');} - - - - }); - element.find(".labels").disableSelection(); - - element.find(".verif").bind("click", function(){ - - var win = true; - - var i = 0; - - element.find("img").each(function(){ - i = i+1; - if(i != $(this).data("order")){ - win = false; - } - - - - }); - if(win == true){ - element.find(".win").show(); - element.find(".loose").hide(); - }else{ - element.find(".win").hide(); - element.find(".loose").show(); - } - }); - - - - element.find(".reset").click(function(){ - element.find(".sortable").html(html); - element.find(".sortable").sortable("refresh"); - element.find(".win").hide(); - element.find(".loose").hide(); - - }); - - } - - initialize_jeu_1(); - initialize_jeu_2(); - - - - -}); - - - - diff --git a/app/assets/javascripts/shared/jquery-jPuzzle.js b/app/assets/javascripts/shared/jquery-jPuzzle.js new file mode 100644 index 0000000..1002538 --- /dev/null +++ b/app/assets/javascripts/shared/jquery-jPuzzle.js @@ -0,0 +1,383 @@ +/*jPuzzle +jQuery plugin (http://jquery.com/) +jQuery => Copyright 2010, John Resig +jPuzzle => Copyright 2010, Adrien Guéret +Dual licensed under the MIT or GPL Version 2 licenses. +http://jquery.org/license +Last update: 26/07/2011*/ +(function($) +{ + $.fn.jPuzzle=function(options) + { + var defaults= + { + 'rows': 5, + 'columns': 5, + 'help': true, + 'fixed': true, + 'showHelpButton': true, + 'textPlayButton': 'Jouer !', + 'textHelpButtonShow': "Voir l'image finale", + 'textHelpButtonHide': "Cacher l'image finale", + 'onstart': null, + 'onend': null + }; + + var parameters=$.extend(defaults,options); + + parameters.rows=Math.max(1,parameters.rows); + parameters.columns=Math.max(1,parameters.columns); + + //Format time in seconds to HH"MM'SS + function formatTime(s) + { + s=parseInt(s,10); + + var h=Math.floor(s/3600); + s-=h*3600; + var formatTime=(h>9?h:'0'+h)+'"'; + + var m=Math.floor(s/60); + s-=m*60; + formatTime+=(m>9?m:'0'+m)+'\''; + + return formatTime+((s>9?s:'0'+s)); + } + + //Function waiting for the loading of the image + function loading() + { + if($(this).is('img')) + { + //If the image is not loaded, we have to wait for it + if(this.complete) + { + init($(this)); + } + else + { + $(this).load(function() + { + init($(this)); + }); + } + } + } + + function init(obj) + { + //We store the image dimensions... + var width=obj.width(); + var height=obj.height(); + + //... and the source of the image + var src=obj.attr('src'); + + //We calculate the pieces dimensions + var pieceWidth=width/parameters.columns; + var pieceHeight=height/parameters.rows; + + //And the height of the box containing all the pieces + var sizeBox=pieceHeight>height/2?pieceHeight:height/2; + + //The main container + var game=$('').css( + { + //'width': width+'px', + 'display': 'inline-block', + 'position': 'relative' + }).addClass('jPuzzle-game').insertAfter(obj); + + //The tag containing the puzzle + var puzzle=$('').css( + { + 'width': width+'px', + 'height': height+'px', + 'display': 'inline-block', + 'position': 'relative' + }).addClass('jPuzzle-container').appendTo(game); + + //The tag displaying the image as a background + var image=$('').css( + { + 'width': width+'px', + 'height': height+'px', + 'opacity': 1, + 'background-image': 'url("'+src+'")', + 'display': 'inline-block' + }).addClass('jPuzzle-image').appendTo(puzzle); + + //Box where the pieces will be generated + var box=$('').css( + { + //'width': width+'px', + 'minHeight': sizeBox+'px', + 'display': 'inline-block', + 'position': 'absolute', + "bottom":"-170px", + "left":"100px" + }).addClass('jPuzzle-box').droppable( + { + 'accept': '.jPuzzle-piece', + 'addClasses': false, + 'drop': function(event,ui) + { + var piece=ui.draggable; + var lastLocation=$.data(piece[0],'lastLocation'); + if(lastLocation[0]!=this) + { + /* If the piece comes from a puzzle location, + we have to adjust its position */ + piece.appendTo($(this)); + piece.css( + { + 'left': '+='+lastLocation.position().left, + 'top':(piece.position().top+lastLocation.position().top-puzzle.outerHeight())+'px' + }); + $.data(piece[0],'lastLocation',$(this)); + } + } + }).hide().insertAfter(puzzle); + + //Foot bar + var infos=$('').css( + { + 'width': width+'px', + 'display': 'inline-block' + }).addClass('jPuzzle-infos').insertAfter(box); + + //The data-time attribute will contain the elapsed time + var infosTime=$('').addClass('jPuzzle-time').attr('data-time',0).hide().appendTo(infos); + + var playButton=$('').val(parameters.textPlayButton).addClass('jPuzzle-playButton').click(function() + { + startGame(); + $(this).hide(); + }).appendTo(infos); + + if(parameters.showHelpButton) + { + var helpButton=$('').val(parameters.textHelpButtonShow).addClass('jPuzzle-helpButton').toggle(function() + { + //The final image is not displayed, we show it! + $(this).val(parameters.textHelpButtonHide).attr('disabled',true); + image.animate( + { + 'opacity': 1 + },'slow',function() + { + helpButton.removeAttr('disabled'); + }); + + //We hide the pieces of the puzzle to avoid the cheating + $('.jPuzzle-piece').hide(); + },function() + { + //The final image is displayed, we hide it! + $(this).val(parameters.textHelpButtonShow).attr('disabled',true); + + image.animate( + { + 'opacity': (parameters.help?0.1:0) + },'slow',function() + { + helpButton.removeAttr('disabled'); + }); + + $('.jPuzzle-piece').show(); + }).hide().appendTo(infos); + } + + //And we remove the initial image! + obj.remove(); + + var timer; + function startGame() + { + if(parameters.onstart) + { + parameters.onstart(game); + } + + box.show(); + infosTime.show(); + infosTime.text('00"00\'00'); + + if(parameters.showHelpButton) + { + helpButton.show(); + } + + image.animate( + { + 'opacity': (parameters.help?0.1:0) + },'slow'); + + for(var i=0;i').addClass('jPuzzle-piece') + .attr('data-num',i+'_'+j).css( + { + 'width': pieceWidth+'px', + 'height': pieceHeight+'px', + 'display': 'block', + 'left': Math.floor((Math.random()*(maxX+1)))+'px', + 'top': Math.floor((Math.random()*(maxY+1)))+'px', + 'z-index': Math.floor((Math.random()*(10))+1), + 'background-image': 'url("'+src+'")', + 'cursor': 'move', + 'background-position': (-j*pieceWidth)+'px '+(-i*pieceHeight)+'px', + 'position': 'absolute' + }).draggable( + { + 'start': function(event,ui) + { + /* If the piece is already on its + good location, we stop the dragging */ + if($.data(this,'ok') && parameters.fixed) + { + return false; + } + + //Otherwise, we put the piece in front of the others + var zIndex=0; + game.find('.jPuzzle-piece').each(function() + { + var x=parseInt($(this).css('z-index')); + zIndex=Math.max(x,zIndex); + }); + $(this).css('z-index',zIndex+1); + }, + 'revert': 'invalid', + 'containment': game + }).appendTo(box); + + $.data(piece[0],'ok',false); + $.data(piece[0],'lastLocation',box); + + var location=$('').addClass('jPuzzle-location') + .attr('data-num',i+'_'+j).css( + { + 'width': pieceWidth+'px', + 'height': pieceHeight+'px', + 'left': j*pieceWidth+'px', + 'top': i*pieceHeight+'px', + 'display': 'block', + 'position': 'absolute' + }).droppable( + { + 'accept': function(ui) + { + /* We accept only puzzle pieces, and only if the location is empty + We also check if the piece and the location are in the same puzzle game */ + return (ui.hasClass('jPuzzle-piece') && $(this).is(':empty') && $(this).parents('.jPuzzle-game')[0]==ui.parents('.jPuzzle-game')[0]); + }, + 'addClasses': false, + 'hoverClass': 'jPuzzle-location-hover', + 'drop': function(event,ui) + { + var obj=$(this); + + ui.draggable.appendTo(obj); + $.data(ui.draggable[0],'lastLocation',obj); + + ui.draggable.css( + { + 'left': '0px', + 'top': '0px' + }); + + /* If piece and location have the same data-num attribute, + then the piece is correctly placed !*/ + $.data(ui.draggable[0],'ok',false); + if(obj.attr('data-num')==ui.draggable.attr('data-num')) + { + $.data(ui.draggable[0],'ok',true); + + /* If we can't remove a piece which is correctly + placed, we can apply a small effect on it*/ + if(parameters.fixed) + { + /* We modify the cursor to indicate + the piece is not longer draggable */ + ui.draggable.css('cursor','default'); + + /* This span will add a "flash + effect" on the piece */ + $('').css( + { + 'position': 'absolute', + 'left': '0px', + 'top': '0px', + 'display':'block', + 'width': '100%', + 'height': '100%', + 'background-color': '#fff' + }).appendTo(ui.draggable) + .fadeOut(2000,function() + { + $(this).remove(); + }); + } + + //The player has correctly placed one piece: what about the others? + var total=0; + game.find('.jPuzzle-piece').each(function() + { + if(!$.data(this,'ok')) + { + return false; + } + total++; + }); + if(total==parameters.rows*parameters.columns) + { + endGame(); + } + } + } + }).appendTo(puzzle); + } + } + + timer=setInterval(function() + { + infosTime.attr('data-time',parseInt(infosTime.attr('data-time'),10)+1); + infosTime.text(formatTime(infosTime.attr('data-time'))); + },1000); + } + + function endGame() + { + //We stop the timer + clearInterval(timer); + var time=parseInt(infosTime.attr('data-time'),10); + + //We set the puzzle to its initial state + box.hide(); + game.find('.jPuzzle-piece,.jPuzzle-location').remove(); + image.css('opacity','1'); + if(parameters.showHelpButton) + { + helpButton.hide(); + } + infosTime.hide().attr('data-time',0); + playButton.show(); + + //We eventually call a function defined by the user + if(parameters.onend) + { + //We send to this function three useful variables + parameters.onend(game,time,formatTime(time)); + } + } + } + + return this.each(loading); + }; +})(jQuery); \ No newline at end of file diff --git a/app/assets/javascripts/shared/jquery.backstretch.js b/app/assets/javascripts/shared/jquery.backstretch.js new file mode 100644 index 0000000..e346903 --- /dev/null +++ b/app/assets/javascripts/shared/jquery.backstretch.js @@ -0,0 +1,364 @@ +/* + * Backstretch + * http://srobbin.com/jquery-plugins/backstretch/ + * + * Copyright (c) 2012 Scott Robbin + * Licensed under the MIT license. + */ + +;(function ($, window, undefined) { + 'use strict'; + + /* PLUGIN DEFINITION + * ========================= */ + + $.fn.backstretch = function (images, options) { + // We need at least one image + if (images === undefined || images.length === 0) { + $.error("No images were supplied for Backstretch"); + } + + /* + * Scroll the page one pixel to get the right window height on iOS + * Pretty harmless for everyone else + */ + if ($(window).scrollTop() === 0 ) { + window.scrollTo(0, 0); + } + + return this.each(function () { + var $this = $(this) + , obj = $this.data('backstretch'); + + // If we've already attached Backstretch to this element, remove the old instance. + if (obj) { + // Merge the old options with the new + options = $.extend(obj.options, options); + + // Remove the old instance + obj.destroy(true); + } + + obj = new Backstretch(this, images, options); + $this.data('backstretch', obj); + }); + }; + + // If no element is supplied, we'll attach to body + $.backstretch = function (images, options) { + // Return the instance + return $('body') + .backstretch(images, options) + .data('backstretch'); + }; + + // Custom selector + $.expr[':'].backstretch = function(elem) { + return $(elem).data('backstretch') !== undefined; + }; + + /* DEFAULTS + * ========================= */ + + $.fn.backstretch.defaults = { + centeredX: true // Should we center the image on the X axis? + , centeredY: true // Should we center the image on the Y axis? + , duration: 5000 // Amount of time in between slides (if slideshow) + , fade: 0 // Speed of fade transition between slides + }; + + /* STYLES + * + * Baked-in styles that we'll apply to our elements. + * In an effort to keep the plugin simple, these are not exposed as options. + * That said, anyone can override these in their own stylesheet. + * ========================= */ + var styles = { + wrap: { + left: 0 + , top: 0 + , overflow: 'hidden' + , margin: 0 + , padding: 0 + , height: '100%' + , width: '100%' + , zIndex: -999999 + } + , img: { + position: 'absolute' + , display: 'none' + , margin: 0 + , padding: 0 + , border: 'none' + , width: 'auto' + , height: 'auto' + , maxWidth: 'none' + , zIndex: -999999 + } + }; + + /* CLASS DEFINITION + * ========================= */ + var Backstretch = function (container, images, options) { + this.options = $.extend({}, $.fn.backstretch.defaults, options || {}); + + /* In its simplest form, we allow Backstretch to be called on an image path. + * e.g. $.backstretch('/path/to/image.jpg') + * So, we need to turn this back into an array. + */ + this.images = $.isArray(images) ? images : [images]; + + // Preload images + $.each(this.images, function () { + $('')[0].src = this; + }); + + // Convenience reference to know if the container is body. + this.isBody = container === document.body; + + /* We're keeping track of a few different elements + * + * Container: the element that Backstretch was called on. + * Wrap: a DIV that we place the image into, so we can hide the overflow. + * Root: Convenience reference to help calculate the correct height. + */ + this.$container = $(container); + this.$root = this.isBody ? supportsFixedPosition ? $(window) : $(document) : this.$container; + + // Don't create a new wrap if one already exists (from a previous instance of Backstretch) + var $existing = this.$container.children(".backstretch").first(); + this.$wrap = $existing.length ? $existing : $('
').css(styles.wrap).appendTo(this.$container); + + // Non-body elements need some style adjustments + if (!this.isBody) { + // If the container is statically positioned, we need to make it relative, + // and if no zIndex is defined, we should set it to zero. + var position = this.$container.css('position') + , zIndex = this.$container.css('zIndex'); + + this.$container.css({ + position: position === 'static' ? 'relative' : position + , zIndex: zIndex === 'auto' ? 0 : zIndex + , background: 'none' + }); + + // Needs a higher z-index + this.$wrap.css({zIndex: -999998}); + } + + // Fixed or absolute positioning? + this.$wrap.css({ + position: this.isBody && supportsFixedPosition ? 'fixed' : 'absolute' + }); + + // Set the first image + this.index = 0; + this.show(this.index); + + // Listen for resize + $(window).on('resize.backstretch', $.proxy(this.resize, this)) + .on('orientationchange.backstretch', $.proxy(function () { + // Need to do this in order to get the right window height + if (this.isBody && window.pageYOffset === 0) { + window.scrollTo(0, 1); + this.resize(); + } + }, this)); + }; + + /* PUBLIC METHODS + * ========================= */ + Backstretch.prototype = { + resize: function () { + try { + var bgCSS = {left: 0, top: 0} + , rootWidth = this.isBody ? this.$root.width() : this.$root.innerWidth() + , bgWidth = rootWidth + , rootHeight = this.isBody ? ( window.innerHeight ? window.innerHeight : this.$root.height() ) : this.$root.innerHeight() + , bgHeight = bgWidth / this.$img.data('ratio') + , bgOffset; + + // Make adjustments based on image ratio + if (bgHeight >= rootHeight) { + bgOffset = (bgHeight - rootHeight) / 2; + if(this.options.centeredY) { + bgCSS.top = '-' + bgOffset + 'px'; + } + } else { + bgHeight = rootHeight; + bgWidth = bgHeight * this.$img.data('ratio'); + bgOffset = (bgWidth - rootWidth) / 2; + if(this.options.centeredX) { + bgCSS.left = '-' + bgOffset + 'px'; + } + } + + this.$wrap.css({width: rootWidth, height: rootHeight}) + .find('img:not(.deleteable)').css({width: bgWidth, height: bgHeight}).css(bgCSS); + } catch(err) { + // IE7 seems to trigger resize before the image is loaded. + // This try/catch block is a hack to let it fail gracefully. + } + + return this; + } + + // Show the slide at a certain position + , show: function (index) { + // Validate index + if (Math.abs(index) > this.images.length - 1) { + return; + } else { + this.index = index; + } + + // Vars + var self = this + , oldImage = self.$wrap.find('img').addClass('deleteable') + , evt = $.Event('backstretch.show', { + relatedTarget: self.$container[0] + }); + + // Pause the slideshow + clearInterval(self.interval); + + // New image + self.$img = $('') + .css(styles.img) + .bind('load', function (e) { + var imgWidth = this.width || $(e.target).width() + , imgHeight = this.height || $(e.target).height(); + + // Save the ratio + $(this).data('ratio', imgWidth / imgHeight); + + // Show the image, then delete the old one + // "speed" option has been deprecated, but we want backwards compatibilty + $(this).fadeIn(self.options.speed || self.options.fade, function () { + oldImage.remove(); + + // Resume the slideshow + if (!self.paused) { + self.cycle(); + } + + // Trigger the event + self.$container.trigger(evt, self); + }); + + // Resize + self.resize(); + }) + .appendTo(self.$wrap); + + // Hack for IE img onload event + self.$img.attr('src', self.images[index]); + return self; + } + + , next: function () { + // Next slide + return this.show(this.index < this.images.length - 1 ? this.index + 1 : 0); + } + + , prev: function () { + // Previous slide + return this.show(this.index === 0 ? this.images.length - 1 : this.index - 1); + } + + , pause: function () { + // Pause the slideshow + this.paused = true; + return this; + } + + , resume: function () { + // Resume the slideshow + this.paused = false; + this.next(); + return this; + } + + , cycle: function () { + // Start/resume the slideshow + if(this.images.length > 1) { + // Clear the interval, just in case + clearInterval(this.interval); + + this.interval = setInterval($.proxy(function () { + // Check for paused slideshow + if (!this.paused) { + this.next(); + } + }, this), this.options.duration); + } + return this; + } + + , destroy: function (preserveBackground) { + // Stop the resize events + $(window).off('resize.backstretch orientationchange.backstretch'); + + // Clear the interval + clearInterval(this.interval); + + // Remove Backstretch + if(!preserveBackground) { + this.$wrap.remove(); + } + this.$container.removeData('backstretch'); + } + }; + + /* SUPPORTS FIXED POSITION? + * + * Based on code from jQuery Mobile 1.1.0 + * http://jquerymobile.com/ + * + * In a nutshell, we need to figure out if fixed positioning is supported. + * Unfortunately, this is very difficult to do on iOS, and usually involves + * injecting content, scrolling the page, etc.. It's ugly. + * jQuery Mobile uses this workaround. It's not ideal, but works. + * + * Modified to detect IE6 + * ========================= */ + + var supportsFixedPosition = (function () { + var ua = navigator.userAgent + , platform = navigator.platform + // Rendering engine is Webkit, and capture major version + , wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ) + , wkversion = !!wkmatch && wkmatch[ 1 ] + , ffmatch = ua.match( /Fennec\/([0-9]+)/ ) + , ffversion = !!ffmatch && ffmatch[ 1 ] + , operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ) + , omversion = !!operammobilematch && operammobilematch[ 1 ] + , iematch = ua.match( /MSIE ([0-9]+)/ ) + , ieversion = !!iematch && iematch[ 1 ]; + + return !( + // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5) + ((platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534) || + + // Opera Mini + (window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]") || + (operammobilematch && omversion < 7458) || + + //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2) + (ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533) || + + // Firefox Mobile before 6.0 - + (ffversion && ffversion < 6) || + + // WebOS less than 3 + ("palmGetResource" in window && wkversion && wkversion < 534) || + + // MeeGo + (ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1) || + + // IE6 + (ieversion && ieversion <= 6) + ); + }()); + +}(jQuery, window)); \ No newline at end of file diff --git a/app/assets/javascripts/shared/jquery.ui.touch-punch.js b/app/assets/javascripts/shared/jquery.ui.touch-punch.js new file mode 100644 index 0000000..2766f41 --- /dev/null +++ b/app/assets/javascripts/shared/jquery.ui.touch-punch.js @@ -0,0 +1,160 @@ +/*! + * jQuery UI Touch Punch 0.2.2 + * + * Copyright 2011, Dave Furfero + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Depends: + * jquery.ui.widget.js + * jquery.ui.mouse.js + */ +(function ($) { + + // Detect touch support + $.support.touch = 'ontouchend' in document; + + // Ignore browsers without touch support + if (!$.support.touch) { + return; + } + + var mouseProto = $.ui.mouse.prototype, + _mouseInit = mouseProto._mouseInit, + touchHandled; + + /** + * Simulate a mouse event based on a corresponding touch event + * @param {Object} event A touch event + * @param {String} simulatedType The corresponding mouse event + */ + function simulateMouseEvent (event, simulatedType) { + + // Ignore multi-touch events + if (event.originalEvent.touches.length > 1) { + return; + } + + event.preventDefault(); + + var touch = event.originalEvent.changedTouches[0], + simulatedEvent = document.createEvent('MouseEvents'); + + // Initialize the simulated mouse event using the touch event's coordinates + simulatedEvent.initMouseEvent( + simulatedType, // type + true, // bubbles + true, // cancelable + window, // view + 1, // detail + touch.screenX, // screenX + touch.screenY, // screenY + touch.clientX, // clientX + touch.clientY, // clientY + false, // ctrlKey + false, // altKey + false, // shiftKey + false, // metaKey + 0, // button + null // relatedTarget + ); + + // Dispatch the simulated event to the target element + event.target.dispatchEvent(simulatedEvent); + } + + /** + * Handle the jQuery UI widget's touchstart events + * @param {Object} event The widget element's touchstart event + */ + mouseProto._touchStart = function (event) { + + var self = this; + + // Ignore the event if another widget is already being handled + if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) { + return; + } + + // Set the flag to prevent other widgets from inheriting the touch event + touchHandled = true; + + // Track movement to determine if interaction was a click + self._touchMoved = false; + + // Simulate the mouseover event + simulateMouseEvent(event, 'mouseover'); + + // Simulate the mousemove event + simulateMouseEvent(event, 'mousemove'); + + // Simulate the mousedown event + simulateMouseEvent(event, 'mousedown'); + }; + + /** + * Handle the jQuery UI widget's touchmove events + * @param {Object} event The document's touchmove event + */ + mouseProto._touchMove = function (event) { + + // Ignore event if not handled + if (!touchHandled) { + return; + } + + // Interaction was not a click + this._touchMoved = true; + + // Simulate the mousemove event + simulateMouseEvent(event, 'mousemove'); + }; + + /** + * Handle the jQuery UI widget's touchend events + * @param {Object} event The document's touchend event + */ + mouseProto._touchEnd = function (event) { + + // Ignore event if not handled + if (!touchHandled) { + return; + } + + // Simulate the mouseup event + simulateMouseEvent(event, 'mouseup'); + + // Simulate the mouseout event + simulateMouseEvent(event, 'mouseout'); + + // If the touch interaction did not move, it should trigger a click + if (!this._touchMoved) { + + // Simulate the click event + simulateMouseEvent(event, 'click'); + } + + // Unset the flag to allow other widgets to inherit the touch event + touchHandled = false; + }; + + /** + * A duck punch of the $.ui.mouse _mouseInit method to support touch events. + * This method extends the widget with bound touch event handlers that + * translate touch events to mouse events and pass them to the widget's + * original mouse event handling methods. + */ + mouseProto._mouseInit = function () { + + var self = this; + + // Delegate the touch handlers to the widget's element + self.element + .bind('touchstart', $.proxy(self, '_touchStart')) + .bind('touchmove', $.proxy(self, '_touchMove')) + .bind('touchend', $.proxy(self, '_touchEnd')); + + // Call the original $.ui.mouse init method + _mouseInit.call(self); + }; + +})(jQuery); \ No newline at end of file diff --git a/app/assets/stylesheets/admin.css.less b/app/assets/stylesheets/admin.css.less index 1c09aa6..2e61763 100644 --- a/app/assets/stylesheets/admin.css.less +++ b/app/assets/stylesheets/admin.css.less @@ -1,3 +1,4 @@ +@import "./vendor/framework/variables.less"; @import "./vendor/framework/bootstrap.less"; @import "./vendor/fontawesome/font-awesome"; diff --git a/app/assets/stylesheets/plaquettes.css.less b/app/assets/stylesheets/plaquettes.css.less new file mode 100644 index 0000000..75e0a4c --- /dev/null +++ b/app/assets/stylesheets/plaquettes.css.less @@ -0,0 +1,493 @@ + +@import "./vendor/framework/variables2.less"; +@import "./vendor/framework/bootstrap.less"; +@import "./vendor/fontawesome/font-awesome"; + + +.pane_hover{ + +position:absolute; +z-index:2000; +top:0; +left:0; +right:0; +bottom:0; +background:rgba(250,250,250,0.95); +text-align:center; +img{ +max-width:90%; +margin-top:30px; +max-height:600px; + +} + +h3{ +font-size:1.8em; + +} + +p{ +font-size:1.5em; +} +} + + + +.prev_slide,.next_slide{ + +color:white; +font-size:30px; +padding:10px 20px; +background:rgba(0,0,0,0.9); +position:absolute; +bottom:10px; +cursor:pointer; +text-align:right; + + +} + +.next_slide{ + +border-radius:30px 0px 0px 0px; +bottom:0px; +right:0px; + +} + +.prev_slide{ +border-radius:0px 30px 0px 0px; +text-align:left; +bottom:0px; +left:0px; + +} + + +.places_jeu{ +position:relative; + +.success{ +color:green; +text-align:center; +display:none; + +} + .img{ + position:relative; + + .receptable{ + position:absolute; + width:40px; + height:40px; + border-radius:50%; + background:rgb(230, 230, 230); + box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 5px rgba(0,0,0,.5); + border:2px solid rgba(82,82,82,1); + text-align:center; + + img{ + max-width:140px; + max-height:140px; + position:relative; + box-shadow:0 1px 5px rgba(0,0,0,.5); + box-sizing:border-box; + border:4px solid white; + top:-100%; + left:-100%; + + + + + + } + + } + + } + .vignettes{ + position:absolute; + right:1em; + width:450px; + top:1em; + height:100px; + + img{ + height:93px; + } + } + + +} +.jPuzzle-time{ +display:none !important; + +} +#results +{ + + text-align: center; + + + + margin-top:3em; + color:green; +} + +p, h2 +{ + text-align: center; +} + + +.content{ + +padding:1em; + +} + +.quizz{ +.quizz_answer{ +margin:1em 0; + +} +label{ + + +} +input[type="radio"] { + position:absolute; + opacity: 0; + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; +} +input[type="radio"] + label { + position:relative; + padding: 0 0 0 25px; + font-size: 20px; + line-height: 20px; +} +input[type="radio"] + label:before { + content:""; + display:block; + position:absolute; + top:2px; + height: 20px; + width: 20px; + background: white; + border: 1px solid gray; + box-shadow: inset 0px 0px 0px 2px white; + -webkit-box-shadow: inset 0px 0px 0px 2px white; + -moz-box-shadow: inset 0px 0px 0px 2px white; + -o-box-shadow: inset 0px 0px 0px 2px white; + + border-radius: 50%; +} +input[type="radio"]:checked + label:before { + background: rgba(74,129,233,1); +} + + +.question { +p{ +text-align:left; +} +*{ +font-size:1.2em !important; +} + +h3{ +font-size:1.7em !important; +line-height:1.3em; +margin-bottom:0.7em; +} +} +.check_place{ +text-align:center; +position:absolute; +bottom:1em; +left:0px; +right:0px; +} +border: 1px solid white; +min-height:600px; +padding:1em; +padding-right:2em; +position:relative; +margin:auto; + +.quizz_ill{ + position:absolute;top:20px;max-width:470px;right:-530px;background: rgba(250,250,250,0.8); + padding:10px; + img{ + max-height:500px; + } +} + + +.quizz_img{ + position:absolute;top:20px;max-width:470px;right:-530px;background: rgba(250,250,250,0.8); + padding:10px; + img{ + max-height:500px; + } +} + + +.prev{ +background:rgba(52,52,52,1) !important; +color:white !important; +position:absolute; +bottom:1em; +left:1em; +height:50px; +font-size:35px !important; +padding-top:10px; +border-radius:50%; +text-align:center; +width:50px; +box-sizing:border-box; +} + +.next{ +background:rgba(52,52,52,1) !important; +color:white !important; +height:50px; +font-size:35px !important; +padding-top:10px; + +text-align:center; +width:50px; +box-sizing:border-box; +position:absolute; +bottom:1em; +right:1em; + +border-radius:50%; +} + +.info{ +display:none; +color:red; + +} + +.response{ + +.info{ +color:green; +} +} + +.success, .fail{ +position:absolute; +bottom:4em; +text-align:center; +left:1em; +right:1em; +} +.success{ +color:green; + +} + +.fail{ +color:red; +} + +} + +.page{ + + + +position:absolute; +top:0; +left:0; +bottom:0px; +right:0px; +box-shadow:0 0 5px rgba(0,0,0,0.5); +background:white; + +//width:1024px; +//height:768px; + + +} +label{ +display:inline; +} +#overlay{ +cursor:pointer; + +} +.navbar{ + +.pull-right{ +margin-right:5px; +} +a{ +color:white !important; +&:hover{ +text-decoration:none !important; +} +} +} +#logos{ +margin:30px; +margin-top:10px; +border-radius:5px; + + +} +.nav-stacked { +margin:30px; +a{ +background:white; + +} + +} + .header{ + padding:10px; + + a{ + display:inline-block; + padding:5px; + text-decoration:none; + } + } + + + + #main{ + font-size:130%; + .btn{ + font-family:"Comic sans ms" + } + + .content{ + + } + + margin:auto; + a{ + color: #5890CD; + text-decoration:none; + + &:hover{ + text-decoration:underline; + } + } + table{ + border-collapse:collapse; + td{ + min-width:60px; + + + } + td, th{ + border: 1px solid #c9c9c9; + padding:5px; + text-align:left; + } + } + + } + body{ + font-family: "Helvetica", "Verdana"; + font-weight:100; + line-height:2.5em; + color:#303030; + padding:0px; + margin:0px; + font-size:12px; + +h3{ + + font-family:Futura; + font-size:18px;} + + h1{ + + font-family:"Architects Daughter"; + color:rgba(0,0,0,0.9); + font-size:27px; + font-weight:100; + + } + } + + #footer{ + + } + +#insectes_jeu_2{ + .labels{ + min-height:100px; + + .label{ + background:#555555; + display:inline-block; + margin-left:5px; + margin-bottom:5px; + padding:0.5em 1em; + color:white; + border-radius:1.2em; + + + + } + + } + .image{ + float:left; + width:300px; + height:200px; + padding:0em; + padding-bottom:2em !important; + + + img{ + max-width:100%; + max-height:100%; + } + position:relative; + text-align:center; + padding-bottom:1em; + + .receptable{ + border:1px solid black; + + .label{ + text-align:center; + position:absolute; + padding-bottom:0.5em; + bottom:0px; + left:0px; + right:0px; + } + + position:absolute; + top:0px; + bottom:0px; + left:0px; + right:0px; + + } + } + +} +#logos{ +text-align:center; +background:white; +padding:0.5em 0; +img{ +max-height:120px; +max-width:220px; +margin:0px 1em; +} + +} + diff --git a/app/assets/stylesheets/plaquettes.css.scss b/app/assets/stylesheets/plaquettes.css.scss deleted file mode 100644 index 2183d2d..0000000 --- a/app/assets/stylesheets/plaquettes.css.scss +++ /dev/null @@ -1,109 +0,0 @@ -/* - - *= require_self - - */ - - h3{ - margin-top:6em; - border-bottom:1px dotted #b0cf81; - padding-bottom:0.2em; - - } - #main{ - padding:1em; -max-width:1024px; - margin:auto; - a{ - color: #5890CD; - text-decoration:none; - - &:hover{ - text-decoration:underline; - } - } - table{ - border-collapse:collapse; - td{ - min-width:60px; - - - } - td, th{ - border: 1px solid #c9c9c9; - padding:5px; - text-align:left; - } - } - - } - body{ - font-family: "Lucida Grande", "Verdana"; - - color:#303030; - padding:0px; - margin:0px; - } - - #footer{ - - } - -#insectes_jeu_2{ - .labels{ - min-height:100px; - - .label{ - background:#555555; - display:inline-block; - margin-left:5px; - margin-bottom:5px; - padding:0.5em 1em; - color:white; - border-radius:1.2em; - - - - } - - } - .image{ - float:left; - width:300px; - height:200px; - padding:0em; - padding-bottom:2em !important; - - - img{ - max-width:100%; - max-height:100%; - } - position:relative; - text-align:center; - padding-bottom:1em; - - .receptable{ - border:1px solid black; - - .label{ - text-align:center; - position:absolute; - padding-bottom:0.5em; - bottom:0px; - left:0px; - right:0px; - } - - position:absolute; - top:0px; - bottom:0px; - left:0px; - right:0px; - - } - } - -} - - diff --git a/app/assets/stylesheets/vendor/framework/bootstrap.less b/app/assets/stylesheets/vendor/framework/bootstrap.less index 9f446aa..8f5098f 100755 --- a/app/assets/stylesheets/vendor/framework/bootstrap.less +++ b/app/assets/stylesheets/vendor/framework/bootstrap.less @@ -9,7 +9,7 @@ */ // Core variables and mixins -@import "variables.less"; // Modify this for custom colors, font-sizes, etc +//@import "variables.less"; // Modify this for custom colors, font-sizes, etc @import "mixins.less"; // CSS Reset @@ -66,4 +66,4 @@ @import "slider.less"; -@import "responsive.less"; + diff --git a/app/assets/stylesheets/vendor/framework/responsive.less b/app/assets/stylesheets/vendor/framework/responsive.less index 9e5f9b1..e80fc6c 100755 --- a/app/assets/stylesheets/vendor/framework/responsive.less +++ b/app/assets/stylesheets/vendor/framework/responsive.less @@ -18,7 +18,7 @@ // ------------------------- // Required since we compile the responsive stuff separately -@import "variables.less"; // Modify this for custom colors, font-sizes, etc +//@import "variables.less"; // Modify this for custom colors, font-sizes, etc @import "mixins.less"; diff --git a/app/assets/stylesheets/vendor/framework/variables2.less b/app/assets/stylesheets/vendor/framework/variables2.less new file mode 100755 index 0000000..55e6a68 --- /dev/null +++ b/app/assets/stylesheets/vendor/framework/variables2.less @@ -0,0 +1,301 @@ +// +// Variables +// -------------------------------------------------- + + +// Global values +// -------------------------------------------------- + + +// Grays +// ------------------------- +@black: #000; +@grayDarker: #222; +@grayDark: #333; +@gray: #555; +@grayLight: #999; +@grayLighter: #eee; +@white: #fff; + + +// Accent colors +// ------------------------- +@blue: #049cdb; +@blueDark: #0064cd; +@green: #46a546; +@red: #9d261d; +@yellow: #ffc40d; +@orange: #f89406; +@pink: #c3325f; +@purple: #7a43b6; + + +// Scaffolding +// ------------------------- +@bodyBackground: @white; +@textColor: @grayDark; + + +// Links +// ------------------------- +@linkColor: #08c; +@linkColorHover: darken(@linkColor, 15%); + + +// Typography +// ------------------------- +@sansFontFamily: "Architects Daughter", Helvetica, Arial, sans-serif; +@serifFontFamily: Georgia, "Times New Roman", Times, serif; +@monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace; + +@baseFontSize: 14px; +@baseFontFamily: @sansFontFamily; +@baseLineHeight: 20px; +@altFontFamily: @serifFontFamily; + +@headingsFontFamily: "Stylograph"; // empty to use BS default, @baseFontFamily +@headingsFontWeight: normal; // instead of browser default, bold +@headingsColor: inherit; // empty to use BS default, @textColor + + +// Component sizing +// ------------------------- +// Based on 14px font-size and 20px line-height + +@fontSizeLarge: @baseFontSize * 1.25; // ~18px +@fontSizeSmall: @baseFontSize * 0.85; // ~12px +@fontSizeMini: @baseFontSize * 0.75; // ~11px + +@paddingLarge: 11px 19px; // 44px +@paddingSmall: 2px 10px; // 26px +@paddingMini: 0 6px; // 22px + +@baseBorderRadius: 4px; +@borderRadiusLarge: 6px; +@borderRadiusSmall: 3px; + + +// Tables +// ------------------------- +@tableBackground: transparent; // overall background-color +@tableBackgroundAccent: #f9f9f9; // for striping +@tableBackgroundHover: #f5f5f5; // for hover +@tableBorder: #ddd; // table and cell border + +// Buttons +// ------------------------- +@btnBackground: @white; +@btnBackgroundHighlight: darken(@white, 10%); +@btnBorder: #ccc; + +@btnPrimaryBackground: @linkColor; +@btnPrimaryBackgroundHighlight: spin(@btnPrimaryBackground, 20%); + +@btnInfoBackground: #5bc0de; +@btnInfoBackgroundHighlight: #2f96b4; + +@btnSuccessBackground: #62c462; +@btnSuccessBackgroundHighlight: #51a351; + +@btnWarningBackground: lighten(@orange, 15%); +@btnWarningBackgroundHighlight: @orange; + +@btnDangerBackground: #ee5f5b; +@btnDangerBackgroundHighlight: #bd362f; + +@btnInverseBackground: #444; +@btnInverseBackgroundHighlight: @grayDarker; + + +// Forms +// ------------------------- +@inputBackground: @white; +@inputBorder: #ccc; +@inputBorderRadius: @baseBorderRadius; +@inputDisabledBackground: @grayLighter; +@formActionsBackground: #f5f5f5; +@inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border + + +// Dropdowns +// ------------------------- +@dropdownBackground: @white; +@dropdownBorder: rgba(0,0,0,.2); +@dropdownDividerTop: #e5e5e5; +@dropdownDividerBottom: @white; + +@dropdownLinkColor: @grayDark; +@dropdownLinkColorHover: @white; +@dropdownLinkColorActive: @white; + +@dropdownLinkBackgroundActive: @linkColor; +@dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive; + + + +// COMPONENT VARIABLES +// -------------------------------------------------- + + +// Z-index master list +// ------------------------- +// Used for a bird's eye view of components dependent on the z-axis +// Try to avoid customizing these :) +@zindexDropdown: 1000; +@zindexPopover: 1010; +@zindexTooltip: 1030; +@zindexFixedNavbar: 1030; +@zindexModalBackdrop: 1040; +@zindexModal: 1050; + + +// Sprite icons path +// ------------------------- +@iconSpritePath: "../img/glyphicons-halflings.png"; +@iconWhiteSpritePath: "../img/glyphicons-halflings-white.png"; + + +// Input placeholder text color +// ------------------------- +@placeholderText: @grayLight; + + +// Hr border color +// ------------------------- +@hrBorder: @grayLighter; + + +// Horizontal forms & lists +// ------------------------- +@horizontalComponentOffset: 180px; + + +// Wells +// ------------------------- +@wellBackground: #f5f5f5; + + +// Navbar +// ------------------------- +@navbarCollapseWidth: 979px; +@navbarCollapseDesktopWidth: @navbarCollapseWidth + 1; + +@navbarHeight: 40px; +@navbarBackgroundHighlight: #ffffff; +@navbarBackground: darken(@navbarBackgroundHighlight, 5%); +@navbarBorder: darken(@navbarBackground, 12%); + +@navbarText: #777; +@navbarLinkColor: #777; +@navbarLinkColorHover: @grayDark; +@navbarLinkColorActive: @gray; +@navbarLinkBackgroundHover: transparent; +@navbarLinkBackgroundActive: darken(@navbarBackground, 5%); + +@navbarBrandColor: @navbarLinkColor; + +// Inverted navbar +@navbarInverseBackground: #111111; +@navbarInverseBackgroundHighlight: #222222; +@navbarInverseBorder: #252525; + +@navbarInverseText: @grayLight; +@navbarInverseLinkColor: @grayLight; +@navbarInverseLinkColorHover: @white; +@navbarInverseLinkColorActive: @navbarInverseLinkColorHover; +@navbarInverseLinkBackgroundHover: transparent; +@navbarInverseLinkBackgroundActive: @navbarInverseBackground; + +@navbarInverseSearchBackground: lighten(@navbarInverseBackground, 25%); +@navbarInverseSearchBackgroundFocus: @white; +@navbarInverseSearchBorder: @navbarInverseBackground; +@navbarInverseSearchPlaceholderColor: #ccc; + +@navbarInverseBrandColor: @navbarInverseLinkColor; + + +// Pagination +// ------------------------- +@paginationBackground: #fff; +@paginationBorder: #ddd; +@paginationActiveBackground: #f5f5f5; + + +// Hero unit +// ------------------------- +@heroUnitBackground: @grayLighter; +@heroUnitHeadingColor: inherit; +@heroUnitLeadColor: inherit; + + +// Form states and alerts +// ------------------------- +@warningText: #c09853; +@warningBackground: #fcf8e3; +@warningBorder: darken(spin(@warningBackground, -10), 3%); + +@errorText: #b94a48; +@errorBackground: #f2dede; +@errorBorder: darken(spin(@errorBackground, -10), 3%); + +@successText: #468847; +@successBackground: #dff0d8; +@successBorder: darken(spin(@successBackground, -10), 5%); + +@infoText: #3a87ad; +@infoBackground: #d9edf7; +@infoBorder: darken(spin(@infoBackground, -10), 7%); + + +// Tooltips and popovers +// ------------------------- +@tooltipColor: #fff; +@tooltipBackground: #000; +@tooltipArrowWidth: 5px; +@tooltipArrowColor: @tooltipBackground; + +@popoverBackground: #fff; +@popoverArrowWidth: 10px; +@popoverArrowColor: #fff; +@popoverTitleBackground: darken(@popoverBackground, 3%); + +// Special enhancement for popovers +@popoverArrowOuterWidth: @popoverArrowWidth + 1; +@popoverArrowOuterColor: rgba(0,0,0,.25); + + + +// GRID +// -------------------------------------------------- + + +// Default 940px grid +// ------------------------- +@gridColumns: 12; +@gridColumnWidth: 60px; +@gridGutterWidth: 20px; +@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); + +// 1200px min +@gridColumnWidth1200: 70px; +@gridGutterWidth1200: 30px; +@gridRowWidth1200: (@gridColumns * @gridColumnWidth1200) + (@gridGutterWidth1200 * (@gridColumns - 1)); + +// 768px-979px +@gridColumnWidth768: 42px; +@gridGutterWidth768: 20px; +@gridRowWidth768: (@gridColumns * @gridColumnWidth768) + (@gridGutterWidth768 * (@gridColumns - 1)); + + +// Fluid grid +// ------------------------- +@fluidGridColumnWidth: percentage(@gridColumnWidth/@gridRowWidth); +@fluidGridGutterWidth: percentage(@gridGutterWidth/@gridRowWidth); + +// 1200px min +@fluidGridColumnWidth1200: percentage(@gridColumnWidth1200/@gridRowWidth1200); +@fluidGridGutterWidth1200: percentage(@gridGutterWidth1200/@gridRowWidth1200); + +// 768px-979px +@fluidGridColumnWidth768: percentage(@gridColumnWidth768/@gridRowWidth768); +@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768); diff --git a/app/controllers/plaquettes_controller.rb b/app/controllers/plaquettes_controller.rb index 06c9dbf..75d29db 100644 --- a/app/controllers/plaquettes_controller.rb +++ b/app/controllers/plaquettes_controller.rb @@ -6,8 +6,13 @@ class PlaquettesController < ApplicationController def show - - render :template => "plaquettes/"+params[:slug].to_s + respond_to do |format| + format.js { + + } + format.html {render :template => "plaquettes/"+params[:slug].to_s} + end + end end diff --git a/app/helpers/plaquettes_helper.rb b/app/helpers/plaquettes_helper.rb index fa7b5c6..3975ec3 100644 --- a/app/helpers/plaquettes_helper.rb +++ b/app/helpers/plaquettes_helper.rb @@ -16,4 +16,57 @@ module PlaquettesHelper raw("
#{label}
") end + + def quizz(questions, success, concl) + num = rand(10000000) + r = "" + i=0 + questions.each do |question| + i += 1 + r+= quizz_question(i, question[0], question[1], question[2], questions.size, question, num) + + end + + r+= raw "
" + r+= raw content_tag("h3", success) + r+= raw content_tag("p", concl) + r+=raw content_tag( "div", "<", :class => " prev btn") + + r+= raw "
" + raw r + end + + def quizz_question(question_id, title, answers, response, tot, value, num) + content_tag "div", :class => "question" do + r = "" + r+=raw content_tag("h3", raw(title)) + r+=raw(content_tag("div",image_tag(value[3])+(content_tag("p", value[4]) if value[4] ).to_s, :class => "quizz_ill")) if value[3] + i = 0 + answers.each do |answer| + i+= 1 + r+=raw quizz_answer(question_id, answer, (true if response.to_i == i), num) + end + #r += content_tag "div", "bravo", :class => "success" + #r += content_tag "div", "erreur", :class => "fail" + + + + + #r += content_tag("div", content_tag("div", "corriger", :class => "btn btn-primary check"), :class => "check_place") + + if question_id > 1 + r += content_tag "div", "<", :class => " prev btn" + end + if question_id < tot+1 + r += content_tag "div", ">", :class => " next btn" + end + + raw r + end + end + def quizz_answer(question_id, value, response=false, num=1) + response = true if value[4] == true + raw(content_tag("div",raw(radio_button("quizz_#{num}", "question_#{question_id}", value[0].to_slug)+label("quizz_#{num}", "question_#{question_id}_#{value[0].to_slug}", " #{value[0]} ")+raw(content_tag("span",(response ? "Vrai"+(","if value[1]).to_s+" " : "Faux"+(","if value[1]).to_s+" ")+value[1].to_s, :class => "info")))+raw((content_tag("div",image_tag(value[2])+(content_tag("p", value[3]) if value[3] ).to_s, :class => "quizz_img") if value[2])), :class => "quizz_answer "+("response" if response).to_s)) + end + end diff --git a/app/views/layouts/plaquettes.html.haml b/app/views/layouts/plaquettes.html.haml index 41fa2aa..29801ad 100644 --- a/app/views/layouts/plaquettes.html.haml +++ b/app/views/layouts/plaquettes.html.haml @@ -1,16 +1,20 @@ !!! %html - %head - %title Le Pic Vert - Votre avis sur les sorties du Pic Vert - = stylesheet_link_tag "plaquettes", :media => "all" - = javascript_include_tag "plaquettes" - = csrf_meta_tags - - + %head + %title Le Pic Vert - Votre avis sur les sorties du Pic Vert + = stylesheet_link_tag "plaquettes", :media => "all" + = javascript_include_tag "plaquettes" + = csrf_meta_tags + + + + = stylesheet_link_tag '/fonts/Stylograph/stylesheet.css' + %body + + - %body - - - #main=yield - - + #overlay + = yield :overlay + #main=yield + + diff --git a/app/views/plaquettes copy/accueil.html.haml b/app/views/plaquettes copy/accueil.html.haml new file mode 100644 index 0000000..4d19ba3 --- /dev/null +++ b/app/views/plaquettes copy/accueil.html.haml @@ -0,0 +1,25 @@ +.page#acceuil + .content + %p Entre Dauphiné et Savoie, entre les contreforts de la Chartreuse et le lac de Paladru, le château de Longpra, écrin de verdure dans la vallée de l’Ainan, témoigne de sept cents ans d’histoire d’un terroir. + %p Le Château de Longpra, classé monument historique, est en relation étroite avec le paysage environnant et représente un patrimoine architectural et naturel exceptionnel. + + %p Dans le cadre du programme leader du Pays Voironnais, le Château de Longpra a demandé à l’association Le Pic Vert d’effectuer un inventaire de la faune et de la flore du parc et des alentours. Grâce à cet inventaire, 197 espèces végétales, 49 espèces d’oiseaux et 17 espèces de mammifères (dont 2 espèces de chauves –souris) ont été découvertes. + %p Le Pic Vert a proposé au Château la mise en place d’un « hôtel » à insectes et un film sur la faune et la flore du Château à été produit. + %br + %p Ce document pédagogique vous permettra d’en savoir plus sur la biodiversité au Château de Longpra. + %br + %p Partez à la découverte de la faune et de la flore du Château à travers les thèmes suivants : + + + + + =link_to "La faune liée aux bâtiments", "/plaquettes/faune-batiments.html", :remote => true, :class => "btn btn-primary" + =link_to "Les vieux arbres du parc", "/plaquettes/arbres-parc.html", :remote => true, :class => "btn" + =link_to "Les insectes", "/plaquettes/insectes.html", :remote => true, :class => "btn" + =link_to "Le jardin du Château et le compost", "/plaquettes/jardins.html", :remote => true, :class => "btn" + + #logos + =image_tag "plaquettes/logos/logo_pic_vert.png" + =image_tag "plaquettes/logos/logo_feader.jpg" + =image_tag "plaquettes/logos/logo_leader.jpg" + =image_tag "plaquettes/logos/logo_CAPV.jpg" diff --git a/app/views/plaquettes copy/arbres-parc.html.haml b/app/views/plaquettes copy/arbres-parc.html.haml new file mode 100644 index 0000000..0a070de --- /dev/null +++ b/app/views/plaquettes copy/arbres-parc.html.haml @@ -0,0 +1,22 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/accueil.html", :class => "btn btn-inverse", :remote => true + + +.content + + %h1 Les vieux arbres du parc + + + %p Le parc du Château de Longpra possède quantité d’arbres remarquables, principalement des tilleuls et des marronniers bi-centenaires. + %p A l’aspect irrégulier avec des creux ou des bourrelets, ils servent de gîte et de couvert pour de nombreux petits animaux. Un arbre peut accueillir un très grand nombre d’êtres vivants à tous les stades de sa vie, même mort. Un arbre mort tombé au sol va pourrir lentement. Des insectes viennent pondre à l’intérieur et leurs larves vont consommer du bois mort. + + %br + %p Le lierre, plante ligneuse grimpante est présente dans le parc du château. Cette plante est considérée à tort comme un parasite qui épuise et tue les arbres. Mais le lierre utilise simplement les arbres comme support pour chercher la lumière. La croissance décalée du lierre en fait un allié pour de nombreux animaux. En effet les abeilles et autre pollinisateurs profitent de ces fleurs en automne et les oiseaux et autres rongeurs se nourrissent de ses fruits durant tout l’hiver. + +%ul{:class => "nav nav-tabs nav-stacked"} + %li=link_to "Les vieux arbres : HLM de biodiversité ","puzzle-puceron", :remote => true + %li=link_to "La vie d’un arbre", "histoire-pollinisation.html", :remote => true + %li=link_to "Quiz", "quizz-arbres.html", :remote => true + + diff --git a/app/views/plaquettes copy/faune-batiments.html.haml b/app/views/plaquettes copy/faune-batiments.html.haml new file mode 100644 index 0000000..f78fdd3 --- /dev/null +++ b/app/views/plaquettes copy/faune-batiments.html.haml @@ -0,0 +1,20 @@ +.page#faune-batiments + .content + %h1 La faune liée aux bâtiments + %p Les bâtiments qui composent le château de Longpra, de style dauphinois, sont entourés d’un écrin de verdure. Cet ensemble est un espace pour la préservation de nombreux animaux qui trouvent en ces lieux accueillants une zone idéale pour se nourrir et se reproduire. + %p Comme vous l’avez vu dans le film de nombreuses espèces animales sont présentes au Château. + %p Parmi celles-ci, les chauves-souris. Le Château de Longpra accueille une colonie importante de petits Rhinolophes, qui trouve refuge dans les combles des dépendances. + %p La bergeronnette grise, facilement observable chasse sur les toits et allées du parc. + %p Le merle noir fait son nid dans les buissons et rosiers du parc. + %p Le faucon crécerelle niche dans les grands arbres, mais aussi dans les bâtiments tel que les granges. En 2012 un couple a niché près de l’entrée du château au sommet d’un arbre. + %p La chouette effraie visite régulièrement les dépendances du Château. On trouve parfois ses pelotes de réjections, contenant des restes de ses proies (os, poils…). + %p + Le + %strong moineau domestique + fait son nid dans les trous des murs et murets. + =image_tag "plaquettes/chauve-souri.jpg", :style => "height:500px;display:block;margin:auto;" + + %ul{:class => "nav nav-tabs nav-stacked"} + %li=link_to "Puzzle d’une chauve-souris","puzzle-chauve-souris.html", :remote => true + %li=link_to "Où se cache les animaux au Château de Longpra", "animaux-longpra.html", :remote => true + %li=link_to "Quiz", "quizz-batiments.html", :remote => true \ No newline at end of file diff --git a/app/views/plaquettes copy/histoire-pollinisation.html.haml b/app/views/plaquettes copy/histoire-pollinisation.html.haml new file mode 100644 index 0000000..d1155d1 --- /dev/null +++ b/app/views/plaquettes copy/histoire-pollinisation.html.haml @@ -0,0 +1,20 @@ + + +#insectes_jeu_1 + %h2 Jeu 1 + + .response{:style => "height:2em;"} + .win{:style => "display:none;"} + %p Bravo ! Tu as gagné, tu peux tirer les cheveux à l'animatrice ! + .loose{:style => "display:none;"} + %p Perdu, tu dois donner 10€ à l'animatrice, c'est la vie ! + %button.verif.btn.btn-primary Vérifier + %button.reset.btn Remettre à zero + .sortable{:style => "height:200px;"} + + =jeux_sortable_img("insectes_jeu_1", 4) + =jeux_sortable_img("insectes_jeu_1", 3) + + =jeux_sortable_img("insectes_jeu_1", 2) + =jeux_sortable_img("insectes_jeu_1", 5) + =jeux_sortable_img("insectes_jeu_1", 1) diff --git a/app/views/plaquettes copy/index.html.haml b/app/views/plaquettes copy/index.html.haml new file mode 100644 index 0000000..c18c6a4 --- /dev/null +++ b/app/views/plaquettes copy/index.html.haml @@ -0,0 +1,10 @@ + +.page#index{:style => "background:url('/assets/plaquettes/fond.jpg'); background-size:contain;"} + =image_tag "plaquettes/logos/logo_longpra.png", :style => "width:500px;margin:auto;padding-top:1em;display:block;" + %h1{:style => "text-align:center;color:white;font-size:4em;margin-top:2em;font-weight:normal;"} Plaquette pédagogique. + +=render :template => "plaquettes/accueil" +=render :template => "plaquettes/faune-batiments" + + + diff --git a/app/views/plaquettes copy/insectes.html.haml b/app/views/plaquettes copy/insectes.html.haml new file mode 100644 index 0000000..b4482c7 --- /dev/null +++ b/app/views/plaquettes copy/insectes.html.haml @@ -0,0 +1,58 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/accueil.html", :class => "btn btn-inverse", :remote => true + + +.content + + + %h1 Le mur à insectes du Château de Longpra + + %p Fabriqué principalement avec des matériaux naturels, le « mur à insectes » du Château de Longpra abrite un grand nombre de petites bêtes, principalement des insectes pollinisateurs. + + %p La plupart des abeilles sauvages (90%) à l’inverse des abeilles domestiques ne vivent pas en groupe. Elles ne fabriquent pas de miel, mai un mélange de nectar et de pollen nécessaire à l’alimentation de leur larve. + %p Les insectes pollinisateurs comme les abeilles sauvages sont en voie de disparition. Ce déclin est dû à la raréfaction des abris et de la nourriture dont elles dépendent. + %p Il est possible, en construisant des petites abris, d’améliorer leurs conditions de vie. + + %p D’autres insectes comme par exemple les coccinelles sont des grands prédateurs de pucerons. Chaque larve de coccinelle peut ingérer près de 600 pucerons jusqu’à sa vie adulte durant laquelle elle en consomme plusieurs milliers. Il est très facile de fabriquer seul un abri à coccinelles à l’aide de quelques matériaux. + +%ul{:class => "nav nav-tabs nav-stacked"} + %li=link_to "Puzzle d’un puceron","puzzle-puceron", :remote => true + %li=link_to "l’histoire de la pollinisation", "histoire-pollinisation.html", :remote => true + %li=link_to "Les insectes qui trouvent refuge dans le mur à insectes","refuge-mur", :remote => true + %li=link_to "Quiz", "quizz-insecte.html", :remote => true + + " \ No newline at end of file diff --git a/app/views/plaquettes copy/jardins.html.haml b/app/views/plaquettes copy/jardins.html.haml new file mode 100644 index 0000000..0590926 --- /dev/null +++ b/app/views/plaquettes copy/jardins.html.haml @@ -0,0 +1,27 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/accueil.html", :class => "btn btn-inverse", :remote => true + + +.content + + + %h1 Un jardin et son compost + + %p Tout ce qui meurt, plantes et animaux, sur et dans le sol, finit par y être incorporé. + %p Les végétaux morts sont décomposés sur le sol par des insectes, des invertébrés et des champignons. Petit à petit ils retournent dans le sol en l’enrichissant en humus indispensable à la croissance des végétaux. + + %p Dans le jardin du Château de Longpra, la décomposition des plantes mortes ne se fait pas à même le sol mais dans un composteur. + + %p Toutes les matières ne mettent pas le même temps pour se décomposer, par exemple une feuille ou un fruit mettra en moyenne quelques mois, tandis que des os d’animaux disparaîtront en plusieurs années. Il en va de même pour les déchets : un mouchoir aura totalement disparu en quelques mois tandis qu’un chewing-gum mettra environ 5 ans et un sac plastique entre 100 et 1000 ans. + + %p Les plantes mortes peuvent encore être utiles. Par exemple, dans un jardin, un tas de feuilles mortes constituent un gîte très accueillant pour des petits mammifères sauvages (hérisson, mulot, campagnol) et des insectes (coccinelles en hiver). + + + +%ul{:class => "nav nav-tabs nav-stacked"} + %li=link_to "La décomposition d’une feuille de hêtre","puzzle-puceron", :remote => true + %li=link_to "Le rôle des « petites bêtes » dans la décomposition", "histoire-pollinisation.html", :remote => true + %li=link_to "Quiz", "quizz-jardin.html", :remote => true + + diff --git a/app/views/plaquettes copy/quizz-arbres.html.haml b/app/views/plaquettes copy/quizz-arbres.html.haml new file mode 100644 index 0000000..203fc66 --- /dev/null +++ b/app/views/plaquettes copy/quizz-arbres.html.haml @@ -0,0 +1,12 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/arbres-parc.html", :class => "btn btn-inverse", :remote => true + + +.content + + %h1 Quizz arbres + + .quizz + =quizz [["Laquelle de ces plantes n’est pas un arbre ?", ["le lierre", "le sapin", "le chêne"], 1],["Faut-il couper les arbres morts ?", ["Oui", "Non"], 2],["Quel arbre ne trouve-t’ont pas au Château de Longpra", ["le chêne", "le palmier", "le sapin"], 2],["Quel oiseau fait son nid dans un trou d’arbre", ["le héron cendré ", "la buse variable", "le pic épeiche "], 3],["Le lierre est-il une plante parasite ?", ["Oui", "Non"], 2]] + diff --git a/app/views/plaquettes copy/quizz-batiments.html.haml b/app/views/plaquettes copy/quizz-batiments.html.haml new file mode 100644 index 0000000..fd6afbf --- /dev/null +++ b/app/views/plaquettes copy/quizz-batiments.html.haml @@ -0,0 +1,12 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/faune-batiments.html", :class => "btn btn-inverse", :remote => true + + +.content + + %h1 Quizz faune des bâtiments + + .quizz + =quizz [["un Murin de Daubenton (espèce de chauve-souris) mange combien de moustique en un été ?", ["60", "60 000", "6 millions"], 2],["quel animal est la proie de la chouette effraie ?", ["le campagnol", "le renard", "le moineau"], 1],["le lézard appartient à la famille des ... ?", ["amphibiens", "mammifères", "reptiles"], 3],["en hiver ou trouve t’ont les petits rhinolophes au château de Longpra ?", ["dans le grenier", "dans la cave", "dans les vieux arbres "], 2],["comment appelle t’on les oiseaux qui vivent la nuit comme le blaireau ou la chouette", ["noctambules", "nocturnes", "nuisibles"],2]] + diff --git a/app/views/plaquettes copy/quizz-insecte.html.haml b/app/views/plaquettes copy/quizz-insecte.html.haml new file mode 100644 index 0000000..0440174 --- /dev/null +++ b/app/views/plaquettes copy/quizz-insecte.html.haml @@ -0,0 +1,11 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/insectes.html", :class => "btn btn-inverse", :remote => true + + +.content + %h1 Quizz + + .quizz + =quizz [["Quel insecte saute, vole, stridule, et ressemble au criquet ?", ["La mouche", "La sauterelle", "Le papillon"], 2],["Est-ce que les abeilles sauvages font du miel ?", ["Oui", "Non"], 2],["Comment les sauterelles chantent-elles ?", ["Avec leur voix", "En frottant leurs ailes", "En frottant leurs pattes arrière "], 2],["Comment s’appelle la nourriture préférée des papillons ?", ["Le nectar ", "La nectarine", "Le délice "], 1],["Quel insecte mange des pucerons ?", ["Le chrysope", "la mouche", "la coccinelle"],1]] + diff --git a/app/views/plaquettes copy/quizz-jardin.html.haml b/app/views/plaquettes copy/quizz-jardin.html.haml new file mode 100644 index 0000000..47606a6 --- /dev/null +++ b/app/views/plaquettes copy/quizz-jardin.html.haml @@ -0,0 +1,12 @@ +.navbar.navbar-inverse.navbar-fixed-top + .navbar-inner{:style => "border-radius:0px;"} + .pull-right=link_to i(:"caret-left", :icon => false)+" Retour", "/plaquettes/jardins.html", :class => "btn btn-inverse", :remote => true + + +.content + + %h1 quizz jardin et compost + + .quizz + =quizz [["le hérisson passe l’hiver", ["dans la cave du château", "sous un tas de bois", "sous un tas de feuille morte"], 1],["un jardin fleurit attirent les insectes", ["pollinisateurs", "carnivores", "colorés"], 2],["qu’elle petite bête ne participe pas à la décomposition de la matière organique", ["le cloporte", "la coccinelle", "la fourme"], 2],["le bousier porte son nom à cause", ["de sa couleur ", "de sa nourriture", "de sa forme "], 3],["pour sa croissance une plante à besoin de terre de soleil et :", ["d’engrais", "d’eau", "de sucre"], 2]] + diff --git a/app/views/plaquettes copy/show.js.erb b/app/views/plaquettes copy/show.js.erb new file mode 100644 index 0000000..c793533 --- /dev/null +++ b/app/views/plaquettes copy/show.js.erb @@ -0,0 +1 @@ +$("#main").html("<%= escape_javascript(render(:template => "plaquettes/"+params[:slug].to_s)) %>"); \ No newline at end of file diff --git a/app/views/plaquettes/accueil.html.haml b/app/views/plaquettes/accueil.html.haml new file mode 100644 index 0000000..f649a69 --- /dev/null +++ b/app/views/plaquettes/accueil.html.haml @@ -0,0 +1,26 @@ +.page#acceuil + .prev_slide + < + .next_slide + > + .content + =image_tag "plaquettes/logos/logo_longpra.jpg", :style => "margin:auto;display:block;height:250px;margin-bottom:1em;" + %p Entre Dauphiné et Savoie, entre les contreforts de la Chartreuse et le lac de Paladru, le château de Longpra, écrin de verdure dans la vallée de l’Ainan, témoigne de sept cents ans d’histoire d’un terroir. + %p Le Château de Longpra, classé monument historique, est en relation étroite avec le paysage environnant et représente un patrimoine architectural et naturel exceptionnel. + + %p Dans le cadre du programme leader du Pays Voironnais, le Château de Longpra a demandé à l’association Le Pic Vert d’effectuer un inventaire de la faune et de la flore du parc et des alentours. Grâce à cet inventaire, 197 espèces végétales, 49 espèces d’oiseaux et 17 espèces de mammifères (dont 2 espèces de chauves –souris) ont été découvertes. + %p Le Pic Vert a proposé au Château la mise en place d’un « hôtel » à insectes et un film sur la faune et la flore du Château à été produit. + %br + %p Ce document pédagogique vous permettra d’en savoir plus sur la biodiversité au Château de Longpra. + + + + + + #logos + =image_tag "plaquettes/logos/logo_pic_vert.png" + =image_tag "plaquettes/logos/logo_feader.jpg" + =image_tag "plaquettes/logos/logo_leader.jpg" + =image_tag "plaquettes/logos/logo_CAPV.jpg" + =image_tag "plaquettes/logos/logo_nb.png" + diff --git a/app/views/plaquettes/animaux-batiment.html.haml b/app/views/plaquettes/animaux-batiment.html.haml new file mode 100644 index 0000000..1333fed --- /dev/null +++ b/app/views/plaquettes/animaux-batiment.html.haml @@ -0,0 +1,40 @@ +.page + + .places_jeu + %h1 Où se cachent les animaux au Château de Longpra ? + %div{:style => "padding:22px;"} + .img{:style => "width:100%;"} + =image_tag "plaquettes/jeu-batiment/batiment-jeu-2.jpg", :style => "width:100%;" + + .receptable{:style => "top:400px;left:760px;", :data => {:rep => 1}} + .receptable{:style => "top:50px;left:830px;", :data => {:rep => 2}} + .receptable{:style => "top:70px;left:90px;", :data => {:rep => 3}} + .receptable{:style => "top:540px;left:170px;", :data => {:rep => 4}} + .receptable{:style => "top:500px;left:520px;", :data => {:rep => 5}} + .receptable{:style => "top:480px;left:630px;", :data => {:rep => 6}} + .receptable{:style => "top:460px;left:360px;", :data => {:rep => 7}} + + .vignettes{:style => "position:static;width:auto;padding:1em;"} + + + + =image_tag "plaquettes/jeu-batiment/1.jpg", :class => "droppable", :data => {:rep => 1, :legend => "Faucon crécerelle"} + =image_tag "plaquettes/jeu-batiment/2.jpg", :class => "droppable", :data => {:rep => 2, :legend => "Chouette effraie"} + =image_tag "plaquettes/jeu-batiment/3.jpg", :class => "droppable", :data => {:rep => 3, :legend => "Hirondelle rustique"} + =image_tag "plaquettes/jeu-batiment/4.jpg", :class => "droppable", :data => {:rep => 4, :legend => "Lézard des murailles"} + =image_tag "plaquettes/jeu-batiment/5.jpg", :class => "droppable", :data => {:rep => 5, :legend => "Moineau domestique"} + =image_tag "plaquettes/jeu-batiment/6.jpg", :class => "droppable", :data => {:rep => 6, :legend => "Bergeronette grise"} + =image_tag "plaquettes/jeu-batiment/7.jpg", :class => "droppable", :data => {:rep => 7, :legend => "Petit rinolophe"} + + .success + Bravo, tu as gagné. + + + =image_tag "plaquettes/jeu-batiment/batiment-jeu-1.jpg", :style => "width:100%;" + + .prev_slide + < + .next_slide + > + + diff --git a/app/views/plaquettes/animaux-sol.html.haml b/app/views/plaquettes/animaux-sol.html.haml new file mode 100644 index 0000000..b0ce698 --- /dev/null +++ b/app/views/plaquettes/animaux-sol.html.haml @@ -0,0 +1,80 @@ +.page + .content + %h1 Le rôle des « petites bêtes » dans la décomposition + .animaux_sol + %table{:style => "width:680px;float:left;"} + %tr + %td + Petit animal sans patte, je vis surtout dans la terre que je mange en la labourant. Les galeries que je creuse aèrent le sol. Quand je vis dans le compost, je mange des déchets en train de pourrir. + %tr + %td + Je suis un petit insecte et peux vivre partout : je me nourris des petits animaux morts comme de déchets du compost. Mon rôle est de décomposer les animaux morts et d’aérer la terre. + %tr + %td + Etre vivant microscopique, je décompose les déchets des petites bêtes pour participer à la production de bonne terre. + %tr + %td + On peut manger certains de mes cousins. Moi je sers à décomposer toutes les crottes des animaux qui mangent les déchets compostables. Je participe au recyclage des parties dures des plantes (tige, bois…). + %tr + %td + Je suis un crustacé à carapace grise. On me reconnaît à mes 14 pattes. Je me nourris essentiellement de matière en décomposition, et surtout, de bois mort. + %tr + %td + Insecte de la famille des coléoptères, je mange les excréments de certains animaux. Je participe donc à la décomposition. + + + %table.t_sortable{:style => "width:300px;float:left;"} + %tr{:"data-order" => 4} + %td + =image_tag "plaquettes/vie-sol/champignon.jpg" + + %td CHAMPIGNON + %tr{:"data-order" => 2} + %td + =image_tag "plaquettes/vie-sol/fourmi.jpg" + %td FOURMI + + %tr{:"data-order" => 3} + %td + =image_tag "plaquettes/vie-sol/bacterie.jpg" + %td BACTERIE + %tr{:"data-order" => 6} + %td + =image_tag "plaquettes/vie-sol/bousier.jpg" + %td LE BOUSIER + %tr{:"data-order" => 5} + %td + =image_tag "plaquettes/vie-sol/cloporte.jpg" + %td CLOPORTE + + %tr{:"data-order" => 1} + %td + =image_tag "plaquettes/vie-sol/lombric.jpg" + %td VER DE TERRE + + + .success{:style => "position:absolute;bottom:0px;left:0px;right:0px;text-align:center;color:green;display:none;"} + %h3 + Bravo tu as réussi à remettre l'histoire dans l'ordre. + .btn.reset Rejouer + + + + :css + .animaux_sol td{ + height:96px; + border:0px !important; + + } + + .t_sortable img{ + height:90px; + display:block; + margin:auto; + } + .prev_slide + < + .next_slide + > + + diff --git a/app/views/plaquettes/arbres-parc.html.haml b/app/views/plaquettes/arbres-parc.html.haml new file mode 100644 index 0000000..e85d21d --- /dev/null +++ b/app/views/plaquettes/arbres-parc.html.haml @@ -0,0 +1,44 @@ + +.page + + .content{:style => "width:500px;box-sizing:border-box;padding:1em;font-size:0.99em;"} + + %div{:style => "font-size:1.30em;"} + %h1 Les vieux arbres du parc et quelques idées fausses... + + + %p Le parc du Château de Longpra possède des arbres remarquables : + + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Tilleul"}} tilleuls + + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Marronier"}} marronniers + + %p + Avec leurs trous, + les vieux arbres + procurent un abri à de nombreux animaux + + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-arbre/2.jpg", :legend => "Chouette hulotte"}} chouette hulotte + + %p + %a.img{:data => {:img => "/assets/plaquettes/arbres/pic.jpg", :legend => "Pic épeiche"}} pic épeiche + + %p + un + %a.img{:data => {:img => "/assets/plaquettes/arbres/chandelle.jpg", :legend => "Une chandelle : Arbre mort"}} arbre mort + accueille aussi un très grand nombre d’êtres vivants + + + %p + Si vous observez le tronc des arbres, vous pourrez peut-être y observer du + %a.img{:data => {:img => "/assets/plaquettes/arbres/lierre.jpg", :legend => "Lierre"}} lierre + + + =image_tag "plaquettes/arbres/texte.jpg", :style => "height:768px;position:absolute;top:0px;right:0px;display:block;margin:auto;" + .prev_slide + < + .next_slide + > diff --git a/app/views/plaquettes/faune-batiments.html.haml b/app/views/plaquettes/faune-batiments.html.haml new file mode 100644 index 0000000..abe0f70 --- /dev/null +++ b/app/views/plaquettes/faune-batiments.html.haml @@ -0,0 +1,38 @@ +.page#faune-batiments + + .content{:style => "width:500px;box-sizing:border-box;padding:1em;font-size:0.99em;"} + %h1 Les discrets habitants du château + + %div{:style => "font-size:1.30em;"} + + + + %p{:style => "text-align:justify !important;"} Les bâtiments du château accueillent plusieurs espèces d’animaux. + + + %p + La + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Bergeronnette grise"}} bergeronnette grise + %p + Le + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/merle.jpg", :legend => "Merle noir"}} merle noir + %p + Le + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/1.jpg", :legend => "Faucon crécerelle"}} faucon crécerelle + %p + La + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/2.jpg", :legend => "Chouette effraie"}} chouette effraie + + %p + Une espèce de chauve-souris vit dans + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "les combles : c'est la partie située juste en dessous du toit"}} les combles + =": le petit Rhinolophe. " + + + + =image_tag "plaquettes/chauve-souri.jpg", :style => "height:768px;position:absolute;top:0px;right:0px;display:block;margin:auto;" + + .prev_slide + < + .next_slide + > \ No newline at end of file diff --git a/app/views/plaquettes/histoire-decomposition.html.haml b/app/views/plaquettes/histoire-decomposition.html.haml new file mode 100644 index 0000000..317d2d2 --- /dev/null +++ b/app/views/plaquettes/histoire-decomposition.html.haml @@ -0,0 +1,27 @@ +.page + + .sortable_quizz + %h2 La décomposition d’une feuille de hêtre + + + %br + %br + .sortable{:style => "height:200px;"} + + =jeux_sortable_img("feuille", 4, "width:200px;") + =jeux_sortable_img("feuille", 3, "width:200px;") + + =jeux_sortable_img("feuille", 2, "width:200px;") + =jeux_sortable_img("feuille", 5, "width:200px;") + =jeux_sortable_img("feuille", 1, "width:200px;") + + .response + .win{:style => "display:none;text-align:center;"} + %h3 Bravo ! Tu as remis les images dans l'ordre. + %button.reset.btn Rejouer + + + .prev_slide + < + .next_slide + > \ No newline at end of file diff --git a/app/views/plaquettes/histoire-pollinisation.html.haml b/app/views/plaquettes/histoire-pollinisation.html.haml new file mode 100644 index 0000000..87159f4 --- /dev/null +++ b/app/views/plaquettes/histoire-pollinisation.html.haml @@ -0,0 +1,26 @@ +.page + + .sortable_quizz + %h2 Histoire pollénisation + + .response{:style => "height:2em;"} + .win{:style => "display:none;"} + %p Bravo ! Tu as gagné, tu peux tirer les cheveux à l'animatrice ! + .loose{:style => "display:none;"} + %p Perdu, tu dois donner 10€ à l'animatrice, c'est la vie ! + %button.verif.btn.btn-primary Vérifier + %button.reset.btn Remettre à zero + .sortable{:style => "height:200px;"} + + =jeux_sortable_img("insectes_jeu_1", 4) + =jeux_sortable_img("insectes_jeu_1", 3) + + =jeux_sortable_img("insectes_jeu_1", 2) + =jeux_sortable_img("insectes_jeu_1", 5) + =jeux_sortable_img("insectes_jeu_1", 1) + + + .prev_slide + < + .next_slide + > \ No newline at end of file diff --git a/app/views/plaquettes/index.html.haml b/app/views/plaquettes/index.html.haml new file mode 100644 index 0000000..1130e70 --- /dev/null +++ b/app/views/plaquettes/index.html.haml @@ -0,0 +1,42 @@ + + + +.page#index{:style => "background:url('/assets/plaquettes/fond.jpg'); background-size:cover;"} + + + .next_slide + > + + =image_tag "plaquettes/logos/logo_longpra.png", :style => "width:500px;margin:auto;padding-top:1em;display:block;" + %h1{:style => "text-align:center;color:white;font-size:4em;margin-top:2em;font-weight:normal;"} Plaquette pédagogique. + + +=render :template => "plaquettes/faune-batiments" +=render :template => "plaquettes/puzzle-chauve-souris" +=render :template => "plaquettes/animaux-batiment" +=render :template => "plaquettes/quizz-batiments" + + +=render :template => "plaquettes/arbres-parc" +=render :template => "plaquettes/jeu-arbre" +=render :template => "plaquettes/vie-arbre" +=render :template => "plaquettes/quizz-arbres" + +=render :template => "plaquettes/insectes" +=render :template => "plaquettes/mur-insectes" +=render :template => "plaquettes/quizz-insectes" + +=render :template => "plaquettes/jardins" +=render :template => "plaquettes/histoire-decomposition" +=render :template => "plaquettes/animaux-sol" +=render :template => "plaquettes/quizz-jardin" + +=render :template => "plaquettes/remerciements" + + + + +:javascript + document.ontouchmove = function(event){ + event.preventDefault(); + } \ No newline at end of file diff --git a/app/views/plaquettes/insectes.html.haml b/app/views/plaquettes/insectes.html.haml index becb896..36a7ee3 100644 --- a/app/views/plaquettes/insectes.html.haml +++ b/app/views/plaquettes/insectes.html.haml @@ -1,71 +1,55 @@ -%h1 Le mur à insectes +.page + .content{:style => "width:500px;box-sizing:border-box;padding:1em;font-size:0.99em;"} + %div{:style => "font-size:1.30em;"} + %h1 Un hôtel pour les insectes au Château de Longpra -%p Fabriqué principalement avec des matériaux naturels, le « mur à insectes » du Château de Longpra abrite un grand nombre de petites bêtes, principalement des INSECTES. -%p Tout d’abord un insecte dispose de 6 pattes et d’un corps composé de 3 parties (la tête, le thorax et l’abdomen). + %p{:style => "text-align:justify !important;"} + Cet hôtel abrite des + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :desc => "insectes pollinisateurs = insectes qui transportent le pollen de fleur en fleur et facilite ainsi la reproduction des plantes"}} insectes pollinisateurs*. + -=image_tag("plaquettes/insectes_01.jpg", :style => "display:block; margin:auto;") - -%p Dans la nature, certains insectes ne trouvent plus de quoi s’abriter ou pondre leurs œufs (bois mort, tiges creuses…) c’est pourquoi on peut les aider en leur fabriquant des abris. + %p{:style => "text-align:justify !important;"} + La plupart des + %a.img{:data => {:img => "/assets/plaquettes/jeu-arbre/2.jpg", :legend => "Abeilles sauvage"}} abeilles sauvages + à l’inverse des + %a.img{:data => {:img => "/assets/plaquettes/jeu-arbre/2.jpg", :legend => "Abeilles domestique"}} abeilles domestiques + ne vivent pas en groupe. + %br Les insectes pollinisateurs tels que les abeilles sauvages sont en voie de disparition. + + %p{:style => "text-align:justify !important;"} + Il y a aussi des insectes des grands + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :desc => "prédateur = chasseur"}} prédateurs + de + %a.img{:data => {:img => "/assets/plaquettes/insectes/puceron.jpg", :legend => "Puceron"}} pucerons + =" :" + + %p + %a.img{:data => {:img => "/assets/plaquettes/insectes/coccinelle.jpg", :legend => "Coccinelle"}} les coccinelles + %p + %a.img{:data => {:img => "/assets/plaquettes/insectes/chrysope.jpg", :legend => "Chrysope"}} les chrysopes. -%p - Certains de ces insectes peuvent être très utiles à l’Homme, notamment au jardinier. - Par exemple au Château de Longpra il y a de très beaux rosiers, mais qui sont souvent grignoté par les pucerons. - La coccinelle, qui raffole des pucerons, est un très bon allier pour le jardinier. En fabriquant des gites à coccinelles, on peut lutter contre les pucerons sans utiliser de produits chimiques. C’est une petite chaîne alimentaire. - De même, en abritant certaines abeilles, on peut favoriser la pollinisation. -%p La plupart des abeilles sauvages (90%) à l’inverse des abeilles domestiques ne vivent pas en groupe. Elles ne fabriquent pas de miel, mai un mélange de nectar et de pollen nécessaire à l’alimentation de leur larve. + %p{:style => "text-align:justify !important;"} + Observe bien le mur à insectes et tu pourras en installer un semblable chez toi. + %p{:style => "text-align:justify !important;"} + Dans l’hôtel on trouve : + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :desc => "fagots = petits paquets de branchages"}} fagots* + de tiges creuses + %p + fagots de tiges à + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :desc => "moelle = partie molle à l'intérieur d'un os ou d'une tige"}} moelle* + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Buches percés"}} buches percés + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Abri à coccinelle"}} abri à coccinelles -#insectes_jeu_1 - %h2 Jeu 1 - - .response{:style => "height:2em;"} - .win{:style => "display:none;"} - %p Bravo ! Tu as gagné, tu peux tirer les cheveux à l'animatrice ! - .loose{:style => "display:none;"} - %p Perdu, tu dois donner 10€ à l'animatrice, c'est la vie ! - %button.verif Vérifier - %button.reset Remettre à zero - .sortable{:style => "height:200px;"} - - =jeux_sortable_img("insectes_jeu_1", 4) - =jeux_sortable_img("insectes_jeu_1", 3) - - =jeux_sortable_img("insectes_jeu_1", 2) - =jeux_sortable_img("insectes_jeu_1", 5) - =jeux_sortable_img("insectes_jeu_1", 1) + - - -#insectes_jeu_2 - - %h2 Jeu 2 - .labels - =jeux_receptable_label("Guêpe", 1) - =jeux_receptable_label("Ornithorynque bleu", 2) - =jeux_receptable_label("Moucheron funanbule", 3) - =jeux_receptable_label("Sarkoglyphte à tête bruni", 4) - =jeux_receptable_label("Fourmillier brun", 5) - =jeux_receptable_label("Pitbull musqué", 6) - - %p{:style => "clear:both;"} - %div.images - =jeux_receptable_element("insectes_jeu_2", 1) - =jeux_receptable_element("insectes_jeu_2", 2) - =jeux_receptable_element("insectes_jeu_2", 3) - =jeux_receptable_element("insectes_jeu_2", 4) - - =jeux_receptable_element("insectes_jeu_2", 5) - =jeux_receptable_element("insectes_jeu_2", 6) - - - - - -%p{:style => "clear:both;"} -%br -%br -%br -%br -%br \ No newline at end of file + =image_tag "plaquettes/insectes/texte.jpg", :style => "height:768px;position:absolute;top:0px;right:0px;display:block;margin:auto;" + .prev_slide + < + .next_slide + > diff --git a/app/views/plaquettes/jardins.html.haml b/app/views/plaquettes/jardins.html.haml new file mode 100644 index 0000000..bbbd808 --- /dev/null +++ b/app/views/plaquettes/jardins.html.haml @@ -0,0 +1,56 @@ + +.page + .content{:style => "width:500px;box-sizing:border-box;padding:1em;font-size:0.99em;"} + %div{:style => "font-size:1.30em;"} + %h1 Un jardin et son compost + + + + + %p + Les plantes et les animaux qui meurent sont décomposés par de nombreuses petites bêtes : + %p + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Insecte"}} insectes, + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Insecte"}} Vers, + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Insecte"}} champignons + + %p + La terre noire qui contient les matières dont les plantes ont besoin pour se développer s’appelle : + %a.img{:data => {:img => "/assets/plaquettes/jardin/humus.jpg", :legend => "Humus"}} l'humus + + %p + Toutes les matières ne mettent pas le même temps pour se décomposer, une + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Insecte"}} feuille + ou un fruit mettra en moyenne quelques mois, tandis qu’une + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Insecte"}} coque de noix + disparaîtra en plusieurs années et il faudra entre 100 et 1000 ans à + %a.img{:data => {:img => "/assets/plaquettes/jardin/sac.jpg", :legend => "Sac plastique dans la nature"}} un sac plastique + pour disparaître ! + + %p + Des déchets sont de + %a.img{:data => {:img => "/assets/plaquettes/jardin/piege.jpg", :desc => "Photo d'un mammifère coincé dans une bouteille ou étouffé par un sac."}} vrais pièges pour les animaux + ="." + + + + %p + On peut aussi laisser dans son jardin + %a.img{:data => {:img => "/assets/plaquettes/jardin/tas.jpg", :legend => "Tas de feuille"}} un tas de feuilles et de végétaux morts + ="." + Il constituera un abri très accueillant pour les petits mammifères sauvages ( + %a.img{:data => {:img => "/assets/plaquettes/jeu-batiment/6.jpg", :legend => "Insecte"}} hérisson + , + %a.img{:data => {:img => "/assets/plaquettes/jardin/campagnol.jpg", :legend => "Campagnol"}} campagnol + ) et les insectes (coccinelles en hiver). + + + + + =image_tag "plaquettes/insectes/texte.jpg", :style => "height:768px;position:absolute;top:0px;right:0px;display:block;margin:auto;" + + + .prev_slide + < + .next_slide + > \ No newline at end of file diff --git a/app/views/plaquettes/jeu-arbre.html.haml b/app/views/plaquettes/jeu-arbre.html.haml new file mode 100644 index 0000000..5a036cf --- /dev/null +++ b/app/views/plaquettes/jeu-arbre.html.haml @@ -0,0 +1,31 @@ +.page + + + .places_jeu + + %div{:style => "padding:22px;"} + .img{:style => "width:500px;"} + =image_tag "plaquettes/arbre.jpg", :style => "width:100%;" + + .receptable{:style => "top:200px;left:70px;", :data => {:rep => 1}} + .receptable{:style => "top:400px;left:250px;", :data => {:rep => 2}} + .receptable{:style => "top:100px;left:380px;", :data => {:rep => 3}} + .receptable{:style => "bottom:50px;left:250px;", :data => {:rep => 4}} + + .vignettes + + %h1 Les vieux arbres : un immeuble de biodiversité + + =image_tag "plaquettes/jeu-arbre/1.jpg", :class => "droppable", :data => {:rep => 1, :legend => "Ecureuil roux"} + =image_tag "plaquettes/jeu-arbre/2.jpg", :class => "droppable", :data => {:rep => 2, :legend => "Chouette hulotte"} + =image_tag "plaquettes/jeu-arbre/3.jpg", :class => "droppable", :data => {:rep => 3, :legend => "Sitelle torchepot"} + =image_tag "plaquettes/jeu-arbre/4.jpg", :class => "droppable", :data => {:rep => 4, :legend => "Mulot"} + + .success + %h3 Bravo, tu as re-placé tout les animaux + + .prev_slide + < + .next_slide + > + \ No newline at end of file diff --git a/app/views/plaquettes/mur-insectes.haml b/app/views/plaquettes/mur-insectes.haml new file mode 100644 index 0000000..98e7d2c --- /dev/null +++ b/app/views/plaquettes/mur-insectes.haml @@ -0,0 +1,31 @@ +.page + + + .places_jeu + + %div{:style => "padding:22px;"} + .img{:style => "width:500px;"} + =image_tag "plaquettes/mur-insectes/hotel.jpg", :style => "width:100%;" + + .receptable{:style => "top:225px;left:270px;", :data => {:rep => 1}} + .receptable{:style => "top:400px;left:250px;", :data => {:rep => 2}} + .receptable{:style => "top:140px;left:340px;", :data => {:rep => 3}} + .receptable{:style => "top:220px;left:85px;", :data => {:rep => 4}} + + .vignettes + + %h1 Les vieux arbres : un immeuble de biodiversité + + =image_tag "plaquettes/mur-insectes/abeille-sol.jpg", :class => "droppable", :data => {:rep => 1, :legend => "Abeille solitaire"} + =image_tag "plaquettes/mur-insectes/chrysope.jpg", :class => "droppable", :data => {:rep => 2, :legend => "Chrysope"} + =image_tag "plaquettes/mur-insectes/coccinelle.jpg", :class => "droppable", :data => {:rep => 3, :legend => "Coccinelle"} + =image_tag "plaquettes/mur-insectes/perce-oreille.jpg", :class => "droppable", :data => {:rep => 4, :legend => "Perce-oreille"} + + .success + %h3 Bravo, tu as re-placé tout les animaux + + .prev_slide + < + .next_slide + > + \ No newline at end of file diff --git a/app/views/plaquettes/old.txt b/app/views/plaquettes/old.txt new file mode 100644 index 0000000..2a4390f --- /dev/null +++ b/app/views/plaquettes/old.txt @@ -0,0 +1,34 @@ + +" \ No newline at end of file diff --git a/app/views/plaquettes/puzzle-chauve-souris.html.haml b/app/views/plaquettes/puzzle-chauve-souris.html.haml new file mode 100644 index 0000000..f91835f --- /dev/null +++ b/app/views/plaquettes/puzzle-chauve-souris.html.haml @@ -0,0 +1,76 @@ +.page + .prev_slide + < + .next_slide + > + .content + + %h1 Puzzle Chauve souris + + -width = 760 + -height = 475 + + + + .puzzle{:style => "position:relative;", :data => {:width => width.to_s+"px", :height => height.to_s+"px"}} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :id => "chauve-puzzle", :style => "opacity:0.2;width:#{width}px;height:#{height}px;" + + .piece_place{:style => "top:0px;left:0px;", :data => {:rep => 1}} + .piece_place{:style => "top:0px; left:#{width/3}px;", :data => {:rep => 2}} + .piece_place{:style => "top:0px; left:#{width/3*2}px;", :data => {:rep => 3}} + .piece_place{:style => "top:#{height/3}px;", :data => {:rep => 4}} + .piece_place{:style => "top:#{height/3}px;left:#{width/3}px;", :data => {:rep => 5}} + .piece_place{:style => "top:#{height/3}px;left:#{width/3*2}px;", :data => {:rep => 6}} + .piece_place{:style => "top:#{height/3*2}px;", :data => {:rep => 7}, } + .piece_place{:style => "left:#{width/3}px;top:#{height/3*2}px;", :data => {:rep => 8}} + .piece_place{:style => "left:#{width/3*2}px;top:#{height/3*2}px;", :data => {:rep => 9}} + + .pieces + .piece{:data => {:rep => 1}, :style => "top:448px;left:453px;-webkit-transform:rotate(2deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "" + .piece{:data => {:rep => 2}, :style => "top:390px; left:706px;-webkit-transform:rotate(3deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "left:-#{width/3}px;" + .piece{:data => {:rep => 3}, :style => "left: 754px; top: 153px;-webkit-transform:rotate(-4deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "left:-#{width/3*2}px;" + + .piece{:data => {:rep => 4}, :style => "top:480px;left:210px;-webkit-transform:rotate(-5deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "top:-#{height/3}px;" + .piece{:data => {:rep => 5}, :style => "top:30px;left:710px;-webkit-transform:rotate(7deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "top:-#{height/3}px;left:-#{width/3}px;" + .piece{:data => {:rep => 6}, :style => "top: 479px; left: 648px;-webkit-transform:rotate(5deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "top:-#{height/3}px;left:-#{width/3*2}px;" + + .piece{:data => {:rep => 7}, :style => "top: 257px; left: 719px;-webkit-transform:rotate(2deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "top:-#{height/3*2}px;" + .piece{:data => {:rep => 8}, :style => "left: 755px; top: 74px;-webkit-transform:rotate(-6deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "top:-#{height/3*2}px;left:-#{width/3}px;" + .piece{:data => {:rep => 9}, :style => "top:440px; left:40px;-webkit-transform:rotate(2deg)"} + =image_tag "plaquettes/chauve-souri-jeu.jpg", :style => "top:-#{height/3*2}px;left:-#{width/3*2}px;" + + .success{:style => "margin:1em;display:none;"} + %h2 Bravo, tu as réussi à reconstituer le puzzle. + %p Détails sur la chauve souris + %center + .btn.reset + Rejouer + + + + :css + .piece_place{ + overflow:hidden;position:absolute; + } + .piece{ + box-shadow:0 0 10px rgba(0,0,0,0.5); + overflow:hidden;position:absolute; + } + .piece img{ + position:absolute; + } \ No newline at end of file diff --git a/app/views/plaquettes/quizz-arbres.html.haml b/app/views/plaquettes/quizz-arbres.html.haml new file mode 100644 index 0000000..49b8264 --- /dev/null +++ b/app/views/plaquettes/quizz-arbres.html.haml @@ -0,0 +1,17 @@ +.page{:style => "background:url('/assets/plaquettes/fond.jpg'); background-size:cover;"} + + .content{:style => "position:absolute;background:rgba(250,250,250,0.8);width:460px;left:0px;top:0px;bottom:0px;height:auto;"} + + %h1 Quizz arbres + + .quizz + =quizz [["Laquelle de ces plantes n’est pas un arbre ?", [["le lierre", "c’est une liane"], ["le sapin", "c’est un arbre de la famille des résineux"], ["le chêne ", "c’est un arbre de la famille des feuillus"]], 1, "plaquettes/arbres/lierre.jpg"],["Faut-il conserver certains arbres morts ?", [["Oui","il faut des arbres morts dans une forêt"], ["non","les arbres morts sont très importants pour certains animaux, il faut donc en conserver quelques uns"]], 1], ["Parmi ces trois plantes laquelle trouve-t-on dans le parc du château de Longpra ?", [["le tilleul","on en trouve plusieurs"], ["le palmier","souviens-toi du texte"], ["le buddleia","souviens-toi du texte"]], 1],["Lequel de ces oiseaux fait son nid dans un trou d’arbre ?", [["le héron cendré ","avec ces grandes pattes il construit son nid en haut des arbres"], ["l’hirondelle rustique","elle construit un nid dans un bâtiment", "plaquettes/quizzs/hirondelle.jpg", "Hirondelles rustiques au nid"], ["le pic épeiche","il pond ses œufs dans un trou d’arbre", "plaquettes/quizzs/pic.jpg", "Pic épeiche"]], 3],["Le lierre est-il une plante parasite ?", [["oui","il ne tue pas les arbres, il s’en sert pour chercher de la lumière"], ["non",", il ne tue pas les arbres, il s’en sert pour chercher de la lumière"]], 2, "plaquettes/arbres/lierre.jpg"] ], "Bravo tu as répondu à toutes les questions.", "" + + .prev_slide + < + .next_slide + > + + + + \ No newline at end of file diff --git a/app/views/plaquettes/quizz-batiments.html.haml b/app/views/plaquettes/quizz-batiments.html.haml new file mode 100644 index 0000000..c15e890 --- /dev/null +++ b/app/views/plaquettes/quizz-batiments.html.haml @@ -0,0 +1,16 @@ +.page#quizz-batiment{:style => "background:url('/assets/plaquettes/jeu-batiment/batiment.jpg'); background-size:cover;"} + + + .content{:style => "position:absolute;background:rgba(250,250,250,0.8);width:460px;left:0px;top:0px;bottom:0px;height:auto;"} + + %h1 Quizz faune des bâtiments + + .quizz + =quizz [["Comment s’appellent les petites boules qui contiennent les déchets que la chouette effraie ne peut pas digérer?", [["Les pelotes de laine "], ["Les pelotes de déjection "], ["Les pelotes de rejection "]], 3],["Quels animaux sont les proies préférées de la chouette effraie ?", [["les campagnols ","elle peut en manger plus de 1500 par an"], ["les renards","Ils sont les concurrents de la chouette : ils mangent eux aussi des campagnols"], ["les lézards","ils vivent le jour alors que la chouette ne chasse que la nuit"]], 1, "plaquettes/quizzs/campagnol.jpg"], ["A quelle famille les lézards appartiennent-ils ?", [["amphibiens ","c’est la famille des grenouilles et crapauds"], ["mammifères","c’est la famille des animaux qui allaitent leurs petits"], ["reptiles ","les serpents en font également partie"]], 3, "plaquettes/quizzs/lezard.jpg", "Lézard des murailles"],["En hiver, où trouve-t-on les petits rhinolophes au château de Longpra ?", [["dans le grenier ","il fait trop froid en hiver dans le grenier"], ["dans la cave ","la température est stable et l’humidité permet au petit rhinolophe de garder ses ailes humides."], ["dans les vieux arbres","on les trouve dans les bâtiments"]], 2],["Comment appelle-t-on les oiseaux qui vivent la nuit comme le blaireau ou la chouette ?", [["somnambules ","ce sont les personnes qui marchent en dormant"], ["nocturnes "," ils dorment la journée et s’activent dès la tombée de la nuit"], ["nuisibles","ce sont les animaux qui abiment les plantes utiles "]], 2, "plaquettes/quizzs/chouette.jpg"] ], "Bravo tu as répondu à toutes les questions.", "Au château de Longpra, il y a de nombreuses cachettes pour les animaux. Et chez toi ?... Si tu n'en as pas, tu peux en construire : nichoirs, tas de bois... " + + + .prev_slide + < + + .next_slide + > \ No newline at end of file diff --git a/app/views/plaquettes/quizz-insectes.html.haml b/app/views/plaquettes/quizz-insectes.html.haml new file mode 100644 index 0000000..401fe6c --- /dev/null +++ b/app/views/plaquettes/quizz-insectes.html.haml @@ -0,0 +1,17 @@ +.page{:style => "background:url('/assets/plaquettes/fond.jpg'); background-size:cover;"} + + .content{:style => "position:absolute;background:rgba(250,250,250,0.8);width:460px;left:0px;top:0px;bottom:0px;height:auto;"} + + %h1 Quizz + + .quizz + =quizz [ ["Quel insecte saute, vole, stridule, et ressemble au criquet ?", [["La mouche"], ["La sauterelle", "on les différencie grâce à leurs antennes"], ["Le papillon "]],2],["Est-ce que les abeilles sauvages font du miel ?", [["Oui","elles produisent uniquement de la nourriture pour leurs larves (nectar et pollen)"], ["Non","ce sont les abeilles domestiques qui font du miel"]], 2, "plaquettes/quizzs/abeille.jpg", "Abeille solitaire Osmie"], ["Les pesticides sont-ils dangereux pour les insectes ?", [["Oui","ils peuvent causer la mort de certains insectes"], ["Non","ils peuvent causer la mort de certains insectes"]], 1],["Comment s’appelle la nourriture préférée des abeilles ?", [["Le nectar","on le trouve dans les fleurs"], ["La nectarine ","c’est un fruit"], ["Le délice","c’est quelque chose de bon"]], 1],["Quel insecte mange des pucerons ?", [["L’abeille","elle se nourrit de nectar"], ["La mouche","les pucerons ne font pas parties de sa nourriture"], ["La coccinelle", "elle peut en manger plusieurs milliers"]], 1] ], "Bravo tu as répondu à toutes les questions.", "" + + .prev_slide + < + .next_slide + > + + + + \ No newline at end of file diff --git a/app/views/plaquettes/quizz-jardin.html.haml b/app/views/plaquettes/quizz-jardin.html.haml new file mode 100644 index 0000000..b03acaf --- /dev/null +++ b/app/views/plaquettes/quizz-jardin.html.haml @@ -0,0 +1,15 @@ +.page{:style => "background:url('/assets/plaquettes/quizzs/fond_jardin.jpg'); background-size:cover;"} + + .content{:style => "position:absolute;background:rgba(250,250,250,0.8);width:460px;left:0px;top:0px;bottom:0px;height:auto;"} + + %h1 Quizz + + .quizz + =quizz [ ["Où le hérisson peut-il passer l’hiver ? ", [["dans la cave du château", "il peut rentrer dans les bâtiments.", nil, nil, true], ["sous un tas de bois ou de feuille", "il est ainsi protégé du froid et de la pluie.", nil, nil, true], ["enfoui dans la terre ", ", il peut occuper les terriers laissés vides (lapin, blaireau…)", nil, nil, true]],2], ["Pour continuer à avoir des cerises, quels animaux faut-il préserver ?", [["les insectes pollinisateurs ", "ils transportent le pollen "], ["les carnivores ", "ce sont les animaux qui mangent de la viande"], ["les granivores", "ce sont les animaux qui se nourrissent de graines"]],1],["Quelle petite bête ne participe pas à la décomposition de la matière organique* ? ", [["le cloporte "," il participe à la décomposition de la matière organique"], ["la coccinelle ","elle mange principalement les pucerons"], ["la fourmi", "elle participe à la décomposition de la matière organique"]], 2], ["D’où vient le nom du bousier ?", [["de sa couleur ","sa couleur n’a rien de particulier"], ["de sa nourriture ","il se nourrit entre autre de la bouse de vache"], ["de sa forme ", "sa forme n’a rien de particulier"]], 2],["Pour sa croissance une plante a besoin de terre, de soleil et …", [["d’engrais","cela aide juste la plante à pousser plus vite"], ["de sucre ","elle trouve sa nourriture dans le sol "], ["d’eau","l’eau est indispensable pour la croissance d’une plante"]], 3]], "Bravo tu as répondu à toutes les questions.", "" + + .prev_slide + < + .next_slide + > + + \ No newline at end of file diff --git a/app/views/plaquettes/remerciements.html.haml b/app/views/plaquettes/remerciements.html.haml new file mode 100644 index 0000000..697fb2d --- /dev/null +++ b/app/views/plaquettes/remerciements.html.haml @@ -0,0 +1,41 @@ +.page#acceuil + .prev_slide + < + + .content + =image_tag "plaquettes/logos/logo_longpra.jpg", :style => "margin:auto;display:block;height:200px;margin-bottom:1em;" + + %p Nous tenons à remercier les photographes de l’association qui nous ont gentiment donné les droits de leurs photos pour la confection de cette plaquette pédagogique. Notamment : + + %p + Yves Thonnerieux + %br + Jean-François Noblet + %br + Gérard Navizet + %br + Loïc Lambert + %br + Brigitte Colet-Lambolez + + %p Nous remercions également les personnes qui nous ont fait les illustrations : + + %p + Brigitte Colet-Lambolez + %br + Anne Berthelet + + %p Nous remercions également l'entreprise Nicolas Bally pour la confection de toute l’application. + + + + + + + #logos + =image_tag "plaquettes/logos/logo_pic_vert.png" + =image_tag "plaquettes/logos/logo_feader.jpg" + =image_tag "plaquettes/logos/logo_leader.jpg" + =image_tag "plaquettes/logos/logo_CAPV.jpg" + =image_tag "plaquettes/logos/logo_nb.png" + diff --git a/app/views/plaquettes/show.js.erb b/app/views/plaquettes/show.js.erb new file mode 100644 index 0000000..c793533 --- /dev/null +++ b/app/views/plaquettes/show.js.erb @@ -0,0 +1 @@ +$("#main").html("<%= escape_javascript(render(:template => "plaquettes/"+params[:slug].to_s)) %>"); \ No newline at end of file diff --git a/app/views/plaquettes/vie-arbre.html.haml b/app/views/plaquettes/vie-arbre.html.haml new file mode 100644 index 0000000..00ff0c6 --- /dev/null +++ b/app/views/plaquettes/vie-arbre.html.haml @@ -0,0 +1,79 @@ +.page + + .sortable_quizz + %h1{:style => "margin-bottom:-5px;z-index:2;position:relative;"} La vie d'un arbre + + + %table.vie-arbre + %tr + %td + %a.img{:"data-img" => "/assets/plaquettes/vie-arbre/1.jpg"}=image_tag "plaquettes/vie-arbre/1.jpg" + %td + %a.img{:"data-img" => "/assets/plaquettes/vie-arbre/2.jpg"}=image_tag "plaquettes/vie-arbre/2.jpg" + + + %td + %a.img{:"data-img" => "/assets/plaquettes/vie-arbre/3.jpg"}=image_tag "plaquettes/vie-arbre/3.jpg" + + %td + %a.img{:"data-img" => "/assets/plaquettes/vie-arbre/4.jpg"}=image_tag "plaquettes/vie-arbre/4.jpg" + + %td + %a.img{:"data-img" => "/assets/plaquettes/vie-arbre/5.jpg"}=image_tag "plaquettes/vie-arbre/5.jpg" + + + %table.vie-arbre.story + %tr + %td{:"data-order" => 5} + %p Cette fois il ne reste plus que la souche du tilleul : peut-être qu’il est tombé lors d’une petite tempête. Son bois va faire le régal de dizaine d’insectes et de larves et des champignons vont rapidement se développer dessus. Le tilleul va laisser la place à un autre jeune arbre qui accueillera lui aussi une foule d’êtres vivants. + + %td{:"data-order" => 3} + %p Une dizaine d’années est passée, il n’a plus grandi et un orage ou le vent lui a cassé une branche. Les trous de son tronc et ses branches servent de cachettes pour de nombreux animaux. La branche tombée au sol sera décomposée au bout de quelques années. + + + %td{:"data-order" => 1} + %p Ce tilleul est jeune, il a environ 10 ans, il est encore petit. De l’herbe et de nombreuses plantes poussent près de lui. + + + %td{:"data-order" => 4} + %p Le tilleul a bien vieilli, il est presque centenaire. Presque toutes ses branches sont mortes, sauf une qui donnent encore des feuilles au printemps. Heureusement pour la chouette hulotte ou les chauves-souris qui trouvent encore refuge dans ses cavités, personne ne l’a coupée. + + %td{:"data-order" => 2} + %p Le tilleul a beaucoup grandi : il a presque 60 ans. Son tronc est devenu très large et il possède de nombreuses branches. Des animaux viennent trouver de l’ombre à son pied. Ce tilleul a terminé sa croissance* (* il a fini de grandir) + + .success{:style => "position:absolute;bottom:0px;left:80px;color:green;display:none;"} + %h3 + Bravo tu as réussi à remettre l'histoire dans l'ordre. + .btn.reset Rejouer + + + :css + + .vie-arbre{ + width:1020px; + } + .vie-arbre td{ + vertical-align:top; + width:204px; + padding:0px; + max-width:200px; + border:0px !important; + } + + .vie-arbre img{ + vertical-align:top; + + + } + + + + + + + + + .prev_slide + < + .next_slide + > diff --git a/public/fonts/Stylograph/styl-webfont.eot b/public/fonts/Stylograph/styl-webfont.eot new file mode 100755 index 0000000..2153d79 Binary files /dev/null and b/public/fonts/Stylograph/styl-webfont.eot differ diff --git a/public/fonts/Stylograph/styl-webfont.ttf b/public/fonts/Stylograph/styl-webfont.ttf new file mode 100755 index 0000000..1047cc0 Binary files /dev/null and b/public/fonts/Stylograph/styl-webfont.ttf differ diff --git a/public/fonts/Stylograph/styl-webfont.woff b/public/fonts/Stylograph/styl-webfont.woff new file mode 100755 index 0000000..93211e3 Binary files /dev/null and b/public/fonts/Stylograph/styl-webfont.woff differ diff --git a/public/fonts/Stylograph/stylesheet.css b/public/fonts/Stylograph/stylesheet.css new file mode 100755 index 0000000..bbba1aa --- /dev/null +++ b/public/fonts/Stylograph/stylesheet.css @@ -0,0 +1,14 @@ +/* Generated by Font Squirrel (http://www.fontsquirrel.com) on August 28, 2013 */ + + + +@font-face { + font-family: 'Stylograph'; + src: url('styl-webfont.eot'); + src: url('styl-webfont.eot?#iefix') format('embedded-opentype'), + url('styl-webfont.woff') format('woff'), + url('styl-webfont.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + +} \ No newline at end of file diff --git a/public/touch/bgd1.jpg b/public/touch/bgd1.jpg new file mode 100644 index 0000000..b933fe3 Binary files /dev/null and b/public/touch/bgd1.jpg differ diff --git a/public/touch/bgd1old.jpg b/public/touch/bgd1old.jpg new file mode 100644 index 0000000..9376098 Binary files /dev/null and b/public/touch/bgd1old.jpg differ diff --git a/public/touch/bgd2.jpg b/public/touch/bgd2.jpg new file mode 100644 index 0000000..582cba9 Binary files /dev/null and b/public/touch/bgd2.jpg differ diff --git a/public/touch/bgd3.jpg b/public/touch/bgd3.jpg new file mode 100644 index 0000000..ba9bd19 Binary files /dev/null and b/public/touch/bgd3.jpg differ diff --git a/public/touch/bgd4.jpg b/public/touch/bgd4.jpg new file mode 100644 index 0000000..d0d8195 Binary files /dev/null and b/public/touch/bgd4.jpg differ diff --git a/public/touch/dragend.js b/public/touch/dragend.js new file mode 100755 index 0000000..489b743 --- /dev/null +++ b/public/touch/dragend.js @@ -0,0 +1,797 @@ +/** + * ---------------------------- DRAGEND JS ------------------------------------- + * + * Version: 0.2.0_rc1 + * https://github.com/Stereobit/dragend + * Copyright (c) 2012 Tobias Otte, t@stereob.it + * + * Licensed under MIT-style license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + ;(function( window ) { + "use strict"; + + function init( $, Hammer ) { + + // Welcome To dragend JS + // ===================== + // + // dragend JS is a swipe plugin for jQuery (http://jquery.com/). It's open + // source (https://github.com/Stereobit/dragend) and uses hammer.js + // (http://eightmedia.github.com/hammer.js/) for observing multi-touch + // gestures. You can use dragend JS in fullscreen or boxed mode. + // + // The current version is 0.2.0_rc2 + // + // Usage + // ===================== + // + // To activate dragend JS just call the function on a jQuery element + // + // $("#swipe-container").dragend(); + // + // You could rather pass in a options object or a string to bump on of the + // following behaviors: "up", "down", "left", "right" for swiping in one of + // these directions, "page" with the page number as second argument to go to a + // explicit page and without any value to go to the first page + // + // Settings + // ===================== + // + // You can use the following options: + // + // * pageClass: classname selector for all elments that should provide a page + // * direction: "horizontal" or "vertical" + // * minDragDistance: minuimum distance (in pixel) the user has to drag + // to trigger swip + // * scribe: pixel value for a possible scribe + // * onSwipeStart: callback function before the animation + // * onSwipeEnd: callback function after the animation + // * onDrag: callback on drag + // * onDragEnd: callback on dragend + // * borderBetweenPages: if you need space between pages add a pixel value + // * duration + // * hammerSettings + + var + + noop = function() {}, + + // Default setting + defaultSettings = { + pageClass : "dragend-page", + direction : "horizontal", + minDragDistance : "40", + onSwipeStart : noop, + onSwipeEnd : noop, + onDrag : noop, + onDragEnd : noop, + keyboardNavigation : false, + itemsInPage : 1, + scribe : 0, + borderBetweenPages : 0, + duration : 300, + hammerSettings : { + drag_min_distance: 0, + css_hacks : false, + prevent_default : true + } + }, + + keycodes = { + 37: "left", + 38: "up", + 39: "right", + 40: "down" + }, + + errors = { + handling: "Dragend JS detected some problems with the event handling. Maybe the user-drag CSS attribute on images can help", + pages: "No pages found", + hammer: "It seems like Hammer JS is not be included before dragend JS" + }, + + containerStyles = { + overflow: "hidden", + padding : 0 + }, + + setStyles = function( element, styles ) { + + var property, + value; + + for ( property in styles ) { + + if ( styles.hasOwnProperty(property) ) { + value = styles[property]; + + switch ( property ) { + case "height": + case "width": + case "marginLeft": + case "marginTop": + value += "px"; + } + + element.style[property] = value; + + } + + } + + }, + + extend = function( destination, source ) { + + var property; + + for ( property in source ) { + destination[property] = source[property]; + } + + return destination; + + }, + + proxy = function( fn, context ) { + + return function() { + return fn.apply( context, Array.prototype.slice.call(arguments) ); + }; + + }, + + getElementsByClassName = function( className, root ) { + var elements = [], + allElements; + + if ( document.querySelector && document.querySelectorAll ) { + elements = root.getElementsByClassName( className ); + } else { + allElements = root.getElementsByTagName('*'); + + for ( var i = 0; i < allElements.length; i++ ) { + if ((' ' + allElements[i].className + ' ').indexOf(' ' + className +' ') > -1 ) { + elements.push( allElements[i] ); + } + } + + } + + return Array.prototype.slice.call( elements ); + }, + + animate = function( element, propery, to, speed, callback ) { + + var start = + new Date(), + from = parseInt(element.style[propery], 10), + + timer = setInterval(function() { + + var timeGone = + new Date() - start, + value; + + if (timeGone >= speed) { + + value = to; + callback(); + + clearInterval( timer ); + + } else { + value = Math.round((( (to - from) * (Math.floor((timeGone / speed) * 100) / 100) ) + from)); + } + + element.style[propery] = value + "px"; + + }, 5); + + }, + + supports = (function() { + var div = document.createElement('div'), + vendors = 'Khtml Ms O Moz Webkit'.split(' '), + len = vendors.length; + + return function( prop ) { + if ( prop in div.style ) return true; + + prop = prop.replace(/^[a-z]/, function(val) { + return val.toUpperCase(); + }); + + while( len-- ) { + if ( vendors[len] + prop in div.style ) { + // browser supports box-shadow. Do what you need. + // Or use a bang (!) to test if the browser doesn't. + return true; + } + } + return false; + }; + })(), + + Dragend = function( container, settings ) { + var defaultSettingsCopy = extend( {}, defaultSettings ); + + this.settings = extend( defaultSettingsCopy, settings ); + this.container = container; + this.pageContainer = document.createElement( "div" ); + this.scrollBorder = { x: 0, y: 0 }; + this.page = 0; + this.preventScroll = false; + this.pageCssProperties = { + margin: 0 + }; + + this.pageContainer.innerHTML = this.container.innerHTML; + this.container.innerHTML = null; + this.container.appendChild( this.pageContainer ); + + // Initialisation + + setStyles(this.container, containerStyles); + this._observe(); + + // Give the DOM some time to update ... + window.setTimeout( proxy(function() { + this.updateInstance( settings ); + }, this), 10 ); + + }, + + // ### Scroll translate + // + // Animation when translate is supported + // + // Takes: + // x and y values to go with + + _scrollTransform = function( coordinates ) { + if ( this.settings.direction === "horizontal" ) { + setStyles( this.pageContainer, { + "-webkit-transform": "translateX(" + coordinates.x + "px)", + "-moz-transform": "translateX(" + coordinates.x + "px)", + "-ms-transform": "translateX(" + coordinates.x + "px)", + "-0-transform": "translateX(" + coordinates.x + "px)", + "transform": "translateX(" + coordinates.x + "px)" + }); + } else if (this.settings.direction === "vertical" ) { + setStyles( this.pageContainer, { + "-webkit-transform": "translateY(" + coordinates.y + "px)", + "-moz-transform": "translateY(" + coordinates.y + "px)", + "-ms-transform": "translateY(" + coordinates.y + "px)", + "-o-transform": "translateY(" + coordinates.y + "px)", + "transform": "translateY(" + coordinates.y + "px)" + }); + } + }, + + // ### Animated scroll with translate support + + _animateScrollTransform = function() { + setStyles( this.pageContainer, { + "-webkit-transition": "-webkit-transform " + this.settings.duration + "ms ease-out", + "-moz-transition": "-moz-transform " + this.settings.duration + "ms ease-out", + "-ms-transition": "-ms-transform " + this.settings.duration + "ms ease-out", + "-o-transition": "-o-transform " + this.settings.duration + "ms ease-out", + "transition": "transform " + this.settings.duration + "ms ease-out" + }); + + this._scroll({ + x: - this.scrollBorder.x, + y: - this.scrollBorder.y + }); + + window.setTimeout( proxy(afterScrollTranslate, this), this.settings.duration ); + }, + + afterScrollTranslate = function() { + this._onSwipeEnd(); + setStyles( this.pageContainer, { + "-webkit-transition": "-webkit-transform 0" + }); + }, + + // ### Scroll fallback + // + // Animation lookup table when translate isn't supported + // + // Takes: + // x and y values to go with + + _scrollWithoutTranslate = function( coordinates ) { + + if ( this.settings.direction === "horizontal") { + setStyles(this.pageContainer, { + "marginLeft": coordinates.x + }); + } else if ( this.settings.direction === "vertical" ) { + setStyles(this.pageContainer, { + "marginTop": coordinates.y + }); + } + }, + + // ### Animated scroll without translate support + + _animateScrollWithoutTranslate = function() { + var property, + value; + + this.activeElement = this.pages[this.page * this.settings.itemsInPage]; + + if ( this.settings.direction === "horizontal") { + property = "marginLeft"; + value = - this.scrollBorder.x; + } else if ( this.settings.direction === "vertical" ) { + property = "marginTop"; + value = - this.scrollBorder.y; + } + + animate( this.pageContainer, property, value, this.settings.duration, proxy( this._onSwipeEnd, this )); + + }; + + // ### Check translate support + ( function() { + + var scroll, + animateScroll; + + if ( supports('transform') ) { + scroll = _scrollTransform; + animateScroll = _animateScrollTransform; + } else { + scroll = _scrollWithoutTransform; + animateScroll = _animateScrollWithoutTranslate; + } + + extend( Dragend.prototype, { + "_scroll": scroll, + "_animateScroll": animateScroll + }); + + })(); + + + extend(Dragend.prototype, { + + // Private functions + // ================= + + // ### Overscroll lookup table + // + // Checks if its the last or first page to slow down the scrolling if so + // + // Takes: + // Drag event + + _checkOverscroll: function( direction, x, y ) { + var coordinates = { + x: x, + y: y, + overscroll: true + }; + + switch ( direction ) { + + case "right": + if ( !this.scrollBorder.x && this._checkGestureDirection( direction ) ) { + Math.round( coordinates.x = (x - this.scrollBorder.x) / 5 ); + return coordinates; + } + break; + + case "left": + if ( (this.pagesCount - 1) * this.pageDimentions.width <= this.scrollBorder.x ) { + coordinates.x = Math.round( - ((Math.ceil(this.pagesCount) - 1) * (this.pageDimentions.width + this.settings.borderBetweenPages)) + x / 5 ); + return coordinates; + } + break; + + case "down": + if ( !this.scrollBorder.y && this._checkGestureDirection( direction )) { + coordinates.y = Math.round( (y - this.scrollBorder.y) / 5 ); + return coordinates; + } + break; + + case "up": + if ( (this.pagesCount - 1) * this.pageDimentions.height <= this.scrollBorder.y ) { + coordinates.y = Math.round( - ((Math.ceil(this.pagesCount) - 1) * (this.pageDimentions.height + this.settings.borderBetweenPages)) + y / 5 ); + return coordinates; + } + break; + } + + return { + x: x - this.scrollBorder.x, + y: y - this.scrollBorder.y, + overscroll: false + }; + }, + + // Observe + // + // Sets the observers for drag, resize and key events + + _observe: function() { + if (!Hammer) { + throw new Error(errors.hammer); + } + + var hammer = new Hammer(this.container, this.settings.hammerSettings); + + hammer.on("drag", proxy( this._onDrag, this )) + .on( "dragend", proxy( this._onDragend, this )); + + Hammer.event.bindDom(window, "resize", proxy( this._sizePages, this )); + + if ( this.settings.keyboardNavigation ) { + Hammer.event.bindDom(document.body, "keydown", proxy( this._onKeydown, this )); + } + + }, + + _onDrag: function( event ) { + var gesture, + coordinates; + + event.stopPropagation(); + + if ( event.gesture ) { + gesture = event.gesture; + coordinates = this._checkOverscroll( gesture.direction, gesture.deltaX, gesture.deltaY ); + this.settings.onDrag.call( this, this.activeElement, gesture, coordinates.overscroll ); + } else { + throw new Error(errors.handling); + } + + if ( !this.preventScroll ) { + this._scroll( coordinates ); + } + + }, + + _onDragend: function( event ) { + var gesture; + + if (event.preventDefault) { + event.preventDefault(); + } else if (event.preventManipulation) { + event.preventManipulation(); + } + + if (event.gesture) { + gesture = event.gesture; + } else { + throw new Error(errors.handling); + } + + if ( event.gesture.distance > this.settings.minDragDistance && this._checkGestureDirection( gesture.direction )) { + this.swipe( gesture.direction ); + } else { + this._scrollToPage(); + } + + this.settings.onDragEnd.call( this, this.container, this.activeElement, this.page ); + }, + + _onKeydown: function( event ) { + var direction = keycodes[event.keyCode]; + + if ( direction ) { + this._scrollToPage(direction); + } + }, + + _checkGestureDirection: function( direction ) { + if (((direction === "left" || direction === "right") && this.settings.direction === "horizontal") || + ((direction === "up" || direction === "down") && this.settings.direction === "vertical") ) { + return true; + } + }, + + setHorizontalContainerCssValues: function() { + extend( this.pageCssProperties, { + "cssFloat" : "left", + "overflowY": "auto", + "overflowX": "hidden", + "padding" : 0, + "display" : "block" + }); + + setStyles(this.pageContainer, { + "overflow" : "hidden", + "width" : (this.pageDimentions.width + this.settings.borderBetweenPages) * this.pagesCount, + "boxSizing" : "content-box", + "-webkit-backface-visibility": "hidden", + "-webkit-perspective" : 1000, + "margin" : 0, + "padding" : 0 + }); + }, + + setVerticalContainerCssValues: function() { + extend( this.pageCssProperties, { + "overflow": "hidden", + "padding" : 0, + "display" : "block" + }); + + setStyles(this.pageContainer, { + "padding-bottom" : this.settings.scribe, + "boxSizing" : "content-box", + "-webkit-backface-visibility" : "hidden", + "-webkit-perspective" : 1000, + "margin" : 0 + }); + }, + + setContainerCssValues: function(){ + switch ( this.settings.direction ) { + case "horizontal": + this.setHorizontalContainerCssValues(); + break; + + case "vertical": + this.setVerticalContainerCssValues(); + break; + } + }, + + // ### Calculate page dimentions + // + // Updates the page dimentions values + + _setPageDimentions: function() { + var width = this.container.offsetWidth, + height = this.container.offsetHeight; + + if ( this.settings.direction === "horizontal" ) { + width = width - parseInt( this.settings.scribe, 10 ); + } else { + height = height - parseInt( this.settings.scribe, 10 ); + } + + this.pageDimentions = { + width : width, + height: height + }; + + }, + + // ### Size pages + + _sizePages: function() { + var pagesCount = this.pages.length; + + this._setPageDimentions(); + + this.setContainerCssValues(); + + if ( this.settings.direction === "horizontal" ) { + extend( this.pageCssProperties, { + height: this.pageDimentions.height, + width : this.pageDimentions.width / this.settings.itemsInPage + }); + } else { + extend( this.pageCssProperties, { + height: this.pageDimentions.height / this.settings.itemsInPage, + width : this.pageDimentions.width + }); + } + + for (var i = 0; i < pagesCount; i++) { + setStyles(this.pages[i], this.pageCssProperties); + } + + }, + + // ### Callculate new page + // + // Update global values for specific swipe action + // + // Takes direction and, if specific page is used the pagenumber + + _calcNewPage: function(direction, pageNumber) { + switch ( direction ) { + case "up": + if ( this.page < this.pagesCount - 1 ) { + this.scrollBorder.y = this.scrollBorder.y + this.pageDimentions.height + this.settings.borderBetweenPages; + this.page++; + } + break; + + case "down": + if ( this.page > 0 ) { + this.scrollBorder.y = this.scrollBorder.y - this.pageDimentions.height - this.settings.borderBetweenPages; + this.page--; + } + break; + + case "left": + if ( this.page < this.pagesCount - 1 ) { + this.scrollBorder.x = this.scrollBorder.x + this.pageDimentions.width + this.settings.borderBetweenPages; + this.page++; + } + break; + + case "right": + if ( this.page > 0 ) { + this.scrollBorder.x = this.scrollBorder.x - this.pageDimentions.width - this.settings.borderBetweenPages; + this.page--; + } + break; + + case "page": + switch ( this.settings.direction ) { + case "horizontal": + this.scrollBorder.x = (this.pageDimentions.width + this.settings.borderBetweenPages) * pageNumber; + break; + + case "vertical": + this.scrollBorder.y = (this.pageDimentions.height + this.settings.borderBetweenPages) * pageNumber; + break; + } + this.page = pageNumber; + break; + + default: + this.scrollBorder.y = 0; + this.scrollBorder.x = 0; + this.page = 0; + break; + } + }, + + // ### On swipe end + // + // Function called after the scroll animation ended + + _onSwipeEnd: function() { + this.preventScroll = false; + + this.activeElement = this.pages[this.page * this.settings.itemsInPage]; + + // Call onSwipeEnd callback function + this.settings.onSwipeEnd.call( this, this.container, this.activeElement, this.page); + }, + + // Jump to page + // + // Jumps without a animantion to specific page. The page number is only + // necessary for the specific page direction + // + // Takes: + // Direction and pagenumber + + _jumpToPage: function( options, pageNumber ) { + + if ( options ) { + this._calcNewPage( options, pageNumber ); + } + + this._scroll({ + x: - this.scrollBorder.x, + y: - this.scrollBorder.y + }); + }, + + // Scroll to page + // + // Scrolls with a animantion to specific page. The page number is only necessary + // for the specific page direction + // + // Takes: + // Direction and pagenumber + + _scrollToPage: function( options, pageNumber ) { + this.preventScroll = true; + + if ( options ) this._calcNewPage( options, pageNumber ); + this._animateScroll(); + }, + + // Public functions + // ================ + + swipe: function( direction ) { + // Call onSwipeStart callback function + this.settings.onSwipeStart.call( this, this.container, this.activeElement, this.page ); + this._scrollToPage( direction ); + }, + + updateInstance: function( settings ) { + + settings = settings || {}; + + if ( typeof settings === "object" ) extend( this.settings, settings ); + + this.pages = getElementsByClassName(this.settings.pageClass, this.pageContainer); + + if (this.pages.length) { + this.pagesCount = this.pages.length / this.settings.itemsInPage; + } else { + throw new Error(errors.pages); + } + + this.activeElement = this.pages[this.page * this.settings.itemsInPage]; + this._sizePages(); + + if ( settings.jumpToPage ) this.jumpToPage( settings.jumpToPage ); + }, + + scrollToPage: function( page ) { + this._scrollToPage( "page", page - 1); + }, + + jumpToPage: function( page ) { + this._jumpToPage( "page", page - 1); + } + + }); + + if ( $ ) { + + // Register jQuery plugin + $.fn.dragend = function( settings ) { + + settings = settings || {}; + + this.each(function() { + var instance = $(this).data( "dragend" ); + + // check if instance already created + if ( instance ) { + instance.updateInstance( settings ); + if ( settings.jumpToPage ) instance.jumpToPage( settings.jumpToPage ); + } else { + instance = new Dragend( this, settings ); + $(this).data( "dragend", instance ); + } + + if ( settings.scrollToPage ) instance.scrollToPage( settings.scrollToPage ); + + // check if should trigger swipe + if ( typeof settings === "string" ) instance.swipe( settings ); + + }); + + // jQuery functions should always return the intance + return this; + }; + + } + + return Dragend; + + } + + if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { + define( ["jquery", "hammer"], function( jquery, hammer ) { + return init( jquery, hammer ); + } ); + } else { + window.Dragend = init( window.jQuery || window.Zepto, window.Hammer ); + } + +})( window ); \ No newline at end of file diff --git a/public/touch/hammer.min.js b/public/touch/hammer.min.js new file mode 100755 index 0000000..b7f42c7 --- /dev/null +++ b/public/touch/hammer.min.js @@ -0,0 +1,7 @@ +/*! Hammer.JS - v1.0.6dev - 2013-09-12 + * http://eightmedia.github.com/hammer.js + * + * Copyright (c) 2013 Jorik Tangelder ; + * Licensed under the MIT license */ + +(function(t,e){"use strict";function n(){if(!r.READY){r.event.determineEventTypes();for(var t in r.gestures)r.gestures.hasOwnProperty(t)&&r.detection.register(r.gestures[t]);r.event.onTouch(r.DOCUMENT,r.EVENT_MOVE,r.detection.detect),r.event.onTouch(r.DOCUMENT,r.EVENT_END,r.detection.detect),r.READY=!0}}var r=function(t,e){return new r.Instance(t,e||{})};r.defaults={stop_browser_behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},r.HAS_POINTEREVENTS=t.navigator.pointerEnabled||t.navigator.msPointerEnabled,r.HAS_TOUCHEVENTS="ontouchstart"in t,r.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android|silk/i,r.NO_MOUSEEVENTS=r.HAS_TOUCHEVENTS&&t.navigator.userAgent.match(r.MOBILE_REGEX),r.EVENT_TYPES={},r.DIRECTION_DOWN="down",r.DIRECTION_LEFT="left",r.DIRECTION_UP="up",r.DIRECTION_RIGHT="right",r.POINTER_MOUSE="mouse",r.POINTER_TOUCH="touch",r.POINTER_PEN="pen",r.EVENT_START="start",r.EVENT_MOVE="move",r.EVENT_END="end",r.DOCUMENT=t.document,r.plugins={},r.READY=!1,r.Instance=function(t,e){var i=this;return n(),this.element=t,this.enabled=!0,this.options=r.utils.extend(r.utils.extend({},r.defaults),e||{}),this.options.stop_browser_behavior&&r.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),r.event.onTouch(t,r.EVENT_START,function(t){i.enabled&&r.detection.startDetect(i,t)}),this},r.Instance.prototype={on:function(t,e){for(var n=t.split(" "),r=0;n.length>r;r++)this.element.addEventListener(n[r],e,!1);return this},off:function(t,e){for(var n=t.split(" "),r=0;n.length>r;r++)this.element.removeEventListener(n[r],e,!1);return this},trigger:function(t,e){e||(e={});var n=r.DOCUMENT.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e;var i=this.element;return r.utils.hasParent(e.target,i)&&(i=e.target),i.dispatchEvent(n),this},enable:function(t){return this.enabled=t,this}};var i=null,o=!1,s=!1;r.event={bindDom:function(t,e,n){for(var r=e.split(" "),i=0;r.length>i;i++)t.addEventListener(r[i],n,!1)},onTouch:function(t,e,n){var a=this;this.bindDom(t,r.EVENT_TYPES[e],function(c){var u=c.type.toLowerCase();if(!u.match(/mouse/)||!s){u.match(/touch/)||u.match(/pointerdown/)||u.match(/mouse/)&&1===c.which?o=!0:u.match(/mouse/)&&1!==c.which&&(o=!1),u.match(/touch|pointer/)&&(s=!0);var h=0;o&&(r.HAS_POINTEREVENTS&&e!=r.EVENT_END?h=r.PointerEvent.updatePointer(e,c):u.match(/touch/)?h=c.touches.length:s||(h=u.match(/up/)?0:1),h>0&&e==r.EVENT_END?e=r.EVENT_MOVE:h||(e=r.EVENT_END),(h||null===i)&&(i=c),n.call(r.detection,a.collectEventData(t,e,a.getTouchList(i,e),c)),r.HAS_POINTEREVENTS&&e==r.EVENT_END&&(h=r.PointerEvent.updatePointer(e,c))),h||(i=null,o=!1,s=!1,r.PointerEvent.reset())}})},determineEventTypes:function(){var t;t=r.HAS_POINTEREVENTS?r.PointerEvent.getEvents():r.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],r.EVENT_TYPES[r.EVENT_START]=t[0],r.EVENT_TYPES[r.EVENT_MOVE]=t[1],r.EVENT_TYPES[r.EVENT_END]=t[2]},getTouchList:function(t){return r.HAS_POINTEREVENTS?r.PointerEvent.getTouchList():t.touches?t.touches:(t.indentifier=1,[t])},collectEventData:function(t,e,n,i){var o=r.POINTER_TOUCH;return(i.type.match(/mouse/)||r.PointerEvent.matchType(r.POINTER_MOUSE,i))&&(o=r.POINTER_MOUSE),{center:r.utils.getCenter(n),timeStamp:(new Date).getTime(),target:i.target,touches:n,eventType:e,pointerType:o,srcEvent:i,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation(),this.srcEvent.preventDefault&&this.srcEvent.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return r.detection.stopDetect()}}}},r.PointerEvent={pointers:{},getTouchList:function(){var t=this,e=[];return Object.keys(t.pointers).sort().forEach(function(n){e.push(t.pointers[n])}),e},updatePointer:function(t,e){return t==r.EVENT_END?this.pointers={}:(e.identifier=e.pointerId,this.pointers[e.pointerId]=e),Object.keys(this.pointers).length},matchType:function(t,e){if(!e.pointerType)return!1;var n={};return n[r.POINTER_MOUSE]=e.pointerType==e.MSPOINTER_TYPE_MOUSE||e.pointerType==r.POINTER_MOUSE,n[r.POINTER_TOUCH]=e.pointerType==e.MSPOINTER_TYPE_TOUCH||e.pointerType==r.POINTER_TOUCH,n[r.POINTER_PEN]=e.pointerType==e.MSPOINTER_TYPE_PEN||e.pointerType==r.POINTER_PEN,n[t]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},r.utils={extend:function(t,n,r){for(var i in n)t[i]!==e&&r||(t[i]=n[i]);return t},hasParent:function(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1},getCenter:function(t){for(var e=[],n=[],r=0,i=t.length;i>r;r++)e.push(t[r].pageX),n.push(t[r].pageY);return{pageX:(Math.min.apply(Math,e)+Math.max.apply(Math,e))/2,pageY:(Math.min.apply(Math,n)+Math.max.apply(Math,n))/2}},getVelocity:function(t,e,n){return{x:Math.abs(e/t)||0,y:Math.abs(n/t)||0}},getAngle:function(t,e){var n=e.pageY-t.pageY,r=e.pageX-t.pageX;return 180*Math.atan2(n,r)/Math.PI},getDirection:function(t,e){var n=Math.abs(t.pageX-e.pageX),i=Math.abs(t.pageY-e.pageY);return n>=i?t.pageX-e.pageX>0?r.DIRECTION_LEFT:r.DIRECTION_RIGHT:t.pageY-e.pageY>0?r.DIRECTION_UP:r.DIRECTION_DOWN},getDistance:function(t,e){var n=e.pageX-t.pageX,r=e.pageY-t.pageY;return Math.sqrt(n*n+r*r)},getScale:function(t,e){return t.length>=2&&e.length>=2?this.getDistance(e[0],e[1])/this.getDistance(t[0],t[1]):1},getRotation:function(t,e){return t.length>=2&&e.length>=2?this.getAngle(e[1],e[0])-this.getAngle(t[1],t[0]):0},isVertical:function(t){return t==r.DIRECTION_UP||t==r.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(t,e){var n,r=["webkit","khtml","moz","Moz","ms","o",""];if(e&&t.style){for(var i=0;r.length>i;i++)for(var o in e)e.hasOwnProperty(o)&&(n=o,r[i]&&(n=r[i]+n.substring(0,1).toUpperCase()+n.substring(1)),t.style[n]=e[o]);"none"==e.userSelect&&(t.onselectstart=function(){return!1}),"none"==e.userDrag&&(t.ondragstart=function(){return!1})}}},r.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(t,e){this.current||(this.stopped=!1,this.current={inst:t,startEvent:r.utils.extend({},e),lastEvent:!1,name:""},this.detect(e))},detect:function(t){if(this.current&&!this.stopped){t=this.extendEventData(t);for(var e=this.current.inst.options,n=0,i=this.gestures.length;i>n;n++){var o=this.gestures[n];if(!this.stopped&&e[o.name]!==!1&&o.handler.call(o,t,this.current.inst)===!1){this.stopDetect();break}}return this.current&&(this.current.lastEvent=t),t.eventType==r.EVENT_END&&!t.touches.length-1&&this.stopDetect(),t}},stopDetect:function(){this.previous=r.utils.extend({},this.current),this.current=null,this.stopped=!0},extendEventData:function(t){var e=this.current.startEvent;if(e&&(t.touches.length!=e.touches.length||t.touches===e.touches)){e.touches=[];for(var n=0,i=t.touches.length;i>n;n++)e.touches.push(r.utils.extend({},t.touches[n]))}var o=t.timeStamp-e.timeStamp,s=t.center.pageX-e.center.pageX,a=t.center.pageY-e.center.pageY,c=r.utils.getVelocity(o,s,a);return r.utils.extend(t,{deltaTime:o,deltaX:s,deltaY:a,velocityX:c.x,velocityY:c.y,distance:r.utils.getDistance(e.center,t.center),angle:r.utils.getAngle(e.center,t.center),interimAngle:this.current.lastEvent&&r.utils.getAngle(this.current.lastEvent.center,t.center),direction:r.utils.getDirection(e.center,t.center),interimDirection:this.current.lastEvent&&r.utils.getDirection(this.current.lastEvent.center,t.center),scale:r.utils.getScale(e.touches,t.touches),rotation:r.utils.getRotation(e.touches,t.touches),startEvent:e}),t},register:function(t){var n=t.defaults||{};return n[t.name]===e&&(n[t.name]=!0),r.utils.extend(r.defaults,n,!0),t.index=t.index||1e3,this.gestures.push(t),this.gestures.sort(function(t,e){return t.indexe.index?1:0}),this.gestures}},r.gestures=r.gestures||{},r.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(t,e){switch(t.eventType){case r.EVENT_START:clearTimeout(this.timer),r.detection.current.name=this.name,this.timer=setTimeout(function(){"hold"==r.detection.current.name&&e.trigger("hold",t)},e.options.hold_timeout);break;case r.EVENT_MOVE:t.distance>e.options.hold_threshold&&clearTimeout(this.timer);break;case r.EVENT_END:clearTimeout(this.timer)}}},r.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(t,e){if(t.eventType==r.EVENT_END&&"touchcancel"!=t.srcEvent.type){var n=r.detection.previous,i=!1;if(t.deltaTime>e.options.tap_max_touchtime||t.distance>e.options.tap_max_distance)return;n&&"tap"==n.name&&t.timeStamp-n.lastEvent.timeStamp0&&t.touches.length>e.options.swipe_max_touches)return;(t.velocityX>e.options.swipe_velocity||t.velocityY>e.options.swipe_velocity)&&(e.trigger(this.name,t),e.trigger(this.name+t.direction,t))}}},r.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!1,drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(t,n){if(r.detection.current.name!=this.name&&this.triggered)return n.trigger(this.name+"end",t),this.triggered=!1,e;if(!(n.options.drag_max_touches>0&&t.touches.length>n.options.drag_max_touches))switch(t.eventType){case r.EVENT_START:this.triggered=!1;break;case r.EVENT_MOVE:if(t.distancet.deltaY?r.DIRECTION_UP:r.DIRECTION_DOWN:0>t.deltaX?r.DIRECTION_LEFT:r.DIRECTION_RIGHT),this.triggered||(n.trigger(this.name+"start",t),this.triggered=!0),n.trigger(this.name,t),n.trigger(this.name+t.direction,t),(n.options.drag_block_vertical&&r.utils.isVertical(t.direction)||n.options.drag_block_horizontal&&!r.utils.isVertical(t.direction))&&t.preventDefault();break;case r.EVENT_END:this.triggered&&n.trigger(this.name+"end",t),this.triggered=!1}}},r.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(t,n){if(r.detection.current.name!=this.name&&this.triggered)return n.trigger(this.name+"end",t),this.triggered=!1,e;if(!(2>t.touches.length))switch(n.options.transform_always_block&&t.preventDefault(),t.eventType){case r.EVENT_START:this.triggered=!1;break;case r.EVENT_MOVE:var i=Math.abs(1-t.scale),o=Math.abs(t.rotation);if(n.options.transform_min_scale>i&&n.options.transform_min_rotation>o)return;r.detection.current.name=this.name,this.triggered||(n.trigger(this.name+"start",t),this.triggered=!0),n.trigger(this.name,t),o>n.options.transform_min_rotation&&n.trigger("rotate",t),i>n.options.transform_min_scale&&(n.trigger("pinch",t),n.trigger("pinch"+(1>t.scale?"in":"out"),t));break;case r.EVENT_END:this.triggered&&n.trigger(this.name+"end",t),this.triggered=!1}}},r.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(t,n){return n.options.prevent_mouseevents&&t.pointerType==r.POINTER_MOUSE?(t.stopDetect(),e):(n.options.prevent_default&&t.preventDefault(),t.eventType==r.EVENT_START&&n.trigger(this.name,t),e)}},r.gestures.Release={name:"release",index:1/0,handler:function(t,e){t.eventType==r.EVENT_END&&e.trigger(this.name,t)}},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return r}):"object"==typeof module&&"object"==typeof module.exports?module.exports=r:t.Hammer=r})(this); \ No newline at end of file diff --git a/public/touch/index.html b/public/touch/index.html new file mode 100755 index 0000000..065b01b --- /dev/null +++ b/public/touch/index.html @@ -0,0 +1,65 @@ + + + + jPuzzle + + + + + + + + + + + +

+ Puzzle 1 +

+ +

+ Puzzle 1 +

+ + + \ No newline at end of file diff --git a/public/touch/jquery-jPuzzle.js b/public/touch/jquery-jPuzzle.js new file mode 100644 index 0000000..0c9fb32 --- /dev/null +++ b/public/touch/jquery-jPuzzle.js @@ -0,0 +1,381 @@ +/*jPuzzle +jQuery plugin (http://jquery.com/) +jQuery => Copyright 2010, John Resig +jPuzzle => Copyright 2010, Adrien Guéret +Dual licensed under the MIT or GPL Version 2 licenses. +http://jquery.org/license +Last update: 26/07/2011*/ +(function($) +{ + $.fn.jPuzzle=function(options) + { + var defaults= + { + 'rows': 5, + 'columns': 5, + 'help': true, + 'fixed': true, + 'showHelpButton': true, + 'textPlayButton': 'Play !', + 'textHelpButtonShow': 'Show final image', + 'textHelpButtonHide': 'Hide final image', + 'onstart': null, + 'onend': null + }; + + var parameters=$.extend(defaults,options); + + parameters.rows=Math.max(1,parameters.rows); + parameters.columns=Math.max(1,parameters.columns); + + //Format time in seconds to HH"MM'SS + function formatTime(s) + { + s=parseInt(s,10); + + var h=Math.floor(s/3600); + s-=h*3600; + var formatTime=(h>9?h:'0'+h)+'"'; + + var m=Math.floor(s/60); + s-=m*60; + formatTime+=(m>9?m:'0'+m)+'\''; + + return formatTime+((s>9?s:'0'+s)); + } + + //Function waiting for the loading of the image + function loading() + { + if($(this).is('img')) + { + //If the image is not loaded, we have to wait for it + if(this.complete) + { + init($(this)); + } + else + { + $(this).load(function() + { + init($(this)); + }); + } + } + } + + function init(obj) + { + //We store the image dimensions... + var width=obj.width(); + var height=obj.height(); + + //... and the source of the image + var src=obj.attr('src'); + + //We calculate the pieces dimensions + var pieceWidth=width/parameters.columns; + var pieceHeight=height/parameters.rows; + + //And the height of the box containing all the pieces + var sizeBox=pieceHeight>height/2?pieceHeight:height/2; + + //The main container + var game=$('').css( + { + 'width': width+'px', + 'display': 'inline-block', + 'position': 'relative' + }).addClass('jPuzzle-game').insertAfter(obj); + + //The tag containing the puzzle + var puzzle=$('').css( + { + 'width': width+'px', + 'height': height+'px', + 'display': 'inline-block', + 'position': 'relative' + }).addClass('jPuzzle-container').appendTo(game); + + //The tag displaying the image as a background + var image=$('').css( + { + 'width': width+'px', + 'height': height+'px', + 'opacity': 1, + 'background-image': 'url("'+src+'")', + 'display': 'inline-block' + }).addClass('jPuzzle-image').appendTo(puzzle); + + //Box where the pieces will be generated + var box=$('').css( + { + 'width': width+'px', + 'minHeight': sizeBox+'px', + 'display': 'inline-block', + 'position': 'relative' + }).addClass('jPuzzle-box').droppable( + { + 'accept': '.jPuzzle-piece', + 'addClasses': false, + 'drop': function(event,ui) + { + var piece=ui.draggable; + var lastLocation=$.data(piece[0],'lastLocation'); + if(lastLocation[0]!=this) + { + /* If the piece comes from a puzzle location, + we have to adjust its position */ + piece.appendTo($(this)); + piece.css( + { + 'left': '+='+lastLocation.position().left, + 'top':(piece.position().top+lastLocation.position().top-puzzle.outerHeight())+'px' + }); + $.data(piece[0],'lastLocation',$(this)); + } + } + }).hide().insertAfter(puzzle); + + //Foot bar + var infos=$('').css( + { + 'width': width+'px', + 'display': 'inline-block' + }).addClass('jPuzzle-infos').insertAfter(box); + + //The data-time attribute will contain the elapsed time + var infosTime=$('').addClass('jPuzzle-time').attr('data-time',0).hide().appendTo(infos); + + var playButton=$('').val(parameters.textPlayButton).addClass('jPuzzle-playButton').click(function() + { + startGame(); + $(this).hide(); + }).appendTo(infos); + + if(parameters.showHelpButton) + { + var helpButton=$('').val(parameters.textHelpButtonShow).addClass('jPuzzle-helpButton').toggle(function() + { + //The final image is not displayed, we show it! + $(this).val(parameters.textHelpButtonHide).attr('disabled',true); + image.animate( + { + 'opacity': 1 + },'slow',function() + { + helpButton.removeAttr('disabled'); + }); + + //We hide the pieces of the puzzle to avoid the cheating + $('.jPuzzle-piece').hide(); + },function() + { + //The final image is displayed, we hide it! + $(this).val(parameters.textHelpButtonShow).attr('disabled',true); + + image.animate( + { + 'opacity': (parameters.help?0.1:0) + },'slow',function() + { + helpButton.removeAttr('disabled'); + }); + + $('.jPuzzle-piece').show(); + }).hide().appendTo(infos); + } + + //And we remove the initial image! + obj.remove(); + + var timer; + function startGame() + { + if(parameters.onstart) + { + parameters.onstart(game); + } + + box.show(); + infosTime.show(); + infosTime.text('00"00\'00'); + + if(parameters.showHelpButton) + { + helpButton.show(); + } + + image.animate( + { + 'opacity': (parameters.help?0.1:0) + },'slow'); + + for(var i=0;i').addClass('jPuzzle-piece') + .attr('data-num',i+'_'+j).css( + { + 'width': pieceWidth+'px', + 'height': pieceHeight+'px', + 'display': 'block', + 'left': Math.floor((Math.random()*(maxX+1)))+'px', + 'top': Math.floor((Math.random()*(maxY+1)))+'px', + 'z-index': Math.floor((Math.random()*(10))+1), + 'background-image': 'url("'+src+'")', + 'cursor': 'move', + 'background-position': (-j*pieceWidth)+'px '+(-i*pieceHeight)+'px', + 'position': 'absolute' + }).draggable( + { + 'start': function(event,ui) + { + /* If the piece is already on its + good location, we stop the dragging */ + if($.data(this,'ok') && parameters.fixed) + { + return false; + } + + //Otherwise, we put the piece in front of the others + var zIndex=0; + game.find('.jPuzzle-piece').each(function() + { + var x=parseInt($(this).css('z-index')); + zIndex=Math.max(x,zIndex); + }); + $(this).css('z-index',zIndex+1); + }, + 'revert': 'invalid', + 'containment': game + }).appendTo(box); + + $.data(piece[0],'ok',false); + $.data(piece[0],'lastLocation',box); + + var location=$('').addClass('jPuzzle-location') + .attr('data-num',i+'_'+j).css( + { + 'width': pieceWidth+'px', + 'height': pieceHeight+'px', + 'left': j*pieceWidth+'px', + 'top': i*pieceHeight+'px', + 'display': 'block', + 'position': 'absolute' + }).droppable( + { + 'accept': function(ui) + { + /* We accept only puzzle pieces, and only if the location is empty + We also check if the piece and the location are in the same puzzle game */ + return (ui.hasClass('jPuzzle-piece') && $(this).is(':empty') && $(this).parents('.jPuzzle-game')[0]==ui.parents('.jPuzzle-game')[0]); + }, + 'addClasses': false, + 'hoverClass': 'jPuzzle-location-hover', + 'drop': function(event,ui) + { + var obj=$(this); + + ui.draggable.appendTo(obj); + $.data(ui.draggable[0],'lastLocation',obj); + + ui.draggable.css( + { + 'left': '0px', + 'top': '0px' + }); + + /* If piece and location have the same data-num attribute, + then the piece is correctly placed !*/ + $.data(ui.draggable[0],'ok',false); + if(obj.attr('data-num')==ui.draggable.attr('data-num')) + { + $.data(ui.draggable[0],'ok',true); + + /* If we can't remove a piece which is correctly + placed, we can apply a small effect on it*/ + if(parameters.fixed) + { + /* We modify the cursor to indicate + the piece is not longer draggable */ + ui.draggable.css('cursor','default'); + + /* This span will add a "flash + effect" on the piece */ + $('').css( + { + 'position': 'absolute', + 'left': '0px', + 'top': '0px', + 'display':'block', + 'width': '100%', + 'height': '100%', + 'background-color': '#fff' + }).appendTo(ui.draggable) + .fadeOut(2000,function() + { + $(this).remove(); + }); + } + + //The player has correctly placed one piece: what about the others? + var total=0; + game.find('.jPuzzle-piece').each(function() + { + if(!$.data(this,'ok')) + { + return false; + } + total++; + }); + if(total==parameters.rows*parameters.columns) + { + endGame(); + } + } + } + }).appendTo(puzzle); + } + } + + timer=setInterval(function() + { + infosTime.attr('data-time',parseInt(infosTime.attr('data-time'),10)+1); + infosTime.text(formatTime(infosTime.attr('data-time'))); + },1000); + } + + function endGame() + { + //We stop the timer + clearInterval(timer); + var time=parseInt(infosTime.attr('data-time'),10); + + //We set the puzzle to its initial state + box.hide(); + game.find('.jPuzzle-piece,.jPuzzle-location').remove(); + image.css('opacity','1'); + if(parameters.showHelpButton) + { + helpButton.hide(); + } + infosTime.hide().attr('data-time',0); + playButton.show(); + + //We eventually call a function defined by the user + if(parameters.onend) + { + //We send to this function three useful variables + parameters.onend(game,time,formatTime(time)); + } + } + } + + return this.each(loading); + }; +})(jQuery); \ No newline at end of file diff --git a/public/touch/jquery.min.js b/public/touch/jquery.min.js new file mode 100755 index 0000000..76d21a4 --- /dev/null +++ b/public/touch/jquery.min.js @@ -0,0 +1,6 @@ +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery-1.10.2.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("