Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Anderson <tony@traveler.(none)>2011-02-27 12:42:01 (GMT)
committer Tony Anderson <tony@traveler.(none)>2011-02-27 12:42:01 (GMT)
commit7307b74f13329171f58f59550f4f14e03be5d5da (patch)
tree75a9bfcb21085d67484f6d73a0c53d38696d3d6a
parent5227d05b333365d3d7f5380167b1ea97c8e69e63 (diff)
version 12.1
-rwxr-xr-xactivity/activity.info4
-rwxr-xr-xcgi-bin/activities.py117
-rwxr-xr-xcgi-bin/downloadFile.py16
-rwxr-xr-xcgi-bin/fetchMilestone.py31
-rwxr-xr-xcgi-bin/play.py38
-rwxr-xr-xcgi-bin/setConfig.py17
-rwxr-xr-xcgi-bin/setUpSubject.py26
-rw-r--r--content/English/activities_p4.js9
-rw-r--r--content/English/activities_p5.js12
-rw-r--r--content/English/activities_p6.js12
-rwxr-xr-xcontent/English/index.html33
-rwxr-xr-xcontent/English/p4.html33
-rwxr-xr-xcontent/English/p5.html33
-rwxr-xr-xcontent/English/p6.html33
-rwxr-xr-xcontent/Explore/activities.js11
-rw-r--r--content/Explore/assets/image/Blue_Marble.jpgbin9735 -> 0 bytes
-rw-r--r--content/Explore/assets/image/English_Flag.jpgbin1537 -> 0 bytes
-rw-r--r--content/Explore/assets/image/Landscape.jpgbin2147 -> 0 bytes
-rwxr-xr-xcontent/Explore/assets/image/btn_start.pngbin5127 -> 0 bytes
-rwxr-xr-xcontent/Explore/assets/image/btn_start_hover.pngbin4966 -> 0 bytes
-rwxr-xr-xcontent/Explore/assets/image/btn_start_mouse_down.pngbin5109 -> 0 bytes
-rw-r--r--content/Explore/assets/image/explore.pngbin6393 -> 0 bytes
-rwxr-xr-xcontent/Explore/assets/image/favicon.icobin32220 -> 0 bytes
-rw-r--r--content/Explore/assets/image/harp.jpgbin1347 -> 0 bytes
-rwxr-xr-xcontent/Explore/assets/image/health.pngbin17690 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/global.css174
-rwxr-xr-xcontent/Explore/css/images/arrow_down_white.svg18
-rwxr-xr-xcontent/Explore/css/images/bg_footer.pngbin137 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/bg_header.pngbin225 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/bg_title_block.pngbin274 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_back.pngbin2665 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_back_hover.pngbin4038 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_help.pngbin2755 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_help_hover.pngbin4190 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_minus25x25.pngbin1234 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_minus_hover.pngbin3612 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_ole.pngbin4842 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_ole_hover.pngbin6253 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_plus25x25.pngbin1395 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/btn_plus_hover.pngbin3780 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/correct.pngbin1190 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/correct200x178.pngbin22142 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/correct200x190.pngbin14858 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/epaath_bg_footer.pngbin137 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/epaath_bg_header.pngbin225 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/happy-face.pngbin55108 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/incorrect.pngbin1379 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/incorrect200x178.pngbin25462 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/incorrect200x190.pngbin23730 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/oleHelp.pngbin348724 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/ole_logo.pngbin6678 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/sad-face.pngbin55007 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/start_page.pngbin65859 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/title_block_lt.pngbin1057 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/images/title_block_rt.pngbin1074 -> 0 bytes
-rwxr-xr-xcontent/Explore/css/intro.css97
-rwxr-xr-xcontent/Explore/css/jquery.svg.css15
-rwxr-xr-xcontent/Explore/css/kStart.css195
-rwxr-xr-xcontent/Explore/css/qunit.css17
-rwxr-xr-xcontent/Explore/css/ui.all.css2
-rwxr-xr-xcontent/Explore/css/ui.base.css2
-rwxr-xr-xcontent/Explore/css/ui.core.css37
-rwxr-xr-xcontent/Explore/css/ui.dialog.css13
-rwxr-xr-xcontent/Explore/css/ui.feedback.css56
-rwxr-xr-xcontent/Explore/css/ui.kFooter.css56
-rwxr-xr-xcontent/Explore/css/ui.kHeader.css160
-rwxr-xr-xcontent/Explore/css/ui.resizable.css13
-rwxr-xr-xcontent/Explore/css/ui.scoreboard.css62
-rwxr-xr-xcontent/Explore/css/ui.tabs.css11
-rwxr-xr-xcontent/Explore/css/ui.theme.css245
-rwxr-xr-xcontent/Explore/index.html34
-rwxr-xr-xcontent/Explore/js/global.js57
-rwxr-xr-xcontent/Explore/js/global.js~57
-rwxr-xr-xcontent/Explore/js/jquery-1.3.2.min.js19
-rwxr-xr-xcontent/Explore/js/jquery-1.4.js5999
-rwxr-xr-xcontent/Explore/js/jquery.es.json1
-rwxr-xr-xcontent/Explore/js/jquery.i18n.js94
-rwxr-xr-xcontent/Explore/js/jquery.jgrowl_minimized.js4
-rwxr-xr-xcontent/Explore/js/jquery.ne.json13
-rwxr-xr-xcontent/Explore/js/jquery.svg.js1325
-rwxr-xr-xcontent/Explore/js/jquery.svg.min.js7
-rwxr-xr-xcontent/Explore/js/jquery.svg.pack.js7
-rwxr-xr-xcontent/Explore/js/jquery.svganim.min.js7
-rwxr-xr-xcontent/Explore/js/jquery.svgdom.js355
-rwxr-xr-xcontent/Explore/js/jquery.svgdom.min.js7
-rwxr-xr-xcontent/Explore/js/jquery.svgdom.pack.js7
-rwxr-xr-xcontent/Explore/js/kDoc.js24
-rwxr-xr-xcontent/Explore/js/karma.js1758
-rwxr-xr-xcontent/Explore/js/menu.js186
-rwxr-xr-xcontent/Explore/js/qunit.js1027
-rwxr-xr-xcontent/Explore/js/raphael-min.js7
-rwxr-xr-xcontent/Explore/js/subject.js205
-rwxr-xr-xcontent/Explore/js/ui.core-draggable-resizable-dialog.js2756
-rwxr-xr-xcontent/Explore/js/ui.core.js519
-rwxr-xr-xcontent/Explore/js/ui.dialog.js671
-rwxr-xr-xcontent/Explore/js/ui.draggable.js766
-rwxr-xr-xcontent/Explore/js/ui.droppable.js282
-rwxr-xr-xcontent/Explore/js/ui.feedback.js137
-rwxr-xr-xcontent/Explore/js/ui.kFooter.js369
-rwxr-xr-xcontent/Explore/js/ui.resizable.js800
-rwxr-xr-xcontent/Explore/js/ui.scoreboard.js107
-rw-r--r--content/Mathematics/activities_p4.js19
-rw-r--r--content/Mathematics/activities_p5.js22
-rw-r--r--content/Mathematics/activities_p6.js24
-rwxr-xr-xcontent/Mathematics/index.html33
-rwxr-xr-xcontent/Mathematics/p4.html33
-rwxr-xr-xcontent/Mathematics/p5.html33
-rwxr-xr-xcontent/Mathematics/p6.html33
-rwxr-xr-xcontent/assets/audio/noclip.oggbin73542 -> 0 bytes
-rwxr-xr-xcontent/assets/default/image/favicon.icobin15086 -> 0 bytes
-rwxr-xr-xcontent/assets/image/background.jpgbin103028 -> 0 bytes
-rwxr-xr-xcontent/assets/image/bg_footer.pngbin185 -> 0 bytes
-rwxr-xr-xcontent/assets/image/bg_header.pngbin307 -> 0 bytes
-rwxr-xr-xcontent/assets/image/bg_title_block.pngbin366 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_back.pngbin2665 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_back_hover.pngbin4038 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_back_subject.pngbin3234 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_help.pngbin2755 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_help_hover.pngbin4190 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_next.pngbin2773 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_next_hover.pngbin3996 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_ole.pngbin4842 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_ole_hover.pngbin6253 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_play_again.pngbin5627 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_play_again_hover.pngbin5468 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_play_again_mouse_down.pngbin5688 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_start.pngbin5127 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_start_hover.pngbin4966 -> 0 bytes
-rwxr-xr-xcontent/assets/image/btn_start_mouse_down.pngbin5109 -> 0 bytes
-rwxr-xr-xcontent/assets/image/english.pngbin13245 -> 0 bytes
-rw-r--r--content/assets/image/explore.pngbin6393 -> 0 bytes
-rwxr-xr-xcontent/assets/image/favicon.icobin32220 -> 0 bytes
-rwxr-xr-xcontent/assets/image/library.gifbin770 -> 0 bytes
-rwxr-xr-xcontent/assets/image/mathematics.pngbin6375 -> 0 bytes
-rw-r--r--content/assets/image/next.pngbin1741 -> 0 bytes
-rwxr-xr-xcontent/assets/image/picClock.pngbin2622 -> 0 bytes
-rwxr-xr-xcontent/assets/image/title_block_lt.pngbin1337 -> 0 bytes
-rwxr-xr-xcontent/assets/image/title_block_rt.pngbin1362 -> 0 bytes
-rwxr-xr-xcontent/css/images/arrow_down_white.pngbin417 -> 0 bytes
-rwxr-xr-xcontent/css/images/arrow_down_white.svg18
-rwxr-xr-xcontent/css/images/back_button_hover.pngbin3700 -> 0 bytes
-rwxr-xr-xcontent/css/images/back_button_start.pngbin3757 -> 0 bytes
-rwxr-xr-xcontent/css/images/bg.pngbin77784 -> 0 bytes
-rwxr-xr-xcontent/css/images/bg_footer.pngbin137 -> 0 bytes
-rwxr-xr-xcontent/css/images/bg_header.pngbin225 -> 0 bytes
-rwxr-xr-xcontent/css/images/bg_title_block.pngbin274 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_back.pngbin2665 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_back_hover.pngbin4038 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_help.pngbin2755 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_help_hover.pngbin4190 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_minus.pngbin2342 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_minus25x25.pngbin1234 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_minus_hover.pngbin3612 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_ole.pngbin4842 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_ole_hover.pngbin6253 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_plus.pngbin2335 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_plus25x25.pngbin1395 -> 0 bytes
-rwxr-xr-xcontent/css/images/btn_plus_hover.pngbin3780 -> 0 bytes
-rwxr-xr-xcontent/css/images/correct.pngbin1190 -> 0 bytes
-rwxr-xr-xcontent/css/images/correct200x178.pngbin22142 -> 0 bytes
-rwxr-xr-xcontent/css/images/correct200x190.pngbin14858 -> 0 bytes
-rwxr-xr-xcontent/css/images/epaath_bg_footer.pngbin137 -> 0 bytes
-rwxr-xr-xcontent/css/images/epaath_bg_header.pngbin225 -> 0 bytes
-rwxr-xr-xcontent/css/images/happy-face.pngbin55108 -> 0 bytes
-rwxr-xr-xcontent/css/images/incorrect.pngbin1379 -> 0 bytes
-rwxr-xr-xcontent/css/images/incorrect200x178.pngbin25462 -> 0 bytes
-rwxr-xr-xcontent/css/images/incorrect200x190.pngbin23730 -> 0 bytes
-rwxr-xr-xcontent/css/images/oleHelp.pngbin348724 -> 0 bytes
-rwxr-xr-xcontent/css/images/ole_logo.pngbin6678 -> 0 bytes
-rwxr-xr-xcontent/css/images/sad-face.pngbin55007 -> 0 bytes
-rwxr-xr-xcontent/css/images/start_page.pngbin65859 -> 0 bytes
-rwxr-xr-xcontent/css/images/title_block_lt.pngbin1057 -> 0 bytes
-rwxr-xr-xcontent/css/images/title_block_rt.pngbin1074 -> 0 bytes
-rwxr-xr-xcontent/css/intro.css97
-rwxr-xr-xcontent/css/jquery.svg.css15
-rw-r--r--content/css/jquizme.css134
-rwxr-xr-xcontent/css/kDoc.css28
-rwxr-xr-xcontent/css/kStart.css195
-rwxr-xr-xcontent/css/karma.css49
-rwxr-xr-xcontent/css/kglobal.css141
-rwxr-xr-xcontent/css/qunit.css17
-rwxr-xr-xcontent/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.pngbin180 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.pngbin213 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_flat_75_ffffff_40x100.pngbin178 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.pngbin120 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_glass_65_e774ec_1x400.pngbin128 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_glass_75_f49aec_1x400.pngbin130 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.pngbin125 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.pngbin151 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.pngbin123 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_222222_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_222222_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_2e83ff_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_2e83ff_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_454545_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_454545_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_7811a2_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_7811a2_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_cd0a0a_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/css/theme/images/ui-icons_cd0a0a_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/css/theme/jquery-ui-1.7.2.custom.css406
-rwxr-xr-xcontent/css/ui.all.css2
-rwxr-xr-xcontent/css/ui.base.css2
-rwxr-xr-xcontent/css/ui.core.css37
-rwxr-xr-xcontent/css/ui.dialog.css13
-rwxr-xr-xcontent/css/ui.feedback.css56
-rwxr-xr-xcontent/css/ui.kFooter.css56
-rwxr-xr-xcontent/css/ui.kHeader.css160
-rwxr-xr-xcontent/css/ui.resizable.css13
-rwxr-xr-xcontent/css/ui.scoreboard.css62
-rwxr-xr-xcontent/css/ui.tabs.css11
-rwxr-xr-xcontent/css/ui.theme.css245
-rwxr-xr-xcontent/index.html18
-rwxr-xr-xcontent/js/common.js218
-rwxr-xr-xcontent/js/explore.js219
-rwxr-xr-xcontent/js/global.js130
-rwxr-xr-xcontent/js/global.js~57
-rwxr-xr-xcontent/js/jquery-1.3.2.min.js19
-rwxr-xr-xcontent/js/jquery-1.4.js5999
-rwxr-xr-xcontent/js/jquery-1.js4376
-rwxr-xr-xcontent/js/jquery-ui-1.js298
-rwxr-xr-xcontent/js/jquery-ui.all.js7531
-rwxr-xr-xcontent/js/jquery.es.json1
-rwxr-xr-xcontent/js/jquery.i18n.js94
-rwxr-xr-xcontent/js/jquery.jgrowl_minimized.js4
-rwxr-xr-xcontent/js/jquery.ne.json13
-rwxr-xr-xcontent/js/jquery.svg.js1325
-rwxr-xr-xcontent/js/jquery.svg.min.js7
-rwxr-xr-xcontent/js/jquery.svg.pack.js7
-rwxr-xr-xcontent/js/jquery.svganim.min.js7
-rwxr-xr-xcontent/js/jquery.svgdom.js355
-rwxr-xr-xcontent/js/jquery.svgdom.min.js7
-rwxr-xr-xcontent/js/jquery.svgdom.pack.js7
-rwxr-xr-xcontent/js/jquery.ui.all.js7531
-rwxr-xr-xcontent/js/jquery.watermarkinput.js81
-rw-r--r--content/js/jquizme.js1028
-rwxr-xr-xcontent/js/kDoc.js24
-rwxr-xr-xcontent/js/karma.js1758
-rwxr-xr-xcontent/js/kglobal.js57
-rwxr-xr-xcontent/js/kkarma.js1758
-rwxr-xr-xcontent/js/langs/en.js169
-rwxr-xr-xcontent/js/learner_lesson.js228
-rwxr-xr-xcontent/js/learner_subject.js224
-rwxr-xr-xcontent/js/math.js274
-rwxr-xr-xcontent/js/menu.js217
-rwxr-xr-xcontent/js/navigation.js43
-rwxr-xr-xcontent/js/qunit.js1027
-rwxr-xr-xcontent/js/raphael-min.js7
-rwxr-xr-xcontent/js/subject.js219
-rwxr-xr-xcontent/js/themes/advanced/editor_template.js1
-rwxr-xr-xcontent/js/themes/advanced/langs/en.js169
-rwxr-xr-xcontent/js/ui.core-draggable-resizable-dialog.js2756
-rwxr-xr-xcontent/js/ui.core.js519
-rwxr-xr-xcontent/js/ui.dialog.js671
-rwxr-xr-xcontent/js/ui.draggable.js766
-rwxr-xr-xcontent/js/ui.droppable.js282
-rwxr-xr-xcontent/js/ui.feedback.js137
-rwxr-xr-xcontent/js/ui.kFooter.js369
-rwxr-xr-xcontent/js/ui.kHeader.js235
-rwxr-xr-xcontent/js/ui.resizable.js800
-rwxr-xr-xcontent/js/ui.scoreboard.js107
-rwxr-xr-xcontent/karma/css/kDoc.css28
-rwxr-xr-xcontent/karma/css/karma.css49
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.pngbin180 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.pngbin213 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_flat_75_ffffff_40x100.pngbin178 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.pngbin120 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_glass_65_e774ec_1x400.pngbin128 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_glass_75_f49aec_1x400.pngbin130 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.pngbin125 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.pngbin151 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.pngbin123 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_222222_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_222222_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_2e83ff_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_2e83ff_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_454545_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_454545_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_7811a2_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_7811a2_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_cd0a0a_256x240.pngbin4369 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/images/ui-icons_cd0a0a_768x720.pngbin5345 -> 0 bytes
-rwxr-xr-xcontent/karma/css/theme/jquery-ui-1.7.2.custom.css406
-rwxr-xr-xcontent/karma/image/arrow_down_white.pngbin417 -> 0 bytes
-rwxr-xr-xcontent/karma/image/back_button_hover.pngbin3700 -> 0 bytes
-rwxr-xr-xcontent/karma/image/back_button_start.pngbin3757 -> 0 bytes
-rwxr-xr-xcontent/karma/image/bg.pngbin77784 -> 0 bytes
-rw-r--r--content/karma/image/bg_footer.pngbin185 -> 0 bytes
-rw-r--r--content/karma/image/bg_header.pngbin307 -> 0 bytes
-rw-r--r--content/karma/image/bg_title_block.pngbin366 -> 0 bytes
-rw-r--r--content/karma/image/btn_back.pngbin2665 -> 0 bytes
-rw-r--r--content/karma/image/btn_back_hover.pngbin4038 -> 0 bytes
-rw-r--r--content/karma/image/btn_help.pngbin2755 -> 0 bytes
-rw-r--r--content/karma/image/btn_help_hover.pngbin4190 -> 0 bytes
-rwxr-xr-xcontent/karma/image/btn_minus.pngbin2342 -> 0 bytes
-rw-r--r--content/karma/image/btn_next.pngbin2773 -> 0 bytes
-rw-r--r--content/karma/image/btn_next_hover.pngbin3996 -> 0 bytes
-rw-r--r--content/karma/image/btn_ole.pngbin4842 -> 0 bytes
-rw-r--r--content/karma/image/btn_ole_hover.pngbin6253 -> 0 bytes
-rw-r--r--content/karma/image/btn_play_again.pngbin5627 -> 0 bytes
-rw-r--r--content/karma/image/btn_play_again_hover.pngbin5468 -> 0 bytes
-rw-r--r--content/karma/image/btn_play_again_mouse_down.pngbin5688 -> 0 bytes
-rwxr-xr-xcontent/karma/image/btn_plus.pngbin2335 -> 0 bytes
-rw-r--r--content/karma/image/favicon.icobin15086 -> 0 bytes
-rw-r--r--content/karma/image/picClock.pngbin2622 -> 0 bytes
-rw-r--r--content/karma/image/title_block_lt.pngbin1337 -> 0 bytes
-rw-r--r--content/karma/image/title_block_rt.pngbin1362 -> 0 bytes
-rw-r--r--content/karma/js/jquery.watermarkinput.js81
-rwxr-xr-xcontent/karma/js/ui.kHeader.js235
-rwxr-xr-xcontent/menu.css99
-rwxr-xr-xindex.html42
-rwxr-xr-x[-rw-r--r--]karma/audio/byebye.ogg (renamed from content/karma/audio/byebye.ogg)bin17002 -> 17002 bytes
-rwxr-xr-x[-rw-r--r--]karma/audio/en_correct.ogg (renamed from content/karma/audio/en_correct.ogg)bin13794 -> 13794 bytes
-rwxr-xr-x[-rw-r--r--]karma/audio/en_incorrect.ogg (renamed from content/karma/audio/en_incorrect.ogg)bin13262 -> 13262 bytes
-rwxr-xr-x[-rw-r--r--]karma/audio/ne_correct.ogg (renamed from content/karma/audio/ne_correct.ogg)bin9672 -> 9672 bytes
-rwxr-xr-x[-rw-r--r--]karma/audio/ne_incorrect.ogg (renamed from content/karma/audio/ne_incorrect.ogg)bin15784 -> 15784 bytes
-rwxr-xr-x[-rw-r--r--]karma/audio/trigger.ogg (renamed from content/karma/audio/trigger.ogg)bin13045 -> 13045 bytes
-rwxr-xr-xkarma/css/global.css (renamed from content/css/global.css)87
-rwxr-xr-xkarma/css/kDoc.css (renamed from content/Explore/css/kDoc.css)0
-rwxr-xr-xkarma/css/kStart.css (renamed from content/karma/css/kStart.css)0
-rwxr-xr-xkarma/css/karma.css (renamed from content/Explore/css/karma.css)0
-rwxr-xr-x[-rw-r--r--]karma/css/kglobal.css (renamed from content/karma/css/global.css)2
-rwxr-xr-xkarma/css/menu.css53
-rwxr-xr-xkarma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png (renamed from content/Explore/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png)bin180 -> 180 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png (renamed from content/Explore/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png)bin213 -> 213 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_flat_75_ffffff_40x100.png (renamed from content/Explore/css/theme/images/ui-bg_flat_75_ffffff_40x100.png)bin178 -> 178 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png (renamed from content/Explore/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png)bin120 -> 120 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_glass_65_e774ec_1x400.png (renamed from content/Explore/css/theme/images/ui-bg_glass_65_e774ec_1x400.png)bin128 -> 128 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_glass_75_f49aec_1x400.png (renamed from content/Explore/css/theme/images/ui-bg_glass_75_f49aec_1x400.png)bin130 -> 130 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png (renamed from content/Explore/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png)bin125 -> 125 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png (renamed from content/Explore/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png)bin151 -> 151 bytes
-rwxr-xr-xkarma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png (renamed from content/Explore/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png)bin123 -> 123 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_222222_256x240.png (renamed from content/Explore/css/theme/images/ui-icons_222222_256x240.png)bin4369 -> 4369 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_222222_768x720.png (renamed from content/Explore/css/theme/images/ui-icons_222222_768x720.png)bin5345 -> 5345 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_2e83ff_256x240.png (renamed from content/Explore/css/theme/images/ui-icons_2e83ff_256x240.png)bin4369 -> 4369 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_2e83ff_768x720.png (renamed from content/Explore/css/theme/images/ui-icons_2e83ff_768x720.png)bin5345 -> 5345 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_454545_256x240.png (renamed from content/Explore/css/theme/images/ui-icons_454545_256x240.png)bin4369 -> 4369 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_454545_768x720.png (renamed from content/Explore/css/theme/images/ui-icons_454545_768x720.png)bin5345 -> 5345 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_7811a2_256x240.png (renamed from content/Explore/css/theme/images/ui-icons_7811a2_256x240.png)bin4369 -> 4369 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_7811a2_768x720.png (renamed from content/Explore/css/theme/images/ui-icons_7811a2_768x720.png)bin5345 -> 5345 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_cd0a0a_256x240.png (renamed from content/Explore/css/theme/images/ui-icons_cd0a0a_256x240.png)bin4369 -> 4369 bytes
-rwxr-xr-xkarma/css/theme/images/ui-icons_cd0a0a_768x720.png (renamed from content/Explore/css/theme/images/ui-icons_cd0a0a_768x720.png)bin5345 -> 5345 bytes
-rwxr-xr-xkarma/css/theme/jquery-ui-1.7.2.custom.css (renamed from content/Explore/css/theme/jquery-ui-1.7.2.custom.css)0
-rwxr-xr-xkarma/css/ui.kHeader.css (renamed from content/karma/css/ui.kHeader.css)0
-rwxr-xr-x[-rw-r--r--]karma/css/ui.scoreboard.css (renamed from content/karma/css/ui.scoreboard.css)0
-rwxr-xr-xkarma/image/I_user_a.gifbin0 -> 118 bytes
-rwxr-xr-xkarma/image/activity-stop.png (renamed from content/assets/image/activity-stop.png)bin411 -> 411 bytes
-rwxr-xr-xkarma/image/apply.png (renamed from content/assets/image/apply.png)bin2744 -> 2744 bytes
-rwxr-xr-xkarma/image/arrow_down_white.png (renamed from content/Explore/css/images/arrow_down_white.png)bin417 -> 417 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/audio-pause.png (renamed from content/assets/image/audio-pause.png)bin2026 -> 2026 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/audio-play.png (renamed from content/assets/image/audio-play.png)bin2905 -> 2905 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/audio-record.png (renamed from content/assets/image/audio-record.png)bin3266 -> 3266 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/audio-stop.png (renamed from content/assets/image/audio-stop.png)bin1865 -> 1865 bytes
-rwxr-xr-xkarma/image/back_button_hover.png (renamed from content/Explore/css/images/back_button_hover.png)bin3700 -> 3700 bytes
-rwxr-xr-xkarma/image/back_button_start.png (renamed from content/Explore/css/images/back_button_start.png)bin3757 -> 3757 bytes
-rwxr-xr-xkarma/image/bg.png (renamed from content/Explore/css/images/bg.png)bin77784 -> 77784 bytes
-rwxr-xr-xkarma/image/bg_footer.png (renamed from content/Explore/assets/image/bg_footer.png)bin185 -> 185 bytes
-rwxr-xr-xkarma/image/bg_header.png (renamed from content/Explore/assets/image/bg_header.png)bin307 -> 307 bytes
-rwxr-xr-xkarma/image/bg_title_block.png (renamed from content/Explore/assets/image/bg_title_block.png)bin366 -> 366 bytes
-rwxr-xr-xkarma/image/btn_back.png (renamed from content/Explore/assets/image/btn_back.png)bin2665 -> 2665 bytes
-rwxr-xr-xkarma/image/btn_back_english.png (renamed from content/assets/image/btn_back_english.png)bin3234 -> 3234 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/btn_back_explore.png (renamed from content/assets/image/btn_back_explore.png)bin5777 -> 5777 bytes
-rwxr-xr-xkarma/image/btn_back_hover.png (renamed from content/Explore/assets/image/btn_back_hover.png)bin4038 -> 4038 bytes
-rwxr-xr-xkarma/image/btn_back_mathematics.png (renamed from content/assets/image/btn_back_mathematics.png)bin2420 -> 2420 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/btn_check.png (renamed from content/karma/image/btn_check.png)bin9052 -> 9052 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/btn_head_over.png (renamed from content/karma/image/btn_head_over.png)bin426 -> 426 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/btn_head_selected.png (renamed from content/karma/image/btn_head_selected.png)bin545 -> 545 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/btn_head_up.png (renamed from content/karma/image/btn_head_up.png)bin332 -> 332 bytes
-rwxr-xr-xkarma/image/btn_help.png (renamed from content/Explore/assets/image/btn_help.png)bin2755 -> 2755 bytes
-rwxr-xr-xkarma/image/btn_help_hover.png (renamed from content/Explore/assets/image/btn_help_hover.png)bin4190 -> 4190 bytes
-rwxr-xr-xkarma/image/btn_minus.png (renamed from content/Explore/css/images/btn_minus.png)bin2342 -> 2342 bytes
-rwxr-xr-xkarma/image/btn_next.png (renamed from content/Explore/assets/image/btn_next.png)bin2773 -> 2773 bytes
-rwxr-xr-xkarma/image/btn_next_hover.png (renamed from content/Explore/assets/image/btn_next_hover.png)bin3996 -> 3996 bytes
-rwxr-xr-xkarma/image/btn_ole.png (renamed from content/Explore/assets/image/btn_ole.png)bin4842 -> 4842 bytes
-rwxr-xr-xkarma/image/btn_ole_hover.png (renamed from content/Explore/assets/image/btn_ole_hover.png)bin6253 -> 6253 bytes
-rwxr-xr-xkarma/image/btn_play_again.png (renamed from content/Explore/assets/image/btn_play_again.png)bin5627 -> 5627 bytes
-rwxr-xr-xkarma/image/btn_play_again_hover.png (renamed from content/Explore/assets/image/btn_play_again_hover.png)bin5468 -> 5468 bytes
-rwxr-xr-xkarma/image/btn_play_again_mouse_down.png (renamed from content/Explore/assets/image/btn_play_again_mouse_down.png)bin5688 -> 5688 bytes
-rwxr-xr-xkarma/image/btn_plus.png (renamed from content/Explore/css/images/btn_plus.png)bin2335 -> 2335 bytes
-rwxr-xr-xkarma/image/btn_prev.png (renamed from content/assets/image/btn_prev.png)bin2665 -> 2665 bytes
-rwxr-xr-xkarma/image/check.png (renamed from content/assets/image/check.png)bin9052 -> 9052 bytes
-rwxr-xr-xkarma/image/edit.png (renamed from content/assets/image/edit.png)bin4278 -> 4278 bytes
-rwxr-xr-xkarma/image/favicon.ico (renamed from content/Explore/assets/default/image/favicon.ico)bin15086 -> 15086 bytes
-rwxr-xr-xkarma/image/picClock.png (renamed from content/Explore/assets/image/picClock.png)bin2622 -> 2622 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/restart.png (renamed from content/assets/image/restart.png)bin2133 -> 2133 bytes
-rwxr-xr-x[-rw-r--r--]karma/image/start.png (renamed from content/assets/image/start.png)bin1408 -> 1408 bytes
-rwxr-xr-xkarma/image/title_block_lt.png (renamed from content/Explore/assets/image/title_block_lt.png)bin1337 -> 1337 bytes
-rwxr-xr-xkarma/image/title_block_rt.png (renamed from content/Explore/assets/image/title_block_rt.png)bin1362 -> 1362 bytes
-rwxr-xr-xkarma/js/base.js140
-rwxr-xr-x[-rw-r--r--]karma/js/clock.js (renamed from content/karma/js/clock.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/common.js (renamed from content/karma/js/common.js)20
-rwxr-xr-xkarma/js/config.js5
-rwxr-xr-xkarma/js/course.js67
-rwxr-xr-x[-rw-r--r--]karma/js/external/jquery-1.4.2.js (renamed from content/karma/js/external/jquery-1.4.2.js)0
-rwxr-xr-xkarma/js/external/jquery-ui-1.8.2.js (renamed from content/karma/js/external/jquery-ui-1.8.2.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.blind.js (renamed from content/karma/js/external/jquery.effects.blind.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.bounce.js (renamed from content/karma/js/external/jquery.effects.bounce.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.clip.js (renamed from content/karma/js/external/jquery.effects.clip.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.core.js (renamed from content/karma/js/external/jquery.effects.core.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.drop.js (renamed from content/karma/js/external/jquery.effects.drop.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.explode.js (renamed from content/karma/js/external/jquery.effects.explode.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.fold.js (renamed from content/karma/js/external/jquery.effects.fold.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.highlight.js (renamed from content/karma/js/external/jquery.effects.highlight.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.pulsate.js (renamed from content/karma/js/external/jquery.effects.pulsate.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.scale.js (renamed from content/karma/js/external/jquery.effects.scale.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.shake.js (renamed from content/karma/js/external/jquery.effects.shake.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.slide.js (renamed from content/karma/js/external/jquery.effects.slide.js)0
-rwxr-xr-xkarma/js/external/jquery.effects.transfer.js (renamed from content/karma/js/external/jquery.effects.transfer.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.accordion.js (renamed from content/karma/js/external/jquery.ui.accordion.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.autocomplete.js (renamed from content/karma/js/external/jquery.ui.autocomplete.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.button.js (renamed from content/karma/js/external/jquery.ui.button.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.core.js (renamed from content/karma/js/external/jquery.ui.core.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.datepicker.js (renamed from content/karma/js/external/jquery.ui.datepicker.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.dialog.js (renamed from content/karma/js/external/jquery.ui.dialog.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.draggable.js (renamed from content/karma/js/external/jquery.ui.draggable.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.droppable.js (renamed from content/karma/js/external/jquery.ui.droppable.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.mouse.js (renamed from content/karma/js/external/jquery.ui.mouse.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.position.js (renamed from content/karma/js/external/jquery.ui.position.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.progressbar.js (renamed from content/karma/js/external/jquery.ui.progressbar.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.resizable.js (renamed from content/karma/js/external/jquery.ui.resizable.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.selectable.js (renamed from content/karma/js/external/jquery.ui.selectable.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.slider.js (renamed from content/karma/js/external/jquery.ui.slider.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.sortable.js (renamed from content/karma/js/external/jquery.ui.sortable.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.tabs.js (renamed from content/karma/js/external/jquery.ui.tabs.js)0
-rwxr-xr-xkarma/js/external/jquery.ui.widget.js (renamed from content/karma/js/external/jquery.ui.widget.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/external/minified/jquery-1.4.2.min.js (renamed from content/karma/js/external/minified/jquery-1.4.2.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery-ui-1.8.2.min.js (renamed from content/karma/js/external/minified/jquery-ui-1.8.2.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.blind.min.js (renamed from content/karma/js/external/minified/jquery.effects.blind.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.bounce.min.js (renamed from content/karma/js/external/minified/jquery.effects.bounce.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.clip.min.js (renamed from content/karma/js/external/minified/jquery.effects.clip.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.core.min.js (renamed from content/karma/js/external/minified/jquery.effects.core.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.drop.min.js (renamed from content/karma/js/external/minified/jquery.effects.drop.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.explode.min.js (renamed from content/karma/js/external/minified/jquery.effects.explode.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.fold.min.js (renamed from content/karma/js/external/minified/jquery.effects.fold.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.highlight.min.js (renamed from content/karma/js/external/minified/jquery.effects.highlight.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.pulsate.min.js (renamed from content/karma/js/external/minified/jquery.effects.pulsate.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.scale.min.js (renamed from content/karma/js/external/minified/jquery.effects.scale.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.shake.min.js (renamed from content/karma/js/external/minified/jquery.effects.shake.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.slide.min.js (renamed from content/karma/js/external/minified/jquery.effects.slide.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.effects.transfer.min.js (renamed from content/karma/js/external/minified/jquery.effects.transfer.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.accordion.min.js (renamed from content/karma/js/external/minified/jquery.ui.accordion.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.autocomplete.min.js (renamed from content/karma/js/external/minified/jquery.ui.autocomplete.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.button.min.js (renamed from content/karma/js/external/minified/jquery.ui.button.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.core.min.js (renamed from content/karma/js/external/minified/jquery.ui.core.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.datepicker.min.js (renamed from content/karma/js/external/minified/jquery.ui.datepicker.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.dialog.min.js (renamed from content/karma/js/external/minified/jquery.ui.dialog.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.draggable.min.js (renamed from content/karma/js/external/minified/jquery.ui.draggable.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.droppable.min.js (renamed from content/karma/js/external/minified/jquery.ui.droppable.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.mouse.min.js (renamed from content/karma/js/external/minified/jquery.ui.mouse.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.position.min.js (renamed from content/karma/js/external/minified/jquery.ui.position.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.progressbar.min.js (renamed from content/karma/js/external/minified/jquery.ui.progressbar.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.resizable.min.js (renamed from content/karma/js/external/minified/jquery.ui.resizable.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.selectable.min.js (renamed from content/karma/js/external/minified/jquery.ui.selectable.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.slider.min.js (renamed from content/karma/js/external/minified/jquery.ui.slider.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.sortable.min.js (renamed from content/karma/js/external/minified/jquery.ui.sortable.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.tabs.min.js (renamed from content/karma/js/external/minified/jquery.ui.tabs.min.js)0
-rwxr-xr-xkarma/js/external/minified/jquery.ui.widget.min.js (renamed from content/karma/js/external/minified/jquery.ui.widget.min.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/global.js (renamed from content/karma/js/global.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.clickable.js (renamed from content/karma/js/jquery.clickable.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.i18n.en.js (renamed from content/karma/js/jquery.i18n.en.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.i18n.js (renamed from content/karma/js/jquery.i18n.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.i18n.ne.js (renamed from content/karma/js/jquery.i18n.ne.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.keyfilter.js (renamed from content/karma/js/jquery.keyfilter.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.strings.js (renamed from content/karma/js/jquery.strings.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/jquery.svg.js (renamed from content/karma/js/jquery.svg.js)0
-rwxr-xr-xkarma/js/jquery.watermarkinput.js (renamed from content/Explore/js/jquery.watermarkinput.js)0
-rwxr-xr-xkarma/js/kDoc.js (renamed from content/karma/js/kDoc.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/kStart.js (renamed from content/karma/js/kStart.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/karma.js (renamed from content/karma/js/karma.js)0
-rwxr-xr-xkarma/js/lesson.js260
-rwxr-xr-xkarma/js/main.js17
-rwxr-xr-x[-rw-r--r--]karma/js/multiple-choice.js (renamed from content/karma/js/multiple-choice.js)0
-rwxr-xr-xkarma/js/oldlesson.js (renamed from content/js/lesson.js)0
-rwxr-xr-xkarma/js/ui.kHeader.js (renamed from content/Explore/js/ui.kHeader.js)0
-rwxr-xr-x[-rw-r--r--]karma/js/ui.scoreboard.js (renamed from content/karma/js/ui.scoreboard.js)0
-rwxr-xr-xkarma/js/unit.js248
-rwxr-xr-xlaunch.py79
-rwxr-xr-xunavailable.html (renamed from content/unavailable.html)0
478 files changed, 1133 insertions, 64093 deletions
diff --git a/activity/activity.info b/activity/activity.info
index 896d5ac..af6bed0 100755
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -1,9 +1,9 @@
[Activity]
-#version = 11.18
+#version = 12.1
name = Learn
service_name = rw.olpc.Learn
icon = activity-learn
-activity_version = 11
+activity_version = 12
show_launcher = yes
#exec = ./launch.py
class = launch.Learn
diff --git a/cgi-bin/activities.py b/cgi-bin/activities.py
index 8176609..5c4f56c 100755
--- a/cgi-bin/activities.py
+++ b/cgi-bin/activities.py
@@ -24,6 +24,7 @@ SS = path('/library/courseware')
def sftp(script, folder = None):
pth = WORKPATH / 'script'
subprocess.call('rm -rf ' + pth, shell=True)
+ subprocess.call('mkdir -p ' + WORKPATH, shell=True)
fout = open(pth, 'w')
fout.write(script)
fout.close()
@@ -36,10 +37,10 @@ def sftp(script, folder = None):
srvr = serial_number[:-1] + '@schoolserver'
cmd = 'sftp ' + auth + scrpt + ' ' + srvr
if folder:
- subprocess.call(cmd, cwd=folder, shell=True)
+ pid = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=folder, shell=True)
else:
- subprocess.call(cmd, shell=True)
- return 0
+ pid = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
+ return pid.communicate()[0]
def getNick():
""" Returns nick from Sugar """
@@ -58,12 +59,12 @@ def getInstalled(subject):
milestones.remove('karma')
return milestones
-def getEntries(subject, grade, milestone):
+def getEntries(subject, course, milestone):
pth = path('content') /subject
if len(milestone) > 0:
fpth = pth / milestone / 'activities.js'
else:
- fpth = pth / 'activities_'+grade+'.js'
+ fpth = pth / course
fin = open(fpth,'r')
txt = fin.read()
fin.close()
@@ -77,12 +78,12 @@ def getEntries(subject, grade, milestone):
continue
return entries
-def setEntries(subject, grade, milestone, entries):
+def setEntries(subject, course, milestone, entries):
pth = path('content') /subject
if len(milestone) > 0:
fpth = pth / milestone / 'activities.js'
else:
- fpth = pth / 'activities_'+grade+'.js'
+ fpth = pth / course
fin = open(fpth,'r')
txt = fin.read()
fin.close()
@@ -93,10 +94,6 @@ def setEntries(subject, grade, milestone, entries):
fout = open(fpth,'w')
fout.write(txtout)
fout.close()
- if len(milestone) < 1 and pth / 'activities.js'.exists():
- fout = open(pth / 'activities.js','w')
- fout.write(txtout)
- fout.close()
def getMilestones(subject, grade):
milestones = getEntries(subject,grade, "")
@@ -112,7 +109,7 @@ def setMilestones(subject, grade, milestones):
def setActivities(subject, milestone, activities):
setEntries(subject, 0, milestone, activities)
-def fetchMilestone(subject, grade, milestone):
+def fetchMilestone(subject, milestone):
if USB.exists(): #get from usb drive
pth = USB / subject
cmd = 'cp -r ' + pth / milestone + '.msxo ' + 'content/'+ subject
@@ -121,7 +118,7 @@ def fetchMilestone(subject, grade, milestone):
except:
print 'failed',sys.exc_info()[:2]
else: #get from schoolserver
- folder = 'content/'+ subject
+ folder = path('content') / subject
pth = SS / subject
script = 'cd ' + str(pth) + '\nget ' + milestone + '.msxo'
result = sftp(script, folder)
@@ -141,3 +138,97 @@ def getActivitiesJs(subject):
pth = SS / subject
script = 'cd ' + str(pth) + '\nget activities*'
result = sftp(script, folder)
+
+def getSubjects():
+ if USB.exists(): #get from usb drive
+ pth = USB / 'subjects.js'
+ cmd = 'cp -r ' + pth + ' ' + 'content/'
+ subprocess.call(cmd,shell=True)
+ else: #get from schoolserver
+ folder = 'content/'
+ pth = SS
+ script = 'cd ' + str(pth) + '\nget subjects.js'
+ result = sftp(script, folder)
+
+def lsFile(path,filename):
+ if USB.exists(): #get from usb drive
+ pth = USB / path / filename
+ cmd = 'ls ' + pth + ' '
+ pid = subprocess.Popen(cmd,stdout=PIPE,shell=True)
+ pid.wait()
+ result = pid.communicate()
+ else:
+ pth = SS
+ script = 'cd ' + str(pth) + '\nls '+filename
+ log = open('/tmp/logls','w')
+ print >> log,'pth',pth,'script',script
+ result = sftp(script)
+ print >> log,'result',result
+ log.close()
+ return result
+
+def getFile(subject,filename):
+ log = open('/tmp/loggetfile','w')
+ if USB.exists(): #get from usb drive
+ pth = USB / subject / filename
+ cmd = 'cp -r ' + pth + ' ' + tgtpth
+ log = open('/tmp/loggetfile','w')
+ print >> log, 'usb',cmd
+ pid = subprocess.Popen(cmd,shell=True)
+ pid.wait()
+ (result,err) = pid.communicate()
+ else: #get from schoolserver
+ print >> log, 'params', subject, filename
+ pth = SS / subject
+ if filename.find('*') > -1:
+ script = 'cd ' + str(pth) + '\nmget ' + filename
+ else:
+ script = 'cd ' + str(pth) + '\nget ' + filename
+ print >> log, 'sftp', pth, script
+ log.close()
+ result = sftp(script, path('content') / subject)
+ log = open('/tmp/loggetfile1','w')
+ print >> log,'sftp result', result
+ print >> log,'getFile done'
+ log.close()
+ return result
+
+def _getParam(txt):
+ pos1 = txt.find('var =')
+ pos2 = txt.find('=')
+ key = txt[pos1+5:pos2].strip()
+ value = txt[pos2+1:-1].strip()
+ value = value.replace("'","")
+ return(key,value)
+
+class Config():
+ def __init__(self):
+ fin = open('content/karma/js/config.js','r')
+ txt = fin.read()
+ fin.close()
+ txtout = txt
+ lines = txt.split('\n')
+ config = {}
+ for line in lines:
+ (rkey,rvalue) = _getParam(line)
+ if len(rkey)>0:
+ config[rkey] = rvalue
+ self.config = config
+
+ def setConfig(self, key, value):
+ self.config[key]= str(value)
+
+ def getConfig(self, key):
+ try:
+ return self.config[key]
+ except:
+ return None
+
+ def saveConfig(self):
+ txtout = ''
+ for key in self.config.keys():
+ txtout = txtout + 'var ' + key + " = '" + self.config[key] + "';\n"
+ fout = open('content/karma/js/config.js','w')
+ fout.write(txtout)
+ fout.close()
+
diff --git a/cgi-bin/downloadFile.py b/cgi-bin/downloadFile.py
new file mode 100755
index 0000000..6092589
--- /dev/null
+++ b/cgi-bin/downloadFile.py
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+import os, sys, subprocess
+import cgi, cgitb
+from path import path
+from activities import getFile
+
+cgitb.enable(display=True)
+log = open('/tmp/logdownload','w')
+print 'Content-Type:text/html\n\n'
+form = cgi.FieldStorage()
+filename = form.getfirst('filename')
+path = form.getfirst('path')
+getFile(path, filename)
+log.close()
+
+
diff --git a/cgi-bin/fetchMilestone.py b/cgi-bin/fetchMilestone.py
new file mode 100755
index 0000000..2ee5041
--- /dev/null
+++ b/cgi-bin/fetchMilestone.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+import os, sys, subprocess
+import cgi, cgitb
+from path import path
+from activities import fetchMilestone
+from activities import getEntries
+from activities import setEntries
+cgitb.enable(display=True)
+print 'Content-Type:text/html\n\n'
+log = open('/tmp/logFetch','w')
+form = cgi.FieldStorage()
+milestone = form.getfirst('milestone')
+subject = form.getfirst('subject')
+course = form.getfirst('course')
+coursepth = 'course_'+course+'.js'
+fetchMilestone(subject, milestone)
+try:
+ entries = getEntries(subject, coursepth, '')
+except:
+ print >> log, 'getEntries failed', subject, coursepth, sys.exc_info()[:2]
+newentries = []
+for entry in entries:
+ if entry[4] == milestone:
+ entry[5] = 'blue'
+ newentries.append(entry)
+ print >> log, entry
+try:
+ setEntries(subject, coursepth, '', newentries)
+except:
+ print >> log, 'setEntries failed', subject, coursepth, sys.exc_info()[:2]
+log.close()
diff --git a/cgi-bin/play.py b/cgi-bin/play.py
new file mode 100755
index 0000000..d1a3dbd
--- /dev/null
+++ b/cgi-bin/play.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+import os, sys, subprocess
+import cgi, cgitb
+from path import path
+#import gstream
+import pygst
+pygst.require("0.10")
+import gst
+
+logpth = path('/tmp') / 'logplay'
+if logpth.exists():
+ logpth = path('/tmp') / 'logplay1'
+cgitb.enable(display=True)
+log = open(logpth,'w')
+print 'Content-Type:text/html\n\n'
+form = cgi.FieldStorage()
+print >> log, 'form',form
+src = form.getfirst('src')
+print >> log, 'src',src
+# Play Audio Clip
+def play(src):
+ #play clip
+ cmd = "gst-launch-0.10 filesrc location=" + src
+ cmd = cmd + " ! decodebin ! audioconvert ! alsasink"
+ pid = subprocess.Popen(cmd, shell=True)
+ print >>log,'play:',cmd
+# Stop Audio Clip
+def stop():
+ #we are playing and need to stop
+ subprocess.call('killall -q gst-launch-0.10',shell=True)
+ print >>log,'stop'
+
+if src:
+ play(src)
+else:
+ stop()
+
+log.close()
diff --git a/cgi-bin/setConfig.py b/cgi-bin/setConfig.py
new file mode 100755
index 0000000..5c820cb
--- /dev/null
+++ b/cgi-bin/setConfig.py
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+import os, sys, subprocess
+import cgi, cgitb
+from path import path
+from activities import Config
+cgitb.enable(display=True)
+log = open('/tmp/logConfig','w')
+print >> log,'logConfig open'
+print 'Content-Type:text/html\n\n'
+form = cgi.FieldStorage()
+config = Config()
+key = form.getfirst('key')
+value = form.getfirst('value')
+print >> log, 'key',key,'value',value
+config.setConfig(key,value)
+config.saveConfig()
+log.close()
diff --git a/cgi-bin/setUpSubject.py b/cgi-bin/setUpSubject.py
new file mode 100755
index 0000000..79feb0f
--- /dev/null
+++ b/cgi-bin/setUpSubject.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+import os, sys, subprocess
+import cgi, cgitb
+from path import path
+from activities import getFile
+
+cgitb.enable(display=True)
+log = open('/tmp/logsetup','w')
+print >> log, 'log opened'
+print 'Content-Type:text/html\n\n'
+form = cgi.FieldStorage()
+subject = form.getfirst('subject')
+tgtpth = path('content') / subject
+srcpth = path('courseware') / subject
+print >> log, subject, tgtpth.exists(), tgtpth, srcpth
+if not tgtpth.exists():
+ pid = subprocess.Popen('mkdir ' + tgtpth,stdout=subprocess.PIPE,shell=True)
+ pid.wait()
+ (result,err) = pid.communicate()
+ print >> log, 'mkdir', result, err
+ result = getFile(subject, '*.js')
+ print >> log, 'js result', result
+ result = getFile(subject, '*.html')
+ print >> log, 'html result', result
+print >> log, 'done'
+log.close()
diff --git a/content/English/activities_p4.js b/content/English/activities_p4.js
deleted file mode 100644
index 154d973..0000000
--- a/content/English/activities_p4.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var activities = [
- ['0',1,'enp4','milestone','enp411m01','cyan'],
- ['0',2,'enp4','milestone','enp411m02','cyan'],
- ['0',3,'enp4','milestone','enp411m03','cyan'],
- ['0',4,'enp4','milestone','enp411m04','cyan'],
- ['0',5,'enp4','milestone','enp411m05','cyan'],
-];
-var assetList= [];
-var logos = [];
diff --git a/content/English/activities_p5.js b/content/English/activities_p5.js
deleted file mode 100644
index 073d867..0000000
--- a/content/English/activities_p5.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var activities = [
- ['0',1,'enp5','milestone','enp511m01','cyan'],
- ['0',2,'enp5','milestone','enp511m02','cyan'],
- ['0',3,'enp5','milestone','enp511m03','cyan'],
- ['0',4,'enp5','milestone','enp511m04','cyan'],
- ['0',5,'enp5','milestone','enp511m05','cyan'],
- ['0',6,'enp5','milestone','enp511m06','cyan'],
- ['0',7,'enp5','milestone','enp511m07','cyan'],
- ['0',8,'enp5','milestone','enp511m08','cyan'],
-];
-var assetList= [];
-var logos = [];
diff --git a/content/English/activities_p6.js b/content/English/activities_p6.js
deleted file mode 100644
index 09d8f0a..0000000
--- a/content/English/activities_p6.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var activities = [
- ['0',1,'enp6','milestone','enp611m01','cyan'],
- ['0',2,'enp6','milestone','enp611m02','cyan'],
- ['0',3,'enp6','milestone','enp611m03','cyan'],
- ['0',4,'enp6','milestone','enp611m04','cyan'],
- ['0',5,'enp6','milestone','enp611m05','cyan'],
- ['0',6,'enp6','milestone','enp611m06','cyan'],
- ['0',7,'enp6','milestone','enp611m07','cyan'],
- ['0',8,'enp6','milestone','enp611m08','cyan'],
-];
-var assetList= [];
-var logos = [];
diff --git a/content/English/index.html b/content/English/index.html
deleted file mode 100755
index 6b44b3e..0000000
--- a/content/English/index.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/learner_subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/English/p4.html b/content/English/p4.html
deleted file mode 100755
index db551a9..0000000
--- a/content/English/p4.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities_p4.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/English/p5.html b/content/English/p5.html
deleted file mode 100755
index fd39bfa..0000000
--- a/content/English/p5.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities_p5.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div></div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/English/p6.html b/content/English/p6.html
deleted file mode 100755
index e20f618..0000000
--- a/content/English/p6.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities_p6.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/Explore/activities.js b/content/Explore/activities.js
deleted file mode 100755
index f022acf..0000000
--- a/content/Explore/activities.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* list of lands to explore
- name, icon, folder, hover text, audio text
-var activities = [
-['Basic English','English_Flag','be_menu','Learn some important English words,''],
-['Health','Cadeceus','health_menu','explore your body and how it works,''],
-['Earth','Blue_Marble','earth_menu','Learn about where and how people live',''],
-['Environment','Landscape','be_menu','Learn about how to take care of our home,''],
-['Music','Harp','music_menu','Explore music from many lands,''],
-];
-var assetList = [];
-var logos = [];
diff --git a/content/Explore/assets/image/Blue_Marble.jpg b/content/Explore/assets/image/Blue_Marble.jpg
deleted file mode 100644
index 60a509b..0000000
--- a/content/Explore/assets/image/Blue_Marble.jpg
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/English_Flag.jpg b/content/Explore/assets/image/English_Flag.jpg
deleted file mode 100644
index b7f510e..0000000
--- a/content/Explore/assets/image/English_Flag.jpg
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/Landscape.jpg b/content/Explore/assets/image/Landscape.jpg
deleted file mode 100644
index ae828e1..0000000
--- a/content/Explore/assets/image/Landscape.jpg
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/btn_start.png b/content/Explore/assets/image/btn_start.png
deleted file mode 100755
index 32e5f20..0000000
--- a/content/Explore/assets/image/btn_start.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/btn_start_hover.png b/content/Explore/assets/image/btn_start_hover.png
deleted file mode 100755
index 811ce78..0000000
--- a/content/Explore/assets/image/btn_start_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/btn_start_mouse_down.png b/content/Explore/assets/image/btn_start_mouse_down.png
deleted file mode 100755
index 5acd43b..0000000
--- a/content/Explore/assets/image/btn_start_mouse_down.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/explore.png b/content/Explore/assets/image/explore.png
deleted file mode 100644
index 9a32220..0000000
--- a/content/Explore/assets/image/explore.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/favicon.ico b/content/Explore/assets/image/favicon.ico
deleted file mode 100755
index 7a08617..0000000
--- a/content/Explore/assets/image/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/harp.jpg b/content/Explore/assets/image/harp.jpg
deleted file mode 100644
index 15ce470..0000000
--- a/content/Explore/assets/image/harp.jpg
+++ /dev/null
Binary files differ
diff --git a/content/Explore/assets/image/health.png b/content/Explore/assets/image/health.png
deleted file mode 100755
index 305c8d0..0000000
--- a/content/Explore/assets/image/health.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/global.css b/content/Explore/css/global.css
deleted file mode 100755
index 91bdd64..0000000
--- a/content/Explore/css/global.css
+++ /dev/null
@@ -1,174 +0,0 @@
-@CHARSET "UTF-8";
-/****** Page Styles ****/
-
-/* Designed for 1200*900 px screen resolution */
-
-body {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10pt;
- margin: 0px;
- background-color: #FFFFCC;
-}
-#header {
- background-image: url(../assets/image/bg_header.png);
- background-repeat: repeat-x;
- height: 75px;
- width: 100%;
- position: absolute;
- left: 0px;
- top: 0px;
- z-index:10;
-}
-#topbtn_left {
- float: left;
- height: 60px;
- width: 60px;
- padding-top: 6px;
- padding-left: 15px;
-}
-
-
- .linkBack{
- cursor:pointer;
- width: 60px; height: 59px;
- background:url(../assets/image/btn_back.png);
- }
- .linkBack:hover{
- background:url(../assets/image/btn_back_hover.png);
- }
-
-#lesson_title {
- float: left;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 16pt;
- font-weight: bold;
- color: #FFFFFF;
- margin-left: 10px;
- background-image: url(../assets/image/bg_title_block.png);
-}
-#topbtn_right {
- float: right;
- height: 60px;
- width: 60px;
- padding-top: 6px;
- padding-right: 15px;
-}
- #linkHelp{
- width: 60px; height: 60px;
- background:url(../assets/image/btn_help.png);
- cursor:pointer;
- }
- #linkHelp:hover{
- background:url(../assets/image/btn_help_hover.png);
- }
- #linkOle{
- cursor:pointer;
- width: 60px; height: 60px;
- background:url(../assets/image/btn_ole.png);
- }
- #linkOle:hover{
- background:url(../assets/image/btn_ole_hover.png);
- }
- .linkNext{
- cursor:pointer;
- width: 60px; height: 60px;
- background:url(../assets/image/btn_next.png);
- }
- .linkNext:hover{
- background:url(../assets/image/btn_next_hover.png);
- }
-#footer {
- position:relative;
- background-image: url(../assets/image/bg_footer.png);
- background-repeat: repeat-x;
- height: 75px;
- width: 100%;
- left: 0px;
- bottom: 0px;
-}
-#score_box {
- float: left;
- padding-left: 5px;
- padding-top: 0.7em;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- color: #FFFF00;
- font-size: 16pt;
- font-weight: bold;
-}
-#botbtn_right {
- float: right;
- height: 55px;
- padding-right: 5px;
- padding-top: 10px;
-}
- #linkCheck{
- margin: 1em 3em 0 0;
- width: 101px; height: 30px;
- background-image: url(../assets/image/check.png);
- }
-
- #linkStart{
- cursor:pointer;
- width: 251px; height: 55px;
- background:url(../assets/image/btn_start.png);
- }
- #linkStart:hover{
- background:url(../assets/image/btn_start_hover.png);
- }
- #linkStart:active{
- background:url(../assets/image/btn_start_mouse_down.png);
- }
- #linkPlayAgain{
- cursor:pointer;
- width: 251px; height: 55px;
- background:url(../assets/image/btn_play_again.png);
- }
- #linkPlayAgain:hover{
- background:url(../assets/image/btn_play_again_hover.png);
- }
- #linkPlayAgain:active{
- background:url(../assets/image/btn_play_again_mouse_down.png);
- }
-#linkNextLesson{
- position:absolute;
- bottom: 75px;
- right: 10px;
-}
-#linkPrevLesson{
- position:absolute;
- bottom: 75px;
- left: 10px;
-}
-#timerBar {
-
- position: absolute;
- left: 30%;
- bottom: 25%;
- width: 210px;
- height:35px;
- padding-left: 10px;
- color: #FFFF00;
- font-size: 16pt;
- font-weight: bold;
- }
- #picClock{
- float:left;
- width:32px;
- height: 32px;
- background: url(../assets/image/picClock.png);
- }
-
- .timerBoxes{ /* Show the timer running after the game has began.... */
- float:right;
- width: 50px;
- height: 35px;
- border: 2px dotted green;
- color: blue;
- text-align:center;
- font : bold 25px Arial Black, Times New Roman;
- background: #ACC;
- }
-
-/**** End of the page style ****/
-
-
diff --git a/content/Explore/css/images/arrow_down_white.svg b/content/Explore/css/images/arrow_down_white.svg
deleted file mode 100755
index fb2cb26..0000000
--- a/content/Explore/css/images/arrow_down_white.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="32"
- height="32"
- viewBox="0 0 32 32"
- id="Layer_1"
- xml:space="preserve"><defs
- id="defs7" />
-<path
- d="m 32,16.016 -5.672,-5.664 c 0,0 -3.18,3.18 -6.312,6.312 V 0 H 11.993 V 16.664 L 5.673,10.344 0,16.016 16,32 32,16.016 z"
- id="path3"
- style="fill:#ffffff" />
-</svg> \ No newline at end of file
diff --git a/content/Explore/css/images/bg_footer.png b/content/Explore/css/images/bg_footer.png
deleted file mode 100755
index 4bd44fa..0000000
--- a/content/Explore/css/images/bg_footer.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/bg_header.png b/content/Explore/css/images/bg_header.png
deleted file mode 100755
index f421817..0000000
--- a/content/Explore/css/images/bg_header.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/bg_title_block.png b/content/Explore/css/images/bg_title_block.png
deleted file mode 100755
index 7311891..0000000
--- a/content/Explore/css/images/bg_title_block.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_back.png b/content/Explore/css/images/btn_back.png
deleted file mode 100755
index d9fbf14..0000000
--- a/content/Explore/css/images/btn_back.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_back_hover.png b/content/Explore/css/images/btn_back_hover.png
deleted file mode 100755
index 0911fcc..0000000
--- a/content/Explore/css/images/btn_back_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_help.png b/content/Explore/css/images/btn_help.png
deleted file mode 100755
index 6753e9c..0000000
--- a/content/Explore/css/images/btn_help.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_help_hover.png b/content/Explore/css/images/btn_help_hover.png
deleted file mode 100755
index d3ccd92..0000000
--- a/content/Explore/css/images/btn_help_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_minus25x25.png b/content/Explore/css/images/btn_minus25x25.png
deleted file mode 100755
index 7ffcc91..0000000
--- a/content/Explore/css/images/btn_minus25x25.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_minus_hover.png b/content/Explore/css/images/btn_minus_hover.png
deleted file mode 100755
index f8203b4..0000000
--- a/content/Explore/css/images/btn_minus_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_ole.png b/content/Explore/css/images/btn_ole.png
deleted file mode 100755
index 0e775e9..0000000
--- a/content/Explore/css/images/btn_ole.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_ole_hover.png b/content/Explore/css/images/btn_ole_hover.png
deleted file mode 100755
index c43c5f7..0000000
--- a/content/Explore/css/images/btn_ole_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_plus25x25.png b/content/Explore/css/images/btn_plus25x25.png
deleted file mode 100755
index 7e4d381..0000000
--- a/content/Explore/css/images/btn_plus25x25.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/btn_plus_hover.png b/content/Explore/css/images/btn_plus_hover.png
deleted file mode 100755
index e08e45a..0000000
--- a/content/Explore/css/images/btn_plus_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/correct.png b/content/Explore/css/images/correct.png
deleted file mode 100755
index f2dbc5a..0000000
--- a/content/Explore/css/images/correct.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/correct200x178.png b/content/Explore/css/images/correct200x178.png
deleted file mode 100755
index a203da6..0000000
--- a/content/Explore/css/images/correct200x178.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/correct200x190.png b/content/Explore/css/images/correct200x190.png
deleted file mode 100755
index 907cf79..0000000
--- a/content/Explore/css/images/correct200x190.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/epaath_bg_footer.png b/content/Explore/css/images/epaath_bg_footer.png
deleted file mode 100755
index 4bd44fa..0000000
--- a/content/Explore/css/images/epaath_bg_footer.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/epaath_bg_header.png b/content/Explore/css/images/epaath_bg_header.png
deleted file mode 100755
index f421817..0000000
--- a/content/Explore/css/images/epaath_bg_header.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/happy-face.png b/content/Explore/css/images/happy-face.png
deleted file mode 100755
index 0bd21e7..0000000
--- a/content/Explore/css/images/happy-face.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/incorrect.png b/content/Explore/css/images/incorrect.png
deleted file mode 100755
index edfe9c5..0000000
--- a/content/Explore/css/images/incorrect.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/incorrect200x178.png b/content/Explore/css/images/incorrect200x178.png
deleted file mode 100755
index f988c6a..0000000
--- a/content/Explore/css/images/incorrect200x178.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/incorrect200x190.png b/content/Explore/css/images/incorrect200x190.png
deleted file mode 100755
index 9eb58e8..0000000
--- a/content/Explore/css/images/incorrect200x190.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/oleHelp.png b/content/Explore/css/images/oleHelp.png
deleted file mode 100755
index 8fca480..0000000
--- a/content/Explore/css/images/oleHelp.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/ole_logo.png b/content/Explore/css/images/ole_logo.png
deleted file mode 100755
index 0b409ac..0000000
--- a/content/Explore/css/images/ole_logo.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/sad-face.png b/content/Explore/css/images/sad-face.png
deleted file mode 100755
index 1523519..0000000
--- a/content/Explore/css/images/sad-face.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/start_page.png b/content/Explore/css/images/start_page.png
deleted file mode 100755
index 08c0e2f..0000000
--- a/content/Explore/css/images/start_page.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/title_block_lt.png b/content/Explore/css/images/title_block_lt.png
deleted file mode 100755
index b1c0e90..0000000
--- a/content/Explore/css/images/title_block_lt.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/images/title_block_rt.png b/content/Explore/css/images/title_block_rt.png
deleted file mode 100755
index 275daaf..0000000
--- a/content/Explore/css/images/title_block_rt.png
+++ /dev/null
Binary files differ
diff --git a/content/Explore/css/intro.css b/content/Explore/css/intro.css
deleted file mode 100755
index 6b8be70..0000000
--- a/content/Explore/css/intro.css
+++ /dev/null
@@ -1,97 +0,0 @@
-body {
-padding-left:15%;
-width:70%;
-}
-#header {
-background-color:transparent;
-height:140px;
-position:relative;
-width:100%;
-}
-#headerBg1 {
-display:inline;
-float:left;
-margin-left: 3%;
-}
-/*#headerBg2{
-display:inline;
-float:left;
-margin-left: 10%;
-}*/
-#header ul {
--moz-border-radius-bottomleft:5px;
--moz-border-radius-bottomright:5px;
--moz-border-radius-topleft:5px;
--moz-border-radius-topright:5px;
--webkit-border-bottom-left-radius:5px;
--webkit-border-bottom-right-radius:5px;
--webkit-border-top-left-radius:5px;
--webkit-border-top-right-radius:5px;
-background-color:#EEF7FB;
-border:1px solid black;
-/*bottom:0;
-position:absolute;*/
-width:95%;
-float:left;
-}
-#header ul li {
-display:inline;
-list-style-type:none;
-padding:10px;
-}
-#header ul li a {
-text-decoration:none;
-}
-#intro {
-float:left;
-padding-top:10px;
-width:100%;
-}
-#introText {
-display:inline;
-float:left;
-width:70%;
-margin-right: 2%;
-}
-#introText a {
-text-decoration:none;
-}
-#blurb{
- font-size:larger;
- font-weight:bolder;
-}
-#imgHolder {
-display:inline;
-float:left;
-width:20%;
-margin-top: 1%;
-}
-#demos {
-float:left;
-width:100%;
-}
-#demos .imgs {
-margin-left:5%;
-margin-right:5%;
-width:100%;
-}
-#demos img {
--moz-border-radius-bottomleft:5px;
--moz-border-radius-bottomright:5px;
--moz-border-radius-topleft:5px;
--moz-border-radius-topright:5px;
--webkit-border-bottom-left-radius:5px;
--webkit-border-bottom-right-radius:5px;
--webkit-border-top-left-radius:5px;
--webkit-border-top-right-radius:5px;
-border:1px solid black;
-margin:5px;
-padding-left:5px;
-padding-right:5px;
-}
-#footer {
-float:left;
-font-size:smaller;
-padding-top:50px;
-width:100%;
-} \ No newline at end of file
diff --git a/content/Explore/css/jquery.svg.css b/content/Explore/css/jquery.svg.css
deleted file mode 100755
index c181ec1..0000000
--- a/content/Explore/css/jquery.svg.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-
-svg\:svg {
- display: none;
-}
-
-.svg_error {
- color: red;
- font-weight: bold;
-}
diff --git a/content/Explore/css/kStart.css b/content/Explore/css/kStart.css
deleted file mode 100755
index 03a41c2..0000000
--- a/content/Explore/css/kStart.css
+++ /dev/null
@@ -1,195 +0,0 @@
-#kStart {
- /*width: 1200px;
- height: 884px;
- */
- position:relative;
- margin:0px auto;
- text-align:center;
- width: 1200px;
- height: 900px;
- overflow:hidden;
- background-image: url(./images/bg.png);
- -moz-background-size: 100% 100%;
- -webkit-background-size: 100% 100%;
-}
-
-#kStart .center{
- /* width: 100%;
- float: left;*/
- width: 800px
- margin-left: auto;
- margin-right: auto;
- text-align: center;
-}
-
-#kStart #top{
- height: 13%;
- width: 100%;
- color: #8a72c4;
-}
-
- #backBtn{
- background-image: url(images/back_button_start.png);
- position: absolute;
- width: 60px;
- height: 60px;
- margin-top: 10px;
- margin-left: 10px;
- opacity: 1.0;
- cursor:pointer;
- }
-
- #backBtn:hover{
- background-image: url(images/back_button_hover.png);
- }
-
- #topMiddle{
- margin-top: 1%;
- color: white;
- }
-
- #topDesc{
-
- }
-
- #topE-Paath{
- font-size: 2em;
- margin-top: 1%;
- }
-
-
-
-#kStart #middle{
- border: 2px solid white;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- color: white;
- height: 70%;
- width: 90%;
- margin-left: auto;
- margin-right: auto;
- position:relative;
- background-color: rgba(0,0,200,0.3);
-}
-
- #grade{
- margin-top: 0.5em;
- }
-
- #gradeText{
- font-size: 2.5em;
- }
-
- #gradeNum{
- font-size: 2.5em;
- }
-
- #subject{
- font-size: 3em;
- }
-
- #lessonTitle{
- margin-top: 1em;
- }
-
- #lessonTitle>a{
- font-size: 2.5em;
- color: yellow;
- text-decoration: none;
- }
-
- #lessonTitle>a:hover{
- /*font-size: 2.9em;*/
- color: #FFFFE0;
- }
-
-
- #lessonDesc{
- font-size: 2em;
- margin-top: 0.2em;
- }
-
- #kStart #middle .button{
- position: absolute;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- background-color: purple;
- margin-left: 0.5em;
- margin-right: 0.5em;
- margin-bottom: 0.5em;
- padding-top:0.2em;
- padding-bottom: 0.2em;
- padding-left: 0.5em;
- padding-right: 0.5em;
- font-size: 1.5em;
- border: 1px black solid;
- }
-
- #kStart #middle .button:hover{
- /*opacity: 0.8;*/
- border: 2px white solid;
- }
-
- #kStart #middle .button a{
- text-decoration: none;
- }
-
- #kStart #middle .button div{
- text-align: center;
- color: white;
- }
-
- #teachersNoteBtn{
- position:absolute;
- right:18em;
- bottom: 8em;
- }
-
- #lessonPlanBtn{
- position:absolute;
- right:18em;
- bottom: 8em;
- }
-
-#kStart #bottom{
-height: 15%;
-width: 100%;
-color: white;
-}
-
- #logo{
- display: block;
- width: 320px;
- height: 60px;
- float: none;
- background-image: url(images/ole_logo.png);
- background-repeat: no-repeat;
- margin-left:auto;
- margin-right:auto;
- margin-top: 0.8em;
- cursor:pointer;
- z-index: 5;
- }
- #logoHelp{
- display:none;
- position:absolute;
- bottom: 7em;
- left: 12em;
- width: 872px;
- height:444px;
- background-image: url(images/oleHelp.png);
- z-index:4;
- }
-
-#kStart #copyright{
- position: fixed;
- left: 5px;
- bottom: 0px;
- color: white;
- font-size: smaller;
-}
-
- #kStart #copyright a{
- color: white;
- opacity:0.8;
- } \ No newline at end of file
diff --git a/content/Explore/css/qunit.css b/content/Explore/css/qunit.css
deleted file mode 100755
index 4542933..0000000
--- a/content/Explore/css/qunit.css
+++ /dev/null
@@ -1,17 +0,0 @@
-h1#qunit-header { padding: 15px; font-size: large; background-color: #06b; color: white; font-family: 'trebuchet ms', verdana, arial; margin: 0; }
-h1#qunit-header a { color: white; }
-
-h2#qunit-banner { height: 2em; border-bottom: 1px solid white; background-color: #eee; margin: 0; font-family: 'trebuchet ms', verdana, arial; }
-h2#qunit-banner.pass { background-color: green; }
-h2#qunit-banner.fail { background-color: red; }
-
-h2#qunit-userAgent { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal; font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; }
-
-div#qunit-testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; font-family: 'trebuchet ms', verdana, arial; margin: 0; font-size: 10pt; }
-
-ol#qunit-tests { font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; }
-ol#qunit-tests li strong { cursor:pointer; }
-ol#qunit-tests .pass { color: green; }
-ol#qunit-tests .fail { color: red; }
-
-p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }
diff --git a/content/Explore/css/ui.all.css b/content/Explore/css/ui.all.css
deleted file mode 100755
index 543e4c3..0000000
--- a/content/Explore/css/ui.all.css
+++ /dev/null
@@ -1,2 +0,0 @@
-@import "ui.base.css";
-@import "ui.theme.css";
diff --git a/content/Explore/css/ui.base.css b/content/Explore/css/ui.base.css
deleted file mode 100755
index ba53841..0000000
--- a/content/Explore/css/ui.base.css
+++ /dev/null
@@ -1,2 +0,0 @@
-@import url("ui.core.css");
-@import url("ui.tabs.css"); \ No newline at end of file
diff --git a/content/Explore/css/ui.core.css b/content/Explore/css/ui.core.css
deleted file mode 100755
index c2f18f2..0000000
--- a/content/Explore/css/ui.core.css
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-*/
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } \ No newline at end of file
diff --git a/content/Explore/css/ui.dialog.css b/content/Explore/css/ui.dialog.css
deleted file mode 100755
index 2997595..0000000
--- a/content/Explore/css/ui.dialog.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Dialog
-----------------------------------*/
-.ui-dialog { position: relative; padding: .2em; width: 300px; }
-.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
diff --git a/content/Explore/css/ui.feedback.css b/content/Explore/css/ui.feedback.css
deleted file mode 100755
index 7eed05f..0000000
--- a/content/Explore/css/ui.feedback.css
+++ /dev/null
@@ -1,56 +0,0 @@
-.ui-feedback div{
- width: 200px;
- height: 178px;
- position: absolute;
- background-repeat: no-repeat;
-}
-
-.ui-feedback .ui-feedback-correct{
- display:none;
- background-image: url(./images/correct200x190.png);
-}
-
-.ui-feedback .ui-feedback-incorrect{
- display:none;
- background-image: url(./images/incorrect200x190.png);
-}
-
-
-.ui-feedback .ui-feedback-over{
- display: none;
- width: 184px;
- height: 240px;
- overflow: visible;
- cursor: pointer;
- z-index: 10;
-}
-
-.ui-feedback .ui-feedback-over .ui-feedback-win{
- width: 184px;
- height: 222px;
- background-image: url(./images/happy-face.png);
- overflow: visible;
-}
-
-
-.ui-feedback .ui-feedback-over .ui-feedback-lose{
- width: 184px;
- height: 222px;
- background-image: url(./images/sad-face.png);
- overflow: visible;
-}
-
-.ui-feedback .ui-feedback-txt{
- color:purple;
- font-size:3em;
- margin-top:-50px;
- width:300px;
-}
-
-.ui-feedback-overlay {
- position: absolute;
- display: none;
- width: 100%;
- height: 100%;
- background-color: rgba(255,255,255, 0.6);
-} \ No newline at end of file
diff --git a/content/Explore/css/ui.kFooter.css b/content/Explore/css/ui.kFooter.css
deleted file mode 100755
index 5a0944b..0000000
--- a/content/Explore/css/ui.kFooter.css
+++ /dev/null
@@ -1,56 +0,0 @@
-.ui-kFooter{
- background-image: url('./images/bg_footer.png');
- background-repeat: repeat;
- height: 70px;
- width: 100%;
- margin:0;
- padding: 0;
- float: left;
- clear: both;
- border-style: none;
- color: #FFFF00;
-}
-
-
-.ui-kFooter>ul{
- margin-left: 0px;
- padding-left: 5px;
- list-style: none;
-}
-.ui-kFooter>ul>li{
- display:inline;
- margin-right: 10px;
- margin-left: 0px;
-}
-
-
-.ui-kFooter .left{
- float: left;
-}
-
-.ui-kFooter .right{
- float: right;
-}
-
-.ui-kFooter .number{
- background-color:white;
- color: black;
- padding-left:0.4em;
- padding-right:0.4em;
-}
-
-
-.ui-kFooter button{
- cursor:pointer;
- margin-top: -10px;
-}
-
-.ui-kFooter button span{
- float: left;
-}
-
-.ui-kFooter button .text{
- color: #7811a2;
-padding-top: 10px;
-font-weight: bold;
-}
diff --git a/content/Explore/css/ui.kHeader.css b/content/Explore/css/ui.kHeader.css
deleted file mode 100755
index 4b4bb99..0000000
--- a/content/Explore/css/ui.kHeader.css
+++ /dev/null
@@ -1,160 +0,0 @@
-#kHeader{
- background-image: url('./images/bg_header.png');
- background-repeat: repeat-x;
- height: 70px;
- width: 100%;
- margin: 0;
- float: left;
- clear: both;
- border: none;
-}
-
- #kHeader .left{
- float: left;
- }
-
- #kHeader .right{
- float: right;
- }
-
- #kHeader>ul{
- margin: 0;
- margin-left: 5px;
- padding: 0;
- }
-
- #kHeader>ul>li{
- display:inline;
- margin: 0;
- padding: 0;
- margin-top: 5px;
- margin-right:15px;
- }
-
- #kHeader .kHeader-btn{
- width: 60px;
- height: 60px;
- display: block;
- cursor:pointer;
- }
-
- #kHeader .kHeader-back{
- background-image:url(./images/btn_back.png);
- }
-
- #kHeader .kHeader-back:hover{
- background:url('./images/btn_back_hover.png');
- }
-
- #kHeader .kHeader-title {
- font-weight: bold;
- color: #FFFFFF;
- margin-top: 10px;
- border:4px solid #e774ec;
- padding: 5px 20px 5px 20px;
- -moz-border-radius:25px;
- -webkit-border-radius: 25px;
- }
-
- #kHeader .kHeader-title span{
- float:left;
- }
-
- #kHeader .kHeader-title .kHeader-kDoc{
- background-image: url(images/arrow_down_white.png);
- background-repeat: no-repeat;
- width: 22px;
- height: 22px;
- cursor: pointer;
- margin-left: 10px;
- margin-top: 3px;
- position: relative;
- }
-
- #kHeader .kHeader-title .kHeader-kDoc .drop-down{
- display: none;
- position: absolute;
- top: 22px;
- left: -20px;
- width: 90px;
- background-color: rgba(0, 0, 0, 0.8);
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border: 1px solid white;
- padding-left: 5px;
- }
- #kHeader .kHeader-title .kHeader-kDoc .drop-down a{
- color: white;
- text-decoration: none;
- font-size: 0.6em;
-
- }
-
- #kHeader .kHeader-title .kHeader-kDoc .drop-down a:hover{
- text-decoration: underline;
- }
-
- #kHeader .kHeader-zoomIn{
- background-image: url(images/btn_plus.png);
- }
-
- #kHeader .kHeader-zoomOut{
- background-image: url(images/btn_minus.png);
- }
-
- #kHeader .kHeader-zoomIn:hover{
- -moz-border-radius: 90px;
- -webkit-border-radius: 90px;
- border: 3px solid rgba(0,0,230, 0.8);
- margin-top:2px;
- margin-left:-6px;
- }
-
- #kHeader .kHeader-zoomOut:hover{
- -moz-border-radius: 90px;
- -webkit-border-radius: 90px;
- border: 3px solid rgba(0,0,230, 0.8);
- margin-top:2px;
- margin-left:-6px;
- }
-
- #kHeader .kHeader-brand{
- background-image:url(./images/btn_ole.png);
- }
-
- #kHeader .kHeader-brand:hover{
- background-image:url(./images/btn_ole_hover.png);
- }
-
- #kHeader .kHeader-help{
- background-image:url(./images/btn_help.png);
- }
-
- #kHeader .kHeader-help:hover{
- background-image:url(./images/btn_help_hover.png);
- }
-
- /* Styles for Help Text */
- .kHeader-help{
- top: 20px !important;
- }
-
- .kHeader-help>div:first>span:first{
- font-size:larger;
- }
-
- .kHeader-help .ui-dialog-titlebar-close {
- top: 10px;
- margin-right: 20px;
- }
-
- .kHeader-help .ui-dialog-content{
- font-size: 0.8em;
- }
-
- #kHeader .kHeader-preload-img{
- height:0;
- width:0;
- display:inline;
- }
-
diff --git a/content/Explore/css/ui.resizable.css b/content/Explore/css/ui.resizable.css
deleted file mode 100755
index 44efeb2..0000000
--- a/content/Explore/css/ui.resizable.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Resizable
-----------------------------------*/
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file
diff --git a/content/Explore/css/ui.scoreboard.css b/content/Explore/css/ui.scoreboard.css
deleted file mode 100755
index 11cdbb5..0000000
--- a/content/Explore/css/ui.scoreboard.css
+++ /dev/null
@@ -1,62 +0,0 @@
-.ui-scoreboard-container-h{
-max-width: 800em;
-max-height: 200px;
-float:left;
-padding-top:0.4em;
-padding-bottom:0.4em;
-}
-
-.ui-scoreboard-spacing-h{
-max-width: 200em;
-max-height: 300em;
-display:inline;
-margin-left:0.2em;
-margin-right:0.4em;
-}
-
-.ui-scoreboard-text{
-font-size:larger;
-text-align: center;
-}
-
-.ui-scoreboard-number-h {
-background-color:black;
-color: white;
-padding-left:0.4em;
-padding-right:0.4em;
-font-size:larger;
-}
-
-.ui-scoreboard-button{
-float:right;
-cursor:pointer;
-}
-
-button .ui-scoreboard-icon{
-float: left;
-margin-right:0.3em;
-}
-.ui-scoreboard-container-v{
-max-width: 200px;
-max-height: 400px;
-float:left;
-padding-top:0.4em;
-padding-bottom:0.4em;
-}
-.ui-scoreboard-spacing-v{
-display:block;
-margin: 0.4em;
-}
-
-.ui-scoreboard-number-v{
-background-color:black;
-color: white;
-width: 1em;
-text-align:center;
-margin-left:auto;
-margin-right: auto;
-padding:0.4em;
-font-size:larger;
-}
-
-
diff --git a/content/Explore/css/ui.tabs.css b/content/Explore/css/ui.tabs.css
deleted file mode 100755
index 3ca6b9a..0000000
--- a/content/Explore/css/ui.tabs.css
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Tabs
-----------------------------------*/
-.ui-tabs { padding: .2em; zoom: 1; }
-.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
-.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
diff --git a/content/Explore/css/ui.theme.css b/content/Explore/css/ui.theme.css
deleted file mode 100755
index 6e40c73..0000000
--- a/content/Explore/css/ui.theme.css
+++ /dev/null
@@ -1,245 +0,0 @@
-
-
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-* To view and modify this theme, visit http://jqueryui.com/themeroller/
-*/
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
-.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(../assets/default/images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
-.ui-widget-content a { color: #222222/*{fcContent}*/; }
-.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(../assets/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
-.ui-widget-header a { color: #222222/*{fcHeader}*/; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(../assets/default/images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; outline: none; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; outline: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(../assets/default/images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; outline: none; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; outline: none; }
-.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(../assets/default/images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; outline: none; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; outline: none; text-decoration: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(../assets/default/images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
-.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(../assets/default/images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
-.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: url(../assets/default/images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
-.ui-widget-content .ui-icon {background-image: url(../assets/default/images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
-.ui-widget-header .ui-icon {background-image: url(../assets/default/images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
-.ui-state-default .ui-icon { background-image: url(../assets/default/images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../assets/default/images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
-.ui-state-active .ui-icon {background-image: url(../assets/default/images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
-.ui-state-highlight .ui-icon {background-image: url(../assets/default/images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../assets/default/images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; }
-
-/* Overlays */
-.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(../assets/default/images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
-.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(../assets/default/images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file
diff --git a/content/Explore/index.html b/content/Explore/index.html
deleted file mode 100755
index 19368bf..0000000
--- a/content/Explore/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Explore</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/lesson.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome" /></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- Sample Milestones
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/Explore/js/global.js b/content/Explore/js/global.js
deleted file mode 100755
index 4479363..0000000
--- a/content/Explore/js/global.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Functions that are common in all lessons
- *
- */
-
-var flag_start = 0,i,j,flag;
-var path = '../../../MenuStage.html'; // MenuStage.html path for the location of flash interface
-
-function gotoMainStage(){
- window.location = path;
-}
-//enable or disable the control buttons
-function controlButtonDisplay(button,status){
- var opacity;
- if(status === 'enabled'){
- opacity = 1;
- cursor = 'pointer';
- }else{
- opacity = .3;
- cursor = 'default';
- }
- var buttonCss = {
- 'opacity':opacity,
- 'cursor':cursor
- };
- $('#'+button).css(buttonCss);
-}
-//generate a random numbers between two limits
-function genRand( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-/*
- Function to generate a set of random numbers and assign it to a variable supplied
- @params: randVar - > The variable in which the random numbers to be stored
- lower -> lower number
- upper -> upper number
- include lower and upper limit
- Currently it generates numbers betweem 0-upper (exclude upper)
-*/
-function shuffleNumbers(randVar,lower,upper) {
- var total_nums = upper-lower;
- randVar[0] = genRand(0,total_nums-1);
- for(i= 1; i < total_nums; i++){
- do{
- flag = 0;
- randVar[i] = genRand(0,total_nums-1);
- for(j=0; j<i; j++){
- if(randVar[i] === randVar[j]){
- flag++;
- }
- }
- }while(flag != 0 ); //end of do while loop
- }
-}
-
-
diff --git a/content/Explore/js/global.js~ b/content/Explore/js/global.js~
deleted file mode 100755
index 4479363..0000000
--- a/content/Explore/js/global.js~
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Functions that are common in all lessons
- *
- */
-
-var flag_start = 0,i,j,flag;
-var path = '../../../MenuStage.html'; // MenuStage.html path for the location of flash interface
-
-function gotoMainStage(){
- window.location = path;
-}
-//enable or disable the control buttons
-function controlButtonDisplay(button,status){
- var opacity;
- if(status === 'enabled'){
- opacity = 1;
- cursor = 'pointer';
- }else{
- opacity = .3;
- cursor = 'default';
- }
- var buttonCss = {
- 'opacity':opacity,
- 'cursor':cursor
- };
- $('#'+button).css(buttonCss);
-}
-//generate a random numbers between two limits
-function genRand( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-/*
- Function to generate a set of random numbers and assign it to a variable supplied
- @params: randVar - > The variable in which the random numbers to be stored
- lower -> lower number
- upper -> upper number
- include lower and upper limit
- Currently it generates numbers betweem 0-upper (exclude upper)
-*/
-function shuffleNumbers(randVar,lower,upper) {
- var total_nums = upper-lower;
- randVar[0] = genRand(0,total_nums-1);
- for(i= 1; i < total_nums; i++){
- do{
- flag = 0;
- randVar[i] = genRand(0,total_nums-1);
- for(j=0; j<i; j++){
- if(randVar[i] === randVar[j]){
- flag++;
- }
- }
- }while(flag != 0 ); //end of do while loop
- }
-}
-
-
diff --git a/content/Explore/js/jquery-1.3.2.min.js b/content/Explore/js/jquery-1.3.2.min.js
deleted file mode 100755
index b1ae21d..0000000
--- a/content/Explore/js/jquery-1.3.2.min.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
-/*
- * Sizzle CSS Selector Engine - v0.9.3
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/content/Explore/js/jquery-1.4.js b/content/Explore/js/jquery-1.4.js
deleted file mode 100755
index a448490..0000000
--- a/content/Explore/js/jquery-1.4.js
+++ /dev/null
@@ -1,5999 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.4
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://docs.jquery.com/License
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Jan 13 15:23:05 2010 -0500
- */
-(function( window, undefined ) {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context );
- },
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
-
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // A simple way to check for HTML strings or ID strings
- // (both of which we optimize for)
- quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
-
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/,
-
- // Check if a string has a non-whitespace character in it
- rnotwhite = /\S/,
-
- // Used for trimming whitespace
- rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
- // Keep a UserAgent string for use with jQuery.browser
- userAgent = navigator.userAgent,
-
- // For matching the engine and version of the browser
- browserMatch,
-
- // Has the ready events already been bound?
- readyBound = false,
-
- // The functions to execute on DOM ready
- readyList = [],
-
- // The ready event handler
- DOMContentLoaded,
-
- // Save a reference to some core methods
- toString = Object.prototype.toString,
- hasOwnProperty = Object.prototype.hasOwnProperty,
- push = Array.prototype.push,
- slice = Array.prototype.slice,
- indexOf = Array.prototype.indexOf;
-
-jQuery.fn = jQuery.prototype = {
- init: function( selector, context ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), or $(undefined)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- match = quickExpr.exec( selector );
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- doc = (context ? context.ownerDocument || context : document);
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- ret = rsingleTag.exec( selector );
-
- if ( ret ) {
- if ( jQuery.isPlainObject( context ) ) {
- selector = [ document.createElement( ret[1] ) ];
- jQuery.fn.attr.call( selector, context, true );
-
- } else {
- selector = [ doc.createElement( ret[1] ) ];
- }
-
- } else {
- ret = buildFragment( [ match[1] ], [ doc ] );
- selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
- }
-
- // HANDLE: $("#id")
- } else {
- elem = document.getElementById( match[2] );
-
- if ( elem ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id !== match[2] ) {
- return rootjQuery.find( selector );
- }
-
- // Otherwise, we inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $("TAG")
- } else if ( !context && /^\w+$/.test( selector ) ) {
- this.selector = selector;
- this.context = document;
- selector = document.getElementsByTagName( selector );
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return (context || rootjQuery).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return jQuery( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if (selector.selector !== undefined) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.isArray( selector ) ?
- this.setArray( selector ) :
- jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.4",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return slice.call( this, 0 );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num == null ?
-
- // Return a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = jQuery( elems || null );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" ) {
- ret.selector = this.selector + (this.selector ? " " : "") + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Force the current matched set of elements to become
- // the specified array of elements (destroying the stack in the process)
- // You should use pushStack() in order to do this, but maintain the stack
- setArray: function( elems ) {
- // Resetting the length to 0, then using the native Array push
- // is a super-fast way to populate an object with array-like properties
- this.length = 0;
- push.apply( this, elems );
-
- return this;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Attach the listeners
- jQuery.bindReady();
-
- // If the DOM is already ready
- if ( jQuery.isReady ) {
- // Execute the function immediately
- fn.call( document, jQuery );
-
- // Otherwise, remember the function for later
- } else if ( readyList ) {
- // Add the function to the wait list
- readyList.push( fn );
- }
-
- return this;
- },
-
- eq: function( i ) {
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, +i + 1 );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ),
- "slice", slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || jQuery(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: [].sort,
- splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
- // copy reference to target object
- var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( length === i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging object literal values or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
- var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
- : jQuery.isArray(copy) ? [] : {};
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend({
- noConflict: function( deep ) {
- window.$ = _$;
-
- if ( deep ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // Handle when the DOM is ready
- ready: function() {
- // Make sure that the DOM is not already loaded
- if ( !jQuery.isReady ) {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 13 );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If there are functions bound, to execute
- if ( readyList ) {
- // Execute all of them
- var fn, i = 0;
- while ( (fn = readyList[ i++ ]) ) {
- fn.call( document, jQuery );
- }
-
- // Reset the list of functions
- readyList = null;
- }
-
- // Trigger any bound ready events
- if ( jQuery.fn.triggerHandler ) {
- jQuery( document ).triggerHandler( "ready" );
- }
- }
- },
-
- bindReady: function() {
- if ( readyBound ) {
- return;
- }
-
- readyBound = true;
-
- // Catch cases where $(document).ready() is called after the
- // browser event has already occurred.
- if ( document.readyState === "complete" ) {
- return jQuery.ready();
- }
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent("onreadystatechange", DOMContentLoaded);
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var toplevel = false;
-
- try {
- toplevel = window.frameElement == null;
- } catch(e) {}
-
- if ( document.documentElement.doScroll && toplevel ) {
- doScrollCheck();
- }
- }
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return toString.call(obj) === "[object Function]";
- },
-
- isArray: function( obj ) {
- return toString.call(obj) === "[object Array]";
- },
-
- isPlainObject: function( obj ) {
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
- return false;
- }
-
- // Not own constructor property must be Object
- if ( obj.constructor
- && !hasOwnProperty.call(obj, "constructor")
- && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || hasOwnProperty.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- for ( var name in obj ) {
- return false;
- }
- return true;
- },
-
- noop: function() {},
-
- // Evalulates a script in a global context
- globalEval: function( data ) {
- if ( data && rnotwhite.test(data) ) {
- // Inspired by code by Andrea Giammarchi
- // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
- var head = document.getElementsByTagName("head")[0] || document.documentElement,
- script = document.createElement("script");
-
- script.type = "text/javascript";
-
- if ( jQuery.support.scriptEval ) {
- script.appendChild( document.createTextNode( data ) );
- } else {
- script.text = data;
- }
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709).
- head.insertBefore( script, head.firstChild );
- head.removeChild( script );
- }
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0,
- length = object.length,
- isObj = length === undefined || jQuery.isFunction(object);
-
- if ( args ) {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.apply( object[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( object[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( var value = object[0];
- i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
- }
- }
-
- return object;
- },
-
- trim: function( text ) {
- return (text || "").replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( array, results ) {
- var ret = results || [];
-
- if ( array != null ) {
- // The window, strings (and functions) also have 'length'
- // The extra typeof function check is to prevent crashes
- // in Safari 2 (See: #3039)
- if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
- push.call( ret, array );
- } else {
- jQuery.merge( ret, array );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, array ) {
- if ( array.indexOf ) {
- return array.indexOf( elem );
- }
-
- for ( var i = 0, length = array.length; i < length; i++ ) {
- if ( array[ i ] === elem ) {
- return i;
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var i = first.length, j = 0;
-
- if ( typeof second.length === "number" ) {
- for ( var l = second.length; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var ret = [];
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- if ( !inv !== !callback( elems[ i ], i ) ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var ret = [], value;
-
- // Go through the array, translating each of the items to their
- // new value (or values).
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- return ret.concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- proxy: function( fn, proxy, thisObject ) {
- if ( arguments.length === 2 ) {
- if ( typeof proxy === "string" ) {
- thisObject = fn;
- fn = thisObject[ proxy ];
- proxy = undefined;
-
- } else if ( proxy && !jQuery.isFunction( proxy ) ) {
- thisObject = proxy;
- proxy = undefined;
- }
- }
-
- if ( !proxy && fn ) {
- proxy = function() {
- return fn.apply( thisObject || this, arguments );
- };
- }
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- if ( fn ) {
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
- }
-
- // So proxy can be declared as an argument
- return proxy;
- },
-
- // Use of jQuery.browser is frowned upon.
- // More details: http://docs.jquery.com/Utilities/jQuery.browser
- uaMatch: function( ua ) {
- var ret = { browser: "" };
-
- ua = ua.toLowerCase();
-
- if ( /webkit/.test( ua ) ) {
- ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
-
- } else if ( /opera/.test( ua ) ) {
- ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
-
- } else if ( /msie/.test( ua ) ) {
- ret = { browser: "msie", version: /msie ([\w.]+)/ };
-
- } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
- ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
- }
-
- ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
-
- return ret;
- },
-
- browser: {}
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
- jQuery.browser[ browserMatch.browser ] = true;
- jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
- jQuery.browser.safari = true;
-}
-
-if ( indexOf ) {
- jQuery.inArray = function( elem, array ) {
- return indexOf.call( array, elem );
- };
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- };
-
-} else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
- if ( jQuery.isReady ) {
- return;
- }
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch( error ) {
- setTimeout( doScrollCheck, 1 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
-}
-
-if ( indexOf ) {
- jQuery.inArray = function( elem, array ) {
- return indexOf.call( array, elem );
- };
-}
-
-function evalScript( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
-}
-
-// Mutifunctional method to get and set values to a collection
-// The value/s can be optionally by executed if its a function
-function access( elems, key, value, exec, fn, pass ) {
- var length = elems.length;
-
- // Setting many attributes
- if ( typeof key === "object" ) {
- for ( var k in key ) {
- access( elems, k, key[k], exec, fn, value );
- }
- return elems;
- }
-
- // Setting one attribute
- if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = !pass && exec && jQuery.isFunction(value);
-
- for ( var i = 0; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
-
- return elems;
- }
-
- // Getting an attribute
- return length ? fn( elems[0], key ) : null;
-}
-
-function now() {
- return (new Date).getTime();
-}
-(function() {
-
- jQuery.support = {};
-
- var root = document.documentElement,
- script = document.createElement("script"),
- div = document.createElement("div"),
- id = "script" + now();
-
- div.style.display = "none";
- div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
- var all = div.getElementsByTagName("*"),
- a = div.getElementsByTagName("a")[0];
-
- // Can't get basic test support
- if ( !all || !all.length || !a ) {
- return;
- }
-
- jQuery.support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: div.firstChild.nodeType === 3,
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText insted)
- style: /red/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: a.getAttribute("href") === "/a",
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.55$/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: div.getElementsByTagName("input")[0].value === "on",
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
-
- // Will be defined later
- scriptEval: false,
- noCloneEvent: true,
- boxModel: null
- };
-
- script.type = "text/javascript";
- try {
- script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
- } catch(e) {}
-
- root.insertBefore( script, root.firstChild );
-
- // Make sure that the execution of code works by injecting a script
- // tag with appendChild/createTextNode
- // (IE doesn't support this, fails, and uses .text instead)
- if ( window[ id ] ) {
- jQuery.support.scriptEval = true;
- delete window[ id ];
- }
-
- root.removeChild( script );
-
- if ( div.attachEvent && div.fireEvent ) {
- div.attachEvent("onclick", function click() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- jQuery.support.noCloneEvent = false;
- div.detachEvent("onclick", click);
- });
- div.cloneNode(true).fireEvent("onclick");
- }
-
- // Figure out if the W3C box model works as expected
- // document.body must exist before we can do this
- // TODO: This timeout is temporary until I move ready into core.js.
- jQuery(function() {
- var div = document.createElement("div");
- div.style.width = div.style.paddingLeft = "1px";
-
- document.body.appendChild( div );
- jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
- document.body.removeChild( div ).style.display = 'none';
- div = null;
- });
-
- // Technique from Juriy Zaytsev
- // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
- var eventSupported = function( eventName ) {
- var el = document.createElement("div");
- eventName = "on" + eventName;
-
- var isSupported = (eventName in el);
- if ( !isSupported ) {
- el.setAttribute(eventName, "return;");
- isSupported = typeof el[eventName] === "function";
- }
- el = null;
-
- return isSupported;
- };
-
- jQuery.support.submitBubbles = eventSupported("submit");
- jQuery.support.changeBubbles = eventSupported("change");
-
- // release memory in IE
- root = script = div = all = a = null;
-})();
-
-jQuery.props = {
- "for": "htmlFor",
- "class": "className",
- readonly: "readOnly",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- rowspan: "rowSpan",
- colspan: "colSpan",
- tabindex: "tabIndex",
- usemap: "useMap",
- frameborder: "frameBorder"
-};
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
-var emptyObject = {};
-
-jQuery.extend({
- cache: {},
-
- expando:expando,
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- "object": true,
- "applet": true
- },
-
- data: function( elem, name, data ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- return;
- }
-
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ], cache = jQuery.cache, thisCache;
-
- // Handle the case where there's no name immediately
- if ( !name && !id ) {
- return null;
- }
-
- // Compute a unique ID for the element
- if ( !id ) {
- id = ++uuid;
- }
-
- // Avoid generating a new cache unless none exists and we
- // want to manipulate it.
- if ( typeof name === "object" ) {
- elem[ expando ] = id;
- thisCache = cache[ id ] = jQuery.extend(true, {}, name);
- } else if ( cache[ id ] ) {
- thisCache = cache[ id ];
- } else if ( typeof data === "undefined" ) {
- thisCache = emptyObject;
- } else {
- thisCache = cache[ id ] = {};
- }
-
- // Prevent overriding the named cache with undefined values
- if ( data !== undefined ) {
- elem[ expando ] = id;
- thisCache[ name ] = data;
- }
-
- return typeof name === "string" ? thisCache[ name ] : thisCache;
- },
-
- removeData: function( elem, name ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- return;
- }
-
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
-
- // If we want to remove a specific section of the element's data
- if ( name ) {
- if ( thisCache ) {
- // Remove the section of cache data
- delete thisCache[ name ];
-
- // If we've removed all the data, remove the element's cache
- if ( jQuery.isEmptyObject(thisCache) ) {
- jQuery.removeData( elem );
- }
- }
-
- // Otherwise, we want to remove all of the element's data
- } else {
- // Clean up the element expando
- try {
- delete elem[ expando ];
- } catch( e ) {
- // IE has trouble directly removing the expando
- // but it's ok with using removeAttribute
- if ( elem.removeAttribute ) {
- elem.removeAttribute( expando );
- }
- }
-
- // Completely remove the data cache
- delete cache[ id ];
- }
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- if ( typeof key === "undefined" && this.length ) {
- return jQuery.data( this[0] );
-
- } else if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- var parts = key.split(".");
- parts[1] = parts[1] ? "." + parts[1] : "";
-
- if ( value === undefined ) {
- var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
- if ( data === undefined && this.length ) {
- data = jQuery.data( this[0], key );
- }
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- } else {
- return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
- jQuery.data( this, key, value );
- });
- }
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-jQuery.extend({
- queue: function( elem, type, data ) {
- if ( !elem ) {
- return;
- }
-
- type = (type || "fx") + "queue";
- var q = jQuery.data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( !data ) {
- return q || [];
- }
-
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery.data( elem, type, jQuery.makeArray(data) );
-
- } else {
- q.push( data );
- }
-
- return q;
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ), fn = queue.shift();
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- }
-
- if ( fn ) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift("inprogress");
- }
-
- fn.call(elem, function() {
- jQuery.dequeue(elem, type);
- });
- }
- }
-});
-
-jQuery.fn.extend({
- queue: function( type, data ) {
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- }
-
- if ( data === undefined ) {
- return jQuery.queue( this[0], type );
- }
- return this.each(function( i, elem ) {
- var queue = jQuery.queue( this, type, data );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
-
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
- type = type || "fx";
-
- return this.queue( type, function() {
- var elem = this;
- setTimeout(function() {
- jQuery.dequeue( elem, type );
- }, time );
- });
- },
-
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- }
-});
-var rclass = /[\n\t]/g,
- rspace = /\s+/,
- rreturn = /\r/g,
- rspecialurl = /href|src|style/,
- rtype = /(button|input)/i,
- rfocusable = /(button|input|object|select|textarea)/i,
- rclickable = /^(a|area)$/i,
- rradiocheck = /radio|checkbox/;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return access( this, name, value, true, jQuery.attr );
- },
-
- removeAttr: function( name, fn ) {
- return this.each(function(){
- jQuery.attr( this, name, "" );
- if ( this.nodeType === 1 ) {
- this.removeAttribute( name );
- }
- });
- },
-
- addClass: function( value ) {
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.addClass( value.call(this, i, self.attr("class")) );
- });
- }
-
- if ( value && typeof value === "string" ) {
- var classNames = (value || "").split( rspace );
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
-
- if ( elem.nodeType === 1 ) {
- if ( !elem.className ) {
- elem.className = value;
-
- } else {
- var className = " " + elem.className + " ";
- for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
- elem.className += " " + classNames[c];
- }
- }
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.removeClass( value.call(this, i, self.attr("class")) );
- });
- }
-
- if ( (value && typeof value === "string") || value === undefined ) {
- var classNames = (value || "").split(rspace);
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
-
- if ( elem.nodeType === 1 && elem.className ) {
- if ( value ) {
- var className = (" " + elem.className + " ").replace(rclass, " ");
- for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
- className = className.replace(" " + classNames[c] + " ", " ");
- }
- elem.className = className.substring(1, className.length - 1);
-
- } else {
- elem.className = "";
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value, isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className, i = 0, self = jQuery(this),
- state = stateVal,
- classNames = value.split( rspace );
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space seperated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- } else if ( type === "undefined" || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery.data( this, "__className__", this.className );
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ";
- for ( var i = 0, l = this.length; i < l; i++ ) {
- if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- if ( value === undefined ) {
- var elem = this[0];
-
- if ( elem ) {
- if ( jQuery.nodeName( elem, "option" ) ) {
- return (elem.attributes.value || {}).specified ? elem.value : elem.text;
- }
-
- // We need to handle select boxes special
- if ( jQuery.nodeName( elem, "select" ) ) {
- var index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
-
- // Nothing was selected
- if ( index < 0 ) {
- return null;
- }
-
- // Loop through all the selected options
- for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
- var option = options[ i ];
-
- if ( option.selected ) {
- // Get the specifc value for the option
- value = jQuery(option).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- }
-
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
-
-
- // Everything else, we just grab the value
- return (elem.value || "").replace(rreturn, "");
-
- }
-
- return undefined;
- }
-
- var isFunction = jQuery.isFunction(value);
-
- return this.each(function(i) {
- var self = jQuery(this), val = value;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call(this, i, self.val());
- }
-
- // Typecast each time if the value is a Function and the appended
- // value is therefore different each time.
- if ( typeof val === "number" ) {
- val += "";
- }
-
- if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
- this.checked = jQuery.inArray( self.val(), val ) >= 0;
-
- } else if ( jQuery.nodeName( this, "select" ) ) {
- var values = jQuery.makeArray(val);
-
- jQuery( "option", this ).each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- this.selectedIndex = -1;
- }
-
- } else {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- attrFn: {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true
- },
-
- attr: function( elem, name, value, pass ) {
- // don't set attributes on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
- return undefined;
- }
-
- if ( pass && name in jQuery.attrFn ) {
- return jQuery(elem)[name](value);
- }
-
- var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
- // Whether we are setting (or getting)
- set = value !== undefined;
-
- // Try to normalize/fix the name
- name = notxml && jQuery.props[ name ] || name;
-
- // Only do all the following if this is a node (faster for style)
- if ( elem.nodeType === 1 ) {
- // These attributes require special treatment
- var special = rspecialurl.test( name );
-
- // Safari mis-reports the default selected property of an option
- // Accessing the parent's selectedIndex property fixes it
- if ( name === "selected" && !jQuery.support.optSelected ) {
- var parent = elem.parentNode;
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- }
-
- // If applicable, access the attribute via the DOM 0 way
- if ( name in elem && notxml && !special ) {
- if ( set ) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
- throw "type property can't be changed";
- }
-
- elem[ name ] = value;
- }
-
- // browsers index elements by id/name on forms, give priority to attributes.
- if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
- return elem.getAttributeNode( name ).nodeValue;
- }
-
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- if ( name === "tabIndex" ) {
- var attributeNode = elem.getAttributeNode( "tabIndex" );
-
- return attributeNode && attributeNode.specified ?
- attributeNode.value :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
-
- return elem[ name ];
- }
-
- if ( !jQuery.support.style && notxml && name === "style" ) {
- if ( set ) {
- elem.style.cssText = "" + value;
- }
-
- return elem.style.cssText;
- }
-
- if ( set ) {
- // convert the value to a string (all browsers do this but IE) see #1070
- elem.setAttribute( name, "" + value );
- }
-
- var attr = !jQuery.support.hrefNormalized && notxml && special ?
- // Some attributes require a special call on IE
- elem.getAttribute( name, 2 ) :
- elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return attr === null ? undefined : attr;
- }
-
- // elem is actually elem.style ... set the style
- // Using attr for specific style information is now deprecated. Use style insead.
- return jQuery.style( elem, name, value );
- }
-});
-var fcleanup = function( nm ) {
- return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
- return "\\" + ch;
- });
-};
-
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code originated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
- // Bind an event to an element
- // Original by Dean Edwards
- add: function( elem, types, handler, data ) {
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // For whatever reason, IE has trouble passing the window object
- // around, causing it to be cloned in the process
- if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
- elem = window;
- }
-
- // Make sure that the function being executed has a unique ID
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // if data is passed, bind to handler
- if ( data !== undefined ) {
- // Create temporary function pointer to original handler
- var fn = handler;
-
- // Create unique handler function, wrapped around original handler
- handler = jQuery.proxy( fn );
-
- // Store data in unique handler
- handler.data = data;
- }
-
- // Init the element's event structure
- var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
- handle = jQuery.data( elem, "handle" ), eventHandle;
-
- if ( !handle ) {
- eventHandle = function() {
- // Handle the second event of a trigger and when
- // an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
- jQuery.event.handle.apply( eventHandle.elem, arguments ) :
- undefined;
- };
-
- handle = jQuery.data( elem, "handle", eventHandle );
- }
-
- // If no handle is found then we must be trying to bind to one of the
- // banned noData elements
- if ( !handle ) {
- return;
- }
-
- // Add elem as a property of the handle function
- // This is to prevent a memory leak with non-native
- // event in IE.
- handle.elem = elem;
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- types = types.split( /\s+/ );
- var type, i=0;
- while ( (type = types[ i++ ]) ) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- handler.type = namespaces.slice(0).sort().join(".");
-
- // Get the current list of functions bound to this event
- var handlers = events[ type ],
- special = this.special[ type ] || {};
-
-
-
- // Init the event handler queue
- if ( !handlers ) {
- handlers = events[ type ] = {};
-
- // Check for a special event handler
- // Only use addEventListener/attachEvent if the special
- // events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
- // Bind the global event handler to the element
- if ( elem.addEventListener ) {
- elem.addEventListener( type, handle, false );
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, handle );
- }
- }
- }
-
- if ( special.add ) {
- var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
- if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
- modifiedHandler.guid = modifiedHandler.guid || handler.guid;
- handler = modifiedHandler;
- }
- }
-
- // Add the function to the element's handler list
- handlers[ handler.guid ] = handler;
-
- // Keep track of which events have been used, for global triggering
- this.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- global: {},
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler ) {
- // don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- var events = jQuery.data( elem, "events" ), ret, type, fn;
-
- if ( events ) {
- // Unbind all events for the element
- if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
- for ( type in events ) {
- this.remove( elem, type + (types || "") );
- }
- } else {
- // types is actually an event object here
- if ( types.type ) {
- handler = types.handler;
- types = types.type;
- }
-
- // Handle multiple events separated by a space
- // jQuery(...).unbind("mouseover mouseout", fn);
- types = types.split(/\s+/);
- var i = 0;
- while ( (type = types[ i++ ]) ) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- var all = !namespaces.length,
- cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
- namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
- special = this.special[ type ] || {};
-
- if ( events[ type ] ) {
- // remove the given handler for the given type
- if ( handler ) {
- fn = events[ type ][ handler.guid ];
- delete events[ type ][ handler.guid ];
-
- // remove all handlers for the given type
- } else {
- for ( var handle in events[ type ] ) {
- // Handle the removal of namespaced events
- if ( all || namespace.test( events[ type ][ handle ].type ) ) {
- delete events[ type ][ handle ];
- }
- }
- }
-
- if ( special.remove ) {
- special.remove.call( elem, namespaces, fn);
- }
-
- // remove generic event handler if no more handlers exist
- for ( ret in events[ type ] ) {
- break;
- }
- if ( !ret ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
- } else if ( elem.detachEvent ) {
- elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
- }
- }
- ret = null;
- delete events[ type ];
- }
- }
- }
- }
-
- // Remove the expando if it's no longer used
- for ( ret in events ) {
- break;
- }
- if ( !ret ) {
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) {
- handle.elem = null;
- }
- jQuery.removeData( elem, "events" );
- jQuery.removeData( elem, "handle" );
- }
- }
- },
-
- // bubbling is internal
- trigger: function( event, data, elem /*, bubbling */ ) {
- // Event object or event type
- var type = event.type || event,
- bubbling = arguments[3];
-
- if ( !bubbling ) {
- event = typeof event === "object" ?
- // jQuery.Event object
- event[expando] ? event :
- // Object literal
- jQuery.extend( jQuery.Event(type), event ) :
- // Just the event type (string)
- jQuery.Event(type);
-
- if ( type.indexOf("!") >= 0 ) {
- event.type = type = type.slice(0, -1);
- event.exclusive = true;
- }
-
- // Handle a global trigger
- if ( !elem ) {
- // Don't bubble custom events when global (to avoid too much overhead)
- event.stopPropagation();
-
- // Only trigger if we've ever bound an event for it
- if ( this.global[ type ] ) {
- jQuery.each( jQuery.cache, function() {
- if ( this.events && this.events[type] ) {
- jQuery.event.trigger( event, data, this.handle.elem );
- }
- });
- }
- }
-
- // Handle triggering a single element
-
- // don't do events on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
- return undefined;
- }
-
- // Clean up in case it is reused
- event.result = undefined;
- event.target = elem;
-
- // Clone the incoming data, if any
- data = jQuery.makeArray( data );
- data.unshift( event );
- }
-
- event.currentTarget = elem;
-
- // Trigger the event, it is assumed that "handle" is a function
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) {
- handle.apply( elem, data );
- }
-
- var nativeFn, nativeHandler;
- try {
- if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
- nativeFn = elem[ type ];
- nativeHandler = elem[ "on" + type ];
- }
- // prevent IE from throwing an error for some elements with some event types, see #3533
- } catch (e) {}
-
- var isClick = jQuery.nodeName(elem, "a") && type === "click";
-
- // Trigger the native events (except for clicks on links)
- if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
- this.triggered = true;
- try {
- elem[ type ]();
- // prevent IE from throwing an error for some hidden elements
- } catch (e) {}
-
- // Handle triggering native .onfoo handlers
- } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
- event.result = false;
- }
-
- this.triggered = false;
-
- if ( !event.isPropagationStopped() ) {
- var parent = elem.parentNode || elem.ownerDocument;
- if ( parent ) {
- jQuery.event.trigger( event, data, parent, true );
- }
- }
- },
-
- handle: function( event ) {
- // returned undefined or false
- var all, handlers;
-
- event = arguments[0] = jQuery.event.fix( event || window.event );
- event.currentTarget = this;
-
- // Namespaced event handlers
- var namespaces = event.type.split(".");
- event.type = namespaces.shift();
-
- // Cache this now, all = true means, any handler
- all = !namespaces.length && !event.exclusive;
-
- var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
-
- handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
-
- for ( var j in handlers ) {
- var handler = handlers[ j ];
-
- // Filter the functions by class
- if ( all || namespace.test(handler.type) ) {
- // Pass in a reference to the handler function itself
- // So that we can later remove it
- event.handler = handler;
- event.data = handler.data;
-
- var ret = handler.apply( this, arguments );
-
- if ( ret !== undefined ) {
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
-
- if ( event.isImmediatePropagationStopped() ) {
- break;
- }
-
- }
- }
-
- return event.result;
- },
-
- props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
- fix: function( event ) {
- if ( event[ expando ] ) {
- return event;
- }
-
- // store a copy of the original event object
- // and "clone" to set read-only properties
- var originalEvent = event;
- event = jQuery.Event( originalEvent );
-
- for ( var i = this.props.length, prop; i; ) {
- prop = this.props[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary
- if ( !event.target ) {
- event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
- }
-
- // check if target is a textnode (safari)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && event.fromElement ) {
- event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
- }
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && event.clientX != null ) {
- var doc = document.documentElement, body = document.body;
- event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
- event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
- }
-
- // Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
- event.which = event.charCode || event.keyCode;
- }
-
- // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
- if ( !event.metaKey && event.ctrlKey ) {
- event.metaKey = event.ctrlKey;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if ( !event.which && event.button !== undefined ) {
- event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
- }
-
- return event;
- },
-
- // Deprecated, use jQuery.guid instead
- guid: 1E8,
-
- // Deprecated, use jQuery.proxy instead
- proxy: jQuery.proxy,
-
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: jQuery.bindReady,
- teardown: jQuery.noop
- },
-
- live: {
- add: function( proxy, data, namespaces, live ) {
- jQuery.extend( proxy, data || {} );
-
- proxy.guid += data.selector + data.live;
- jQuery.event.add( this, data.live, liveHandler, data );
-
- },
-
- remove: function( namespaces ) {
- if ( namespaces.length ) {
- var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
-
- jQuery.each( (jQuery.data(this, "events").live || {}), function() {
- if ( name.test(this.type) ) {
- remove++;
- }
- });
-
- if ( remove < 1 ) {
- jQuery.event.remove( this, namespaces[0], liveHandler );
- }
- }
- },
- special: {}
- },
- beforeunload: {
- setup: function( data, namespaces, fn ) {
- // We only want to do this special case on windows
- if ( this.setInterval ) {
- this.onbeforeunload = fn;
- }
-
- return false;
- },
- teardown: function( namespaces, fn ) {
- if ( this.onbeforeunload === fn ) {
- this.onbeforeunload = null;
- }
- }
- }
- }
-};
-
-jQuery.Event = function( src ) {
- // Allow instantiation without the 'new' keyword
- if ( !this.preventDefault ) {
- return new jQuery.Event( src );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
- // Event type
- } else {
- this.type = src;
- }
-
- // timeStamp is buggy for some events on Firefox(#3843)
- // So we won't rely on the native value
- this.timeStamp = now();
-
- // Mark it as fixed
- this[ expando ] = true;
-};
-
-function returnFalse() {
- return false;
-}
-function returnTrue() {
- return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
- }
- // otherwise set the returnValue property of the original event to false (IE)
- e.returnValue = false;
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-
-// Checks if an event happened on an element within another element
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function( event ) {
- // Check if mouse(over|out) are still within the same parent element
- var parent = event.relatedTarget;
-
- // Traverse up the tree
- while ( parent && parent !== this ) {
- // Firefox sometimes assigns relatedTarget a XUL element
- // which we cannot access the parentNode property of
- try {
- parent = parent.parentNode;
-
- // assuming we've left the element since we most likely mousedover a xul element
- } catch(e) {
- break;
- }
- }
-
- if ( parent !== this ) {
- // set the correct event type
- event.type = event.data;
-
- // handle event if we actually just moused on to a non sub-element
- jQuery.event.handle.apply( this, arguments );
- }
-
-},
-
-// In case of event delegation, we only need to rename the event.type,
-// liveHandler will take care of the rest.
-delegate = function( event ) {
- event.type = event.data;
- jQuery.event.handle.apply( this, arguments );
-};
-
-// Create mouseenter and mouseleave events
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- setup: function( data ) {
- jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
- },
- teardown: function( data ) {
- jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
- }
- };
-});
-
-// submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-jQuery.event.special.submit = {
- setup: function( data, namespaces, fn ) {
- if ( this.nodeName.toLowerCase() !== "form" ) {
- jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
- return trigger( "submit", this, arguments );
- }
- });
-
- jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
- return trigger( "submit", this, arguments );
- }
- });
-
- } else {
- return false;
- }
- },
-
- remove: function( namespaces, fn ) {
- jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
- jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
- }
-};
-
-}
-
-// change delegation, happens here so we have bind.
-if ( !jQuery.support.changeBubbles ) {
-
-var formElems = /textarea|input|select/i;
-
-function getVal( elem ) {
- var type = elem.type, val = elem.value;
-
- if ( type === "radio" || type === "checkbox" ) {
- val = elem.checked;
-
- } else if ( type === "select-multiple" ) {
- val = elem.selectedIndex > -1 ?
- jQuery.map( elem.options, function( elem ) {
- return elem.selected;
- }).join("-") :
- "";
-
- } else if ( elem.nodeName.toLowerCase() === "select" ) {
- val = elem.selectedIndex;
- }
-
- return val;
-}
-
-function testChange( e ) {
- var elem = e.target, data, val;
-
- if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
- return;
- }
-
- data = jQuery.data( elem, "_change_data" );
- val = getVal(elem);
-
- if ( val === data ) {
- return;
- }
-
- // the current data will be also retrieved by beforeactivate
- if ( e.type !== "focusout" || elem.type !== "radio" ) {
- jQuery.data( elem, "_change_data", val );
- }
-
- if ( elem.type !== "select" && (data != null || val) ) {
- e.type = "change";
- return jQuery.event.trigger( e, arguments[1], this );
- }
-}
-
-jQuery.event.special.change = {
- filters: {
- focusout: testChange,
-
- click: function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
- return testChange.call( this, e );
- }
- },
-
- // Change has to be called before submit
- // Keydown will be called before keypress, which is used in submit-event delegation
- keydown: function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
- (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
- type === "select-multiple" ) {
- return testChange.call( this, e );
- }
- },
-
- // Beforeactivate happens also before the previous element is blurred
- // with this event you can't trigger a change event, but you can store
- // information/focus[in] is not needed anymore
- beforeactivate: function( e ) {
- var elem = e.target;
-
- if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
- jQuery.data( elem, "_change_data", getVal(elem) );
- }
- }
- },
- setup: function( data, namespaces, fn ) {
- for ( var type in changeFilters ) {
- jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
- }
-
- return formElems.test( this.nodeName );
- },
- remove: function( namespaces, fn ) {
- for ( var type in changeFilters ) {
- jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
- }
-
- return formElems.test( this.nodeName );
- }
-};
-
-var changeFilters = jQuery.event.special.change.filters;
-
-}
-
-function trigger( type, elem, args ) {
- args[0].type = type;
- return jQuery.event.handle.apply( elem, args );
-}
-
-// Create "bubbling" focus and blur events
-if ( document.addEventListener ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
- jQuery.event.special[ fix ] = {
- setup: function() {
- this.addEventListener( orig, handler, true );
- },
- teardown: function() {
- this.removeEventListener( orig, handler, true );
- }
- };
-
- function handler( e ) {
- e = jQuery.event.fix( e );
- e.type = fix;
- return jQuery.event.handle.call( this, e );
- }
- });
-}
-
-jQuery.each(["bind", "one"], function( i, name ) {
- jQuery.fn[ name ] = function( type, data, fn ) {
- // Handle object literals
- if ( typeof type === "object" ) {
- for ( var key in type ) {
- this[ name ](key, data, type[key], fn);
- }
- return this;
- }
-
- if ( jQuery.isFunction( data ) ) {
- thisObject = fn;
- fn = data;
- data = undefined;
- }
-
- var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
- jQuery( this ).unbind( event, handler );
- return fn.apply( this, arguments );
- }) : fn;
-
- return type === "unload" && name !== "one" ?
- this.one( type, data, fn, thisObject ) :
- this.each(function() {
- jQuery.event.add( this, type, handler, data );
- });
- };
-});
-
-jQuery.fn.extend({
- unbind: function( type, fn ) {
- // Handle object literals
- if ( typeof type === "object" && !type.preventDefault ) {
- for ( var key in type ) {
- this.unbind(key, type[key]);
- }
- return this;
- }
-
- return this.each(function() {
- jQuery.event.remove( this, type, fn );
- });
- },
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
-
- triggerHandler: function( type, data ) {
- if ( this[0] ) {
- var event = jQuery.Event( type );
- event.preventDefault();
- event.stopPropagation();
- jQuery.event.trigger( event, data, this[0] );
- return event.result;
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments, i = 1;
-
- // link all the functions, so any of them can unbind this click handler
- while ( i < args.length ) {
- jQuery.proxy( fn, args[ i++ ] );
- }
-
- return this.click( jQuery.proxy( fn, function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- }));
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- },
-
- live: function( type, data, fn ) {
- if ( jQuery.isFunction( data ) ) {
- fn = data;
- data = undefined;
- }
-
- jQuery( this.context ).bind( liveConvert( type, this.selector ), {
- data: data, selector: this.selector, live: type
- }, fn );
-
- return this;
- },
-
- die: function( type, fn ) {
- jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
- return this;
- }
-});
-
-function liveHandler( event ) {
- var stop = true, elems = [], selectors = [], args = arguments,
- related, match, fn, elem, j, i, data,
- live = jQuery.extend({}, jQuery.data( this, "events" ).live);
-
- for ( j in live ) {
- fn = live[j];
- if ( fn.live === event.type ||
- fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
-
- data = fn.data;
- if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
- !data.beforeFilter[event.type](event)) ) {
- selectors.push( fn.selector );
- }
- } else {
- delete live[j];
- }
- }
-
- match = jQuery( event.target ).closest( selectors, event.currentTarget );
-
- for ( i = 0, l = match.length; i < l; i++ ) {
- for ( j in live ) {
- fn = live[j];
- elem = match[i].elem;
- related = null;
-
- if ( match[i].selector === fn.selector ) {
- // Those two events require additional checking
- if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
- related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
- }
-
- if ( !related || related !== elem ) {
- elems.push({ elem: elem, fn: fn });
- }
- }
- }
- }
-
- for ( i = 0, l = elems.length; i < l; i++ ) {
- match = elems[i];
- event.currentTarget = match.elem;
- event.data = match.fn.data;
- if ( match.fn.apply( match.elem, args ) === false ) {
- stop = false;
- break;
- }
- }
-
- return stop;
-}
-
-function liveConvert( type, selector ) {
- return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
-}
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( fn ) {
- return fn ? this.bind( name, fn ) : this.trigger( name );
- };
-
- if ( jQuery.attrFn ) {
- jQuery.attrFn[ name ] = true;
- }
-});
-
-// Prevent memory leaks in IE
-// Window isn't included so as not to unbind existing unload events
-// More info:
-// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-if ( window.attachEvent && !window.addEventListener ) {
- window.attachEvent("onunload", function() {
- for ( var id in jQuery.cache ) {
- if ( jQuery.cache[ id ].handle ) {
- // Try/Catch is to handle iframes being unloaded, see #4280
- try {
- jQuery.event.remove( jQuery.cache[ id ].handle.elem );
- } catch(e) {}
- }
- }
- });
-}
-/*!
- * Sizzle CSS Selector Engine - v1.0
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- done = 0,
- toString = Object.prototype.toString,
- hasDuplicate = false,
- baseHasDuplicate = true;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-// Thus far that includes Google Chrome.
-[0, 0].sort(function(){
- baseHasDuplicate = false;
- return 0;
-});
-
-var Sizzle = function(selector, context, results, seed) {
- results = results || [];
- var origContext = context = context || document;
-
- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
- return [];
- }
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
- soFar = selector;
-
- // Reset the position of the chunker regexp (start from head)
- while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
- soFar = m[3];
-
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = m[3];
- break;
- }
- }
-
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context );
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
-
- while ( parts.length ) {
- selector = parts.shift();
-
- if ( Expr.relative[ selector ] ) {
- selector += parts.shift();
- }
-
- set = posProcess( selector, set );
- }
- }
- } else {
- // Take a shortcut and set the context if the root selector is an ID
- // (but not if it'll be faster if the inner selector is an ID)
- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
- var ret = Sizzle.find( parts.shift(), context, contextXML );
- context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
- }
-
- if ( context ) {
- var ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
- set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
-
- if ( parts.length > 0 ) {
- checkSet = makeArray(set);
- } else {
- prune = false;
- }
-
- while ( parts.length ) {
- var cur = parts.pop(), pop = cur;
-
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if ( pop == null ) {
- pop = context;
- }
-
- Expr.relative[ cur ]( checkSet, pop, contextXML );
- }
- } else {
- checkSet = parts = [];
- }
- }
-
- if ( !checkSet ) {
- checkSet = set;
- }
-
- if ( !checkSet ) {
- throw "Syntax error, unrecognized expression: " + (cur || selector);
- }
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
- } else if ( context && context.nodeType === 1 ) {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
- } else {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
- }
- } else {
- makeArray( checkSet, results );
- }
-
- if ( extra ) {
- Sizzle( extra, origContext, results, seed );
- Sizzle.uniqueSort( results );
- }
-
- return results;
-};
-
-Sizzle.uniqueSort = function(results){
- if ( sortOrder ) {
- hasDuplicate = baseHasDuplicate;
- results.sort(sortOrder);
-
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[i-1] ) {
- results.splice(i--, 1);
- }
- }
- }
- }
-
- return results;
-};
-
-Sizzle.matches = function(expr, set){
- return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
- var set, match;
-
- if ( !expr ) {
- return [];
- }
-
- for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
- var type = Expr.order[i], match;
-
- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
- var left = match[1];
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace(/\\/g, "");
- set = Expr.find[ type ]( match, context, isXML );
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = context.getElementsByTagName("*");
- }
-
- return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
- var old = expr, result = [], curLoop = set, match, anyFound,
- isXMLFilter = set && set[0] && isXML(set[0]);
-
- while ( expr && set.length ) {
- for ( var type in Expr.filter ) {
- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
- var filter = Expr.filter[ type ], found, item, left = match[1];
- anyFound = false;
-
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) === "\\" ) {
- continue;
- }
-
- if ( curLoop === result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- var pass = not ^ !!found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
- } else {
- curLoop[i] = false;
- }
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
-
- expr = expr.replace( Expr.match[ type ], "" );
-
- if ( !anyFound ) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if ( expr === old ) {
- if ( anyFound == null ) {
- throw "Syntax error, unrecognized expression: " + expr;
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
- leftMatch: {},
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
- attrHandle: {
- href: function(elem){
- return elem.getAttribute("href");
- }
- },
- relative: {
- "+": function(checkSet, part){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !/\W/.test(part),
- isPartStrNotTag = isPartStr && !isTag;
-
- if ( isTag ) {
- part = part.toLowerCase();
- }
-
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
- elem || false :
- elem === part;
- }
- }
-
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
- }
- },
- ">": function(checkSet, part){
- var isPartStr = typeof part === "string";
-
- if ( isPartStr && !/\W/.test(part) ) {
- part = part.toLowerCase();
-
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
- }
- }
- } else {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
- }
- }
- },
- "": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( typeof part === "string" && !/\W/.test(part) ) {
- var nodeCheck = part = part.toLowerCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
- },
- "~": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( typeof part === "string" && !/\W/.test(part) ) {
- var nodeCheck = part = part.toLowerCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
- }
- },
- find: {
- ID: function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? [m] : [];
- }
- },
- NAME: function(match, context){
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [], results = context.getElementsByName(match[1]);
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
- TAG: function(match, context){
- return context.getElementsByTagName(match[1]);
- }
- },
- preFilter: {
- CLASS: function(match, curLoop, inplace, result, not, isXML){
- match = " " + match[1].replace(/\\/g, "") + " ";
-
- if ( isXML ) {
- return match;
- }
-
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
- if ( !inplace ) {
- result.push( elem );
- }
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
- ID: function(match){
- return match[1].replace(/\\/g, "");
- },
- TAG: function(match, curLoop){
- return match[1].toLowerCase();
- },
- CHILD: function(match){
- if ( match[1] === "nth" ) {
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
- ATTR: function(match, curLoop, inplace, result, not, isXML){
- var name = match[1].replace(/\\/g, "");
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
- }
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
- PSEUDO: function(match, curLoop, inplace, result, not){
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
- return false;
- }
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
- }
-
- return match;
- },
- POS: function(match){
- match.unshift( true );
- return match;
- }
- },
- filters: {
- enabled: function(elem){
- return elem.disabled === false && elem.type !== "hidden";
- },
- disabled: function(elem){
- return elem.disabled === true;
- },
- checked: function(elem){
- return elem.checked === true;
- },
- selected: function(elem){
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- elem.parentNode.selectedIndex;
- return elem.selected === true;
- },
- parent: function(elem){
- return !!elem.firstChild;
- },
- empty: function(elem){
- return !elem.firstChild;
- },
- has: function(elem, i, match){
- return !!Sizzle( match[3], elem ).length;
- },
- header: function(elem){
- return /h\d/i.test( elem.nodeName );
- },
- text: function(elem){
- return "text" === elem.type;
- },
- radio: function(elem){
- return "radio" === elem.type;
- },
- checkbox: function(elem){
- return "checkbox" === elem.type;
- },
- file: function(elem){
- return "file" === elem.type;
- },
- password: function(elem){
- return "password" === elem.type;
- },
- submit: function(elem){
- return "submit" === elem.type;
- },
- image: function(elem){
- return "image" === elem.type;
- },
- reset: function(elem){
- return "reset" === elem.type;
- },
- button: function(elem){
- return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
- },
- input: function(elem){
- return /input|select|textarea|button/i.test(elem.nodeName);
- }
- },
- setFilters: {
- first: function(elem, i){
- return i === 0;
- },
- last: function(elem, i, match, array){
- return i === array.length - 1;
- },
- even: function(elem, i){
- return i % 2 === 0;
- },
- odd: function(elem, i){
- return i % 2 === 1;
- },
- lt: function(elem, i, match){
- return i < match[3] - 0;
- },
- gt: function(elem, i, match){
- return i > match[3] - 0;
- },
- nth: function(elem, i, match){
- return match[3] - 0 === i;
- },
- eq: function(elem, i, match){
- return match[3] - 0 === i;
- }
- },
- filter: {
- PSEUDO: function(elem, match, i, array){
- var name = match[1], filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var i = 0, l = not.length; i < l; i++ ) {
- if ( not[i] === elem ) {
- return false;
- }
- }
-
- return true;
- } else {
- throw "Syntax error, unrecognized expression: " + name;
- }
- },
- CHILD: function(elem, match){
- var type = match[1], node = elem;
- switch (type) {
- case 'only':
- case 'first':
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
- if ( type === "first" ) {
- return true;
- }
- node = elem;
- case 'last':
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
- return true;
- case 'nth':
- var first = match[2], last = match[3];
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- var doneName = match[0],
- parent = elem.parentNode;
-
- if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
- var count = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
- parent.sizcache = doneName;
- }
-
- var diff = elem.nodeIndex - last;
- if ( first === 0 ) {
- return diff === 0;
- } else {
- return ( diff % first === 0 && diff / first >= 0 );
- }
- }
- },
- ID: function(elem, match){
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
- TAG: function(elem, match){
- return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
- },
- CLASS: function(elem, match){
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
- },
- ATTR: function(elem, match){
- var name = match[1],
- result = Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value !== check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
- POS: function(elem, match, i, array){
- var name = match[2], filter = Expr.setFilters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
- return "\\" + (num - 0 + 1);
- }));
-}
-
-var makeArray = function(array, results) {
- array = Array.prototype.slice.call( array, 0 );
-
- if ( results ) {
- results.push.apply( results, array );
- return results;
- }
-
- return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-try {
- Array.prototype.slice.call( document.documentElement.childNodes, 0 );
-
-// Provide a fallback method if it does not work
-} catch(e){
- makeArray = function(array, results) {
- var ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
- } else {
- if ( typeof array.length === "number" ) {
- for ( var i = 0, l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
- } else {
- for ( var i = 0; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
- }
-
- return ret;
- };
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
- if ( a == b ) {
- hasDuplicate = true;
- }
- return a.compareDocumentPosition ? -1 : 1;
- }
-
- var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( "sourceIndex" in document.documentElement ) {
- sortOrder = function( a, b ) {
- if ( !a.sourceIndex || !b.sourceIndex ) {
- if ( a == b ) {
- hasDuplicate = true;
- }
- return a.sourceIndex ? -1 : 1;
- }
-
- var ret = a.sourceIndex - b.sourceIndex;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( document.createRange ) {
- sortOrder = function( a, b ) {
- if ( !a.ownerDocument || !b.ownerDocument ) {
- if ( a == b ) {
- hasDuplicate = true;
- }
- return a.ownerDocument ? -1 : 1;
- }
-
- var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
- aRange.setStart(a, 0);
- aRange.setEnd(a, 0);
- bRange.setStart(b, 0);
- bRange.setEnd(b, 0);
- var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-}
-
-// Utility function for retreiving the text value of an array of DOM nodes
-function getText( elems ) {
- var ret = "", elem;
-
- for ( var i = 0; elems[i]; i++ ) {
- elem = elems[i];
-
- // Get the text from text nodes and CDATA nodes
- if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
- ret += elem.nodeValue;
-
- // Traverse everything else, except comment nodes
- } else if ( elem.nodeType !== 8 ) {
- ret += getText( elem.childNodes );
- }
- }
-
- return ret;
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("div"),
- id = "script" + (new Date).getTime();
- form.innerHTML = "<a name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- var root = document.documentElement;
- root.insertBefore( form, root.firstChild );
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( document.getElementById( id ) ) {
- Expr.find.ID = function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
- }
- };
-
- Expr.filter.ID = function(elem, match){
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild( form );
- root = form = null; // release memory in IE
-})();
-
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
-
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function(match, context){
- var results = context.getElementsByTagName(match[1]);
-
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
-
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
- Expr.attrHandle.href = function(elem){
- return elem.getAttribute("href", 2);
- };
- }
-
- div = null; // release memory in IE
-})();
-
-if ( document.querySelectorAll ) {
- (function(){
- var oldSizzle = Sizzle, div = document.createElement("div");
- div.innerHTML = "<p class='TEST'></p>";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function(query, context, extra, seed){
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && context.nodeType === 9 && !isXML(context) ) {
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(e){}
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- for ( var prop in oldSizzle ) {
- Sizzle[ prop ] = oldSizzle[ prop ];
- }
-
- div = null; // release memory in IE
- })();
-}
-
-(function(){
- var div = document.createElement("div");
-
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
- // Opera can't find a second classname (in 9.6)
- // Also, make sure that getElementsByClassName actually exists
- if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
- return;
- }
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 ) {
- return;
- }
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function(match, context, isXML) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-
- div = null; // release memory in IE
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 && !isXML ){
- elem.sizcache = doneName;
- elem.sizset = i;
- }
-
- if ( elem.nodeName.toLowerCase() === cur ) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
-
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-var contains = document.compareDocumentPosition ? function(a, b){
- return a.compareDocumentPosition(b) & 16;
-} : function(a, b){
- return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function(selector, context){
- var tmpSet = [], later = "", match,
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet );
- }
-
- return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.getText = getText;
-jQuery.isXMLDoc = isXML;
-jQuery.contains = contains;
-
-return;
-
-window.Sizzle = Sizzle;
-
-})();
-var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
- slice = Array.prototype.slice;
-
-// Implement the identical functionality for filter and not
-var winnow = function( elements, qualifier, keep ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- return !!qualifier.call( elem, i, elem ) === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return (elem === qualifier) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, elements );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
- });
-};
-
-jQuery.fn.extend({
- find: function( selector ) {
- var ret = this.pushStack( "", "find", selector ), length = 0;
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- length = ret.length;
- jQuery.find( selector, this[i], ret );
-
- if ( i > 0 ) {
- // Make sure that the results are unique
- for ( var n = length; n < ret.length; n++ ) {
- for ( var r = 0; r < length; r++ ) {
- if ( ret[r] === ret[n] ) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
-
- has: function( target ) {
- var targets = jQuery( target );
- return this.filter(function() {
- for ( var i = 0, l = targets.length; i < l; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
- },
-
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
- },
-
- is: function( selector ) {
- return !!selector && jQuery.filter( selector, this ).length > 0;
- },
-
- closest: function( selectors, context ) {
- if ( jQuery.isArray( selectors ) ) {
- var ret = [], cur = this[0], match, matches = {}, selector;
-
- if ( cur && selectors.length ) {
- for ( var i = 0, l = selectors.length; i < l; i++ ) {
- selector = selectors[i];
-
- if ( !matches[selector] ) {
- matches[selector] = jQuery.expr.match.POS.test( selector ) ?
- jQuery( selector, context || this.context ) :
- selector;
- }
- }
-
- while ( cur && cur.ownerDocument && cur !== context ) {
- for ( selector in matches ) {
- match = matches[selector];
-
- if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
- ret.push({ selector: selector, elem: cur });
- delete matches[selector];
- }
- }
- cur = cur.parentNode;
- }
- }
-
- return ret;
- }
-
- var pos = jQuery.expr.match.POS.test( selectors ) ?
- jQuery( selectors, context || this.context ) : null;
-
- return this.map(function( i, cur ) {
- while ( cur && cur.ownerDocument && cur !== context ) {
- if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
- return cur;
- }
- cur = cur.parentNode;
- }
- return null;
- });
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
- if ( !elem || typeof elem === "string" ) {
- return jQuery.inArray( this[0],
- // If it receives a string, the selector is used
- // If it receives nothing, the siblings are used
- elem ? jQuery( elem ) : this.parent().children() );
- }
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem, this );
- },
-
- add: function( selector, context ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context || this.context ) :
- jQuery.makeArray( selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
- all :
- jQuery.unique( all ) );
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- }
-});
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return jQuery.nth( elem, 2, "nextSibling" );
- },
- prev: function( elem ) {
- return jQuery.nth( elem, 2, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( elem.parentNode.firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return jQuery.nodeName( elem, "iframe" ) ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.makeArray( elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var ret = jQuery.map( this, fn, until );
-
- if ( !runtil.test( name ) ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- ret = this.length > 1 ? jQuery.unique( ret ) : ret;
-
- if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
-
- return this.pushStack( ret, name, slice.call(arguments).join(",") );
- };
-});
-
-jQuery.extend({
- filter: function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return jQuery.find.matches(expr, elems);
- },
-
- dir: function( elem, dir, until ) {
- var matched = [], cur = elem[dir];
- while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- nth: function( cur, result, dir, elem ) {
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] ) {
- if ( cur.nodeType === 1 && ++num === result ) {
- break;
- }
- }
-
- return cur;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
- rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
- rtagName = /<([\w:]+)/,
- rtbody = /<tbody/i,
- rhtml = /<|&\w+;/,
- fcloseTag = function( all, front, tag ) {
- return rselfClosing.test( tag ) ?
- all :
- front + "></" + tag + ">";
- },
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- area: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- };
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
- text: function( text ) {
- if ( jQuery.isFunction(text) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- return self.text( text.call(this, i, self.text()) );
- });
- }
-
- if ( typeof text !== "object" && text !== undefined ) {
- return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
- }
-
- return jQuery.getText( this );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append(this);
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- return this.each(function() {
- var self = jQuery( this ), contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- return this.each(function() {
- jQuery( this ).wrapAll( html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- } else if ( arguments.length ) {
- var set = jQuery(arguments[0]);
- set.push.apply( set, this.toArray() );
- return this.pushStack( set, "before", arguments );
- }
- },
-
- after: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- } else if ( arguments.length ) {
- var set = this.pushStack( this, "after", arguments );
- set.push.apply( set, jQuery(arguments[0]).toArray() );
- return set;
- }
- },
-
- clone: function( events ) {
- // Do the clone
- var ret = this.map(function() {
- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
- // IE copies events bound via attachEvent when
- // using cloneNode. Calling detachEvent on the
- // clone will also remove the events from the orignal
- // In order to get around this, we use innerHTML.
- // Unfortunately, this means some modifications to
- // attributes in IE that are actually only stored
- // as properties will not be copied (such as the
- // the name attribute on an input).
- var html = this.outerHTML, ownerDocument = this.ownerDocument;
- if ( !html ) {
- var div = ownerDocument.createElement("div");
- div.appendChild( this.cloneNode(true) );
- html = div.innerHTML;
- }
-
- return jQuery.clean([html.replace(rinlinejQuery, "")
- .replace(rleadingWhitespace, "")], ownerDocument)[0];
- } else {
- return this.cloneNode(true);
- }
- });
-
- // Copy the events from the original to the clone
- if ( events === true ) {
- cloneCopyEvent( this, ret );
- cloneCopyEvent( this.find("*"), ret.find("*") );
- }
-
- // Return the cloned set
- return ret;
- },
-
- html: function( value ) {
- if ( value === undefined ) {
- return this[0] && this[0].nodeType === 1 ?
- this[0].innerHTML.replace(rinlinejQuery, "") :
- null;
-
- // See if we can take a shortcut and just use innerHTML
- } else if ( typeof value === "string" && !/<script/i.test( value ) &&
- (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
- !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
-
- try {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( this[i].nodeType === 1 ) {
- cleanData( this[i].getElementsByTagName("*") );
- this[i].innerHTML = value;
- }
- }
-
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {
- this.empty().append( value );
- }
-
- } else if ( jQuery.isFunction( value ) ) {
- this.each(function(i){
- var self = jQuery(this), old = self.html();
- self.empty().append(function(){
- return value.call( this, i, old );
- });
- });
-
- } else {
- this.empty().append( value );
- }
-
- return this;
- },
-
- replaceWith: function( value ) {
- if ( this[0] && this[0].parentNode ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( !jQuery.isFunction( value ) ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling, parent = this.parentNode;
-
- jQuery(this).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- } else {
- return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
- }
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
- var results, first, value = args[0], scripts = [];
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call(this, i, table ? self.html() : undefined);
- return self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- // If we're in a fragment, just use that instead of building a new one
- if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
- results = { fragment: args[0].parentNode };
- } else {
- results = buildFragment( args, this, scripts );
- }
-
- first = results.fragment.firstChild;
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- callback.call(
- table ?
- root(this[i], first) :
- this[i],
- results.cacheable || this.length > 1 || i > 0 ?
- results.fragment.cloneNode(true) :
- results.fragment
- );
- }
- }
-
- if ( scripts ) {
- jQuery.each( scripts, evalScript );
- }
- }
-
- return this;
-
- function root( elem, cur ) {
- return jQuery.nodeName(elem, "table") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
- }
- }
-});
-
-function cloneCopyEvent(orig, ret) {
- var i = 0;
-
- ret.each(function() {
- if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
- return;
- }
-
- var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
-
- if ( events ) {
- delete curData.handle;
- curData.events = {};
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
- }
- });
-}
-
-function buildFragment( args, nodes, scripts ) {
- var fragment, cacheable, cached, cacheresults, doc;
-
- if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
- cacheable = true;
- cacheresults = jQuery.fragments[ args[0] ];
- if ( cacheresults ) {
- if ( cacheresults !== 1 ) {
- fragment = cacheresults;
- }
- cached = true;
- }
- }
-
- if ( !fragment ) {
- doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, scripts );
- }
-
- if ( cacheable ) {
- jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
- }
-
- return { fragment: fragment, cacheable: cacheable };
-}
-
-jQuery.fragments = {};
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var ret = [], insert = jQuery( selector );
-
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = (i > 0 ? this.clone(true) : this).get();
- jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
- ret = ret.concat( elems );
- }
- return this.pushStack( ret, name, insert.selector );
- };
-});
-
-jQuery.each({
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
- if ( !keepData && this.nodeType === 1 ) {
- cleanData( this.getElementsByTagName("*") );
- cleanData( [ this ] );
- }
-
- if ( this.parentNode ) {
- this.parentNode.removeChild( this );
- }
- }
- },
-
- empty: function() {
- // Remove element nodes and prevent memory leaks
- if ( this.nodeType === 1 ) {
- cleanData( this.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( this.firstChild ) {
- this.removeChild( this.firstChild );
- }
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function() {
- return this.each( fn, arguments );
- };
-});
-
-jQuery.extend({
- clean: function( elems, context, fragment, scripts ) {
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" ) {
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
- }
-
- var ret = [];
-
- jQuery.each(elems, function( i, elem ) {
- if ( typeof elem === "number" ) {
- elem += "";
- }
-
- if ( !elem ) {
- return;
- }
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" && !rhtml.test( elem ) ) {
- elem = context.createTextNode( elem );
-
- } else if ( typeof elem === "string" ) {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, fcloseTag);
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
- wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0],
- div = context.createElement("div");
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( depth-- ) {
- div = div.lastChild;
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = rtbody.test(elem),
- tbody = tag === "table" && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( var j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
-
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
- }
-
- elem = jQuery.makeArray( div.childNodes );
- }
-
- if ( elem.nodeType ) {
- ret.push( elem );
- } else {
- ret = jQuery.merge( ret, elem );
- }
-
- });
-
- if ( fragment ) {
- for ( var i = 0; ret[i]; i++ ) {
- if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
- scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
- } else {
- if ( ret[i].nodeType === 1 ) {
- ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
- }
- fragment.appendChild( ret[i] );
- }
- }
- }
-
- return ret;
- }
-});
-
-function cleanData( elems ) {
- for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
- if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
- delete jQuery.cache[ id ];
- }
- }
-}
-// exclude the following css properties to add px
-var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
- ralpha = /alpha\([^)]*\)/,
- ropacity = /opacity=([^)]*)/,
- rfloat = /float/i,
- rdashAlpha = /-([a-z])/ig,
- rupper = /([A-Z])/g,
- rnumpx = /^-?\d+(?:px)?$/i,
- rnum = /^-?\d/,
-
- cssShow = { position: "absolute", visibility: "hidden", display:"block" },
- cssWidth = [ "Left", "Right" ],
- cssHeight = [ "Top", "Bottom" ],
-
- // cache check for defaultView.getComputedStyle
- getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
- // normalize float css property
- styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn.css = function( name, value ) {
- return access( this, name, value, true, function( elem, name, value ) {
- if ( value === undefined ) {
- return jQuery.curCSS( elem, name );
- }
-
- if ( typeof value === "number" && !rexclude.test(name) ) {
- value += "px";
- }
-
- jQuery.style( elem, name, value );
- });
-};
-
-jQuery.extend({
- style: function( elem, name, value ) {
- // don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
- return undefined;
- }
-
- // ignore negative width and height values #1599
- if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
- value = undefined;
- }
-
- var style = elem.style || elem, set = value !== undefined;
-
- // IE uses filters for opacity
- if ( !jQuery.support.opacity && name === "opacity" ) {
- if ( set ) {
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // Set the alpha filter to set the opacity
- var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
- var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
- style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
- }
-
- return style.filter && style.filter.indexOf("opacity=") >= 0 ?
- (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
- "";
- }
-
- // Make sure we're using the right name for getting the float value
- if ( rfloat.test( name ) ) {
- name = styleFloat;
- }
-
- name = name.replace(rdashAlpha, fcamelCase);
-
- if ( set ) {
- style[ name ] = value;
- }
-
- return style[ name ];
- },
-
- css: function( elem, name, force, extra ) {
- if ( name === "width" || name === "height" ) {
- var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
-
- function getWH() {
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
-
- if ( extra === "border" ) {
- return;
- }
-
- jQuery.each( which, function() {
- if ( !extra ) {
- val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
- }
-
- if ( extra === "margin" ) {
- val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
- } else {
- val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
- }
- });
- }
-
- if ( elem.offsetWidth !== 0 ) {
- getWH();
- } else {
- jQuery.swap( elem, props, getWH );
- }
-
- return Math.max(0, Math.round(val));
- }
-
- return jQuery.curCSS( elem, name, force );
- },
-
- curCSS: function( elem, name, force ) {
- var ret, style = elem.style, filter;
-
- // IE uses filters for opacity
- if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
- ret = ropacity.test(elem.currentStyle.filter || "") ?
- (parseFloat(RegExp.$1) / 100) + "" :
- "";
-
- return ret === "" ?
- "1" :
- ret;
- }
-
- // Make sure we're using the right name for getting the float value
- if ( rfloat.test( name ) ) {
- name = styleFloat;
- }
-
- if ( !force && style && style[ name ] ) {
- ret = style[ name ];
-
- } else if ( getComputedStyle ) {
-
- // Only "float" is needed here
- if ( rfloat.test( name ) ) {
- name = "float";
- }
-
- name = name.replace( rupper, "-$1" ).toLowerCase();
-
- var defaultView = elem.ownerDocument.defaultView;
-
- if ( !defaultView ) {
- return null;
- }
-
- var computedStyle = defaultView.getComputedStyle( elem, null );
-
- if ( computedStyle ) {
- ret = computedStyle.getPropertyValue( name );
- }
-
- // We should always get a number back from opacity
- if ( name === "opacity" && ret === "" ) {
- ret = "1";
- }
-
- } else if ( elem.currentStyle ) {
- var camelCase = name.replace(rdashAlpha, fcamelCase);
-
- ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
- // Remember the original values
- var left = style.left, rsLeft = elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
- style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret;
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {};
-
- // Remember the old values, and insert the new ones
- for ( var name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- callback.call( elem );
-
- // Revert the old values
- for ( var name in options ) {
- elem.style[ name ] = old[ name ];
- }
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth, height = elem.offsetHeight,
- skip = elem.nodeName.toLowerCase() === "tr";
-
- return width === 0 && height === 0 && !skip ?
- true :
- width > 0 && height > 0 && !skip ?
- false :
- jQuery.curCSS(elem, "display") === "none";
- };
-
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
-var jsc = now(),
- rscript = /<script(.|\s)*?\/script>/gi,
- rselectTextarea = /select|textarea/i,
- rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
- jsre = /=\?(&|$)/,
- rquery = /\?/,
- rts = /(\?|&)_=.*?(&|$)/,
- rurl = /^(\w+:)?\/\/([^\/?#]+)/,
- r20 = /%20/g;
-
-jQuery.fn.extend({
- // Keep a copy of the old load
- _load: jQuery.fn.load,
-
- load: function( url, params, callback ) {
- if ( typeof url !== "string" ) {
- return this._load( url );
-
- // Don't do a request if no elements are being requested
- } else if ( !this.length ) {
- return this;
- }
-
- var off = url.indexOf(" ");
- if ( off >= 0 ) {
- var selector = url.slice(off, url.length);
- url = url.slice(0, off);
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = null;
-
- // Otherwise, build a param string
- } else if ( typeof params === "object" ) {
- params = jQuery.param( params, jQuery.ajaxSettings.traditional );
- type = "POST";
- }
- }
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- context:this,
- complete: function( res, status ) {
- // If successful, inject the HTML into all the matched elements
- if ( status === "success" || status === "notmodified" ) {
- // See if a selector was specified
- this.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div />")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(res.responseText.replace(rscript, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- res.responseText );
- }
-
- if ( callback ) {
- this.each( callback, [res.responseText, status, res] );
- }
- }
- });
-
- return this;
- },
-
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
- serializeArray: function() {
- return this.map(function() {
- return this.elements ? jQuery.makeArray(this.elements) : this;
- })
- .filter(function() {
- return this.name && !this.disabled &&
- (this.checked || rselectTextarea.test(this.nodeName) ||
- rinput.test(this.type));
- })
- .map(function( i, elem ) {
- var val = jQuery(this).val();
-
- return val == null ?
- null :
- jQuery.isArray(val) ?
- jQuery.map( val, function( val, i ) {
- return { name: elem.name, value: val };
- }) :
- { name: elem.name, value: val };
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
- jQuery.fn[o] = function( f ) {
- return this.bind(o, f);
- };
-});
-
-jQuery.extend({
-
- get: function( url, data, callback, type ) {
- // shift arguments if data argument was omited
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = null;
- }
-
- return jQuery.ajax({
- type: "GET",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- getScript: function( url, callback ) {
- return jQuery.get(url, null, callback, "script");
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get(url, data, callback, "json");
- },
-
- post: function( url, data, callback, type ) {
- // shift arguments if data argument was omited
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = {};
- }
-
- return jQuery.ajax({
- type: "POST",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- ajaxSetup: function( settings ) {
- jQuery.extend( jQuery.ajaxSettings, settings );
- },
-
- ajaxSettings: {
- url: location.href,
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- username: null,
- password: null,
- traditional: false,
- */
- // Create the request object; Microsoft failed to properly
- // implement the XMLHttpRequest in IE7 (can't request local files),
- // so we use the ActiveXObject when it is available
- // This function can be overriden by calling jQuery.ajaxSetup
- xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
- function() {
- return new window.XMLHttpRequest();
- } :
- function() {
- try {
- return new window.ActiveXObject("Microsoft.XMLHTTP");
- } catch(e) {}
- },
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- script: "text/javascript, application/javascript",
- json: "application/json, text/javascript",
- text: "text/plain",
- _default: "*/*"
- }
- },
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajax: function( origSettings ) {
- var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
-
- var jsonp, status, data,
- callbackContext = s.context || s,
- type = s.type.toUpperCase();
-
- // convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Handle JSONP Parameter Callbacks
- if ( s.dataType === "jsonp" ) {
- if ( type === "GET" ) {
- if ( !jsre.test( s.url ) ) {
- s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
- }
- } else if ( !s.data || !jsre.test(s.data) ) {
- s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
- }
- s.dataType = "json";
- }
-
- // Build temporary JSONP function
- if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
- jsonp = s.jsonpCallback || ("jsonp" + jsc++);
-
- // Replace the =? sequence both in the query string and the data
- if ( s.data ) {
- s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
- }
-
- s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
- // We need to make sure
- // that a JSONP style response is executed properly
- s.dataType = "script";
-
- // Handle JSONP-style loading
- window[ jsonp ] = window[ jsonp ] || function( tmp ) {
- data = tmp;
- success();
- complete();
- // Garbage collect
- window[ jsonp ] = undefined;
-
- try {
- delete window[ jsonp ];
- } catch(e) {}
-
- if ( head ) {
- head.removeChild( script );
- }
- };
- }
-
- if ( s.dataType === "script" && s.cache === null ) {
- s.cache = false;
- }
-
- if ( s.cache === false && type === "GET" ) {
- var ts = now();
-
- // try replacing _= if it is there
- var ret = s.url.replace(rts, "$1_=" + ts + "$2");
-
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
- }
-
- // If data is available, append data to url for get requests
- if ( s.data && type === "GET" ) {
- s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
- }
-
- // Watch for a new set of requests
- if ( s.global && ! jQuery.active++ ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // Matches an absolute URL, and saves the domain
- var parts = rurl.exec( s.url ),
- remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
-
- // If we're requesting a remote document
- // and trying to load JSON or Script with a GET
- if ( s.dataType === "script" && type === "GET" && remote ) {
- var head = document.getElementsByTagName("head")[0] || document.documentElement;
- var script = document.createElement("script");
- script.src = s.url;
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- // Handle Script loading
- if ( !jsonp ) {
- var done = false;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function() {
- if ( !done && (!this.readyState ||
- this.readyState === "loaded" || this.readyState === "complete") ) {
- done = true;
- success();
- complete();
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
- if ( head && script.parentNode ) {
- head.removeChild( script );
- }
- }
- };
- }
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709 and #4378).
- head.insertBefore( script, head.firstChild );
-
- // We handle everything using the script element injection
- return undefined;
- }
-
- var requestDone = false;
-
- // Create the request object
- var xhr = s.xhr();
-
- if ( !xhr ) {
- return;
- }
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if ( s.username ) {
- xhr.open(type, s.url, s.async, s.username, s.password);
- } else {
- xhr.open(type, s.url, s.async);
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- // Set the correct header, if data is being sent
- if ( s.data || origSettings && origSettings.contentType ) {
- xhr.setRequestHeader("Content-Type", s.contentType);
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[s.url] ) {
- xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
- }
-
- if ( jQuery.etag[s.url] ) {
- xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
- }
- }
-
- // Set header so the called script knows that it's an XMLHttpRequest
- // Only send the header if it's not a remote XHR
- if ( !remote ) {
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- }
-
- // Set the Accepts header for the server, depending on the dataType
- xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
- s.accepts[ s.dataType ] + ", */*" :
- s.accepts._default );
- } catch(e) {}
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active ) {
- jQuery.event.trigger( "ajaxStop" );
- }
-
- // close opended socket
- xhr.abort();
- return false;
- }
-
- if ( s.global ) {
- trigger("ajaxSend", [xhr, s]);
- }
-
- // Wait for a response to come back
- var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
- // The request was aborted
- if ( !xhr || xhr.readyState === 0 ) {
- // Opera doesn't call onreadystatechange before this point
- // so we simulate the call
- if ( !requestDone ) {
- complete();
- }
-
- requestDone = true;
- if ( xhr ) {
- xhr.onreadystatechange = jQuery.noop;
- }
-
- // The transfer is complete and the data is available, or the request timed out
- } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
- requestDone = true;
- xhr.onreadystatechange = jQuery.noop;
-
- status = isTimeout === "timeout" ?
- "timeout" :
- !jQuery.httpSuccess( xhr ) ?
- "error" :
- s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
- "notmodified" :
- "success";
-
- if ( status === "success" ) {
- // Watch for, and catch, XML document parse errors
- try {
- // process the data (runs the xml through httpData regardless of callback)
- data = jQuery.httpData( xhr, s.dataType, s );
- } catch(e) {
- status = "parsererror";
- }
- }
-
- // Make sure that the request was successful or notmodified
- if ( status === "success" || status === "notmodified" ) {
- // JSONP handles its own success callback
- if ( !jsonp ) {
- success();
- }
- } else {
- jQuery.handleError(s, xhr, status);
- }
-
- // Fire the complete handlers
- complete();
-
- if ( isTimeout === "timeout" ) {
- xhr.abort();
- }
-
- // Stop memory leaks
- if ( s.async ) {
- xhr = null;
- }
- }
- };
-
- // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
- // Opera doesn't fire onreadystatechange at all on abort
- try {
- var oldAbort = xhr.abort;
- xhr.abort = function() {
- if ( xhr ) {
- oldAbort.call( xhr );
- if ( xhr ) {
- xhr.readyState = 0;
- }
- }
-
- onreadystatechange();
- };
- } catch(e) { }
-
- // Timeout checker
- if ( s.async && s.timeout > 0 ) {
- setTimeout(function() {
- // Check to see if the request is still happening
- if ( xhr && !requestDone ) {
- onreadystatechange( "timeout" );
- }
- }, s.timeout);
- }
-
- // Send the data
- try {
- xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
- } catch(e) {
- jQuery.handleError(s, xhr, null, e);
- // Fire the complete handlers
- complete();
- }
-
- // firefox 1.5 doesn't fire statechange for sync requests
- if ( !s.async ) {
- onreadystatechange();
- }
-
- function success() {
- // If a local callback was specified, fire it and pass it the data
- if ( s.success ) {
- s.success.call( callbackContext, data, status, xhr );
- }
-
- // Fire the global callback
- if ( s.global ) {
- trigger( "ajaxSuccess", [xhr, s] );
- }
- }
-
- function complete() {
- // Process result
- if ( s.complete ) {
- s.complete.call( callbackContext, xhr, status);
- }
-
- // The request was completed
- if ( s.global ) {
- trigger( "ajaxComplete", [xhr, s] );
- }
-
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
-
- function trigger(type, args) {
- (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
- }
-
- // return XMLHttpRequest to allow aborting the request etc.
- return xhr;
- },
-
- handleError: function( s, xhr, status, e ) {
- // If a local callback was specified, fire it
- if ( s.error ) {
- s.error.call( s.context || window, xhr, status, e );
- }
-
- // Fire the global callback
- if ( s.global ) {
- (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
- }
- },
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Determines if an XMLHttpRequest was successful or not
- httpSuccess: function( xhr ) {
- try {
- // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
- return !xhr.status && location.protocol === "file:" ||
- // Opera returns 0 when status is 304
- ( xhr.status >= 200 && xhr.status < 300 ) ||
- xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
- } catch(e) {}
-
- return false;
- },
-
- // Determines if an XMLHttpRequest returns NotModified
- httpNotModified: function( xhr, url ) {
- var lastModified = xhr.getResponseHeader("Last-Modified"),
- etag = xhr.getResponseHeader("Etag");
-
- if ( lastModified ) {
- jQuery.lastModified[url] = lastModified;
- }
-
- if ( etag ) {
- jQuery.etag[url] = etag;
- }
-
- // Opera returns 0 when status is 304
- return xhr.status === 304 || xhr.status === 0;
- },
-
- httpData: function( xhr, type, s ) {
- var ct = xhr.getResponseHeader("content-type") || "",
- xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
- data = xml ? xhr.responseXML : xhr.responseText;
-
- if ( xml && data.documentElement.nodeName === "parsererror" ) {
- throw "parsererror";
- }
-
- // Allow a pre-filtering function to sanitize the response
- // s is checked to keep backwards compatibility
- if ( s && s.dataFilter ) {
- data = s.dataFilter( data, type );
- }
-
- // The filter can actually parse the response
- if ( typeof data === "string" ) {
- // Get the JavaScript object, if JSON is used.
- if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
-
- // Try to use the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- data = window.JSON.parse( data );
-
- } else {
- data = (new Function("return " + data))();
- }
-
- } else {
- throw "Invalid JSON: " + data;
- }
-
- // If the type is "script", eval it in global context
- } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
- jQuery.globalEval( data );
- }
- }
-
- return data;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a, traditional ) {
-
- var s = [];
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings.traditional;
- }
-
- function add( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction(value) ? value() : value;
- s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray(a) || a.jquery ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- jQuery.each( a, function buildParams( prefix, obj ) {
-
- if ( jQuery.isArray(obj) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional ) {
- // Treat each array item as a scalar.
- add( prefix, v );
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
- }
- });
-
- } else if ( !traditional && obj != null && typeof obj === "object" ) {
- // Serialize object item.
- jQuery.each( obj, function( k, v ) {
- buildParams( prefix + "[" + k + "]", v );
- });
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
- });
- }
-
- // Return the resulting serialization
- return s.join("&").replace(r20, "+");
- }
-
-});
-var elemdisplay = {},
- rfxtypes = /toggle|show|hide/,
- rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ];
-
-jQuery.fn.extend({
- show: function( speed, callback ) {
- if ( speed != null ) {
- return this.animate( genFx("show", 3), speed, callback);
-
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var old = jQuery.data(this[i], "olddisplay");
-
- this[i].style.display = old || "";
-
- if ( jQuery.css(this[i], "display") === "none" ) {
- var nodeName = this[i].nodeName, display;
-
- if ( elemdisplay[ nodeName ] ) {
- display = elemdisplay[ nodeName ];
-
- } else {
- var elem = jQuery("<" + nodeName + " />").appendTo("body");
-
- display = elem.css("display");
-
- if ( display === "none" ) {
- display = "block";
- }
-
- elem.remove();
-
- elemdisplay[ nodeName ] = display;
- }
-
- jQuery.data(this[i], "olddisplay", display);
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var j = 0, k = this.length; j < k; j++ ) {
- this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
- }
-
- return this;
- }
- },
-
- hide: function( speed, callback ) {
- if ( speed != null ) {
- return this.animate( genFx("hide", 3), speed, callback);
-
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var old = jQuery.data(this[i], "olddisplay");
- if ( !old && old !== "none" ) {
- jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var j = 0, k = this.length; j < k; j++ ) {
- this[j].style.display = "none";
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2 ) {
- var bool = typeof fn === "boolean";
-
- if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
- this._toggle.apply( this, arguments );
-
- } else if ( fn == null || bool ) {
- this.each(function() {
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- });
-
- } else {
- this.animate(genFx("toggle", 3), fn, fn2);
- }
-
- return this;
- },
-
- fadeTo: function( speed, to, callback ) {
- return this.filter(":hidden").css("opacity", 0).show().end()
- .animate({opacity: to}, speed, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed(speed, easing, callback);
-
- if ( jQuery.isEmptyObject( prop ) ) {
- return this.each( optall.complete );
- }
-
- return this[ optall.queue === false ? "each" : "queue" ](function() {
- var opt = jQuery.extend({}, optall), p,
- hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
- self = this;
-
- for ( p in prop ) {
- var name = p.replace(rdashAlpha, fcamelCase);
-
- if ( p !== name ) {
- prop[ name ] = prop[ p ];
- delete prop[ p ];
- p = name;
- }
-
- if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
- return opt.complete.call(this);
- }
-
- if ( ( p === "height" || p === "width" ) && this.style ) {
- // Store display property
- opt.display = jQuery.css(this, "display");
-
- // Make sure that nothing sneaks out
- opt.overflow = this.style.overflow;
- }
-
- if ( jQuery.isArray( prop[p] ) ) {
- // Create (if needed) and add to specialEasing
- (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
- prop[p] = prop[p][0];
- }
- }
-
- if ( opt.overflow != null ) {
- this.style.overflow = "hidden";
- }
-
- opt.curAnim = jQuery.extend({}, prop);
-
- jQuery.each( prop, function( name, val ) {
- var e = new jQuery.fx( self, opt, name );
-
- if ( rfxtypes.test(val) ) {
- e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-
- } else {
- var parts = rfxnum.exec(val),
- start = e.cur(true) || 0;
-
- if ( parts ) {
- var end = parseFloat( parts[2] ),
- unit = parts[3] || "px";
-
- // We need to compute starting value
- if ( unit !== "px" ) {
- self.style[ name ] = (end || 1) + unit;
- start = ((end || 1) / e.cur(true)) * start;
- self.style[ name ] = start + unit;
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] ) {
- end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
- }
-
- e.custom( start, end, unit );
-
- } else {
- e.custom( start, val, "" );
- }
- }
- });
-
- // For JS strict compliance
- return true;
- });
- },
-
- stop: function( clearQueue, gotoEnd ) {
- var timers = jQuery.timers;
-
- if ( clearQueue ) {
- this.queue([]);
- }
-
- this.each(function() {
- // go in reverse order so anything added to the queue during the loop is ignored
- for ( var i = timers.length - 1; i >= 0; i-- ) {
- if ( timers[i].elem === this ) {
- if (gotoEnd) {
- // force the next step to be the last
- timers[i](true);
- }
-
- timers.splice(i, 1);
- }
- }
- });
-
- // start the next in the queue if the last step wasn't forced
- if ( !gotoEnd ) {
- this.dequeue();
- }
-
- return this;
- }
-
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show", 1),
- slideUp: genFx("hide", 1),
- slideToggle: genFx("toggle", 1),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, callback ) {
- return this.animate( props, speed, callback );
- };
-});
-
-jQuery.extend({
- speed: function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? speed : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
-
- // Queueing
- opt.old = opt.complete;
- opt.complete = function() {
- if ( opt.queue !== false ) {
- jQuery(this).dequeue();
- }
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p, n, firstNum, diff ) {
- return firstNum + diff * p;
- },
- swing: function( p, n, firstNum, diff ) {
- return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ) {
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- if ( !options.orig ) {
- options.orig = {};
- }
- }
-
-});
-
-jQuery.fx.prototype = {
- // Simple function for setting a style value
- update: function() {
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
- // Set display property to block for height/width animations
- if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
- this.elem.style.display = "block";
- }
- },
-
- // Get the current size
- cur: function( force ) {
- if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
- return this.elem[ this.prop ];
- }
-
- var r = parseFloat(jQuery.css(this.elem, this.prop, force));
- return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
- },
-
- // Start an animation from one number to another
- custom: function( from, to, unit ) {
- this.startTime = now();
- this.start = from;
- this.end = to;
- this.unit = unit || this.unit || "px";
- this.now = this.start;
- this.pos = this.state = 0;
-
- var self = this;
- function t( gotoEnd ) {
- return self.step(gotoEnd);
- }
-
- t.elem = this.elem;
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval(jQuery.fx.tick, 13);
- }
- },
-
- // Simple 'show' function
- show: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any
- // flash of content
- this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
-
- // Start by showing the element
- jQuery( this.elem ).show();
- },
-
- // Simple 'hide' function
- hide: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom(this.cur(), 0);
- },
-
- // Each step of an animation
- step: function( gotoEnd ) {
- var t = now(), done = true;
-
- if ( gotoEnd || t >= this.options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- this.options.curAnim[ this.prop ] = true;
-
- for ( var i in this.options.curAnim ) {
- if ( this.options.curAnim[i] !== true ) {
- done = false;
- }
- }
-
- if ( done ) {
- if ( this.options.display != null ) {
- // Reset the overflow
- this.elem.style.overflow = this.options.overflow;
-
- // Reset the display
- var old = jQuery.data(this.elem, "olddisplay");
- this.elem.style.display = old ? old : this.options.display;
-
- if ( jQuery.css(this.elem, "display") === "none" ) {
- this.elem.style.display = "block";
- }
- }
-
- // Hide the element if the "hide" operation was done
- if ( this.options.hide ) {
- jQuery(this.elem).hide();
- }
-
- // Reset the properties, if the item has been hidden or shown
- if ( this.options.hide || this.options.show ) {
- for ( var p in this.options.curAnim ) {
- jQuery.style(this.elem, p, this.options.orig[p]);
- }
- }
-
- // Execute the complete function
- this.options.complete.call( this.elem );
- }
-
- return false;
-
- } else {
- var n = t - this.startTime;
- this.state = n / this.options.duration;
-
- // Perform the easing function, defaults to swing
- var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
- var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
- this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
- this.now = this.start + ((this.end - this.start) * this.pos);
-
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-};
-
-jQuery.extend( jQuery.fx, {
- tick: function() {
- var timers = jQuery.timers;
-
- for ( var i = 0; i < timers.length; i++ ) {
- if ( !timers[i]() ) {
- timers.splice(i--, 1);
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- },
-
- stop: function() {
- clearInterval( timerId );
- timerId = null;
- },
-
- speeds: {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
-
- step: {
- opacity: function( fx ) {
- jQuery.style(fx.elem, "opacity", fx.now);
- },
-
- _default: function( fx ) {
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
- } else {
- fx.elem[ fx.prop ] = fx.now;
- }
- }
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-
-function genFx( type, num ) {
- var obj = {};
-
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
- obj[ this ] = type;
- });
-
- return obj;
-}
-if ( "getBoundingClientRect" in document.documentElement ) {
- jQuery.fn.offset = function( options ) {
- var elem = this[0];
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
- clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
- top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
- left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
-
- return { top: top, left: left };
- };
-
-} else {
- jQuery.fn.offset = function( options ) {
- var elem = this[0];
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- jQuery.offset.initialize();
-
- var offsetParent = elem.offsetParent, prevOffsetParent = elem,
- doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
- body = doc.body, defaultView = doc.defaultView,
- prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
- top = elem.offsetTop, left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
- break;
- }
-
- computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
- top -= elem.scrollTop;
- left -= elem.scrollLeft;
-
- if ( elem === offsetParent ) {
- top += elem.offsetTop;
- left += elem.offsetLeft;
-
- if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
- }
-
- if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
- top += body.offsetTop;
- left += body.offsetLeft;
- }
-
- if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
- top += Math.max( docElem.scrollTop, body.scrollTop );
- left += Math.max( docElem.scrollLeft, body.scrollLeft );
- }
-
- return { top: top, left: left };
- };
-}
-
-jQuery.offset = {
- initialize: function() {
- var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
- html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-
- jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
-
- container.innerHTML = html;
- body.insertBefore( container, body.firstChild );
- innerDiv = container.firstChild;
- checkDiv = innerDiv.firstChild;
- td = innerDiv.nextSibling.firstChild.firstChild;
-
- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
- checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
- // safari subtracts parent border width here which is 5px
- this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
- checkDiv.style.position = checkDiv.style.top = "";
-
- innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
- this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
-
- body.removeChild( container );
- body = container = innerDiv = checkDiv = table = td = null;
- jQuery.offset.initialize = jQuery.noop;
- },
-
- bodyOffset: function( body ) {
- var top = body.offsetTop, left = body.offsetLeft;
-
- jQuery.offset.initialize();
-
- if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
- top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
- left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
- }
-
- return { top: top, left: left };
- },
-
- setOffset: function( elem, options, i ) {
- // set position first, in-case top/left are set even on static elem
- if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
- elem.style.position = "relative";
- }
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
- curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- var props = {
- top: (options.top - curOffset.top) + curTop,
- left: (options.left - curOffset.left) + curLeft
- };
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
- position: function() {
- if ( !this[0] ) {
- return null;
- }
-
- var elem = this[0],
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
- offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
- parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( ["Left", "Top"], function( i, name ) {
- var method = "scroll" + name;
-
- jQuery.fn[ method ] = function(val) {
- var elem = this[0], win;
-
- if ( !elem ) {
- return null;
- }
-
- if ( val !== undefined ) {
- // Set the scroll offset
- return this.each(function() {
- win = getWindow( this );
-
- if ( win ) {
- win.scrollTo(
- !i ? val : jQuery(win).scrollLeft(),
- i ? val : jQuery(win).scrollTop()
- );
-
- } else {
- this[ method ] = val;
- }
- });
- } else {
- win = getWindow( elem );
-
- // Return the scroll offset
- return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
- jQuery.support.boxModel && win.document.documentElement[ method ] ||
- win.document.body[ method ] :
- elem[ method ];
- }
- };
-});
-
-function getWindow( elem ) {
- return ("scrollTo" in elem && elem.document) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function( i, name ) {
-
- var type = name.toLowerCase();
-
- // innerHeight and innerWidth
- jQuery.fn["inner" + name] = function() {
- return this[0] ?
- jQuery.css( this[0], type, false, "padding" ) :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn["outer" + name] = function( margin ) {
- return this[0] ?
- jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
- null;
- };
-
- jQuery.fn[ type ] = function( size ) {
- // Get window width or height
- var elem = this[0];
- if ( !elem ) {
- return size == null ? null : this;
- }
-
- return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
- // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
- elem.document.body[ "client" + name ] :
-
- // Get document width or height
- (elem.nodeType === 9) ? // is it a document
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- Math.max(
- elem.documentElement["client" + name],
- elem.body["scroll" + name], elem.documentElement["scroll" + name],
- elem.body["offset" + name], elem.documentElement["offset" + name]
- ) :
-
- // Get or set width or height on the element
- size === undefined ?
- // Get width or height on the element
- jQuery.css( elem, type ) :
-
- // Set the width or height on the element (default to pixels if value is unitless)
- this.css( type, typeof size === "string" ? size : size + "px" );
- };
-
-});
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-})(window);
diff --git a/content/Explore/js/jquery.es.json b/content/Explore/js/jquery.es.json
deleted file mode 100755
index 699dc93..0000000
--- a/content/Explore/js/jquery.es.json
+++ /dev/null
@@ -1 +0,0 @@
-$.i18n.es = {}; \ No newline at end of file
diff --git a/content/Explore/js/jquery.i18n.js b/content/Explore/js/jquery.i18n.js
deleted file mode 100755
index 4eb303f..0000000
--- a/content/Explore/js/jquery.i18n.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright Bryan W Berry, 2009,
- * under the MIT license http://www.opensource.org/licenses/mit-license.php
- *
- * this library is heavily influenced by the GNU LIBC library
- * http://www.gnu.org/software/libc/manual/html_node/Locales.html
- */
-
-(function($){
- // PG: Maybe put everything in namespace i18n and rename the following function $.i18n.gettext?
-
- $.i18n = function(string, locale){
- var lang = locale || $.i18n.lang;
- if (!$.i18n[lang] || !$.i18n[lang].strings){
- return string;
- }
- return this.i18n[lang].strings['default'][string]||string;
- };
-
- $.i18n.cgettext = function(context, string, locale){
- var lang = locale || $.i18n.lang;
- if (!this.i18n[lang] || !this.i18n[lang].strings){
- return string;
- }
- return this.i18n[lang].strings[context][string]||string;
- };
-
- // You can override this in messages.<lang>.json.
- $.i18n.choose_pluralized_msg = function (choices, n) {
- return n == 1 ? choices[0] : choices[1];
- };
-
- $.i18n.ngettext = function (msgid1, msgid2, n) {
- var lang = $.i18n.lang;
- if (!$.i18n[lang] || !$.i18n[lang].strings) {
- return $.i18n.choose_pluralized_msg([msgid1, msgid2], n);
- }
- // Is using msgid1 as the key ok?
- return $.i18n.choose_pluralized_msg($.i18n[lang].strings[msgid1]
- || [msgid1, msgid2],
- n);
- };
-
- $._ = $.i18n;
- $._c = $.i18n.cgettext;
-
- $.i18n.setLocale = function (locale){
- $.i18n.lang = locale;
- };
-
- $.i18n.getLocale = function (){
- return $.i18n.lang;
- };
-
-
- /**
- * Converts a number to numerals in the specified locale. Currently only
- * supports devanagari numerals for Indic languages like Nepali and Hindi
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
- $.i18n._n = function(num, locale){
-
- locale = locale || $.i18n.lang;
-
- if (!this.i18n[locale] || !this.i18n[locale].numeralBase ){
- return num;
- }
-
-
- //48 is the base for western numerals
- var numBase = $.i18n[$.i18n.lang].numeralBase || 48;
- var prefix = $.i18n[$.i18n.lang].numeralPrefix || "u00";
-
- var convertDigit = function(digit){
- return '\\' + prefix +
- (numBase + parseInt(digit)).toString(16);
- };
-
- var charArray = num.toString().split("").map(convertDigit);
- return eval('"' + charArray.join('') + '"');
- };
-
- $._n = $.i18n._n;
-
- /* ToDo
- * implement sprintf
- * conversion functions for monetary and numeric
- * sorting functions (collation) for different locales
- */
-
- })(jQuery);
-
-
diff --git a/content/Explore/js/jquery.jgrowl_minimized.js b/content/Explore/js/jquery.jgrowl_minimized.js
deleted file mode 100755
index 09ddc88..0000000
--- a/content/Explore/js/jquery.jgrowl_minimized.js
+++ /dev/null
@@ -1,4 +0,0 @@
-
-(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)$('<div id="jGrowl"></div>').addClass($.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',new $.fn.jGrowl());$(this).data('jGrowl.instance').startup(this);}
-if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'&times;',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);this.notifications[this.notifications.length]={message:message,options:o};o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification'+((o.group!=undefined&&o.group!='')?' '+o.group:'')+'"><div class="close">'+o.closeTemplate+'</div><div class="header">'+o.header+'</div><div class="message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();(o.glue=='after')?$('div.jGrowl-notification:last',this.element).after(notification):$('div.jGrowl-notification:first',this.element).before(notification);$(notification).bind("mouseover.jGrowl",function(){$(this).data("jGrowl").pause=true;}).bind("mouseout.jGrowl",function(){$(this).data("jGrowl").pause=false;}).bind('jGrowl.beforeOpen',function(){o.beforeOpen.apply(self.element,[self.element,message,o]);}).bind('jGrowl.open',function(){o.open.apply(self.element,[self.element,message,o]);}).bind('jGrowl.beforeClose',function(){o.beforeClose.apply(self.element,[self.element,message,o]);}).bind('jGrowl.close',function(){$(this).trigger('jGrowl.beforeClose').animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();o.close.apply(self.element,[self.element,message,o]);});}).trigger('jGrowl.beforeOpen').animate(o.animateOpen,o.speed,o.easing,function(){$(this).data("jGrowl").created=new Date();}).trigger('jGrowl.open');if($.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',this.element).size()>1&&$('div.jGrowl-closer',this.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer').addClass(this.defaults.theme).appendTo(this.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer))self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){$(this).trigger('jGrowl.close');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool)){this.render(this.notifications.shift());}
-if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});};},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){jQuery(e).data('jGrowl.instance').update();},this.defaults.check);if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"])$(this.element).addClass('ie6');},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file
diff --git a/content/Explore/js/jquery.ne.json b/content/Explore/js/jquery.ne.json
deleted file mode 100755
index fe5e97b..0000000
--- a/content/Explore/js/jquery.ne.json
+++ /dev/null
@@ -1,13 +0,0 @@
-$.i18n.ne = {
- numeralBase : 2406,
- numeralPrefix:"u0"
- /*
- * additional values that could be added
- *
- * monetary format
- * non-monetary numeric format
- * date format
- * time format
- * yes, no for yes, no questions
- */
-}; \ No newline at end of file
diff --git a/content/Explore/js/jquery.svg.js b/content/Explore/js/jquery.svg.js
deleted file mode 100755
index 3d13d94..0000000
--- a/content/Explore/js/jquery.svg.js
+++ /dev/null
@@ -1,1325 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-
-(function($) { // Hide scope, no $ conflict
-
-/* SVG manager.
- Use the singleton instance of this class, $.svg,
- to interact with the SVG functionality. */
-function SVGManager() {
- this._settings = []; // Settings to be remembered per SVG object
- this._extensions = []; // List of SVG extensions added to SVGWrapper
- // for each entry [0] is extension name, [1] is extension class (function)
- // the function takes one parameter - the SVGWrapper instance
- this.regional = []; // Localisations, indexed by language, '' for default (English)
- this.regional[''] = {errorLoadingText: 'Error loading',
- notSupportedText: 'This browser does not support SVG'};
- this.local = this.regional['']; // Current localisation
- this._uuid = new Date().getTime();
- this._renesis = detectActiveX('RenesisX.RenesisCtrl');
-}
-
-/* Determine whether a given ActiveX control is available.
- @param classId (string) the ID for the ActiveX control
- @return (boolean) true if found, false if not */
-function detectActiveX(classId) {
- try {
- return !!(window.ActiveXObject && new ActiveXObject(classId));
- }
- catch (e) {
- return false;
- }
-}
-
-var PROP_NAME = 'svgwrapper';
-
-$.extend(SVGManager.prototype, {
- /* Class name added to elements to indicate already configured with SVG. */
- markerClassName: 'hasSVG',
-
- /* SVG namespace. */
- svgNS: 'http://www.w3.org/2000/svg',
- /* XLink namespace. */
- xlinkNS: 'http://www.w3.org/1999/xlink',
-
- /* SVG wrapper class. */
- _wrapperClass: SVGWrapper,
-
- /* Camel-case versions of attribute names containing dashes or are reserved words. */
- _attrNames: {class_: 'class', in_: 'in',
- alignmentBaseline: 'alignment-baseline', baselineShift: 'baseline-shift',
- clipPath: 'clip-path', clipRule: 'clip-rule',
- colorInterpolation: 'color-interpolation',
- colorInterpolationFilters: 'color-interpolation-filters',
- colorRendering: 'color-rendering', dominantBaseline: 'dominant-baseline',
- enableBackground: 'enable-background', fillOpacity: 'fill-opacity',
- fillRule: 'fill-rule', floodColor: 'flood-color',
- floodOpacity: 'flood-opacity', fontFamily: 'font-family',
- fontSize: 'font-size', fontSizeAdjust: 'font-size-adjust',
- fontStretch: 'font-stretch', fontStyle: 'font-style',
- fontVariant: 'font-variant', fontWeight: 'font-weight',
- glyphOrientationHorizontal: 'glyph-orientation-horizontal',
- glyphOrientationVertical: 'glyph-orientation-vertical',
- horizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x',
- imageRendering: 'image-rendering', letterSpacing: 'letter-spacing',
- lightingColor: 'lighting-color', markerEnd: 'marker-end',
- markerMid: 'marker-mid', markerStart: 'marker-start',
- stopColor: 'stop-color', stopOpacity: 'stop-opacity',
- strikethroughPosition: 'strikethrough-position',
- strikethroughThickness: 'strikethrough-thickness',
- strokeDashArray: 'stroke-dasharray', strokeDashOffset: 'stroke-dashoffset',
- strokeLineCap: 'stroke-linecap', strokeLineJoin: 'stroke-linejoin',
- strokeMiterLimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity',
- strokeWidth: 'stroke-width', textAnchor: 'text-anchor',
- textDecoration: 'text-decoration', textRendering: 'text-rendering',
- underlinePosition: 'underline-position', underlineThickness: 'underline-thickness',
- vertAdvY: 'vert-adv-y', vertOriginY: 'vert-origin-y',
- wordSpacing: 'word-spacing', writingMode: 'writing-mode'},
-
- /* Add the SVG object to its container. */
- _attachSVG: function(container, settings) {
- if ($(container).hasClass(this.markerClassName)) {
- return;
- }
- if (typeof settings == 'string') {
- settings = {loadURL: settings};
- }
- else if (typeof settings == 'function') {
- settings = {onLoad: settings};
- }
- $(container).addClass(this.markerClassName);
- try {
- var svg = document.createElementNS(this.svgNS, 'svg');
- svg.setAttribute('version', '1.1');
- svg.setAttribute('width', container.clientWidth);
- svg.setAttribute('height', container.clientHeight);
- container.appendChild(svg);
- this._afterLoad(container, svg, settings);
- }
- catch (e) {
- if ($.browser.msie) {
- if (!container.id) {
- container.id = 'svg' + (this._uuid++);
- }
- this._settings[container.id] = settings;
- container.innerHTML = '<embed type="image/svg+xml" width="100%" ' +
- 'height="100%" src="' + (settings.initPath || '') + 'blank.svg"/>';
- }
- else {
- container.innerHTML = '<p class="svg_error">' +
- this.local.notSupportedText + '</p>';
- }
- }
- },
-
- /* SVG callback after loading - register SVG root. */
- _registerSVG: function() {
- for (var i = 0; i < document.embeds.length; i++) { // Check all
- var container = document.embeds[i].parentNode;
- if (!$(container).hasClass($.svg.markerClassName) || // Not SVG
- $.data(container, PROP_NAME)) { // Already done
- continue;
- }
- var svg = null;
- try {
- svg = document.embeds[i].getSVGDocument();
- }
- catch(e) {
- setTimeout($.svg._registerSVG, 250); // Renesis takes longer to load
- return;
- }
- svg = (svg ? svg.documentElement : null);
- if (svg) {
- $.svg._afterLoad(container, svg);
- }
- }
- },
-
- /* Post-processing once loaded. */
- _afterLoad: function(container, svg, settings) {
- var settings = settings || this._settings[container.id];
- this._settings[container.id] = null;
- var wrapper = new this._wrapperClass(svg, container);
- $.data(container, PROP_NAME, wrapper);
- try {
- if (settings.loadURL) { // Load URL
- wrapper.load(settings.loadURL, settings);
- }
- if (settings.settings) { // Additional settings
- wrapper.configure(settings.settings);
- }
- if (settings.onLoad && !settings.loadURL) { // Onload callback
- settings.onLoad.apply(container, [wrapper]);
- }
- }
- catch (e) {
- alert(e);
- }
- },
-
- /* Return the SVG wrapper created for a given container.
- @param container (string) selector for the container or
- (element) the container for the SVG object or
- jQuery collection - first entry is the container
- @return (SVGWrapper) the corresponding SVG wrapper element, or null if not attached */
- _getSVG: function(container) {
- container = (typeof container == 'string' ? $(container)[0] :
- (container.jquery ? container[0] : container));
- return $.data(container, PROP_NAME);
- },
-
- /* Remove the SVG functionality from a div.
- @param container (element) the container for the SVG object */
- _destroySVG: function(container) {
- var $container = $(container);
- if (!$container.hasClass(this.markerClassName)) {
- return;
- }
- $container.removeClass(this.markerClassName).empty();
- $.removeData(container, PROP_NAME);
- },
-
- /* Extend the SVGWrapper object with an embedded class.
- The constructor function must take a single parameter that is
- a reference to the owning SVG root object. This allows the
- extension to access the basic SVG functionality.
- @param name (string) the name of the SVGWrapper attribute to access the new class
- @param extClass (function) the extension class constructor */
- addExtension: function(name, extClass) {
- this._extensions.push([name, extClass]);
- }
-});
-
-/* The main SVG interface, which encapsulates the SVG element.
- Obtain a reference from $().svg('get') */
-function SVGWrapper(svg, container) {
- this._svg = svg; // The SVG root node
- this._container = container; // The containing div
- for (var i = 0; i < $.svg._extensions.length; i++) {
- var extension = $.svg._extensions[i];
- this[extension[0]] = new extension[1](this);
- }
-}
-
-$.extend(SVGWrapper.prototype, {
-
- /* Retrieve the width of the SVG object. */
- _width: function() {
- return this._container.clientWidth;
- },
-
- /* Retrieve the height of the SVG object. */
- _height: function() {
- return this._container.clientHeight;
- },
-
- /* Retrieve the root SVG element.
- @return the top-level SVG element */
- root: function() {
- return this._svg;
- },
-
- /* Configure the SVG root.
- @param settings (object) additional settings for the root
- @param clear (boolean) true to remove existing attributes first,
- false to add to what is already there (optional)
- @return (SVGWrapper) this root */
- configure: function(settings, clear) {
- if (clear) {
- for (var i = this._svg.attributes.length - 1; i >= 0; i--) {
- var attr = this._svg.attributes.item(i);
- if (!(attr.nodeName == 'onload' || attr.nodeName == 'version' ||
- attr.nodeName.substring(0, 5) == 'xmlns')) {
- this._svg.attributes.removeNamedItem(attr.nodeName);
- }
- }
- }
- for (var attrName in settings) {
- this._svg.setAttribute(attrName, settings[attrName]);
- }
- return this;
- },
-
- /* Locate a specific element in the SVG document.
- @param id (string) the element's identifier
- @return (element) the element reference, or null if not found */
- getElementById: function(id) {
- return this._svg.ownerDocument.getElementById(id);
- },
-
- /* Change the attributes for a SVG node.
- @param element (SVG element) the node to change
- @param settings (object) the new settings
- @return (SVGWrapper) this root */
- change: function(element, settings) {
- if (element) {
- for (var name in settings) {
- if (settings[name] == null) {
- element.removeAttribute(name);
- }
- else {
- element.setAttribute(name, settings[name]);
- }
- }
- }
- return this;
- },
-
- /* Check for parent being absent and adjust arguments accordingly. */
- _args: function(values, names, optSettings) {
- names.splice(0, 0, 'parent');
- names.splice(names.length, 0, 'settings');
- var args = {};
- var offset = 0;
- if (values[0] != null && (typeof values[0] != 'object' || !values[0].nodeName)) {
- args['parent'] = null;
- offset = 1;
- }
- for (var i = 0; i < values.length; i++) {
- args[names[i + offset]] = values[i];
- }
- if (optSettings) {
- $.each(optSettings, function(i, value) {
- if (typeof args[value] == 'object') {
- args.settings = args[value];
- args[value] = null;
- }
- });
- }
- return args;
- },
-
- /* Add a title.
- @param parent (element) the parent node for the new title (optional)
- @param text (string) the text of the title
- @param settings (object) additional settings for the title (optional)
- @return (element) the new title node */
- title: function(parent, text, settings) {
- var args = this._args(arguments, ['text']);
- var node = this._makeNode(args.parent, 'title', args.settings || {});
- node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
- return node;
- },
-
- /* Add a description.
- @param parent (element) the parent node for the new description (optional)
- @param text (string) the text of the description
- @param settings (object) additional settings for the description (optional)
- @return (element) the new description node */
- describe: function(parent, text, settings) {
- var args = this._args(arguments, ['text']);
- var node = this._makeNode(args.parent, 'desc', args.settings || {});
- node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
- return node;
- },
-
- /* Add a definitions node.
- @param parent (element) the parent node for the new definitions (optional)
- @param id (string) the ID of this definitions (optional)
- @param settings (object) additional settings for the definitions (optional)
- @return (element) the new definitions node */
- defs: function(parent, id, settings) {
- var args = this._args(arguments, ['id'], ['id']);
- return this._makeNode(args.parent, 'defs', $.extend(
- (args.id ? {id: args.id} : {}), args.settings || {}));
- },
-
- /* Add a symbol definition.
- @param parent (element) the parent node for the new symbol (optional)
- @param id (string) the ID of this symbol
- @param x1 (number) the left coordinate for this symbol
- @param y1 (number) the top coordinate for this symbol
- @param x2 (number) the right coordinate for this symbol
- @param y2 (number) the bottom coordinate for this symbol
- @param settings (object) additional settings for the symbol (optional)
- @return (element) the new symbol node */
- symbol: function(parent, id, x1, y1, x2, y2, settings) {
- var args = this._args(arguments, ['id', 'x1', 'y1', 'x2', 'y2']);
- return this._makeNode(args.parent, 'symbol', $.extend(
- {id: args.id, viewBox: args.x1 + ' ' + args.y1 + ' ' + args.x2 + ' ' + args.y2},
- args.settings || {}));
- },
-
- /* Add a marker definition.
- @param parent (element) the parent node for the new marker (optional)
- @param id (string) the ID of this marker
- @param refX (number) the x-coordinate for the reference point
- @param refY (number) the y-coordinate for the reference point
- @param mWidth (number) the marker viewport width
- @param mHeight (number) the marker viewport height
- @param orient (string or int) 'auto' or angle (degrees) (optional)
- @param settings (object) additional settings for the marker (optional)
- @return (element) the new marker node */
- marker: function(parent, id, refX, refY, mWidth, mHeight, orient, settings) {
- var args = this._args(arguments, ['id', 'refX', 'refY',
- 'mWidth', 'mHeight', 'orient'], ['orient']);
- return this._makeNode(args.parent, 'marker', $.extend(
- {id: args.id, refX: args.refX, refY: args.refY, markerWidth: args.mWidth,
- markerHeight: args.mHeight, orient: args.orient || 'auto'}, args.settings || {}));
- },
-
- /* Add a style node.
- @param parent (element) the parent node for the new node (optional)
- @param styles (string) the CSS styles
- @param settings (object) additional settings for the node (optional)
- @return (element) the new style node */
- style: function(parent, styles, settings) {
- var args = this._args(arguments, ['styles']);
- var node = this._makeNode(args.parent, 'style', $.extend(
- {type: 'text/css'}, args.settings || {}));
- node.appendChild(this._svg.ownerDocument.createTextNode(args.styles));
- if ($.browser.opera) {
- $('head').append('<style type="text/css">' + args.styles + '</style>');
- }
- return node;
- },
-
- /* Add a script node.
- @param parent (element) the parent node for the new node (optional)
- @param script (string) the JavaScript code
- @param type (string) the MIME type for the code (optional, default 'text/javascript')
- @param settings (object) additional settings for the node (optional)
- @return (element) the new script node */
- script: function(parent, script, type, settings) {
- var args = this._args(arguments, ['script', 'type'], ['type']);
- var node = this._makeNode(args.parent, 'script', $.extend(
- {type: args.type || 'text/javascript'}, args.settings || {}));
- node.appendChild(this._svg.ownerDocument.createTextNode(this._escapeXML(args.script)));
- if (!$.browser.mozilla) {
- $.globalEval(args.script);
- }
- return node;
- },
-
- /* Add a linear gradient definition.
- Specify all of x1, y1, x2, y2 or none of them.
- @param parent (element) the parent node for the new gradient (optional)
- @param id (string) the ID for this gradient
- @param stops (string[][]) the gradient stops, each entry is
- [0] is offset (0.0-1.0 or 0%-100%), [1] is colour,
- [2] is opacity (optional)
- @param x1 (number) the x-coordinate of the gradient start (optional)
- @param y1 (number) the y-coordinate of the gradient start (optional)
- @param x2 (number) the x-coordinate of the gradient end (optional)
- @param y2 (number) the y-coordinate of the gradient end (optional)
- @param settings (object) additional settings for the gradient (optional)
- @return (element) the new gradient node */
- linearGradient: function(parent, id, stops, x1, y1, x2, y2, settings) {
- var args = this._args(arguments,
- ['id', 'stops', 'x1', 'y1', 'x2', 'y2'], ['x1']);
- var sets = $.extend({id: args.id},
- (args.x1 != null ? {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2} : {}));
- return this._gradient(args.parent, 'linearGradient',
- $.extend(sets, args.settings || {}), args.stops);
- },
-
- /* Add a radial gradient definition.
- Specify all of cx, cy, r, fx, fy or none of them.
- @param parent (element) the parent node for the new gradient (optional)
- @param id (string) the ID for this gradient
- @param stops (string[][]) the gradient stops, each entry
- [0] is offset, [1] is colour, [2] is opacity (optional)
- @param cx (number) the x-coordinate of the largest circle centre (optional)
- @param cy (number) the y-coordinate of the largest circle centre (optional)
- @param r (number) the radius of the largest circle (optional)
- @param fx (number) the x-coordinate of the gradient focus (optional)
- @param fy (number) the y-coordinate of the gradient focus (optional)
- @param settings (object) additional settings for the gradient (optional)
- @return (element) the new gradient node */
- radialGradient: function(parent, id, stops, cx, cy, r, fx, fy, settings) {
- var args = this._args(arguments,
- ['id', 'stops', 'cx', 'cy', 'r', 'fx', 'fy'], ['cx']);
- var sets = $.extend({id: args.id}, (args.cx != null ?
- {cx: args.cx, cy: args.cy, r: args.r, fx: args.fx, fy: args.fy} : {}));
- return this._gradient(args.parent, 'radialGradient',
- $.extend(sets, args.settings || {}), args.stops);
- },
-
- /* Add a gradient node. */
- _gradient: function(parent, name, settings, stops) {
- var node = this._makeNode(parent, name, settings);
- for (var i = 0; i < stops.length; i++) {
- var stop = stops[i];
- this._makeNode(node, 'stop', $.extend(
- {offset: stop[0], stopColor: stop[1]},
- (stop[2] != null ? {stopOpacity: stop[2]} : {})));
- }
- return node;
- },
-
- /* Add a pattern definition.
- Specify all of vx, vy, xwidth, vheight or none of them.
- @param parent (element) the parent node for the new pattern (optional)
- @param id (string) the ID for this pattern
- @param x (number) the x-coordinate for the left edge of the pattern
- @param y (number) the y-coordinate for the top edge of the pattern
- @param width (number) the width of the pattern
- @param height (number) the height of the pattern
- @param vx (number) the minimum x-coordinate for view box (optional)
- @param vy (number) the minimum y-coordinate for the view box (optional)
- @param vwidth (number) the width of the view box (optional)
- @param vheight (number) the height of the view box (optional)
- @param settings (object) additional settings for the pattern (optional)
- @return (element) the new pattern node */
- pattern: function(parent, id, x, y, width, height, vx, vy, vwidth, vheight, settings) {
- var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height',
- 'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
- var sets = $.extend({id: args.id, x: args.x, y: args.y,
- width: args.width, height: args.height}, (args.vx != null ?
- {viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' ' + args.vheight} : {}));
- return this._makeNode(args.parent, 'pattern', $.extend(sets, args.settings || {}));
- },
-
- /* Add a mask definition.
- @param parent (element) the parent node for the new mask (optional)
- @param id (string) the ID for this mask
- @param x (number) the x-coordinate for the left edge of the mask
- @param y (number) the y-coordinate for the top edge of the mask
- @param width (number) the width of the mask
- @param height (number) the height of the mask
- @param settings (object) additional settings for the mask (optional)
- @return (element) the new mask node */
- mask: function(parent, id, x, y, width, height, settings) {
- var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height']);
- return this._makeNode(args.parent, 'mask', $.extend(
- {id: args.id, x: args.x, y: args.y, width: args.width, height: args.height},
- args.settings || {}));
- },
-
- /* Create a new path object.
- @return (SVGPath) a new path object */
- createPath: function() {
- return new SVGPath();
- },
-
- /* Create a new text object.
- @return (SVGText) a new text object */
- createText: function() {
- return new SVGText();
- },
-
- /* Add an embedded SVG element.
- Specify all of vx, vy, vwidth, vheight or none of them.
- @param parent (element) the parent node for the new node (optional)
- @param x (number) the x-coordinate for the left edge of the node
- @param y (number) the y-coordinate for the top edge of the node
- @param width (number) the width of the node
- @param height (number) the height of the node
- @param vx (number) the minimum x-coordinate for view box (optional)
- @param vy (number) the minimum y-coordinate for the view box (optional)
- @param vwidth (number) the width of the view box (optional)
- @param vheight (number) the height of the view box (optional)
- @param settings (object) additional settings for the node (optional)
- @return (element) the new node */
- svg: function(parent, x, y, width, height, vx, vy, vwidth, vheight, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height',
- 'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
- var sets = $.extend({x: args.x, y: args.y, width: args.width, height: args.height},
- (args.vx != null ? {viewBox: args.vx + ' ' + args.vy + ' ' +
- args.vwidth + ' ' + args.vheight} : {}));
- return this._makeNode(args.parent, 'svg', $.extend(sets, args.settings || {}));
- },
-
- /* Create a group.
- @param parent (element) the parent node for the new group (optional)
- @param id (string) the ID of this group (optional)
- @param settings (object) additional settings for the group (optional)
- @return (element) the new group node */
- group: function(parent, id, settings) {
- var args = this._args(arguments, ['id'], ['id']);
- return this._makeNode(args.parent, 'g', $.extend({id: args.id}, args.settings || {}));
- },
-
- /* Add a usage reference.
- Specify all of x, y, width, height or none of them.
- @param parent (element) the parent node for the new node (optional)
- @param x (number) the x-coordinate for the left edge of the node (optional)
- @param y (number) the y-coordinate for the top edge of the node (optional)
- @param width (number) the width of the node (optional)
- @param height (number) the height of the node (optional)
- @param ref (string) the ID of the definition node
- @param settings (object) additional settings for the node (optional)
- @return (element) the new node */
- use: function(parent, x, y, width, height, ref, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
- if (typeof args.x == 'string') {
- args.ref = args.x;
- args.settings = args.y;
- args.x = args.y = args.width = args.height = null;
- }
- var node = this._makeNode(args.parent, 'use', $.extend(
- {x: args.x, y: args.y, width: args.width, height: args.height},
- args.settings || {}));
- node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
- return node;
- },
-
- /* Add a link, which applies to all child elements.
- @param parent (element) the parent node for the new link (optional)
- @param ref (string) the target URL
- @param settings (object) additional settings for the link (optional)
- @return (element) the new link node */
- link: function(parent, ref, settings) {
- var args = this._args(arguments, ['ref']);
- var node = this._makeNode(args.parent, 'a', args.settings);
- node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
- return node;
- },
-
- /* Add an image.
- @param parent (element) the parent node for the new image (optional)
- @param x (number) the x-coordinate for the left edge of the image
- @param y (number) the y-coordinate for the top edge of the image
- @param width (number) the width of the image
- @param height (number) the height of the image
- @param ref (string) the path to the image
- @param settings (object) additional settings for the image (optional)
- @return (element) the new image node */
- image: function(parent, x, y, width, height, ref, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
- var node = this._makeNode(args.parent, 'image', $.extend(
- {x: args.x, y: args.y, width: args.width, height: args.height},
- args.settings || {}));
- node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
- return node;
- },
-
- /* Draw a path.
- @param parent (element) the parent node for the new shape (optional)
- @param path (string or SVGPath) the path to draw
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- path: function(parent, path, settings) {
- var args = this._args(arguments, ['path']);
- return this._makeNode(args.parent, 'path', $.extend(
- {d: (args.path.path ? args.path.path() : args.path)}, args.settings || {}));
- },
-
- /* Draw a rectangle.
- Specify both of rx and ry or neither.
- @param parent (element) the parent node for the new shape (optional)
- @param x (number) the x-coordinate for the left edge of the rectangle
- @param y (number) the y-coordinate for the top edge of the rectangle
- @param width (number) the width of the rectangle
- @param height (number) the height of the rectangle
- @param rx (number) the x-radius of the ellipse for the rounded corners (optional)
- @param ry (number) the y-radius of the ellipse for the rounded corners (optional)
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- rect: function(parent, x, y, width, height, rx, ry, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height', 'rx', 'ry'], ['rx']);
- return this._makeNode(args.parent, 'rect', $.extend(
- {x: args.x, y: args.y, width: args.width, height: args.height},
- (args.rx ? {rx: args.rx, ry: args.ry} : {}), args.settings || {}));
- },
-
- /* Draw a circle.
- @param parent (element) the parent node for the new shape (optional)
- @param cx (number) the x-coordinate for the centre of the circle
- @param cy (number) the y-coordinate for the centre of the circle
- @param r (number) the radius of the circle
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- circle: function(parent, cx, cy, r, settings) {
- var args = this._args(arguments, ['cx', 'cy', 'r']);
- return this._makeNode(args.parent, 'circle', $.extend(
- {cx: args.cx, cy: args.cy, r: args.r}, args.settings || {}));
- },
-
- /* Draw an ellipse.
- @param parent (element) the parent node for the new shape (optional)
- @param cx (number) the x-coordinate for the centre of the ellipse
- @param cy (number) the y-coordinate for the centre of the ellipse
- @param rx (number) the x-radius of the ellipse
- @param ry (number) the y-radius of the ellipse
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- ellipse: function(parent, cx, cy, rx, ry, settings) {
- var args = this._args(arguments, ['cx', 'cy', 'rx', 'ry']);
- return this._makeNode(args.parent, 'ellipse', $.extend(
- {cx: args.cx, cy: args.cy, rx: args.rx, ry: args.ry}, args.settings || {}));
- },
-
- /* Draw a line.
- @param parent (element) the parent node for the new shape (optional)
- @param x1 (number) the x-coordinate for the start of the line
- @param y1 (number) the y-coordinate for the start of the line
- @param x2 (number) the x-coordinate for the end of the line
- @param y2 (number) the y-coordinate for the end of the line
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- line: function(parent, x1, y1, x2, y2, settings) {
- var args = this._args(arguments, ['x1', 'y1', 'x2', 'y2']);
- return this._makeNode(args.parent, 'line', $.extend(
- {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2}, args.settings || {}));
- },
-
- /* Draw a polygonal line.
- @param parent (element) the parent node for the new shape (optional)
- @param points (number[][]) the x-/y-coordinates for the points on the line
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- polyline: function(parent, points, settings) {
- var args = this._args(arguments, ['points']);
- return this._poly(args.parent, 'polyline', args.points, args.settings);
- },
-
- /* Draw a polygonal shape.
- @param parent (element) the parent node for the new shape (optional)
- @param points (number[][]) the x-/y-coordinates for the points on the shape
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- polygon: function(parent, points, settings) {
- var args = this._args(arguments, ['points']);
- return this._poly(args.parent, 'polygon', args.points, args.settings);
- },
-
- /* Draw a polygonal line or shape. */
- _poly: function(parent, name, points, settings) {
- var ps = '';
- for (var i = 0; i < points.length; i++) {
- ps += points[i].join() + ' ';
- }
- return this._makeNode(parent, name, $.extend(
- {points: $.trim(ps)}, settings || {}));
- },
-
- /* Draw text.
- Specify both of x and y or neither of them.
- @param parent (element) the parent node for the text (optional)
- @param x (number or number[]) the x-coordinate(s) for the text (optional)
- @param y (number or number[]) the y-coordinate(s) for the text (optional)
- @param value (string) the text content or
- (SVGText) text with spans and references
- @param settings (object) additional settings for the text (optional)
- @return (element) the new text node */
- text: function(parent, x, y, value, settings) {
- var args = this._args(arguments, ['x', 'y', 'value']);
- if (typeof args.x == 'string' && arguments.length < 4) {
- args.value = args.x;
- args.settings = args.y;
- args.x = args.y = null;
- }
- return this._text(args.parent, 'text', args.value, $.extend(
- {x: (args.x && isArray(args.x) ? args.x.join(' ') : args.x),
- y: (args.y && isArray(args.y) ? args.y.join(' ') : args.y)},
- args.settings || {}));
- },
-
- /* Draw text along a path.
- @param parent (element) the parent node for the text (optional)
- @param path (string) the ID of the path
- @param value (string) the text content or
- (SVGText) text with spans and references
- @param settings (object) additional settings for the text (optional)
- @return (element) the new text node */
- textpath: function(parent, path, value, settings) {
- var args = this._args(arguments, ['path', 'value']);
- var node = this._text(args.parent, 'textPath', args.value, args.settings || {});
- node.setAttributeNS($.svg.xlinkNS, 'href', args.path);
- return node;
- },
-
- /* Draw text. */
- _text: function(parent, name, value, settings) {
- var node = this._makeNode(parent, name, settings);
- if (typeof value == 'string') {
- node.appendChild(node.ownerDocument.createTextNode(value));
- }
- else {
- for (var i = 0; i < value._parts.length; i++) {
- var part = value._parts[i];
- if (part[0] == 'tspan') {
- var child = this._makeNode(node, part[0], part[2]);
- child.appendChild(node.ownerDocument.createTextNode(part[1]));
- node.appendChild(child);
- }
- else if (part[0] == 'tref') {
- var child = this._makeNode(node, part[0], part[2]);
- child.setAttributeNS($.svg.xlinkNS, 'href', part[1]);
- node.appendChild(child);
- }
- else if (part[0] == 'textpath') {
- var set = $.extend({}, part[2]);
- set.href = null;
- var child = this._makeNode(node, part[0], set);
- child.setAttributeNS($.svg.xlinkNS, 'href', part[2].href);
- child.appendChild(node.ownerDocument.createTextNode(part[1]));
- node.appendChild(child);
- }
- else { // straight text
- node.appendChild(node.ownerDocument.createTextNode(part[1]));
- }
- }
- }
- return node;
- },
-
- /* Add a custom SVG element.
- @param parent (element) the parent node for the new element (optional)
- @param name (string) the name of the element
- @param settings (object) additional settings for the element (optional)
- @return (element) the new title node */
- other: function(parent, name, settings) {
- var args = this._args(arguments, ['name']);
- return this._makeNode(args.parent, args.name, args.settings || {});
- },
-
- /* Create a shape node with the given settings. */
- _makeNode: function(parent, name, settings) {
- parent = parent || this._svg;
- var node = this._svg.ownerDocument.createElementNS($.svg.svgNS, name);
- for (var name in settings) {
- var value = settings[name];
- if (value != null && value != null &&
- (typeof value != 'string' || value != '')) {
- node.setAttribute($.svg._attrNames[name] || name, value);
- }
- }
- parent.appendChild(node);
- return node;
- },
-
- /* Add an existing SVG node to the diagram.
- @param parent (element) the parent node for the new node (optional)
- @param node (element) the new node to add or
- (string) the jQuery selector for the node or
- (jQuery collection) set of nodes to add
- @return (SVGWrapper) this wrapper */
- add: function(parent, node) {
- var args = this._args(arguments, ['node']);
- var svg = this;
- args.parent = args.parent || this._svg;
- try {
- if ($.svg._renesis) {
- throw 'Force traversal';
- }
- args.parent.appendChild(args.node.cloneNode(true));
- }
- catch (e) {
- args.node = (args.node.jquery ? args.node : $(args.node));
- args.node.each(function() {
- var child = svg._cloneAsSVG(this);
- if (child) {
- args.parent.appendChild(child);
- }
- });
- }
- return this;
- },
-
- /* SVG nodes must belong to the SVG namespace, so clone and ensure this is so. */
- _cloneAsSVG: function(node) {
- var newNode = null;
- if (node.nodeType == 1) { // element
- newNode = this._svg.ownerDocument.createElementNS(
- $.svg.svgNS, this._checkName(node.nodeName));
- for (var i = 0; i < node.attributes.length; i++) {
- var attr = node.attributes.item(i);
- if (attr.nodeName != 'xmlns' && attr.nodeValue) {
- if (attr.prefix == 'xlink') {
- newNode.setAttributeNS($.svg.xlinkNS, attr.localName, attr.nodeValue);
- }
- else {
- newNode.setAttribute(this._checkName(attr.nodeName), attr.nodeValue);
- }
- }
- }
- for (var i = 0; i < node.childNodes.length; i++) {
- var child = this._cloneAsSVG(node.childNodes[i]);
- if (child) {
- newNode.appendChild(child);
- }
- }
- }
- else if (node.nodeType == 3) { // text
- if ($.trim(node.nodeValue)) {
- newNode = this._svg.ownerDocument.createTextNode(node.nodeValue);
- }
- }
- else if (node.nodeType == 4) { // CDATA
- if ($.trim(node.nodeValue)) {
- try {
- newNode = this._svg.ownerDocument.createCDATASection(node.nodeValue);
- }
- catch (e) {
- newNode = this._svg.ownerDocument.createTextNode(
- node.nodeValue.replace(/&/g, '&amp;').
- replace(/</g, '&lt;').replace(/>/g, '&gt;'));
- }
- }
- }
- return newNode;
- },
-
- /* Node names must be lower case and without SVG namespace prefix. */
- _checkName: function(name) {
- name = (name.substring(0, 1) >= 'A' && name.substring(0, 1) <= 'Z' ?
- name.toLowerCase() : name);
- return (name.substring(0, 4) == 'svg:' ? name.substring(4) : name);
- },
-
- /* Load an external SVG document.
- @param url (string) the location of the SVG document or
- the actual SVG content
- @param settings (boolean) see addTo below or
- (function) see onLoad below or
- (object) additional settings for the load with attributes below:
- addTo (boolean) true to add to what's already there,
- or false to clear the canvas first
- changeSize (boolean) true to allow the canvas size to change,
- or false to retain the original
- onLoad (function) callback after the document has loaded,
- 'this' is the container, receives SVG object and
- optional error message as a parameter
- @return (SVGWrapper) this root */
- load: function(url, settings) {
- settings = (typeof settings == 'boolean'? {addTo: settings} :
- (typeof settings == 'function'? {onLoad: settings} : settings || {}));
- if (!settings.addTo) {
- this.clear(false);
- }
- var size = [this._svg.getAttribute('width'), this._svg.getAttribute('height')];
- var wrapper = this;
- // Report a problem with the load
- var reportError = function(message) {
- message = $.svg.local.errorLoadingText + ': ' + message;
- if (settings.onLoad) {
- settings.onLoad.apply(wrapper._container, [wrapper, message]);
- }
- else {
- wrapper.text(null, 10, 20, message);
- }
- };
- // Create a DOM from SVG content
- var loadXML4IE = function(data) {
- var xml = new ActiveXObject('Microsoft.XMLDOM');
- xml.validateOnParse = false;
- xml.resolveExternals = false;
- xml.async = false;
- xml.loadXML(data);
- if (xml.parseError.errorCode != 0) {
- reportError(xml.parseError.reason);
- return null;
- }
- return xml;
- };
- // Load the SVG DOM
- var loadSVG = function(data) {
- if (!data) {
- return;
- }
- if (data.documentElement.nodeName != 'svg') {
- var errors = data.getElementsByTagName('parsererror');
- var messages = (errors.length ? errors[0].getElementsByTagName('div') : []); // Safari
- reportError(!errors.length ? '???' :
- (messages.length ? messages[0] : errors[0]).firstChild.nodeValue);
- return;
- }
- var attrs = {};
- for (var i = 0; i < data.documentElement.attributes.length; i++) {
- var attr = data.documentElement.attributes.item(i);
- if (!(attr.nodeName == 'version' || attr.nodeName.substring(0, 5) == 'xmlns')) {
- attrs[attr.nodeName] = attr.nodeValue;
- }
- }
- wrapper.configure(attrs, true);
- var nodes = data.documentElement.childNodes;
- for (var i = 0; i < nodes.length; i++) {
- try {
- if ($.svg._renesis) {
- throw 'Force traversal';
- }
- wrapper._svg.appendChild(nodes[i].cloneNode(true));
- }
- catch (e) {
- wrapper.add(null, nodes[i]);
- }
- }
- if (!settings.changeSize) {
- wrapper.configure({width: size[0], height: size[1]});
- }
- if (settings.onLoad) {
- settings.onLoad.apply(wrapper._container, [wrapper]);
- }
- };
- if (url.match('<svg')) { // Inline SVG
- loadSVG($.browser.msie ? loadXML4IE(url) :
- new DOMParser().parseFromString(url, 'text/xml'));
- }
- else { // Remote SVG
- $.ajax({url: url, dataType: ($.browser.msie ? 'text' : 'xml'),
- success: function(xml) {
- loadSVG($.browser.msie ? loadXML4IE(xml) : xml);
- }, error: function(http, message, exc) {
- reportError(message + (exc ? ' ' + exc.message : ''));
- }});
- }
- return this;
- },
-
- /* Delete a specified node.
- @param node (element) the drawing node to remove
- @return (SVGWrapper) this root */
- remove: function(node) {
- node.parentNode.removeChild(node);
- return this;
- },
-
- /* Delete everything in the current document.
- @param attrsToo (boolean) true to clear any root attributes as well,
- false to leave them (optional)
- @return (SVGWrapper) this root */
- clear: function(attrsToo) {
- if (attrsToo) {
- this.configure({}, true);
- }
- while (this._svg.firstChild) {
- this._svg.removeChild(this._svg.firstChild);
- }
- return this;
- },
-
- /* Serialise the current diagram into an SVG text document.
- @param node (SVG element) the starting node (optional)
- @return (string) the SVG as text */
- toSVG: function(node) {
- node = node || this._svg;
- return (typeof XMLSerializer == 'undefined' ? this._toSVG(node) :
- new XMLSerializer().serializeToString(node));
- },
-
- /* Serialise one node in the SVG hierarchy. */
- _toSVG: function(node) {
- var svgDoc = '';
- if (!node) {
- return svgDoc;
- }
- if (node.nodeType == 3) { // Text
- svgDoc = node.nodeValue;
- }
- else if (node.nodeType == 4) { // CDATA
- svgDoc = '<![CDATA[' + node.nodeValue + ']]>';
- }
- else { // Element
- svgDoc = '<' + node.nodeName;
- if (node.attributes) {
- for (var i = 0; i < node.attributes.length; i++) {
- var attr = node.attributes.item(i);
- if (!($.trim(attr.nodeValue) == '' || attr.nodeValue.match(/^\[object/) ||
- attr.nodeValue.match(/^function/))) {
- svgDoc += ' ' + (attr.namespaceURI == $.svg.xlinkNS ? 'xlink:' : '') +
- attr.nodeName + '="' + attr.nodeValue + '"';
- }
- }
- }
- if (node.firstChild) {
- svgDoc += '>';
- var child = node.firstChild;
- while (child) {
- svgDoc += this._toSVG(child);
- child = child.nextSibling;
- }
- svgDoc += '</' + node.nodeName + '>';
- }
- else {
- svgDoc += '/>';
- }
- }
- return svgDoc;
- },
-
- /* Escape reserved characters in XML. */
- _escapeXML: function(text) {
- text = text.replace(/&/g, '&amp;');
- text = text.replace(/</g, '&lt;');
- text = text.replace(/>/g, '&gt;');
- return text;
- }
-});
-
-/* Helper to generate an SVG path.
- Obtain an instance from the SVGWrapper object.
- String calls together to generate the path and use its value:
- var path = root.createPath();
- root.path(null, path.move(100, 100).line(300, 100).line(200, 300).close(), {fill: 'red'});
- or
- root.path(null, path.move(100, 100).line([[300, 100], [200, 300]]).close(), {fill: 'red'}); */
-function SVGPath() {
- this._path = '';
-}
-
-$.extend(SVGPath.prototype, {
- /* Prepare to create a new path.
- @return (SVGPath) this path */
- reset: function() {
- this._path = '';
- return this;
- },
-
- /* Move the pointer to a position.
- @param x (number) x-coordinate to move to or
- (number[][]) x-/y-coordinates to move to
- @param y (number) y-coordinate to move to (omitted if x is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- move: function(x, y, relative) {
- relative = (isArray(x) ? y : relative);
- return this._coords((relative ? 'm' : 'M'), x, y);
- },
-
- /* Draw a line to a position.
- @param x (number) x-coordinate to move to or
- (number[][]) x-/y-coordinates to move to
- @param y (number) y-coordinate to move to (omitted if x is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- line: function(x, y, relative) {
- relative = (isArray(x) ? y : relative);
- return this._coords((relative ? 'l' : 'L'), x, y);
- },
-
- /* Draw a horizontal line to a position.
- @param x (number) x-coordinate to draw to or
- (number[]) x-coordinates to draw to
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- horiz: function(x, relative) {
- this._path += (relative ? 'h' : 'H') + (isArray(x) ? x.join(' ') : x);
- return this;
- },
-
- /* Draw a vertical line to a position.
- @param y (number) y-coordinate to draw to or
- (number[]) y-coordinates to draw to
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- vert: function(y, relative) {
- this._path += (relative ? 'v' : 'V') + (isArray(y) ? y.join(' ') : y);
- return this;
- },
-
- /* Draw a cubic Bézier curve.
- @param x1 (number) x-coordinate of beginning control point or
- (number[][]) x-/y-coordinates of control and end points to draw to
- @param y1 (number) y-coordinate of beginning control point (omitted if x1 is array)
- @param x2 (number) x-coordinate of ending control point (omitted if x1 is array)
- @param y2 (number) y-coordinate of ending control point (omitted if x1 is array)
- @param x (number) x-coordinate of curve end (omitted if x1 is array)
- @param y (number) y-coordinate of curve end (omitted if x1 is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- curveC: function(x1, y1, x2, y2, x, y, relative) {
- relative = (isArray(x1) ? y1 : relative);
- return this._coords((relative ? 'c' : 'C'), x1, y1, x2, y2, x, y);
- },
-
- /* Continue a cubic Bézier curve.
- Starting control point is the reflection of the previous end control point.
- @param x2 (number) x-coordinate of ending control point or
- (number[][]) x-/y-coordinates of control and end points to draw to
- @param y2 (number) y-coordinate of ending control point (omitted if x2 is array)
- @param x (number) x-coordinate of curve end (omitted if x2 is array)
- @param y (number) y-coordinate of curve end (omitted if x2 is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- smoothC: function(x2, y2, x, y, relative) {
- relative = (isArray(x2) ? y2 : relative);
- return this._coords((relative ? 's' : 'S'), x2, y2, x, y);
- },
-
- /* Draw a quadratic Bézier curve.
- @param x1 (number) x-coordinate of control point or
- (number[][]) x-/y-coordinates of control and end points to draw to
- @param y1 (number) y-coordinate of control point (omitted if x1 is array)
- @param x (number) x-coordinate of curve end (omitted if x1 is array)
- @param y (number) y-coordinate of curve end (omitted if x1 is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- curveQ: function(x1, y1, x, y, relative) {
- relative = (isArray(x1) ? y1 : relative);
- return this._coords((relative ? 'q' : 'Q'), x1, y1, x, y);
- },
-
- /* Continue a quadratic Bézier curve.
- Control point is the reflection of the previous control point.
- @param x (number) x-coordinate of curve end or
- (number[][]) x-/y-coordinates of points to draw to
- @param y (number) y-coordinate of curve end (omitted if x is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- smoothQ: function(x, y, relative) {
- relative = (isArray(x) ? y : relative);
- return this._coords((relative ? 't' : 'T'), x, y);
- },
-
- /* Generate a path command with (a list of) coordinates. */
- _coords: function(cmd, x1, y1, x2, y2, x3, y3) {
- if (isArray(x1)) {
- for (var i = 0; i < x1.length; i++) {
- var cs = x1[i];
- this._path += (i == 0 ? cmd : ' ') + cs[0] + ',' + cs[1] +
- (cs.length < 4 ? '' : ' ' + cs[2] + ',' + cs[3] +
- (cs.length < 6 ? '': ' ' + cs[4] + ',' + cs[5]));
- }
- }
- else {
- this._path += cmd + x1 + ',' + y1 +
- (x2 == null ? '' : ' ' + x2 + ',' + y2 +
- (x3 == null ? '' : ' ' + x3 + ',' + y3));
- }
- return this;
- },
-
- /* Draw an arc to a position.
- @param rx (number) x-radius of arc or
- (number/boolean[][]) x-/y-coordinates and flags for points to draw to
- @param ry (number) y-radius of arc (omitted if rx is array)
- @param xRotate (number) x-axis rotation (degrees, clockwise) (omitted if rx is array)
- @param large (boolean) true to draw the large part of the arc,
- false to draw the small part (omitted if rx is array)
- @param clockwise (boolean) true to draw the clockwise arc,
- false to draw the anti-clockwise arc (omitted if rx is array)
- @param x (number) x-coordinate of arc end (omitted if rx is array)
- @param y (number) y-coordinate of arc end (omitted if rx is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- arc: function(rx, ry, xRotate, large, clockwise, x, y, relative) {
- relative = (isArray(rx) ? ry : relative);
- this._path += (relative ? 'a' : 'A');
- if (isArray(rx)) {
- for (var i = 0; i < rx.length; i++) {
- var cs = rx[i];
- this._path += (i == 0 ? '' : ' ') + cs[0] + ',' + cs[1] + ' ' +
- cs[2] + ' ' + (cs[3] ? '1' : '0') + ',' +
- (cs[4] ? '1' : '0') + ' ' + cs[5] + ',' + cs[6];
- }
- }
- else {
- this._path += rx + ',' + ry + ' ' + xRotate + ' ' +
- (large ? '1' : '0') + ',' + (clockwise ? '1' : '0') + ' ' + x + ',' + y;
- }
- return this;
- },
-
- /* Close the current path.
- @return (SVGPath) this path */
- close: function() {
- this._path += 'z';
- return this;
- },
-
- /* Return the string rendering of the specified path.
- @return (string) stringified path */
- path: function() {
- return this._path;
- }
-});
-
-SVGPath.prototype.moveTo = SVGPath.prototype.move;
-SVGPath.prototype.lineTo = SVGPath.prototype.line;
-SVGPath.prototype.horizTo = SVGPath.prototype.horiz;
-SVGPath.prototype.vertTo = SVGPath.prototype.vert;
-SVGPath.prototype.curveCTo = SVGPath.prototype.curveC;
-SVGPath.prototype.smoothCTo = SVGPath.prototype.smoothC;
-SVGPath.prototype.curveQTo = SVGPath.prototype.curveQ;
-SVGPath.prototype.smoothQTo = SVGPath.prototype.smoothQ;
-SVGPath.prototype.arcTo = SVGPath.prototype.arc;
-
-/* Helper to generate an SVG text object.
- Obtain an instance from the SVGWrapper object.
- String calls together to generate the text and use its value:
- var text = root.createText();
- root.text(null, x, y, text.string('This is ').
- span('red', {fill: 'red'}).string('!'), {fill: 'blue'}); */
-function SVGText() {
- this._parts = []; // The components of the text object
-}
-
-$.extend(SVGText.prototype, {
- /* Prepare to create a new text object.
- @return (SVGText) this text */
- reset: function() {
- this._parts = [];
- return this;
- },
-
- /* Add a straight string value.
- @param value (string) the actual text
- @return (SVGText) this text object */
- string: function(value) {
- this._parts[this._parts.length] = ['text', value];
- return this;
- },
-
- /* Add a separate text span that has its own settings.
- @param value (string) the actual text
- @param settings (object) the settings for this text
- @return (SVGText) this text object */
- span: function(value, settings) {
- this._parts[this._parts.length] = ['tspan', value, settings];
- return this;
- },
-
- /* Add a reference to a previously defined text string.
- @param id (string) the ID of the actual text
- @param settings (object) the settings for this text
- @return (SVGText) this text object */
- ref: function(id, settings) {
- this._parts[this._parts.length] = ['tref', id, settings];
- return this;
- },
-
- /* Add text drawn along a path.
- @param id (string) the ID of the path
- @param value (string) the actual text
- @param settings (object) the settings for this text
- @return (SVGText) this text object */
- path: function(id, value, settings) {
- this._parts[this._parts.length] = ['textpath', value,
- $.extend({href: id}, settings || {})];
- return this;
- }
-});
-
-/* Attach the SVG functionality to a jQuery selection.
- @param command (string) the command to run (optional, default 'attach')
- @param options (object) the new settings to use for these SVG instances
- @return jQuery (object) for chaining further calls */
-$.fn.svg = function(options) {
- var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (typeof options == 'string' && options == 'get') {
- return $.svg['_' + options + 'SVG'].apply($.svg, [this[0]].concat(otherArgs));
- }
- return this.each(function() {
- if (typeof options == 'string') {
- $.svg['_' + options + 'SVG'].apply($.svg, [this].concat(otherArgs));
- }
- else {
- $.svg._attachSVG(this, options || {});
- }
- });
-};
-
-/* Determine whether an object is an array. */
-function isArray(a) {
- return (a && a.constructor == Array);
-}
-
-// Singleton primary SVG interface
-$.svg = new SVGManager();
-
-})(jQuery);
diff --git a/content/Explore/js/jquery.svg.min.js b/content/Explore/js/jquery.svg.min.js
deleted file mode 100755
index d6ad13c..0000000
--- a/content/Explore/js/jquery.svg.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-(function($){function SVGManager(){this._settings=[];this._extensions=[];this.regional=[];this.regional['']={errorLoadingText:'Error loading',notSupportedText:'This browser does not support SVG'};this.local=this.regional[''];this._uuid=new Date().getTime();this._renesis=detectActiveX('RenesisX.RenesisCtrl')}function detectActiveX(a){try{return!!(window.ActiveXObject&&new ActiveXObject(a))}catch(e){return false}}var p='svgwrapper';$.extend(SVGManager.prototype,{markerClassName:'hasSVG',svgNS:'http://www.w3.org/2000/svg',xlinkNS:'http://www.w3.org/1999/xlink',_wrapperClass:SVGWrapper,_attrNames:{class_:'class',in_:'in',alignmentBaseline:'alignment-baseline',baselineShift:'baseline-shift',clipPath:'clip-path',clipRule:'clip-rule',colorInterpolation:'color-interpolation',colorInterpolationFilters:'color-interpolation-filters',colorRendering:'color-rendering',dominantBaseline:'dominant-baseline',enableBackground:'enable-background',fillOpacity:'fill-opacity',fillRule:'fill-rule',floodColor:'flood-color',floodOpacity:'flood-opacity',fontFamily:'font-family',fontSize:'font-size',fontSizeAdjust:'font-size-adjust',fontStretch:'font-stretch',fontStyle:'font-style',fontVariant:'font-variant',fontWeight:'font-weight',glyphOrientationHorizontal:'glyph-orientation-horizontal',glyphOrientationVertical:'glyph-orientation-vertical',horizAdvX:'horiz-adv-x',horizOriginX:'horiz-origin-x',imageRendering:'image-rendering',letterSpacing:'letter-spacing',lightingColor:'lighting-color',markerEnd:'marker-end',markerMid:'marker-mid',markerStart:'marker-start',stopColor:'stop-color',stopOpacity:'stop-opacity',strikethroughPosition:'strikethrough-position',strikethroughThickness:'strikethrough-thickness',strokeDashArray:'stroke-dasharray',strokeDashOffset:'stroke-dashoffset',strokeLineCap:'stroke-linecap',strokeLineJoin:'stroke-linejoin',strokeMiterLimit:'stroke-miterlimit',strokeOpacity:'stroke-opacity',strokeWidth:'stroke-width',textAnchor:'text-anchor',textDecoration:'text-decoration',textRendering:'text-rendering',underlinePosition:'underline-position',underlineThickness:'underline-thickness',vertAdvY:'vert-adv-y',vertOriginY:'vert-origin-y',wordSpacing:'word-spacing',writingMode:'writing-mode'},_attachSVG:function(a,b){if($(a).hasClass(this.markerClassName)){return}if(typeof b=='string'){b={loadURL:b}}else if(typeof b=='function'){b={onLoad:b}}$(a).addClass(this.markerClassName);try{var c=document.createElementNS(this.svgNS,'svg');c.setAttribute('version','1.1');c.setAttribute('width',a.clientWidth);c.setAttribute('height',a.clientHeight);a.appendChild(c);this._afterLoad(a,c,b)}catch(e){if($.browser.msie){if(!a.id){a.id='svg'+(this._uuid++)}this._settings[a.id]=b;a.innerHTML='<embed type="image/svg+xml" width="100%" '+'height="100%" src="'+(b.initPath||'')+'blank.svg"/>'}else{a.innerHTML='<p class="svg_error">'+this.local.notSupportedText+'</p>'}}},_registerSVG:function(){for(var i=0;i<document.embeds.length;i++){var a=document.embeds[i].parentNode;if(!$(a).hasClass($.svg.markerClassName)||$.data(a,p)){continue}var b=null;try{b=document.embeds[i].getSVGDocument()}catch(e){setTimeout($.svg._registerSVG,250);return}b=(b?b.documentElement:null);if(b){$.svg._afterLoad(a,b)}}},_afterLoad:function(a,b,c){var c=c||this._settings[a.id];this._settings[a.id]=null;var d=new this._wrapperClass(b,a);$.data(a,p,d);try{if(c.loadURL){d.load(c.loadURL,c)}if(c.settings){d.configure(c.settings)}if(c.onLoad&&!c.loadURL){c.onLoad.apply(a,[d])}}catch(e){alert(e)}},_getSVG:function(a){a=(typeof a=='string'?$(a)[0]:(a.jquery?a[0]:a));return $.data(a,p)},_destroySVG:function(a){var b=$(a);if(!b.hasClass(this.markerClassName)){return}b.removeClass(this.markerClassName).empty();$.removeData(a,p)},addExtension:function(a,b){this._extensions.push([a,b])}});function SVGWrapper(a,b){this._svg=a;this._container=b;for(var i=0;i<$.svg._extensions.length;i++){var c=$.svg._extensions[i];this[c[0]]=new c[1](this)}}$.extend(SVGWrapper.prototype,{_width:function(){return this._container.clientWidth},_height:function(){return this._container.clientHeight},root:function(){return this._svg},configure:function(a,b){if(b){for(var i=this._svg.attributes.length-1;i>=0;i--){var c=this._svg.attributes.item(i);if(!(c.nodeName=='onload'||c.nodeName=='version'||c.nodeName.substring(0,5)=='xmlns')){this._svg.attributes.removeNamedItem(c.nodeName)}}}for(var d in a){this._svg.setAttribute(d,a[d])}return this},getElementById:function(a){return this._svg.ownerDocument.getElementById(a)},change:function(a,b){if(a){for(var c in b){if(b[c]==null){a.removeAttribute(c)}else{a.setAttribute(c,b[c])}}}return this},_args:function(b,c,d){c.splice(0,0,'parent');c.splice(c.length,0,'settings');var e={};var f=0;if(b[0]!=null&&(typeof b[0]!='object'||!b[0].nodeName)){e['parent']=null;f=1}for(var i=0;i<b.length;i++){e[c[i+f]]=b[i]}if(d){$.each(d,function(i,a){if(typeof e[a]=='object'){e.settings=e[a];e[a]=null}})}return e},title:function(a,b,c){var d=this._args(arguments,['text']);var e=this._makeNode(d.parent,'title',d.settings||{});e.appendChild(this._svg.ownerDocument.createTextNode(d.text));return e},describe:function(a,b,c){var d=this._args(arguments,['text']);var e=this._makeNode(d.parent,'desc',d.settings||{});e.appendChild(this._svg.ownerDocument.createTextNode(d.text));return e},defs:function(a,b,c){var d=this._args(arguments,['id'],['id']);return this._makeNode(d.parent,'defs',$.extend((d.id?{id:d.id}:{}),d.settings||{}))},symbol:function(a,b,c,d,e,f,g){var h=this._args(arguments,['id','x1','y1','x2','y2']);return this._makeNode(h.parent,'symbol',$.extend({id:h.id,viewBox:h.x1+' '+h.y1+' '+h.x2+' '+h.y2},h.settings||{}))},marker:function(a,b,c,d,e,f,g,h){var i=this._args(arguments,['id','refX','refY','mWidth','mHeight','orient'],['orient']);return this._makeNode(i.parent,'marker',$.extend({id:i.id,refX:i.refX,refY:i.refY,markerWidth:i.mWidth,markerHeight:i.mHeight,orient:i.orient||'auto'},i.settings||{}))},style:function(a,b,c){var d=this._args(arguments,['styles']);var e=this._makeNode(d.parent,'style',$.extend({type:'text/css'},d.settings||{}));e.appendChild(this._svg.ownerDocument.createTextNode(d.styles));if($.browser.opera){$('head').append('<style type="text/css">'+d.styles+'</style>')}return e},script:function(a,b,c,d){var e=this._args(arguments,['script','type'],['type']);var f=this._makeNode(e.parent,'script',$.extend({type:e.type||'text/javascript'},e.settings||{}));f.appendChild(this._svg.ownerDocument.createTextNode(this._escapeXML(e.script)));if(!$.browser.mozilla){$.globalEval(e.script)}return f},linearGradient:function(a,b,c,d,e,f,g,h){var i=this._args(arguments,['id','stops','x1','y1','x2','y2'],['x1']);var j=$.extend({id:i.id},(i.x1!=null?{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2}:{}));return this._gradient(i.parent,'linearGradient',$.extend(j,i.settings||{}),i.stops)},radialGradient:function(a,b,c,d,e,r,f,g,h){var i=this._args(arguments,['id','stops','cx','cy','r','fx','fy'],['cx']);var j=$.extend({id:i.id},(i.cx!=null?{cx:i.cx,cy:i.cy,r:i.r,fx:i.fx,fy:i.fy}:{}));return this._gradient(i.parent,'radialGradient',$.extend(j,i.settings||{}),i.stops)},_gradient:function(a,b,c,d){var e=this._makeNode(a,b,c);for(var i=0;i<d.length;i++){var f=d[i];this._makeNode(e,'stop',$.extend({offset:f[0],stopColor:f[1]},(f[2]!=null?{stopOpacity:f[2]}:{})))}return e},pattern:function(a,b,x,y,c,d,e,f,g,h,i){var j=this._args(arguments,['id','x','y','width','height','vx','vy','vwidth','vheight'],['vx']);var k=$.extend({id:j.id,x:j.x,y:j.y,width:j.width,height:j.height},(j.vx!=null?{viewBox:j.vx+' '+j.vy+' '+j.vwidth+' '+j.vheight}:{}));return this._makeNode(j.parent,'pattern',$.extend(k,j.settings||{}))},mask:function(a,b,x,y,c,d,e){var f=this._args(arguments,['id','x','y','width','height']);return this._makeNode(f.parent,'mask',$.extend({id:f.id,x:f.x,y:f.y,width:f.width,height:f.height},f.settings||{}))},createPath:function(){return new SVGPath()},createText:function(){return new SVGText()},svg:function(a,x,y,b,c,d,e,f,g,h){var i=this._args(arguments,['x','y','width','height','vx','vy','vwidth','vheight'],['vx']);var j=$.extend({x:i.x,y:i.y,width:i.width,height:i.height},(i.vx!=null?{viewBox:i.vx+' '+i.vy+' '+i.vwidth+' '+i.vheight}:{}));return this._makeNode(i.parent,'svg',$.extend(j,i.settings||{}))},group:function(a,b,c){var d=this._args(arguments,['id'],['id']);return this._makeNode(d.parent,'g',$.extend({id:d.id},d.settings||{}))},use:function(a,x,y,b,c,d,e){var f=this._args(arguments,['x','y','width','height','ref']);if(typeof f.x=='string'){f.ref=f.x;f.settings=f.y;f.x=f.y=f.width=f.height=null}var g=this._makeNode(f.parent,'use',$.extend({x:f.x,y:f.y,width:f.width,height:f.height},f.settings||{}));g.setAttributeNS($.svg.xlinkNS,'href',f.ref);return g},link:function(a,b,c){var d=this._args(arguments,['ref']);var e=this._makeNode(d.parent,'a',d.settings);e.setAttributeNS($.svg.xlinkNS,'href',d.ref);return e},image:function(a,x,y,b,c,d,e){var f=this._args(arguments,['x','y','width','height','ref']);var g=this._makeNode(f.parent,'image',$.extend({x:f.x,y:f.y,width:f.width,height:f.height},f.settings||{}));g.setAttributeNS($.svg.xlinkNS,'href',f.ref);return g},path:function(a,b,c){var d=this._args(arguments,['path']);return this._makeNode(d.parent,'path',$.extend({d:(d.path.path?d.path.path():d.path)},d.settings||{}))},rect:function(a,x,y,b,c,d,e,f){var g=this._args(arguments,['x','y','width','height','rx','ry'],['rx']);return this._makeNode(g.parent,'rect',$.extend({x:g.x,y:g.y,width:g.width,height:g.height},(g.rx?{rx:g.rx,ry:g.ry}:{}),g.settings||{}))},circle:function(a,b,c,r,d){var e=this._args(arguments,['cx','cy','r']);return this._makeNode(e.parent,'circle',$.extend({cx:e.cx,cy:e.cy,r:e.r},e.settings||{}))},ellipse:function(a,b,c,d,e,f){var g=this._args(arguments,['cx','cy','rx','ry']);return this._makeNode(g.parent,'ellipse',$.extend({cx:g.cx,cy:g.cy,rx:g.rx,ry:g.ry},g.settings||{}))},line:function(a,b,c,d,e,f){var g=this._args(arguments,['x1','y1','x2','y2']);return this._makeNode(g.parent,'line',$.extend({x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2},g.settings||{}))},polyline:function(a,b,c){var d=this._args(arguments,['points']);return this._poly(d.parent,'polyline',d.points,d.settings)},polygon:function(a,b,c){var d=this._args(arguments,['points']);return this._poly(d.parent,'polygon',d.points,d.settings)},_poly:function(a,b,c,d){var e='';for(var i=0;i<c.length;i++){e+=c[i].join()+' '}return this._makeNode(a,b,$.extend({points:$.trim(e)},d||{}))},text:function(a,x,y,b,c){var d=this._args(arguments,['x','y','value']);if(typeof d.x=='string'&&arguments.length<4){d.value=d.x;d.settings=d.y;d.x=d.y=null}return this._text(d.parent,'text',d.value,$.extend({x:(d.x&&isArray(d.x)?d.x.join(' '):d.x),y:(d.y&&isArray(d.y)?d.y.join(' '):d.y)},d.settings||{}))},textpath:function(a,b,c,d){var e=this._args(arguments,['path','value']);var f=this._text(e.parent,'textPath',e.value,e.settings||{});f.setAttributeNS($.svg.xlinkNS,'href',e.path);return f},_text:function(a,b,c,d){var e=this._makeNode(a,b,d);if(typeof c=='string'){e.appendChild(e.ownerDocument.createTextNode(c))}else{for(var i=0;i<c._parts.length;i++){var f=c._parts[i];if(f[0]=='tspan'){var g=this._makeNode(e,f[0],f[2]);g.appendChild(e.ownerDocument.createTextNode(f[1]));e.appendChild(g)}else if(f[0]=='tref'){var g=this._makeNode(e,f[0],f[2]);g.setAttributeNS($.svg.xlinkNS,'href',f[1]);e.appendChild(g)}else if(f[0]=='textpath'){var h=$.extend({},f[2]);h.href=null;var g=this._makeNode(e,f[0],h);g.setAttributeNS($.svg.xlinkNS,'href',f[2].href);g.appendChild(e.ownerDocument.createTextNode(f[1]));e.appendChild(g)}else{e.appendChild(e.ownerDocument.createTextNode(f[1]))}}}return e},other:function(a,b,c){var d=this._args(arguments,['name']);return this._makeNode(d.parent,d.name,d.settings||{})},_makeNode:function(a,b,c){a=a||this._svg;var d=this._svg.ownerDocument.createElementNS($.svg.svgNS,b);for(var b in c){var e=c[b];if(e!=null&&e!=null&&(typeof e!='string'||e!='')){d.setAttribute($.svg._attrNames[b]||b,e)}}a.appendChild(d);return d},add:function(b,c){var d=this._args(arguments,['node']);var f=this;d.parent=d.parent||this._svg;try{if($.svg._renesis){throw'Force traversal';}d.parent.appendChild(d.node.cloneNode(true))}catch(e){d.node=(d.node.jquery?d.node:$(d.node));d.node.each(function(){var a=f._cloneAsSVG(this);if(a){d.parent.appendChild(a)}})}return this},_cloneAsSVG:function(a){var b=null;if(a.nodeType==1){b=this._svg.ownerDocument.createElementNS($.svg.svgNS,this._checkName(a.nodeName));for(var i=0;i<a.attributes.length;i++){var c=a.attributes.item(i);if(c.nodeName!='xmlns'&&c.nodeValue){if(c.prefix=='xlink'){b.setAttributeNS($.svg.xlinkNS,c.localName,c.nodeValue)}else{b.setAttribute(this._checkName(c.nodeName),c.nodeValue)}}}for(var i=0;i<a.childNodes.length;i++){var d=this._cloneAsSVG(a.childNodes[i]);if(d){b.appendChild(d)}}}else if(a.nodeType==3){if($.trim(a.nodeValue)){b=this._svg.ownerDocument.createTextNode(a.nodeValue)}}else if(a.nodeType==4){if($.trim(a.nodeValue)){try{b=this._svg.ownerDocument.createCDATASection(a.nodeValue)}catch(e){b=this._svg.ownerDocument.createTextNode(a.nodeValue.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'))}}}return b},_checkName:function(a){a=(a.substring(0,1)>='A'&&a.substring(0,1)<='Z'?a.toLowerCase():a);return(a.substring(0,4)=='svg:'?a.substring(4):a)},load:function(h,j){j=(typeof j=='boolean'?{addTo:j}:(typeof j=='function'?{onLoad:j}:j||{}));if(!j.addTo){this.clear(false)}var k=[this._svg.getAttribute('width'),this._svg.getAttribute('height')];var l=this;var m=function(a){a=$.svg.local.errorLoadingText+': '+a;if(j.onLoad){j.onLoad.apply(l._container,[l,a])}else{l.text(null,10,20,a)}};var n=function(a){var b=new ActiveXObject('Microsoft.XMLDOM');b.validateOnParse=false;b.resolveExternals=false;b.async=false;b.loadXML(a);if(b.parseError.errorCode!=0){m(b.parseError.reason);return null}return b};var o=function(a){if(!a){return}if(a.documentElement.nodeName!='svg'){var b=a.getElementsByTagName('parsererror');var c=(b.length?b[0].getElementsByTagName('div'):[]);m(!b.length?'???':(c.length?c[0]:b[0]).firstChild.nodeValue);return}var d={};for(var i=0;i<a.documentElement.attributes.length;i++){var f=a.documentElement.attributes.item(i);if(!(f.nodeName=='version'||f.nodeName.substring(0,5)=='xmlns')){d[f.nodeName]=f.nodeValue}}l.configure(d,true);var g=a.documentElement.childNodes;for(var i=0;i<g.length;i++){try{if($.svg._renesis){throw'Force traversal';}l._svg.appendChild(g[i].cloneNode(true))}catch(e){l.add(null,g[i])}}if(!j.changeSize){l.configure({width:k[0],height:k[1]})}if(j.onLoad){j.onLoad.apply(l._container,[l])}};if(h.match('<svg')){o($.browser.msie?n(h):new DOMParser().parseFromString(h,'text/xml'))}else{$.ajax({url:h,dataType:($.browser.msie?'text':'xml'),success:function(a){o($.browser.msie?n(a):a)},error:function(a,b,c){m(b+(c?' '+c.message:''))}})}return this},remove:function(a){a.parentNode.removeChild(a);return this},clear:function(a){if(a){this.configure({},true)}while(this._svg.firstChild){this._svg.removeChild(this._svg.firstChild)}return this},toSVG:function(a){a=a||this._svg;return(typeof XMLSerializer=='undefined'?this._toSVG(a):new XMLSerializer().serializeToString(a))},_toSVG:function(a){var b='';if(!a){return b}if(a.nodeType==3){b=a.nodeValue}else if(a.nodeType==4){b='<![CDATA['+a.nodeValue+']]>'}else{b='<'+a.nodeName;if(a.attributes){for(var i=0;i<a.attributes.length;i++){var c=a.attributes.item(i);if(!($.trim(c.nodeValue)==''||c.nodeValue.match(/^\[object/)||c.nodeValue.match(/^function/))){b+=' '+(c.namespaceURI==$.svg.xlinkNS?'xlink:':'')+c.nodeName+'="'+c.nodeValue+'"'}}}if(a.firstChild){b+='>';var d=a.firstChild;while(d){b+=this._toSVG(d);d=d.nextSibling}b+='</'+a.nodeName+'>'}else{b+='/>'}}return b},_escapeXML:function(a){a=a.replace(/&/g,'&amp;');a=a.replace(/</g,'&lt;');a=a.replace(/>/g,'&gt;');return a}});function SVGPath(){this._path=''}$.extend(SVGPath.prototype,{reset:function(){this._path='';return this},move:function(x,y,a){a=(isArray(x)?y:a);return this._coords((a?'m':'M'),x,y)},line:function(x,y,a){a=(isArray(x)?y:a);return this._coords((a?'l':'L'),x,y)},horiz:function(x,a){this._path+=(a?'h':'H')+(isArray(x)?x.join(' '):x);return this},vert:function(y,a){this._path+=(a?'v':'V')+(isArray(y)?y.join(' '):y);return this},curveC:function(a,b,c,d,x,y,e){e=(isArray(a)?b:e);return this._coords((e?'c':'C'),a,b,c,d,x,y)},smoothC:function(a,b,x,y,c){c=(isArray(a)?b:c);return this._coords((c?'s':'S'),a,b,x,y)},curveQ:function(a,b,x,y,c){c=(isArray(a)?b:c);return this._coords((c?'q':'Q'),a,b,x,y)},smoothQ:function(x,y,a){a=(isArray(x)?y:a);return this._coords((a?'t':'T'),x,y)},_coords:function(a,b,c,d,e,f,g){if(isArray(b)){for(var i=0;i<b.length;i++){var h=b[i];this._path+=(i==0?a:' ')+h[0]+','+h[1]+(h.length<4?'':' '+h[2]+','+h[3]+(h.length<6?'':' '+h[4]+','+h[5]))}}else{this._path+=a+b+','+c+(d==null?'':' '+d+','+e+(f==null?'':' '+f+','+g))}return this},arc:function(a,b,c,d,e,x,y,f){f=(isArray(a)?b:f);this._path+=(f?'a':'A');if(isArray(a)){for(var i=0;i<a.length;i++){var g=a[i];this._path+=(i==0?'':' ')+g[0]+','+g[1]+' '+g[2]+' '+(g[3]?'1':'0')+','+(g[4]?'1':'0')+' '+g[5]+','+g[6]}}else{this._path+=a+','+b+' '+c+' '+(d?'1':'0')+','+(e?'1':'0')+' '+x+','+y}return this},close:function(){this._path+='z';return this},path:function(){return this._path}});SVGPath.prototype.moveTo=SVGPath.prototype.move;SVGPath.prototype.lineTo=SVGPath.prototype.line;SVGPath.prototype.horizTo=SVGPath.prototype.horiz;SVGPath.prototype.vertTo=SVGPath.prototype.vert;SVGPath.prototype.curveCTo=SVGPath.prototype.curveC;SVGPath.prototype.smoothCTo=SVGPath.prototype.smoothC;SVGPath.prototype.curveQTo=SVGPath.prototype.curveQ;SVGPath.prototype.smoothQTo=SVGPath.prototype.smoothQ;SVGPath.prototype.arcTo=SVGPath.prototype.arc;function SVGText(){this._parts=[]}$.extend(SVGText.prototype,{reset:function(){this._parts=[];return this},string:function(a){this._parts[this._parts.length]=['text',a];return this},span:function(a,b){this._parts[this._parts.length]=['tspan',a,b];return this},ref:function(a,b){this._parts[this._parts.length]=['tref',a,b];return this},path:function(a,b,c){this._parts[this._parts.length]=['textpath',b,$.extend({href:a},c||{})];return this}});$.fn.svg=function(a){var b=Array.prototype.slice.call(arguments,1);if(typeof a=='string'&&a=='get'){return $.svg['_'+a+'SVG'].apply($.svg,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){$.svg['_'+a+'SVG'].apply($.svg,[this].concat(b))}else{$.svg._attachSVG(this,a||{})}})};function isArray(a){return(a&&a.constructor==Array)}$.svg=new SVGManager()})(jQuery); \ No newline at end of file
diff --git a/content/Explore/js/jquery.svg.pack.js b/content/Explore/js/jquery.svg.pack.js
deleted file mode 100755
index 4727218..0000000
--- a/content/Explore/js/jquery.svg.pack.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){9 2f(){7.1U=[];7.1V=[];7.2g=[];7.2g[\'\']={2Q:\'4d 4e\',2R:\'4f 1s 4g 4h 4i 2h\'};7.2i=7.2g[\'\'];7.2S=1d 4j().4k();7.2j=2T(\'4l.4m\')}9 2T(a){1t{u!!(4n.2k&&1d 2k(a))}1u(e){u 1H}}8 p=\'4o\';$.G(2f.R,{1C:\'4p\',1W:\'2U://2V.2W.2X/4q/B\',1h:\'2U://2V.2W.2X/4r/2l\',2Y:2m,2Z:{4s:\'30\',4t:\'1X\',4u:\'4v-2n\',4w:\'2n-4x\',4y:\'31-19\',4z:\'31-32\',4A:\'1D-33\',4B:\'1D-33-4C\',4D:\'1D-2o\',4E:\'4F-2n\',4G:\'4H-4I\',4J:\'34-1Y\',4K:\'34-32\',4L:\'35-1D\',4M:\'35-1Y\',4N:\'1v-4O\',4P:\'1v-36\',4Q:\'1v-36-4R\',4S:\'1v-4T\',4U:\'1v-1I\',4V:\'1v-4W\',4X:\'1v-4Y\',4Z:\'37-38-50\',51:\'37-38-52\',53:\'1Z-39-x\',54:\'1Z-3a-x\',55:\'21-2o\',56:\'57-3b\',58:\'59-1D\',5a:\'1J-5b\',5c:\'1J-5d\',5e:\'1J-5f\',3c:\'2p-1D\',3d:\'2p-1Y\',5g:\'3e-3f\',5h:\'3e-3g\',5i:\'1w-5j\',5k:\'1w-5l\',5m:\'1w-5n\',5o:\'1w-5p\',5q:\'1w-5r\',5s:\'1w-1Y\',5t:\'1w-P\',5u:\'13-5v\',5w:\'13-5x\',5y:\'13-2o\',5z:\'3h-3f\',5A:\'3h-3g\',5B:\'22-39-y\',5C:\'22-3a-y\',5D:\'5E-3b\',5F:\'5G-5H\'},3i:9(a,b){w($(a).2q(7.1C)){u}w(16 b==\'1i\'){b={23:b}}Y w(16 b==\'9\'){b={1l:b}}$(a).5I(7.1C);1t{8 c=24.2r(7.1W,\'B\');c.1x(\'2s\',\'1.1\');c.1x(\'P\',a.3j);c.1x(\'U\',a.3k);a.11(c);7.2t(a,c,b)}1u(e){w($.1s.25){w(!a.D){a.D=\'B\'+(7.2S++)}7.1U[a.D]=b;a.3l=\'<5J 1y="21/B+2u" P="3m%" \'+\'U="3m%" 5K="\'+(b.5L||\'\')+\'5M.B"/>\'}Y{a.3l=\'<p 30="5N">\'+7.2i.2R+\'</p>\'}}},3n:9(){12(8 i=0;i<24.2v.N;i++){8 a=24.2v[i].3o;w(!$(a).2q($.B.1C)||$.2w(a,p)){5O}8 b=W;1t{b=24.2v[i].5P()}1u(e){5Q($.B.3n,5R);u}b=(b?b.1K:W);w(b){$.B.2t(a,b)}}},2t:9(a,b,c){8 c=c||7.1U[a.D];7.1U[a.D]=W;8 d=1d 7.2Y(b,a);$.2w(a,p,d);1t{w(c.23){d.3p(c.23,c)}w(c.E){d.1L(c.E)}w(c.1l&&!c.23){c.1l.1M(a,[d])}}1u(e){5S(e)}},5T:9(a){a=(16 a==\'1i\'?$(a)[0]:(a.3q?a[0]:a));u $.2w(a,p)},5U:9(a){8 b=$(a);w(!b.2q(7.1C)){u}b.5V(7.1C).5W();$.5X(a,p)},5Y:9(a,b){7.1V.5Z([a,b])}});9 2m(a,b){7.O=a;7.1N=b;12(8 i=0;i<$.B.1V.N;i++){8 c=$.B.1V[i];7[c[0]]=1d c[1](7)}}$.G(2m.R,{60:9(){u 7.1N.3j},61:9(){u 7.1N.3k},62:9(){u 7.O},1L:9(a,b){w(b){12(8 i=7.O.1e.N-1;i>=0;i--){8 c=7.O.1e.26(i);w(!(c.15==\'63\'||c.15==\'2s\'||c.15.1E(0,5)==\'2x\')){7.O.1e.64(c.15)}}}12(8 d 1X a){7.O.1x(d,a[d])}u 7},3r:9(a){u 7.O.17.3r(a)},65:9(a,b){w(a){12(8 c 1X b){w(b[c]==W){a.66(c)}Y{a.1x(c,b[c])}}}u 7},J:9(b,c,d){c.3s(0,0,\'F\');c.3s(c.N,0,\'E\');8 e={};8 f=0;w(b[0]!=W&&(16 b[0]!=\'2y\'||!b[0].15)){e[\'F\']=W;f=1}12(8 i=0;i<b.N;i++){e[c[i+f]]=b[i]}w(d){$.2z(d,9(i,a){w(16 e[a]==\'2y\'){e.E=e[a];e[a]=W}})}u e},3t:9(a,b,c){8 d=7.J(I,[\'13\']);8 e=7.K(d.F,\'3t\',d.E||{});e.11(7.O.17.1f(d.13));u e},67:9(a,b,c){8 d=7.J(I,[\'13\']);8 e=7.K(d.F,\'68\',d.E||{});e.11(7.O.17.1f(d.13));u e},3u:9(a,b,c){8 d=7.J(I,[\'D\'],[\'D\']);u 7.K(d.F,\'3u\',$.G((d.D?{D:d.D}:{}),d.E||{}))},3v:9(a,b,c,d,e,f,g){8 h=7.J(I,[\'D\',\'1g\',\'1m\',\'1n\',\'1o\']);u 7.K(h.F,\'3v\',$.G({D:h.D,2A:h.1g+\' \'+h.1m+\' \'+h.1n+\' \'+h.1o},h.E||{}))},1J:9(a,b,c,d,e,f,g,h){8 i=7.J(I,[\'D\',\'2B\',\'2C\',\'3w\',\'3x\',\'27\'],[\'27\']);u 7.K(i.F,\'1J\',$.G({D:i.D,2B:i.2B,2C:i.2C,69:i.3w,6a:i.3x,27:i.27||\'6b\'},i.E||{}))},1I:9(a,b,c){8 d=7.J(I,[\'2D\']);8 e=7.K(d.F,\'1I\',$.G({1y:\'13/3y\'},d.E||{}));e.11(7.O.17.1f(d.2D));w($.1s.6c){$(\'6d\').6e(\'<1I 1y="13/3y">\'+d.2D+\'</1I>\')}u e},1O:9(a,b,c,d){8 e=7.J(I,[\'1O\',\'1y\'],[\'1y\']);8 f=7.K(e.F,\'1O\',$.G({1y:e.1y||\'13/6f\'},e.E||{}));f.11(7.O.17.1f(7.3z(e.1O)));w(!$.1s.6g){$.6h(e.1O)}u f},3A:9(a,b,c,d,e,f,g,h){8 i=7.J(I,[\'D\',\'28\',\'1g\',\'1m\',\'1n\',\'1o\'],[\'1g\']);8 j=$.G({D:i.D},(i.1g!=W?{1g:i.1g,1m:i.1m,1n:i.1n,1o:i.1o}:{}));u 7.2E(i.F,\'3A\',$.G(j,i.E||{}),i.28)},3B:9(a,b,c,d,e,r,f,g,h){8 i=7.J(I,[\'D\',\'28\',\'1b\',\'1j\',\'r\',\'2F\',\'2G\'],[\'1b\']);8 j=$.G({D:i.D},(i.1b!=W?{1b:i.1b,1j:i.1j,r:i.r,2F:i.2F,2G:i.2G}:{}));u 7.2E(i.F,\'3B\',$.G(j,i.E||{}),i.28)},2E:9(a,b,c,d){8 e=7.K(a,b,c);12(8 i=0;i<d.N;i++){8 f=d[i];7.K(e,\'2p\',$.G({6i:f[0],3c:f[1]},(f[2]!=W?{3d:f[2]}:{})))}u e},3C:9(a,b,x,y,c,d,e,f,g,h,i){8 j=7.J(I,[\'D\',\'x\',\'y\',\'P\',\'U\',\'1p\',\'29\',\'2a\',\'2b\'],[\'1p\']);8 k=$.G({D:j.D,x:j.x,y:j.y,P:j.P,U:j.U},(j.1p!=W?{2A:j.1p+\' \'+j.29+\' \'+j.2a+\' \'+j.2b}:{}));u 7.K(j.F,\'3C\',$.G(k,j.E||{}))},3D:9(a,b,x,y,c,d,e){8 f=7.J(I,[\'D\',\'x\',\'y\',\'P\',\'U\']);u 7.K(f.F,\'3D\',$.G({D:f.D,x:f.x,y:f.y,P:f.P,U:f.U},f.E||{}))},6j:9(){u 1d X()},6k:9(){u 1d 2H()},B:9(a,x,y,b,c,d,e,f,g,h){8 i=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1p\',\'29\',\'2a\',\'2b\'],[\'1p\']);8 j=$.G({x:i.x,y:i.y,P:i.P,U:i.U},(i.1p!=W?{2A:i.1p+\' \'+i.29+\' \'+i.2a+\' \'+i.2b}:{}));u 7.K(i.F,\'B\',$.G(j,i.E||{}))},6l:9(a,b,c){8 d=7.J(I,[\'D\'],[\'D\']);u 7.K(d.F,\'g\',$.G({D:d.D},d.E||{}))},3E:9(a,x,y,b,c,d,e){8 f=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1q\']);w(16 f.x==\'1i\'){f.1q=f.x;f.E=f.y;f.x=f.y=f.P=f.U=W}8 g=7.K(f.F,\'3E\',$.G({x:f.x,y:f.y,P:f.P,U:f.U},f.E||{}));g.1z($.B.1h,\'1k\',f.1q);u g},6m:9(a,b,c){8 d=7.J(I,[\'1q\']);8 e=7.K(d.F,\'a\',d.E);e.1z($.B.1h,\'1k\',d.1q);u e},21:9(a,x,y,b,c,d,e){8 f=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1q\']);8 g=7.K(f.F,\'21\',$.G({x:f.x,y:f.y,P:f.P,U:f.U},f.E||{}));g.1z($.B.1h,\'1k\',f.1q);u g},19:9(a,b,c){8 d=7.J(I,[\'19\']);u 7.K(d.F,\'19\',$.G({d:(d.19.19?d.19.19():d.19)},d.E||{}))},3F:9(a,x,y,b,c,d,e,f){8 g=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1r\',\'1F\'],[\'1r\']);u 7.K(g.F,\'3F\',$.G({x:g.x,y:g.y,P:g.P,U:g.U},(g.1r?{1r:g.1r,1F:g.1F}:{}),g.E||{}))},3G:9(a,b,c,r,d){8 e=7.J(I,[\'1b\',\'1j\',\'r\']);u 7.K(e.F,\'3G\',$.G({1b:e.1b,1j:e.1j,r:e.r},e.E||{}))},3H:9(a,b,c,d,e,f){8 g=7.J(I,[\'1b\',\'1j\',\'1r\',\'1F\']);u 7.K(g.F,\'3H\',$.G({1b:g.1b,1j:g.1j,1r:g.1r,1F:g.1F},g.E||{}))},2c:9(a,b,c,d,e,f){8 g=7.J(I,[\'1g\',\'1m\',\'1n\',\'1o\']);u 7.K(g.F,\'2c\',$.G({1g:g.1g,1m:g.1m,1n:g.1n,1o:g.1o},g.E||{}))},3I:9(a,b,c){8 d=7.J(I,[\'1P\']);u 7.2I(d.F,\'3I\',d.1P,d.E)},3J:9(a,b,c){8 d=7.J(I,[\'1P\']);u 7.2I(d.F,\'3J\',d.1P,d.E)},2I:9(a,b,c,d){8 e=\'\';12(8 i=0;i<c.N;i++){e+=c[i].1Q()+\' \'}u 7.K(a,b,$.G({1P:$.2d(e)},d||{}))},13:9(a,x,y,b,c){8 d=7.J(I,[\'x\',\'y\',\'1R\']);w(16 d.x==\'1i\'&&I.N<4){d.1R=d.x;d.E=d.y;d.x=d.y=W}u 7.2J(d.F,\'13\',d.1R,$.G({x:(d.x&&18(d.x)?d.x.1Q(\' \'):d.x),y:(d.y&&18(d.y)?d.y.1Q(\' \'):d.y)},d.E||{}))},2K:9(a,b,c,d){8 e=7.J(I,[\'19\',\'1R\']);8 f=7.2J(e.F,\'6n\',e.1R,e.E||{});f.1z($.B.1h,\'1k\',e.19);u f},2J:9(a,b,c,d){8 e=7.K(a,b,d);w(16 c==\'1i\'){e.11(e.17.1f(c))}Y{12(8 i=0;i<c.1a.N;i++){8 f=c.1a[i];w(f[0]==\'3K\'){8 g=7.K(e,f[0],f[2]);g.11(e.17.1f(f[1]));e.11(g)}Y w(f[0]==\'3L\'){8 g=7.K(e,f[0],f[2]);g.1z($.B.1h,\'1k\',f[1]);e.11(g)}Y w(f[0]==\'2K\'){8 h=$.G({},f[2]);h.1k=W;8 g=7.K(e,f[0],h);g.1z($.B.1h,\'1k\',f[2].1k);g.11(e.17.1f(f[1]));e.11(g)}Y{e.11(e.17.1f(f[1]))}}}u e},6o:9(a,b,c){8 d=7.J(I,[\'3M\']);u 7.K(d.F,d.3M,d.E||{})},K:9(a,b,c){a=a||7.O;8 d=7.O.17.2r($.B.1W,b);12(8 b 1X c){8 e=c[b];w(e!=W&&e!=W&&(16 e!=\'1i\'||e!=\'\')){d.1x($.B.2Z[b]||b,e)}}a.11(d);u d},3N:9(b,c){8 d=7.J(I,[\'1A\']);8 f=7;d.F=d.F||7.O;1t{w($.B.2j){3O\'3P 3Q\';}d.F.11(d.1A.3R(2e))}1u(e){d.1A=(d.1A.3q?d.1A:$(d.1A));d.1A.2z(9(){8 a=f.2L(7);w(a){d.F.11(a)}})}u 7},2L:9(a){8 b=W;w(a.1S==1){b=7.O.17.2r($.B.1W,7.2M(a.15));12(8 i=0;i<a.1e.N;i++){8 c=a.1e.26(i);w(c.15!=\'2x\'&&c.14){w(c.6p==\'2l\'){b.1z($.B.1h,c.6q,c.14)}Y{b.1x(7.2M(c.15),c.14)}}}12(8 i=0;i<a.2N.N;i++){8 d=7.2L(a.2N[i]);w(d){b.11(d)}}}Y w(a.1S==3){w($.2d(a.14)){b=7.O.17.1f(a.14)}}Y w(a.1S==4){w($.2d(a.14)){1t{b=7.O.17.6r(a.14)}1u(e){b=7.O.17.1f(a.14.1G(/&/g,\'&3S;\').1G(/</g,\'&3T;\').1G(/>/g,\'&3U;\'))}}}u b},2M:9(a){a=(a.1E(0,1)>=\'A\'&&a.1E(0,1)<=\'Z\'?a.6s():a);u(a.1E(0,4)==\'B:\'?a.1E(4):a)},3p:9(h,j){j=(16 j==\'6t\'?{3V:j}:(16 j==\'9\'?{1l:j}:j||{}));w(!j.3V){7.3W(1H)}8 k=[7.O.3X(\'P\'),7.O.3X(\'U\')];8 l=7;8 m=9(a){a=$.B.2i.2Q+\': \'+a;w(j.1l){j.1l.1M(l.1N,[l,a])}Y{l.13(W,10,20,a)}};8 n=9(a){8 b=1d 2k(\'6u.6v\');b.6w=1H;b.6x=1H;b.6y=1H;b.6z(a);w(b.3Y.6A!=0){m(b.3Y.6B);u W}u b};8 o=9(a){w(!a){u}w(a.1K.15!=\'B\'){8 b=a.3Z(\'6C\');8 c=(b.N?b[0].3Z(\'6D\'):[]);m(!b.N?\'???\':(c.N?c[0]:b[0]).1T.14);u}8 d={};12(8 i=0;i<a.1K.1e.N;i++){8 f=a.1K.1e.26(i);w(!(f.15==\'2s\'||f.15.1E(0,5)==\'2x\')){d[f.15]=f.14}}l.1L(d,2e);8 g=a.1K.2N;12(8 i=0;i<g.N;i++){1t{w($.B.2j){3O\'3P 3Q\';}l.O.11(g[i].3R(2e))}1u(e){l.3N(W,g[i])}}w(!j.6E){l.1L({P:k[0],U:k[1]})}w(j.1l){j.1l.1M(l.1N,[l])}};w(h.2O(\'<B\')){o($.1s.25?n(h):1d 6F().6G(h,\'13/2u\'))}Y{$.6H({6I:h,6J:($.1s.25?\'13\':\'2u\'),6K:9(a){o($.1s.25?n(a):a)},6L:9(a,b,c){m(b+(c?\' \'+c.6M:\'\'))}})}u 7},6N:9(a){a.3o.40(a);u 7},3W:9(a){w(a){7.1L({},2e)}41(7.O.1T){7.O.40(7.O.1T)}u 7},6O:9(a){a=a||7.O;u(16 42==\'6P\'?7.2P(a):1d 42().6Q(a))},2P:9(a){8 b=\'\';w(!a){u b}w(a.1S==3){b=a.14}Y w(a.1S==4){b=\'<![6R[\'+a.14+\']]>\'}Y{b=\'<\'+a.15;w(a.1e){12(8 i=0;i<a.1e.N;i++){8 c=a.1e.26(i);w(!($.2d(c.14)==\'\'||c.14.2O(/^\\[2y/)||c.14.2O(/^9/))){b+=\' \'+(c.6S==$.B.1h?\'2l:\':\'\')+c.15+\'="\'+c.14+\'"\'}}}w(a.1T){b+=\'>\';8 d=a.1T;41(d){b+=7.2P(d);d=d.6T}b+=\'</\'+a.15+\'>\'}Y{b+=\'/>\'}}u b},3z:9(a){a=a.1G(/&/g,\'&3S;\');a=a.1G(/</g,\'&3T;\');a=a.1G(/>/g,\'&3U;\');u a}});9 X(){7.1c=\'\'}$.G(X.R,{43:9(){7.1c=\'\';u 7},44:9(x,y,a){a=(18(x)?y:a);u 7.1B((a?\'m\':\'M\'),x,y)},2c:9(x,y,a){a=(18(x)?y:a);u 7.1B((a?\'l\':\'L\'),x,y)},1Z:9(x,a){7.1c+=(a?\'h\':\'H\')+(18(x)?x.1Q(\' \'):x);u 7},22:9(y,a){7.1c+=(a?\'v\':\'V\')+(18(y)?y.1Q(\' \'):y);u 7},45:9(a,b,c,d,x,y,e){e=(18(a)?b:e);u 7.1B((e?\'c\':\'C\'),a,b,c,d,x,y)},46:9(a,b,x,y,c){c=(18(a)?b:c);u 7.1B((c?\'s\':\'S\'),a,b,x,y)},47:9(a,b,x,y,c){c=(18(a)?b:c);u 7.1B((c?\'q\':\'Q\'),a,b,x,y)},48:9(x,y,a){a=(18(x)?y:a);u 7.1B((a?\'t\':\'T\'),x,y)},1B:9(a,b,c,d,e,f,g){w(18(b)){12(8 i=0;i<b.N;i++){8 h=b[i];7.1c+=(i==0?a:\' \')+h[0]+\',\'+h[1]+(h.N<4?\'\':\' \'+h[2]+\',\'+h[3]+(h.N<6?\'\':\' \'+h[4]+\',\'+h[5]))}}Y{7.1c+=a+b+\',\'+c+(d==W?\'\':\' \'+d+\',\'+e+(f==W?\'\':\' \'+f+\',\'+g))}u 7},49:9(a,b,c,d,e,x,y,f){f=(18(a)?b:f);7.1c+=(f?\'a\':\'A\');w(18(a)){12(8 i=0;i<a.N;i++){8 g=a[i];7.1c+=(i==0?\'\':\' \')+g[0]+\',\'+g[1]+\' \'+g[2]+\' \'+(g[3]?\'1\':\'0\')+\',\'+(g[4]?\'1\':\'0\')+\' \'+g[5]+\',\'+g[6]}}Y{7.1c+=a+\',\'+b+\' \'+c+\' \'+(d?\'1\':\'0\')+\',\'+(e?\'1\':\'0\')+\' \'+x+\',\'+y}u 7},6U:9(){7.1c+=\'z\';u 7},19:9(){u 7.1c}});X.R.6V=X.R.44;X.R.6W=X.R.2c;X.R.6X=X.R.1Z;X.R.6Y=X.R.22;X.R.6Z=X.R.45;X.R.70=X.R.46;X.R.71=X.R.47;X.R.72=X.R.48;X.R.73=X.R.49;9 2H(){7.1a=[]}$.G(2H.R,{43:9(){7.1a=[];u 7},1i:9(a){7.1a[7.1a.N]=[\'13\',a];u 7},74:9(a,b){7.1a[7.1a.N]=[\'3K\',a,b];u 7},1q:9(a,b){7.1a[7.1a.N]=[\'3L\',a,b];u 7},19:9(a,b,c){7.1a[7.1a.N]=[\'2K\',b,$.G({1k:a},c||{})];u 7}});$.75.B=9(a){8 b=4a.R.76.77(I,1);w(16 a==\'1i\'&&a==\'78\'){u $.B[\'4b\'+a+\'2h\'].1M($.B,[7[0]].4c(b))}u 7.2z(9(){w(16 a==\'1i\'){$.B[\'4b\'+a+\'2h\'].1M($.B,[7].4c(b))}Y{$.B.3i(7,a||{})}})};9 18(a){u(a&&a.79==4a)}$.B=1d 2f()})(7a);',62,445,'|||||||this|var|function|||||||||||||||||||||return||if|||||svg||id|settings|parent|extend||arguments|_args|_makeNode|||length|_svg|width||prototype|||height||null|SVGPath|else|||appendChild|for|text|nodeValue|nodeName|typeof|ownerDocument|isArray|path|_parts|cx|_path|new|attributes|createTextNode|x1|xlinkNS|string|cy|href|onLoad|y1|x2|y2|vx|ref|rx|browser|try|catch|font|stroke|setAttribute|type|setAttributeNS|node|_coords|markerClassName|color|substring|ry|replace|false|style|marker|documentElement|configure|apply|_container|script|points|join|value|nodeType|firstChild|_settings|_extensions|svgNS|in|opacity|horiz||image|vert|loadURL|document|msie|item|orient|stops|vy|vwidth|vheight|line|trim|true|SVGManager|regional|SVG|local|_renesis|ActiveXObject|xlink|SVGWrapper|baseline|rendering|stop|hasClass|createElementNS|version|_afterLoad|xml|embeds|data|xmlns|object|each|viewBox|refX|refY|styles|_gradient|fx|fy|SVGText|_poly|_text|textpath|_cloneAsSVG|_checkName|childNodes|match|_toSVG|errorLoadingText|notSupportedText|_uuid|detectActiveX|http|www|w3|org|_wrapperClass|_attrNames|class|clip|rule|interpolation|fill|flood|size|glyph|orientation|adv|origin|spacing|stopColor|stopOpacity|strikethrough|position|thickness|underline|_attachSVG|clientWidth|clientHeight|innerHTML|100|_registerSVG|parentNode|load|jquery|getElementById|splice|title|defs|symbol|mWidth|mHeight|css|_escapeXML|linearGradient|radialGradient|pattern|mask|use|rect|circle|ellipse|polyline|polygon|tspan|tref|name|add|throw|Force|traversal|cloneNode|amp|lt|gt|addTo|clear|getAttribute|parseError|getElementsByTagName|removeChild|while|XMLSerializer|reset|move|curveC|smoothC|curveQ|smoothQ|arc|Array|_|concat|Error|loading|This|does|not|support|Date|getTime|RenesisX|RenesisCtrl|window|svgwrapper|hasSVG|2000|1999|class_|in_|alignmentBaseline|alignment|baselineShift|shift|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|filters|colorRendering|dominantBaseline|dominant|enableBackground|enable|background|fillOpacity|fillRule|floodColor|floodOpacity|fontFamily|family|fontSize|fontSizeAdjust|adjust|fontStretch|stretch|fontStyle|fontVariant|variant|fontWeight|weight|glyphOrientationHorizontal|horizontal|glyphOrientationVertical|vertical|horizAdvX|horizOriginX|imageRendering|letterSpacing|letter|lightingColor|lighting|markerEnd|end|markerMid|mid|markerStart|start|strikethroughPosition|strikethroughThickness|strokeDashArray|dasharray|strokeDashOffset|dashoffset|strokeLineCap|linecap|strokeLineJoin|linejoin|strokeMiterLimit|miterlimit|strokeOpacity|strokeWidth|textAnchor|anchor|textDecoration|decoration|textRendering|underlinePosition|underlineThickness|vertAdvY|vertOriginY|wordSpacing|word|writingMode|writing|mode|addClass|embed|src|initPath|blank|svg_error|continue|getSVGDocument|setTimeout|250|alert|_getSVG|_destroySVG|removeClass|empty|removeData|addExtension|push|_width|_height|root|onload|removeNamedItem|change|removeAttribute|describe|desc|markerWidth|markerHeight|auto|opera|head|append|javascript|mozilla|globalEval|offset|createPath|createText|group|link|textPath|other|prefix|localName|createCDATASection|toLowerCase|boolean|Microsoft|XMLDOM|validateOnParse|resolveExternals|async|loadXML|errorCode|reason|parsererror|div|changeSize|DOMParser|parseFromString|ajax|url|dataType|success|error|message|remove|toSVG|undefined|serializeToString|CDATA|namespaceURI|nextSibling|close|moveTo|lineTo|horizTo|vertTo|curveCTo|smoothCTo|curveQTo|smoothQTo|arcTo|span|fn|slice|call|get|constructor|jQuery'.split('|'),0,{})) \ No newline at end of file
diff --git a/content/Explore/js/jquery.svganim.min.js b/content/Explore/js/jquery.svganim.min.js
deleted file mode 100755
index 09c432b..0000000
--- a/content/Explore/js/jquery.svganim.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG attribute animations for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) June 2008.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-(function($){$.each(['x','y','width','height','rx','ry','cx','cy','r','x1','y1','x2','y2','stroke-width','strokeWidth','opacity','fill-opacity','fillOpacity','stroke-opacity','strokeOpacity','font-size','fontSize'],function(i,f){var g=f.charAt(0).toUpperCase()+f.substr(1);$.fx.step['svg'+g]=$.fx.step['svg-'+f]=function(a){var b=$.svg._attrNames[f]||f;var c=a.elem.attributes.getNamedItem(b);if(!a.set){a.start=(c?parseFloat(c.nodeValue):0);var d=a.options.curAnim['svg-'+f]||a.options.curAnim['svg'+g];if(/^[+-]=/.exec(d)){a.end=a.start+parseFloat(d.replace(/=/,''))}a.set=true}var e=(a.pos*(a.end-a.start)+a.start)+(a.unit=='%'?'%':'');(c?c.nodeValue=e:a.elem.setAttribute(b,e))}});$.fx.step['svgViewBox']=$.fx.step['svg-viewBox']=function(a){var b=a.elem.attributes.getNamedItem('viewBox');if(!a.set){a.start=parseViewBox(b?b.nodeValue:'');var c=a.options.curAnim['svg-viewBox']||a.options.curAnim['svgViewBox'];a.end=parseViewBox(c);if(/^[+-]=/.exec(c)){c=c.split(' ');while(c.length<4){c.push('0')}for(var i=0;i<4;i++){if(/^[+-]=/.exec(c[i])){a.end[i]=a.start[i]+parseFloat(c[i].replace(/=/,''))}}}a.set=true}var d=$.map(a.start,function(n,i){return(a.pos*(a.end[i]-n)+n)}).join(' ');(b?b.nodeValue=d:a.elem.setAttribute('viewBox',d))};function parseViewBox(a){var b=a.split(' ');for(var i=0;i<b.length;i++){b[i]=parseFloat(b[i]);if(isNaN(b[i])){b[i]=0}}while(b.length<4){b.push(0)}return b}$.fx.step['svgTransform']=$.fx.step['svg-transform']=function(a){var b=a.elem.attributes.getNamedItem('transform');if(!a.set){a.start=parseTransform(b?b.nodeValue:'');a.end=parseTransform(a.end,a.start);a.set=true}var c='';for(var i=0;i<a.end.order.length;i++){switch(a.end.order.charAt(i)){case't':c+=(a.start.translateX!=a.end.translateX||a.start.translateY!=a.end.translateY?' translate('+(a.pos*(a.end.translateX-a.start.translateX)+a.start.translateX)+','+(a.pos*(a.end.translateY-a.start.translateY)+a.start.translateY)+')':'');break;case's':c+=(a.start.scaleX!=a.end.scaleX||a.start.scaleY!=a.end.scaleY?' scale('+(a.pos*(a.end.scaleX-a.start.scaleX)+a.start.scaleX)+','+(a.pos*(a.end.scaleY-a.start.scaleY)+a.start.scaleY)+')':'');break;case'r':c+=(a.start.rotateA!=a.end.rotateA||a.start.rotateX!=a.end.rotateX||a.start.rotateY!=a.end.rotateY?' rotate('+(a.pos*(a.end.rotateA-a.start.rotateA)+a.start.rotateA)+','+(a.pos*(a.end.rotateX-a.start.rotateX)+a.start.rotateX)+','+(a.pos*(a.end.rotateY-a.start.rotateY)+a.start.rotateY)+')':'');break;case'x':c+=(a.start.skewX!=a.end.skewX?' skewX('+(a.pos*(a.end.skewX-a.start.skewX)+a.start.skewX)+')':'');case'y':c+=(a.start.skewY!=a.end.skewY?' skewY('+(a.pos*(a.end.skewY-a.start.skewY)+a.start.skewY)+')':'');break;case'm':var d='';for(var j=0;j<6;j++){d+=','+(a.pos*(a.end.matrix[j]-a.start.matrix[j])+a.start.matrix[j])}c+=' matrix('+d.substr(1)+')';break}}(b?b.nodeValue=c:a.elem.setAttribute('transform',c))};function parseTransform(a,b){a=a||'';if(typeof a=='object'){a=a.nodeValue}var c=$.extend({translateX:0,translateY:0,scaleX:0,scaleY:0,rotateA:0,rotateX:0,rotateY:0,skewX:0,skewY:0,matrix:[0,0,0,0,0,0]},b||{});c.order='';var d=/([a-zA-Z]+)\(\s*([+-]?[\d\.]+)\s*(?:[\s,]\s*([+-]?[\d\.]+)\s*(?:[\s,]\s*([+-]?[\d\.]+)\s*(?:[\s,]\s*([+-]?[\d\.]+)\s*[\s,]\s*([+-]?[\d\.]+)\s*[\s,]\s*([+-]?[\d\.]+)\s*)?)?)?\)/g;var e=d.exec(a);while(e){switch(e[1]){case'translate':c.order+='t';c.translateX=parseFloat(e[2]);c.translateY=(e[3]?parseFloat(e[3]):0);break;case'scale':c.order+='s';c.scaleX=parseFloat(e[2]);c.scaleY=(e[3]?parseFloat(e[3]):c.scaleX);break;case'rotate':c.order+='r';c.rotateA=parseFloat(e[2]);c.rotateX=(e[3]?parseFloat(e[3]):0);c.rotateY=(e[4]?parseFloat(e[4]):0);break;case'skewX':c.order+='x';c.skewX=parseFloat(e[2]);break;case'skewY':c.order+='y';c.skewY=parseFloat(e[2]);break;case'matrix':c.order+='m';c.matrix=[parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),parseFloat(e[7])];break}e=d.exec(a)}return c}$.each(['fill','stroke'],function(i,e){var f=e.charAt(0).toUpperCase()+e.substr(1);$.fx.step['svg'+f]=$.fx.step['svg-'+e]=function(a){if(!a.set){a.start=getColour(a.elem,e);var b=(a.end=='none');a.end=(b?getColour(a.elem.parentNode,e):getRGB(a.end));a.end[3]=b;a.set=true}var c=a.elem.attributes.getNamedItem(e);var d='rgb('+[Math.min(Math.max(parseInt((a.pos*(a.end[0]-a.start[0]))+a.start[0],10),0),255),Math.min(Math.max(parseInt((a.pos*(a.end[1]-a.start[1]))+a.start[1],10),0),255),Math.min(Math.max(parseInt((a.pos*(a.end[2]-a.start[2]))+a.start[2],10),0),255)].join(',')+')';d=(a.end[3]&&a.state==1?'none':d);(c?c.nodeValue=d:a.elem.setAttribute(e,d))}});function getColour(a,b){var c;do{c=(a.attributes&&a.attributes.getNamedItem(b)?a.attributes.getNamedItem(b).nodeValue:'');if((c!=''&&c!='none')||$(a).hasClass('hasSVG')){break}}while(a=a.parentNode);return getRGB(c)}function getRGB(a){var b;if(a&&a.constructor==Array&&(a.length==3||a.length==4)){return a}if(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a)){return[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10)]}if(b=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a)){return[parseFloat(b[1])*2.55,parseFloat(b[2])*2.55,parseFloat(b[3])*2.55]}if(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a)){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}if(b=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a)){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}return h[$.trim(a).toLowerCase()]||h['none']}var h={'':[255,255,255,1],none:[255,255,255,1],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})(jQuery); \ No newline at end of file
diff --git a/content/Explore/js/jquery.svgdom.js b/content/Explore/js/jquery.svgdom.js
deleted file mode 100755
index be0cf4a..0000000
--- a/content/Explore/js/jquery.svgdom.js
+++ /dev/null
@@ -1,355 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG/jQuery DOM compatibility for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-
-(function($) { // Hide scope, no $ conflict
-
-/* Support adding class names to SVG nodes. */
-var origAddClass = $.fn.addClass;
-
-$.fn.addClass = function(classNames) {
- classNames = classNames || '';
- return this.each(function() {
- if (isSVGElem(this)) {
- var node = this;
- $.each(classNames.split(/\s+/), function(i, className) {
- var classes = (node.className ? node.className.baseVal : node.getAttribute('class'));
- if ($.inArray(className, classes.split(/\s+/)) == -1) {
- classes += (classes ? ' ' : '') + className;
- (node.className ? node.className.baseVal = classes :
- node.setAttribute('class', classes));
- }
- });
- }
- else {
- origAddClass.apply($(this), [classNames]);
- }
- });
-};
-
-/* Support removing class names from SVG nodes. */
-var origRemoveClass = $.fn.removeClass;
-
-$.fn.removeClass = function(classNames) {
- classNames = classNames || '';
- return this.each(function() {
- if (isSVGElem(this)) {
- var node = this;
- $.each(classNames.split(/\s+/), function(i, className) {
- var classes = (node.className ? node.className.baseVal : node.getAttribute('class'));
- classes = $.grep(classes.split(/\s+/), function(n, i) { return n != className; }).
- join(' ');
- (node.className ? node.className.baseVal = classes :
- node.setAttribute('class', classes));
- });
- }
- else {
- origRemoveClass.apply($(this), [classNames]);
- }
- });
-};
-
-/* Support toggling class names on SVG nodes. */
-var origToggleClass = $.fn.toggleClass;
-
-$.fn.toggleClass = function(className, state) {
- return this.each(function() {
- if (isSVGElem(this)) {
- if (typeof state !== 'boolean') {
- state = !$(this).hasClass(className);
- }
- $(this)[(state ? 'add' : 'remove') + 'Class'](className);
- }
- else {
- origToggleClass.apply($(this), [className, state]);
- }
- });
-};
-
-/* Support checking class names on SVG nodes. */
-var origHasClass = $.fn.hasClass;
-
-$.fn.hasClass = function(className) {
- className = className || '';
- var found = false;
- this.each(function() {
- if (isSVGElem(this)) {
- var classes = (this.className ? this.className.baseVal :
- this.getAttribute('class')).split(/\s+/);
- found = ($.inArray(className, classes) > -1);
- }
- else {
- found = (origHasClass.apply($(this), [className]));
- }
- return !found;
- });
- return found;
-};
-
-/* Support attributes on SVG nodes. */
-var origAttr = $.fn.attr;
-
-//BWB: is this what i need to do for css?
-$.fn.attr = function(name, value, type) {
- if (typeof name === 'string' && value === undefined) {
- var val = origAttr.apply(this, [name, value, type]);
- return (val && val.baseVal ? val.baseVal.valueAsString : val);
- }
- var options = name;
- if (typeof name === 'string') {
- options = {};
- options[name] = value;
- }
- return this.each(function() {
- if (isSVGElem(this)) {
- for (var n in options) {
- this.setAttribute(n,
- (typeof options[n] == 'function' ? options[n]() : options[n]));
- }
- }
- else {
- origAttr.apply($(this), [name, value, type]);
- }
- });
-};
-
-// BWB attempting to patch css manipulation of SVG
-//support manipulation of css styles
-var origCss = $.fn.css;
-
-$.fn.css = function(name, value, type) {
- var revAttrName = function(name){
- for (var jsName in $.svg._attrNames){
- if ($.svg._attrNames[jsName] === name){
- return jsName;
- }
- }
- return name;
- };
-
- if (typeof name === 'string' && value === undefined) {
- var val = origCss.apply(this, [name, value, type]);
- return (val && val.baseVal ? val.baseVal.valueAsString : val);
- }
- var options = name;
- if (typeof name === 'string') {
- options = {};
- options[name] = value;
- }
- return this.each(function() {
- if (isSVGElem(this)) {
- for (var n in options) {
- //if Firefox
- if (this.style.MozBinding === "") {
- var jsName = revAttrName(n);
- this.style[jsName] = options[n];
- (typeof options[n] === 'function' ? options[n]() : options[n]);
- } else {
- this.style.setProperty(n,
- typeof options[n] == 'function' ? options[n]() : options[n]);
- }
- }
- }
- else {
- origCss.apply($(this), [name, value, type]);
- }
- });
-};
-
-
-/* Support removing attributes on SVG nodes. */
-var origRemoveAttr = $.fn.removeAttr;
-
-$.fn.removeAttr = function(name) {
- return this.each(function() {
- if (isSVGElem(this)) {
- (this[name] && this[name].baseVal ? this[name].baseVal.value = '' :
- this.setAttribute(name, ''));
- }
- else {
- origRemoveAttr.apply($(this), [name]);
- }
- });
-};
-
-/* Update Sizzle selectors. */
-var origRelativeNext = $.expr.relative['+'];
-var origRelativeChild = $.expr.relative['>'];
-var origRelativeDescendant = $.expr.relative[''];
-var origRelativeSiblings = $.expr.relative['~'];
-var origFindId = $.expr.find.ID;
-var origFindTag = $.expr.find.TAG;
-var origPreFilterClass = $.expr.preFilter.CLASS;
-var origFilterClass = $.expr.filter.CLASS;
-var origFilterAttr = $.expr.filter.ATTR;
-
-/* Determine if any nodes are SVG nodes. */
-function anySVG(checkSet) {
- for (var i = 0; i < checkSet.length; i++) {
- if (checkSet[i].nodeType == 1 && checkSet[i].namespaceURI == $.svg.svgNS) {
- return true;
- }
- }
- return false;
-}
-
-$.expr.relative['+'] = function(checkSet, part, isXML) {
- origRelativeNext(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.relative['>'] = function(checkSet, part, isXML) {
- origRelativeChild(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.relative[''] = function(checkSet, part, isXML) {
- origRelativeDescendant(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.relative['~'] = function(checkSet, part, isXML) {
- origRelativeSiblings(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.find.ID = function(match, context, isXML) {
- return (isSVGElem(context) ?
- [context.ownerDocument.getElementById(match[1])] :
- origFindId(match, context, isXML));
-};
-
-var div = document.createElement('div');
-div.appendChild(document.createComment(''));
-if (div.getElementsByTagName('*').length > 0) { // Make sure no comments are found
- $.expr.find.TAG = function(match, context) {
- var results = context.getElementsByTagName(match[1]);
- if (match[1] === '*') { // Filter out possible comments
- var tmp = [];
- for (var i = 0; results[i] || results.item(i); i++) {
- if ((results[i] || results.item(i)).nodeType === 1) {
- tmp.push(results[i] || results.item(i));
- }
- }
- results = tmp;
- }
- return results;
- };
-}
-
-$.expr.preFilter.CLASS = function(match, curLoop, inplace, result, not, isXML) {
- match = ' ' + match[1].replace(/\\/g, '') + ' ';
- if (isXML) {
- return match;
- }
- for (var i = 0, elem = {}; elem != null; i++) {
- elem = curLoop[i];
- if (!elem) {
- try {
- elem = curLoop.item(i);
- }
- catch (e) {
- // Ignore
- }
- }
- if (elem) {
- var className = (!isSVGElem(elem) ? elem.className :
- (elem.className ? elem.className.baseVal : '') || elem.getAttribute('class'));
- if (not ^ (className && (' ' + className + ' ').indexOf(match) > -1)) {
- if (!inplace)
- result.push(elem);
- }
- else if (inplace) {
- curLoop[i] = false;
- }
- }
- }
- return false;
-};
-
-$.expr.filter.CLASS = function(elem, match) {
- var className = (!isSVGElem(elem) ? elem.className :
- (elem.className ? elem.className.baseVal : elem.getAttribute('class')));
- return (' ' + className + ' ').indexOf(match) > -1;
-};
-
-$.expr.filter.ATTR = function(elem, match) {
- var handler = null;
- if (isSVGElem(elem)) {
- handler = match[1];
- $.expr.attrHandle[handler] = function(elem){
- var attr = elem.getAttribute(handler);
- return attr && attr.baseVal || attr;
- };
- }
- var filter = origFilterAttr(elem, match);
- if (handler) {
- $.expr.attrHandle[handler] = null;
- }
- return filter;
-};
-
-/*
- Change Sizzle initialisation (line 1425) in jQuery v1.3.2 base code...
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
- } else if ( context.nodeType === 1 ) {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
- results.push( set[i] || set.item(i) ); // Here
- }
- }
- } else {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] || set.item(i) ); // Here
- }
- }
- }
- }
-
- Change fallback makeArray (line 2076) implementation in jQuery Sizzle...
-
- if ( typeof array.length === "number" ) {
- for ( var i = 0, l = array.length; i < l; i++ ) {
- ret.push( array[i] || array.item(i) ); // Here
- }
- }
-*/
-
-/*
- Events management requires changes to jQuery v1.3.2 base code...
-
- In $.event.add (line 2437)...
-
- if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
- // Bind the global event handler to the element
- try { // Here
- elem.addEventListener(type, handle, false);
- }
- catch(e) {
- if (elem.attachEvent)
- elem.attachEvent("on" + type, handle);
- }
- }
-
- In $.event.remove (line 2521)...
-
- if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
- try { // Here
- elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
- }
- catch (e) {
- if (elem.detachEvent)
- elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
- }
- }
-*/
-
-/* Does this node belong to SVG? */
-function isSVGElem(node) {
- return (node.nodeType == 1 && node.namespaceURI == $.svg.svgNS);
-}
-
-})(jQuery);
diff --git a/content/Explore/js/jquery.svgdom.min.js b/content/Explore/js/jquery.svgdom.min.js
deleted file mode 100755
index e3db0c8..0000000
--- a/content/Explore/js/jquery.svgdom.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG/jQuery DOM compatibility for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-(function($){var j=$.fn.addClass;$.fn.addClass=function(d){d=d||'';return this.each(function(){if(isSVGElem(this)){var c=this;$.each(d.split(/\s+/),function(i,a){var b=(c.className?c.className.baseVal:c.getAttribute('class'));if($.inArray(a,b.split(/\s+/))==-1){b+=(b?' ':'')+a;(c.className?c.className.baseVal=b:c.setAttribute('class',b))}})}else{j.apply($(this),[d])}})};var k=$.fn.removeClass;$.fn.removeClass=function(d){d=d||'';return this.each(function(){if(isSVGElem(this)){var c=this;$.each(d.split(/\s+/),function(i,a){var b=(c.className?c.className.baseVal:c.getAttribute('class'));b=$.grep(b.split(/\s+/),function(n,i){return n!=a}).join(' ');(c.className?c.className.baseVal=b:c.setAttribute('class',b))})}else{k.apply($(this),[d])}})};var l=$.fn.toggleClass;$.fn.toggleClass=function(a,b){return this.each(function(){if(isSVGElem(this)){if(typeof b!=='boolean'){b=!$(this).hasClass(a)}$(this)[(b?'add':'remove')+'Class'](a)}else{l.apply($(this),[a,b])}})};var m=$.fn.hasClass;$.fn.hasClass=function(b){b=b||'';var c=false;this.each(function(){if(isSVGElem(this)){var a=(this.className?this.className.baseVal:this.getAttribute('class')).split(/\s+/);c=($.inArray(b,a)>-1)}else{c=(m.apply($(this),[b]))}return!c});return c};var o=$.fn.attr;$.fn.attr=function(a,b,c){if(typeof a==='string'&&b===undefined){var d=o.apply(this,[a,b,c]);return(d&&d.baseVal?d.baseVal.valueAsString:d)}var e=a;if(typeof a==='string'){e={};e[a]=b}return this.each(function(){if(isSVGElem(this)){for(var n in e){this.setAttribute(n,(typeof e[n]=='function'?e[n]():e[n]))}}else{o.apply($(this),[a,b,c])}})};var p=$.fn.removeAttr;$.fn.removeAttr=function(a){return this.each(function(){if(isSVGElem(this)){(this[a]&&this[a].baseVal?this[a].baseVal.value='':this.setAttribute(a,''))}else{p.apply($(this),[a])}})};var q=$.expr.relative['+'];var r=$.expr.relative['>'];var s=$.expr.relative[''];var t=$.expr.relative['~'];var u=$.expr.find.ID;var v=$.expr.find.TAG;var w=$.expr.preFilter.CLASS;var x=$.expr.filter.CLASS;var y=$.expr.filter.ATTR;function anySVG(a){for(var i=0;i<a.length;i++){if(a[i].nodeType==1&&a[i].namespaceURI==$.svg.svgNS){return true}}return false}$.expr.relative['+']=function(a,b,c){q(a,b,c||anySVG(a))};$.expr.relative['>']=function(a,b,c){r(a,b,c||anySVG(a))};$.expr.relative['']=function(a,b,c){s(a,b,c||anySVG(a))};$.expr.relative['~']=function(a,b,c){t(a,b,c||anySVG(a))};$.expr.find.ID=function(a,b,c){return(isSVGElem(b)?[b.ownerDocument.getElementById(a[1])]:u(a,b,c))};var z=document.createElement('div');z.appendChild(document.createComment(''));if(z.getElementsByTagName('*').length>0){$.expr.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==='*'){var d=[];for(var i=0;c[i]||c.item(i);i++){if((c[i]||c.item(i)).nodeType===1){d.push(c[i]||c.item(i))}}c=d}return c}}$.expr.preFilter.CLASS=function(a,b,c,d,f,g){a=' '+a[1].replace(/\\/g,'')+' ';if(g){return a}for(var i=0,elem={};elem!=null;i++){elem=b[i];if(!elem){try{elem=b.item(i)}catch(e){}}if(elem){var h=(!isSVGElem(elem)?elem.className:(elem.className?elem.className.baseVal:'')||elem.getAttribute('class'));if(f^(h&&(' '+h+' ').indexOf(a)>-1)){if(!c)d.push(elem)}else if(c){b[i]=false}}}return false};$.expr.filter.CLASS=function(a,b){var c=(!isSVGElem(a)?a.className:(a.className?a.className.baseVal:a.getAttribute('class')));return(' '+c+' ').indexOf(b)>-1};$.expr.filter.ATTR=function(c,d){var e=null;if(isSVGElem(c)){e=d[1];$.expr.attrHandle[e]=function(a){var b=a.getAttribute(e);return b&&b.baseVal||b}}var f=y(c,d);if(e){$.expr.attrHandle[e]=null}return f};function isSVGElem(a){return(a.nodeType==1&&a.namespaceURI==$.svg.svgNS)}})(jQuery); \ No newline at end of file
diff --git a/content/Explore/js/jquery.svgdom.pack.js b/content/Explore/js/jquery.svgdom.pack.js
deleted file mode 100755
index be88a52..0000000
--- a/content/Explore/js/jquery.svgdom.pack.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG/jQuery DOM compatibility for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){2 j=$.9.W;$.9.W=4(d){d=d||\'\';7 3.D(4(){5(C(3)){2 c=3;$.D(d.J(/\\s+/),4(i,a){2 b=(c.8?c.8.A:c.I(\'F\'));5($.X(a,b.J(/\\s+/))==-1){b+=(b?\' \':\'\')+a;(c.8?c.8.A=b:c.L(\'F\',b))}})}G{j.H($(3),[d])}})};2 k=$.9.Y;$.9.Y=4(d){d=d||\'\';7 3.D(4(){5(C(3)){2 c=3;$.D(d.J(/\\s+/),4(i,a){2 b=(c.8?c.8.A:c.I(\'F\'));b=$.1g(b.J(/\\s+/),4(n,i){7 n!=a}).1h(\' \');(c.8?c.8.A=b:c.L(\'F\',b))})}G{k.H($(3),[d])}})};2 l=$.9.Z;$.9.Z=4(a,b){7 3.D(4(){5(C(3)){5(M b!==\'1i\'){b=!$(3).T(a)}$(3)[(b?\'1j\':\'1k\')+\'1l\'](a)}G{l.H($(3),[a,b])}})};2 m=$.9.T;$.9.T=4(b){b=b||\'\';2 c=N;3.D(4(){5(C(3)){2 a=(3.8?3.8.A:3.I(\'F\')).J(/\\s+/);c=($.X(b,a)>-1)}G{c=(m.H($(3),[b]))}7!c});7 c};2 o=$.9.10;$.9.10=4(a,b,c){5(M a===\'11\'&&b===1m){2 d=o.H(3,[a,b,c]);7(d&&d.A?d.A.1n:d)}2 e=a;5(M a===\'11\'){e={};e[a]=b}7 3.D(4(){5(C(3)){O(2 n 1o e){3.L(n,(M e[n]==\'4\'?e[n]():e[n]))}}G{o.H($(3),[a,b,c])}})};2 p=$.9.12;$.9.12=4(a){7 3.D(4(){5(C(3)){(3[a]&&3[a].A?3[a].A.1p=\'\':3.L(a,\'\'))}G{p.H($(3),[a])}})};2 q=$.6.E[\'+\'];2 r=$.6.E[\'>\'];2 s=$.6.E[\'\'];2 t=$.6.E[\'~\'];2 u=$.6.P.13;2 v=$.6.P.14;2 w=$.6.15.Q;2 x=$.6.R.Q;2 y=$.6.R.16;4 K(a){O(2 i=0;i<a.17;i++){5(a[i].U==1&&a[i].18==$.19.1a){7 1q}}7 N}$.6.E[\'+\']=4(a,b,c){q(a,b,c||K(a))};$.6.E[\'>\']=4(a,b,c){r(a,b,c||K(a))};$.6.E[\'\']=4(a,b,c){s(a,b,c||K(a))};$.6.E[\'~\']=4(a,b,c){t(a,b,c||K(a))};$.6.P.13=4(a,b,c){7(C(b)?[b.1r.1s(a[1])]:u(a,b,c))};2 z=1b.1t(\'1u\');z.1v(1b.1w(\'\'));5(z.1c(\'*\').17>0){$.6.P.14=4(a,b){2 c=b.1c(a[1]);5(a[1]===\'*\'){2 d=[];O(2 i=0;c[i]||c.S(i);i++){5((c[i]||c.S(i)).U===1){d.1d(c[i]||c.S(i))}}c=d}7 c}}$.6.15.Q=4(a,b,c,d,f,g){a=\' \'+a[1].1x(/\\\\/g,\'\')+\' \';5(g){7 a}O(2 i=0,B={};B!=V;i++){B=b[i];5(!B){1y{B=b.S(i)}1z(e){}}5(B){2 h=(!C(B)?B.8:(B.8?B.8.A:\'\')||B.I(\'F\'));5(f^(h&&(\' \'+h+\' \').1e(a)>-1)){5(!c)d.1d(B)}G 5(c){b[i]=N}}}7 N};$.6.R.Q=4(a,b){2 c=(!C(a)?a.8:(a.8?a.8.A:a.I(\'F\')));7(\' \'+c+\' \').1e(b)>-1};$.6.R.16=4(c,d){2 e=V;5(C(c)){e=d[1];$.6.1f[e]=4(a){2 b=a.I(e);7 b&&b.A||b}}2 f=y(c,d);5(e){$.6.1f[e]=V}7 f};4 C(a){7(a.U==1&&a.18==$.19.1a)}})(1A);',62,99,'||var|this|function|if|expr|return|className|fn|||||||||||||||||||||||||||baseVal|elem|isSVGElem|each|relative|class|else|apply|getAttribute|split|anySVG|setAttribute|typeof|false|for|find|CLASS|filter|item|hasClass|nodeType|null|addClass|inArray|removeClass|toggleClass|attr|string|removeAttr|ID|TAG|preFilter|ATTR|length|namespaceURI|svg|svgNS|document|getElementsByTagName|push|indexOf|attrHandle|grep|join|boolean|add|remove|Class|undefined|valueAsString|in|value|true|ownerDocument|getElementById|createElement|div|appendChild|createComment|replace|try|catch|jQuery'.split('|'),0,{})) \ No newline at end of file
diff --git a/content/Explore/js/kDoc.js b/content/Explore/js/kDoc.js
deleted file mode 100755
index cf14bc2..0000000
--- a/content/Explore/js/kDoc.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(document).ready(
- function(){
-
- var back = 'index.html';
-
- var parseUrlParams = function(){
- var doc = '';
- var params = window.location.search.slice(1).split('&');
- if (params){
- back = params[0].split('=')[1];
- doc = params[1].split('=')[1];
- }
-
- $('#iframeLessonPlan').attr('src', "" + doc + ".html");
- };
-
- var $kHeader = $('#kHeader').kHeader({title:"Lesson Plan", zoom: true});
-
-
- $('#kHeaderBackBtn').click(function(){ window.location = back; });
-
- parseUrlParams();
- Karma.scaleToViewport();
-}); \ No newline at end of file
diff --git a/content/Explore/js/karma.js b/content/Explore/js/karma.js
deleted file mode 100755
index 3d29073..0000000
--- a/content/Explore/js/karma.js
+++ /dev/null
@@ -1,1758 +0,0 @@
-/* Documentation Note:
- * Public methods and properties are commented with /** some text *\/
- * and private methods and properties are commented with //
- *
- * Please leave it that way to keep this documentation sane
- */
-
-
-/*
-* Karma Framework
-* http://karmaeducation.org
-*
-* Copyright (c) 2009
-* Bryan W Berry bryan@olenepal.org
-* Felipe López Toledo zer.subzero@gmail.com
-*
-* Under MIT 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 above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* 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.
-*/
-
-/**
-* @fileOverview Contains karma library
-* @author Bryan Berry <bryan@olenepal.org>
-* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
-*/
-
-
-//common.js modules use exports object
-if(!this.exports) {
- exports = {};
-}
-
-
-
-/** Karma is the namespace for the Karma library and Karma() is the constructor
- * function for the Karma library object Karma.
- * Karma() checks if the current document type is set to HTML 5, throws
- * an error if not. Otherwise, initializes the karma object and returns
- * a reference to that object.
- * @namespace Global namespace for Karma library
- * @constructor
- * @param {Object} [options={}] options for intializing Karma library
- * @param {String} [options.locale=''] sets current locale Not Yet Implemented
- * @param {Array} [options.image=[]] array of images to be converted into a collection
- * @param {Array} [options.audio=[]] array of audio to be converted into a collection
- * @param {Array} [options.video=[]] NYI array of videos to be converted into a collection
- * @param {Array} [options.svg=[]] array of SVG elements to be
- * converted into a collection. Each SVG element must already exist in the html document
- * @param {Array} [options.canvas=[]] array of canvas elements
- * to be converted into a collection. Each canvas element must already exist in the
- * html document and width and height of each element must be set as attributes
- * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
- * <!DOCTYPE html>
- * @throws {Error} If any of the initialization parameters are invalid values
- * @returns {Object} Karma -- reference to the initialized Karma library
- * @example
- *
- * var k = Karma({
- * image: [
- * {name: "ninja", file: "ninja.png"},
- * {name: "cowboy", file: "cowboy.png"}
- * ],
- * audio: [
- * {name: "woosh", file: "woosh.ogg"},
- * {name: "yeehaw", file: "yeehaw.ogg"}
- * ],
- * video: [ //Not Yet Implemented
- * {name: "attack", file: "attack.ogv"},
- * {name: "ride", file: "ride.ogv"}
- * ]
- * canvas: [
- * {name: "ninja", domId: "ninjaCanvas"},
- * {name: "cowboy", domId: "cowboyCanvas"}
- * ],
- * svg: [
- * {name: "ninja", domId: "ninjaSvg"},
- * {name: "cowboy", domId: "cowboySvg"}
- * ],
- * });
- * Next, call the ready function with a callback to your program code
- *
- * k.ready(function () { ... your application code . . . }
- *
- * after that you can access each asset like so
- * k.image.ninja;
- * k.svg.cowboy;
- * k.audio.yeehaw.play();
- * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
- *
- */
-var Karma = exports.Karma = function (options) {
- Karma._isHtml5(document.doctype.nodeName);
-
- if ( Karma._initialized === true ) {
- return Karma;
- } else {
- return Karma._init(options);
- }
-};
-
-
-//helper functions
-
-/**This emulates the Object.create method in ecmascript 5 spec
- * This isn't a full implementation as it doesn't support an all of Object.create's features
- * This has the same functionality as Crockford's beget method
- * and this primary building block for prototypal inheritance in
- * this library
- * @param {Object} parent that the new object's prototype should point to
- * @returns {Object} a new object whose prototype is parent
- * @example
- *
- * var ninja = { weapon : "sword" };
- * var ninja1 = Karma.create(ninja);
- * ninja1.weapon === "sword"
- */
-Karma.create = function (parent){
- function F () {};
- F.prototype = parent;
- return new F();
-};
-
-/** Returns a shallow copy of the passed in object
- * @param {Object} target to be copied
- * @returns {Object} a shallow copy of target
- */
-Karma.clone = function (target){
- var copy = {};
- for ( var i in target ) {
- if(target.hasOwnProperty(i)){
- copy[i] = target[i];
- }
- }
- return copy;
-};
-
-/** Extends properties of the target object with those of
- * the source object
- * @param {Object} target object to be extended
- * @param {Object} source whose properties will extend target
- * @returns {Object} target extended by source
- */
-Karma.objectPlus = function (target, source){
- for ( var i in source){
- if (source.hasOwnProperty(i)){
- target[i] = source[i];
- }
- }
- return target;
-};
-
-Karma.extend = Karma.objectPlus;
-
-/** Creates a new object that is a prototype of the first argument
- * then extends it with the properties of the second argument
- * @param {Object} parent1 will be prototype of returned object
- * @param {Object} parent2 will extend properties of returned object
- * @returns {Object} object that whose prototype is parent1 and has
- * been extended with properties of parent2
- */
-Karma.copyObjectPlus = function (parent1, parent2){
- function F () {};
- F.prototype = parent1;
- var G = new F();
- return Karma.objectPlus(G, parent2);
-};
-
-
-//Throws big ugly error if doctype isn't html5
-Karma._isHtml5 = function (doctype){
- var regex = new RegExp('^html$', 'i');
- if(!regex.test(doctype)){
- var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
- "in order to use Karma. Karma require you use html5";
- var errorElem = document.createElement('div');
- errorElem.setAttribute('id', 'errorDoctype');
- errorElem.innerText = errorMsg;
- document.body.appendChild(errorElem);
- throw new Error(errorMsg);
- }
-};
-
-/**
- * Shuffles an array of items randomly
- * @param {Array} oldList of choices to be shuffled
- * @returns {Array} newlist of choices randomly reordered
- */
-Karma.shuffle = function (oldList) {
- var newList = oldList.slice(0);
- for (var i = newList.length - 1; i > 0; i -= 1) {
- var j = Karma.rand(0, i);
- var t = newList[i];
- newList[i] = newList[j];
- newList[j] = t;
- }
- return newList;
-};
-
-
-/**
- * Converts a number to numerals in the specified locale. Currently only
- * supports Nepali
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
-Karma.convertNumToLocale = function(num, locale){
- locale = locale || Karma.locale;
- //48 is the base for western numerals
- var convertDigit = function(digit){
-
- var numBase = 48;
- var prefix = "u00";
-
- if (locale === "ne"){
- prefix = "u0";
- numBase = 2406;
- }
-
- return '\\' + prefix +
- (numBase + parseInt(digit)).toString(16);
- };
-
- var charArray = num.toString().split("").map(convertDigit);
- return eval('"' + charArray.join('') + '"');
-};
-
-/**
- * @name Karma._n
- * @function
- * @public
- * Alias for Karma.convertNumToLocale. Converts a number to numerals to
- * Karma.locale or to specified locale. Currently only supports Nepali
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
-Karma._n = Karma.convertNumToLocale;
-
-/* Scales the dimensions of document.body to the innerHeight and innerWidth
- * of the viewport, i.e. browser window, with a minor offset to the height to
- * make sure the scrollbars do not appear
- */
-Karma.scaleToViewport = function(){
- var width = window.innerWidth;
- var height = window.innerHeight;
-
- //hack to ensure scrollbars don't appear
- if (height === 900){
- height = "" + 900 + "px";
- } else {
- height = "" + (height - 13) + "px";
- }
-
- document.body.style.width = "" + width + "px";
- document.body.style.height = height;
-};
-
-Karma.scaleWindow = function(){
- var width = "1200px";
- var height = "900px";
- var viewportHeight = "760px";
- var $body = $('body');
- var $kMain = $('#kMain');
-
- if (window.innerWidth < 1150){
- width = "950px";
- height = "600px";
- viewportHeight = "460px";
- $body.css('border', '2px solid black');
-
- // 460/760 * 16 = 9.6
- $kMain.css('font-size', '9.6px');
- }
-
- $body.css({border: '2px solid black', width: width, height: height});
- $kMain.css({width: width, height: viewportHeight});
-
-
-};
-
- // Below are geometry and math helper methods
-
-/**
- * Converts a value from degrees to radians.
- * @param {Number} angle The angle in degrees
- * @returns {Number} The angle in radians
- */
-Karma.radians = function( angle ){
- return ( angle / 180 ) * Math.PI;
-};
-
-/**
- * Gets the square of the Euclidian (ordinary) distance between 2 points.
- * @param {Object} Point No. 0
- * @param {Number} Point0.x
- * @param {Number} Point0.y
- * @param {Object} Point No. 1
- * @param {Number} Point1.x
- * @param {Number} Point1.y
- * @returns {Number} The square of the Euclidian distance
- * @example
- *
- * p0 = {x:0, y:1};
- * p1 = {x:50, y:70};
- * var d = distance2(p0, p1);
- *
- */
-Karma.distance2 = function ( p0, p1 ) {
- return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
-};
-
-/**
- * Gets the Euclidian (ordinary) distance between 2 points.<br>
- * <b>Warning:</b> It's slower than distance2 function
- * @param {Object} Point No. 0
- * @param {Number} Point0.x
- * @param {Number} Point0.y
- * @param {Object} Point No. 1
- * @param {Number} Point1.x
- * @param {Number} Point1.y
- * @returns {Number} The Euclidian distance
- * @example
- *
- * p0 = {x:0, y:1};
- * p1 = {x:50, y:70};
- * var d = distance2(p0, p1);
- *
- */
-Karma.distance = function ( p0, p1 ) {
- return Math.sqrt( this.distance2( p0, p1 ) );
-};
-
-/** Returns a random number within the range provided
- * @param {Number} lower limit of the range, lowest number that can be returned
- * @param {Number} upper limit of the range, highest number that can be returned
- * @returns {Number} number that is >= lower and <= upper
- * @example
- *
- * var num = rand(0, 10);
- *
- * //num could be 0, 1, 2, 3 ... or 10
- *
- */
-Karma.rand = function ( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-
-Karma.extend(Karma, {
- /** This is the global locale as passed to Karma(),
- * such as "en", "es_SP"
- * @fieldOf Karma
- * @property {string} locale This is the global locale as passed to Karma()
- * @default 'en'
- */
- locale : 'en',
- /** Collection of images with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- image : {},
- /** Collection of audio files with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- audio : {},
- /** Collection of html 5 canvases with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- canvas : {},
- /** Collection of svgs with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- svg : {},
- /** Collection of videos with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- video : {},
- _localized : false,
- _assetPath : "assets/",
- _localePath : "",
- _initialized : false,
- _statusDiv: undefined,
- _loaderDiv : undefined,
- _counters : { total : 0, errors : 0, loaded : 0},
-
- //This constructs the Karma object per values provided by the user
- _init: function(options) {
- this._initialized = true;
-
- //set up message that show count of assets loaded
- //and has an ordered list to append error messages to
- var _statusDiv = this._statusDiv = document.createElement('div');
- this._loaderDiv = this._loaderDiv = document.createElement('div');
- var errorList = document.createElement('ol');
-
- _statusDiv.setAttribute('id', 'karma-status');
- _statusDiv.setAttribute('style', 'position:absolute;');
- _statusDiv.innerHTML = 'Karma is loading ...';
- this._loaderDiv.setAttribute('id', 'karma-loader');
- this._loaderDiv.setAttribute('class', 'status');
- errorList.setAttribute('id', 'errorList');
-
- _statusDiv.appendChild(this._loaderDiv);
- this._statusDiv.appendChild(errorList);
- document.body.appendChild(_statusDiv);
-
- //regular expression that matches the name of aprivate property
- // the karma object
- var regexPrivate = new RegExp('^_.*');
-
- for ( var option in options ) {
- if (options.hasOwnProperty(option)){
- if (option === "image" || option === "audio" || option ===
- "svg" || option === "video" || option === "canvas"){
-
- if(!(options[option] instanceof Array)){
- throw new Error("" + option + " must be an array");
- } else if (options[option].length === 0){
- continue;
- }
- } else if (regexPrivate.test(option)){
- //don't overwrite a private property of karma object
- continue;
- }
-
- switch (option){
- case "locale":
-
- if (this._isValidLocale(options[option])){
- this.locale = this._normalizeLocale(options[option]);
- this._localized = true;
- this._localePath = Karma._computeLocalePath(this.locale);
- } else {
- throw new Error("locale provided to karma._init() is invalid");
- }
-
- break;
- case "image":
- options[option]._type = 'image';
- Karma._makeCollection(options[option], 'image');
- break;
- case "audio":
- options[option]._type = 'audio';
- Karma._makeCollection(options[option], 'audio');
- break;
- case "video":
- options[option]._type = 'video';
- Karma._makeCollection(options[option], 'video');
- break;
- case "svg":
- options[option]._type = 'svg';
- Karma._makeCollection(options[option], 'svg');
- break;
- case "canvas":
- options[option]._type = 'canvas';
- Karma._makeCollection(options[option], 'canvas');
- break;
- }
- }
- }
-
-
-
- return this;
- },
-
- /** Waits until all assets loaded(ready), then calls callback cb
- * @memberOf Karma
- * @param {Function} [cb] callback function
- * @returns this
- * @throws {Error} if Karma is not initialized with the
- * Karma({ options }) function
- * @example
- *
- * var k = Karma({ . . . your assets here . . . });
- * k.ready(function(){ .. your code here . . .});
- *
- * your code will not be called until all assets have been loaded
- * into collections
- *
- */
- ready : function( cb ) {
- var that = this;
- if (Karma._initialized !== true){
- throw new Error("Karma not initialized");
- }
-
- if (this._counters.loaded !== this._counters.total){
- setTimeout(function(){ that.ready(cb);}, 5);
- } else if (cb) {
- //hide the "Karma is loading..." message
- this._statusDiv.setAttribute('style', 'display:none;');
-
- cb();
- } else if (!cb) {
- //hide the "Karma is loading..." message
- this._statusDiv.setAttribute('style', 'display:none;');
-
- //if no options passed, show it works message
- this._showStarterMessage();
- }
-
-
-
-
- return this;
- },
-
- //Display Apache-like "It works" message if no options
- _showStarterMessage : function (){
- var starterMsg = document.createElement('div');
- starterMsg.setAttribute('id', 'starterMsg');
- starterMsg.innerHTML = "<h1>It Works</h1>";
- document.body.appendChild(starterMsg);
- },
-
- //Updates visible counter of how many assets are loaded
- _updateStatus : function (errorMsg) {
- var loaded = this._counters.loaded;
- var total = this._counters.total;
- var errors = this._counters.errors;
- this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
- "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
- if (errorMsg) {
- var liError = document.createElement('li');
- liError.innerHTML = errorMsg;
- var errorList = document.getElementById('errorList');
- errorList.appendChild(liError);
- }
- },
-
- //matches 2 letter country code then optionally
- //a dash or underscore followed by a country or language identifier
- //i currently only allow a language identifier 2-3 chars long
- _isValidLocale : function (locale) {
- var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
- return localeRegex.test(locale);
- },
-
- _normalizeLocale : function(locale) {
- var lang = "";
- var country = "";
- var divider = "";
-
- lang = locale.slice(0, 2).toLowerCase();
- divider = "_";
- country = locale.slice(3, 6).toUpperCase();
-
- return locale.length > 2 ? "" + lang + divider + country : lang;
- },
-
-
-
-});
-
-//Helper functions for creating assets
-Karma._isLocalized = function (boolLocalized) {
- if (typeof boolLocalized === "boolean" ) {
- if(boolLocalized === true &&
- Karma.locale === undefined){
- throw new Error("You cannot localize a media asset" +
- " if the global locale for Karma isn't set");
- } else {
- return boolLocalized;
- }
- } else if (typeof boolLocalized === undefined){
- return false;
- } else{
- throw new Error("This is not a valid value for the localized option");
- }
-};
-
-Karma._computeLocalePath = function(locale) {
- return Karma._assetPath + locale + "/";
-};
-
-
-
-
-Karma._makeCollection = function (configs, type){
- var makeAsset = function (config){
- var asset = undefined;
- var target = undefined;
- switch(type){
- case "image":
- target = Karma.kImage;
- break;
- case "audio":
- target = Karma.kAudio;
- break;
- case "video":
- target = Karma.kVideo;
- break;
- case "svg":
- target = Karma.kSvg;
- break;
- case "canvas":
- target = Karma.kCanvas;
- break;
- }
-
- asset = Karma.create(target)._init(config);
- Karma[type][config.name] = asset;
- };
-
- configs.forEach(function(config){ makeAsset(config);});
-};
-
-
-
-
-
-//Prototype objects for assets
-
-
-/** Prototype object for images
- * @class This object is the prototype for images submitted to Karma in the
- * Karma() method
- * @ throws {Error} if the image asset is set to be localized but
- * the global locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- * @example
- * kImage is the prototype object for images. This 'media' asset is loaded
- * in a distinctly different way from the canvas or svg assets.
- *
- */
-Karma.kImage =
- {
- /** file location of image
- * @type String
- * @default ""
- */
- file : "",
- /** media object
- * @type Image
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this image
- _localized : false,
- _type : "image",
- //initializes kImage instance with values provided by user
- _init : function (image) {
- image._localized = image._localized || false;
- Karma._counters.total++;
-
- if (image.name === undefined || image.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = image.name;
- this.file = image.file;
- }
-
- this.media = new Image();
-
- if(Karma._isLocalized(image._localized)){
- this._localized = image._localized;
- this._path = Karma._localePath + "image/";
- } else {
- this._path = Karma._assetPath + "image/";
- }
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the image is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
-
- that.media.addEventListener(
- "load",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
- }
-
-};
-
-/** Prototype object for audio files
- * @class This object is the prototype for audio files submitted to Karma in the
- * Karma() method
- * @ throws {Error} if the individual audio asset is set to be localized but
- * the globale locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- * @example
- * kAudio is the prototype object for audio
- * The audio assets are loaded in a distinctly different way
- * from the canvas or svg assets. They also have distinctly different
- * helper methods
- *
- * You initialize the kAudio assets by passing an array of objects
- */
-Karma.kAudio = {
- /** file location of asset
- * @type String
- * @default ""
- */
- file : "",
- /** Media object. You can access the src, autobuffer, autoplay, loop, and
- * controls attributes
- * via the media property of kAudio. Read more about the properties of the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#media-element-attributes">HTML 5 media element</a>
- * @type Audio
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this asset
- _localized : false,
- _type : "audio",
- //initializes kAudio instance with values provided by user
- _init : function (audio) {
- audio._localized = audio._localized || false;
- Karma._counters.total++;
-
- if (audio.name === undefined || audio.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = audio.name;
- this.file = audio.file;
- }
-
- this.media = new Audio();
-
- if(Karma._isLocalized(audio._localized)){
- this._localized = audio._localized;
- this._path = Karma._localePath + "audio/";
- } else {
- this._path = Karma._assetPath + "audio/";
- }
-
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
- this.media.autobuffer = true;
- this.media.load();
-
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the asset is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
- //'canplaythrough' event is a Browser Hack recommended by chromium devs
- //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
-
- that.media.addEventListener(
- "canplaythrough",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- },
- /** Plays the audio file */
- play : function () {
- this.media.play();
- }
-
-};
-
-/** NYI:Prototype object for Video files
- * @class Not Yet Implemented:This object is the prototype for video files submitted
- * to Karma in the Karma() method
- * @ throws {Error} if the individual video asset is set to be localized but
- * the globale locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- */
-Karma.kVideo = {
- /** file location of asset
- * @type String
- * @default ""
- */
- file : "",
- /** media object
- * @type Video
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this asset
- _localized : false,
- _type : "video",
- //initializes kVideo instance with values provided by user
- _init : function (video) {
- //Not Yet Implemented
- Karma._counters.errors++;
- throw new Error("Video is not Yet Implemented");
-
- video._localized = video._localized || false;
- Karma._counters.total++;
-
- if (video.name === undefined || video.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = video.name;
- this.file = video.file;
- }
-
- this.media = new Video();
-
- if(Karma._isLocalized(video._localized)){
- this._localized = video._localized;
- this._path = Karma._localePath + "video/";
- } else {
- this._path = Karma._assetPath + "video/";
- }
-
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the asset is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
- //'canplaythrough' event is a Browser Hack recommended by chromium devs
- //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
-
- that.media.addEventListener(
- "canplaythrough",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- }
-
-};
-
-
-
-/** Prototype object for each canvas element submitted to Karma in the
- * Karma() method
- * @throws {Error} if the name and domId for the canvas element are not specified
- * @thows {Error} if the supplied domId does not match an element in the DOM
- * @class This object is the prototype for each canvas element submitted to Karma in the
- * Karma() method
- */
-Karma.kCanvas = {
- /** Name of the canvas, used internally by karma.js
- * @type String
- * @default ''
- */
- name : '',
- /** Width of canvas element
- * @type Number
- * @default 0
- */
- width: 0,
- /** Height of canvas element
- * @type Number
- * @default 0
- */
- height: 0,
- /** Whether canvas is visible
- * @type boolean
- * @default true
- */
- visible: true,
- /** Element ID for canvas element in html document. This value is read-only
- * @type String
- * @default undefined
- */
- domId: undefined,
- /** Reference to the DOM element
- * @type DOMElement
- * @default undefined
- * @example
- * //You can access all properties and methods of the underlying DOM element
- * //using the 'node' property
- * Karma.canvas.someCanvas.node.dispatchEvent( ... some event ...);
- * var stuff = Karma.canvas.someCanvas.node.innerHTML;
- *
- */
- node: undefined,
- /** The 2 Dimensional Rendering context property for this canvas
- * @type 2DRenderingContext
- * @default undefined
- * @example
- * //Almost all of the context attributes and methods are wrapped in helper functions
- * //but you can also access them directly using the ctx property
- * Karma.canvas.someCanvas.ctx.drawImage(someImage, x, y);
- * Karma.canvas.someCanvas.ctx.fillStyle = "#ffffff";
- */
- ctx: undefined,
-
- //initializes object with values provides by user
- _init: function (config) {
- for (var option in config){
- if (config.hasOwnProperty(option)){
- switch (option){
- case "name":
- this.name = config[option];
- break;
- case "domId":
- this.domId = config[option];
- break;
- case "width":
- if(!this.height){
- throw new Error("If you specify a width you must also" +
- "specify a height");
- }
- this.width = config[option];
- break;
- case "height":
- if(!this.width){
- throw new Error("If you specify a height you must also" +
- "specify a width");
- }
- this.height = parseInt(config.option, 10);
- break;
- case "fps":
- this.fps = parseInt(config.option, 10);
- break;
- }
- }
- }
-
- if(this.domId && document.getElementById(this.domId)){
- this.node = document.getElementById(this.domId);
- this.ctx = this.node.getContext('2d');
- } else {
- throw new Error('you must specify a valid domId that' +
- 'is in your html page');
- }
-
- if(!config.height && !config.width){
- this.width = parseInt(this.node.getAttribute('width'), 10);
- this.height = parseInt(this.node.getAttribute('height'), 10);
- }
-
- return this;
- },
- /** Clear area of canvas element specified by parameters, if no
- * parameters supplied, clears entire canvas
- * @param {Number} [x=0] x coordinate, defaults to zero if left blank
- * @param {Number} [y=0] y coordinate, defaults to zero if left blank
- * @param {Number} [width=0] width of area to be cleared, defaults
- * entire width of canvas
- * @param {Number} [height=0] height of area to be cleared, defaults
- * entire height of canvas
- * @returns this
- * @example
- *
- * k.canvas.ninja.clear();
- * // clears the entire ninja canvas
- *
- * k.canvas.ninja.clear(0, 10, 20, 30);
- * //clears a specific portion of the ninja canvas
- *
- */
- clear : function ( x, y, width, height ) {
- var that = this;
- that.ctx.clearRect(
- x || 0,
- y || 0,
- width || that.width,
- height || that.height
- );
- return that;
- },
-
- /** The globalAlpha attribute gives an alpha value that is applied to shapes
- * and images before they are composited onto the canvas
- * @param {Number} number in the range from 0.0 to 1.0
- * @returns this
- */
- globalAlpha : function (attribute){
- var name = 'globalAlpha';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the globalCompositeOperation attribute, which sets how shapes and images
- * are drawn onto the existing bitmap, once they have had globalAlpha and the
- * current transformation matrix applied.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} globalCompositeOperation source-atop,
- * source-in, source-out,
- * source-over, destination-atop, destination-in, destination-out, destination-over,
- * lighter
- * @returns this
- */
- globalCompositeOperation: function (attribute){
- var name = ' globalCompositeOperation';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the lineWidth attribute which gives the width of lines, in coordinate space
- * units.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {Number} lineWidth
- * @returns this
- */
- lineWidth: function (attribute){
- var name = 'lineWidth';
- this.ctx[name] = attribute;
- return this;
- },
- /** The lineCap attribute defines the type of endings that UAs will place on
- * the end of lines.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} type butt, round, square
- * @returns this
- */
- lineCap: function (attribute){
- var name = 'lineCap';
- this.ctx[name] = attribute;
- return this;
- },
- /** The lineJoin attribute defines the type of corners that UAs will place
- * where two lines meet. The three valid values are bevel, round, and miter.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} type
- * @returns this
- */
- lineJoin: function (attribute){
- var name = 'lineJoin';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the miter limit
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {Number} number
- * @returns this
- */
- miterLimit: function (attribute){
- var name = 'miterLimit';
- this.ctx[name] = attribute;
- return this;
- },
- /** Sets the font property and takes the same syntax as setting the font property
- * in CSS
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String}
- * @returns this
- */
- font: function (attribute){
- var name = 'font';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Changes the text alignment. The possible values are start, end, left, right,
- * and center. The default is start. Other values are ignored.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {string} alignment
- * @returns this
- */
- textAlign: function (attribute){
- var name = 'textAlign';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Changes the baseline alignment. If the value is one of top, hanging, middle,
- * alphabetic, ideographic, or bottom, then the value must be changed to the new value.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} alignment
- * @returns this
- */
- textBaseline: function (attribute){
- var name = 'textBaseline';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Save the current state of the context
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- save : function ( ){
- var name = 'save';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Restore the saved context
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- restore : function ( ){
- var name = 'restore';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Perform a scale transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- scale : function ( ){
- var name = 'scale';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Perform a rotation transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- rotate : function ( ){
- var name = 'rotate';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Performa a translation transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- translate : function ( ){
- var name = 'translate';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Transform the identity matrix
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- transform : function ( ){
- var name = 'transform';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Set the transform
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- setTransform : function ( ){
- var name = 'setTransform';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Clear a rectangular area
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- clearRect : function ( ){
- var name = 'clearRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Fill a rectangular area
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillRect : function ( ){
- var name = 'fillRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Draw the outline of the rectangle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeRect : function ( ){
- var name = 'strokeRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Begin a path
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- beginPath : function ( ){
- var name = 'beginPath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** End a path
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- closePath : function ( ){
- var name = 'closePath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Move to specified coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- moveTo : function ( ){
- var name = 'moveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
-
- /** Draw a line to the given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- lineTo : function ( ){
- var name = 'lineTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Draw a quadratic curve to given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- quadraticCurveTo : function ( ){
- var name = 'quadraticCurveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Draw a bezier curve to given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- bezierCurveTo : function ( ){
- var name = 'bezierCurveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Draw an arc to the given points
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- arcTo : function ( ){
- var name = 'arcTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Create an arc
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- arc : function ( ){
- var name = 'arc';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Create a rectangle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- rect : function ( ){
- var name = 'rect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** fill in the current subpaths with the current fillstyle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fill : function ( ){
- var name = 'fill';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Stroke the subpaths
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- stroke : function ( ){
- var name = 'stroke';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- clip : function ( ){
- var name = 'clip';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillText : function ( ){
- var name = 'fillText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeText : function ( ){
- var name = 'strokeText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- measureText : function ( ){
- var name = 'measureText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- isPointInPath : function ( ){
- var name = 'isPointInPath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Sets the stroke style
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeStyle: function (attribute){
- var name = 'strokeStyle';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the fill style
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillStyle: function (attribute){
- var name = 'fillStyle';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createLinearGradient : function ( ){
- var name = 'createLinearGradient';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createRadialGradient : function ( ){
- var name = 'createRadialGradient';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createPattern : function ( ){
- var name = 'createPattern';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowOffsetX: function (attribute){
- var name = 'shadowOffsetX';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowOffsetY: function (attribute){
- var name = 'shadowOffsetY';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowBlur: function (attribute){
- var name = 'shadowBlur';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowColor: function (attribute){
- var name = 'shadowColor';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- drawImage : function ( ){
- var name = 'drawImage';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- getImageData : function ( ){
- var name = 'getImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- putImageData : function ( ){
- var name = 'putImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createImageData : function ( ){
- var name = 'createImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- drawWindow : function ( ){
- var name = 'drawWindow';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
-
-
-
-};
-
-
-/** Prototype object for each svg element submitted to Karma in the
- * Karma() method
- * @throws {Error} if the name and domId for the svg element are not specified
- * @thows {Error} if the supplied domId does not match an element in the DOM
- * @class This object is the prototype for each svg element submitted to Karma in the
- * Karma() method
- */
-Karma.kSvg = {
- /** name of instance, used internally
- * @typeof string
- * @default ""
- */
- name : "",
- /** width of element
- * @type number
- * @default 0
- */
- width: 0,
- /** height of element
- * @type number
- * @default 0
- */
- height: 0,
- /** Status of element, either "loaded" or "error"
- * @type string
- * @default ""
- */
- status: "",
- /** Whether canvas is visible. This value is read-only
- * @type boolean
- * @default true
- */
- visible: true,
- /** Element ID for canvas element in html document.
- * @type String
- * @default undefined
- */
- domId: undefined,
- /** Reference to the DOM element.
- * @type DOMElement
- * @default undefined
- * @example
- * //You can access all properties and methods of the underlying DOM element
- * //using the 'node' property
- * Karma.svg.someSvg.node.dispatchEvent;
- * Karma.svg.someSvg.node.addEvenListener(...);
- */
- node: undefined,
- /** Reference to the SVGDocument. You can use the this.doc to manipulate
- * the SVG document
- * @type SVGDocument
- * @default undefined
- * @example
- * var myElem = Karma.svg.someSvg.doc.getElementById('foobar');
- * Karma.svg.someSvg.doc.createElement(...);
- * Karma.svg.someSvg.doc.removeChild(someNode);
- *
- */
- doc: undefined,
- /** Reference to the root element of the SVG Document
- * @type DocumentElement
- * @default undefined
- * @example
- * // The root element is equivalent to "document" in a regular html document
- * // The root attribute is used frequently with the jQuery SVG plugin for CSS selectors
- * $('#someId', Karma.svg.someSvg.root).css(.. manipulate css attributes ...);
- */
- root: undefined,
- _localized : undefined,
- _init: function (config) {
- Karma._counters.total++;
-
- for (var option in config){
- if (config.hasOwnProperty(option)){
- switch (option){
- case "name":
- this.name = config[option];
- break;
- case "domId":
- this.domId = config[option];
- break;
- case "width":
- if(!this.height){
- throw new Error("If you specify a width you must also" +
- "specify a height");
- }
- this.width = parseInt(config[option], 10);
- break;
- case "height":
- if(!this.width){
- throw new Error("If you specify a height you must also" +
- "specify a width");
- }
- this.height = config[option];
- break;
- }
- }
- }
-
- if(this.domId && document.getElementById(this.domId)){
- this.node = document.getElementById(this.domId);
- } else {
- throw new Error('you must specify a valid domId that' +
- 'is in your html page');
- }
-
- if(!config.height && !config.width){
- this.width = parseInt(this.node.getAttribute('width'), 10);
- this.height = parseInt(this.node.getAttribute('height'), 10);
- }
-
- var that = this;
- that._addEventHandlers();
-
- return this;
-
-
- },
- _addEventHandlers : function () {
- var that = this;
- that.doc = that.node.getSVGDocument();
- that.node.addEventListener(
- "load",
- function (e) {
- that.doc = that.node.getSVGDocument();
- that.root = that.doc.documentElement;
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";
- }, false);
-
- that.node.addEventListener(
- "error",
- function (e) {
- Karma._counters.loaded--;
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.node.addEventListener(
- "abort",
- function (e) {
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- }
-};
diff --git a/content/Explore/js/menu.js b/content/Explore/js/menu.js
deleted file mode 100755
index 65984f1..0000000
--- a/content/Explore/js/menu.js
+++ /dev/null
@@ -1,186 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma();
-
- k.ready(function() {
-
- activities;
-
- k.ready(function(){
-
- //game logic
-
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 5;
- var rows = 2 + (activities.length / cells);
- var maxx = 1100;
- var cellsize = 64;
- var maxy = rows * 2 * cellsize;
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 1.7 * cellsize;
- var ystart = maxy - cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
-
-/*
- response to left-click
-*/
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX
- y = $e.pageY
- $.each(acts, function() {
- xy = this;
- if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2]) && (y > xy[2] - cellsize) ) {
- window.location = xy[4] + '.html';
- };
- });
- });
-/*
- draw screen
-*/
-
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- ctx.beginPath();
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {
- break;
- };
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if (activity < activities.length){
- ctx.strokeRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.strokeRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.strokeRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) &&
- (activity < activities.length)) {
- if (row % 2 == 0) {
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.stroke();
- } else {
- x = xstart;
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.stroke();
- }
- }
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta;
- }
- }
-
- function drawarrow(x,y,sz) {
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- };
-
- function drawlogo(x, y, activity) {
- id = activities[activity][0];
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls];
- sz = cellsize
- if (id == 0){
- // draw milestone
- ctx.moveTo(x,y);
- ctx.lineTo(x,y-sz);
- ctx.moveTo(x+sz, y-sz);
- ctx.lineTo(x+sz, y);
- ctx.moveTo(x, y-sz);
- ctx.arc(x+0.5*sz,y-sz,0.5*sz,Math.PI,0,0);
- ctx.fillText(ix, x + (sz * 0.3), y-(sz * 0.4), sz);
- ctx.stroke();
- } else {
- // draw logo
- ctx.moveTo(x,y);
- ctx.lineTo(x,y-sz);
- ctx.strokeRect(x,y-sz,sz, sz/2);
- ctx.textAlign = 'center';
- ctx.font = '20pt Arial';
- ctx.fillText(ix,x+sz/2,y-sz/2-10,sz);
- };
- }
- }
-
- draw();
-
- });
- });
-
-});
diff --git a/content/Explore/js/qunit.js b/content/Explore/js/qunit.js
deleted file mode 100755
index b7ee538..0000000
--- a/content/Explore/js/qunit.js
+++ /dev/null
@@ -1,1027 +0,0 @@
-/*
- * QUnit - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2009 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- */
-
-(function(window) {
-
-var QUnit = {
-
- // Initialize the configuration options
- init: function() {
- config = {
- stats: { all: 0, bad: 0 },
- moduleStats: { all: 0, bad: 0 },
- started: +new Date,
- blocking: false,
- autorun: false,
- assertions: [],
- filters: [],
- queue: []
- };
-
- var tests = id("qunit-tests"),
- banner = id("qunit-banner"),
- result = id("qunit-testresult");
-
- if ( tests ) {
- tests.innerHTML = "";
- }
-
- if ( banner ) {
- banner.className = "";
- }
-
- if ( result ) {
- result.parentNode.removeChild( result );
- }
- },
-
- // call on start of module test to prepend name to all tests
- module: function(name, testEnvironment) {
- config.currentModule = name;
-
- synchronize(function() {
- if ( config.currentModule ) {
- QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
- }
-
- config.currentModule = name;
- config.moduleTestEnvironment = testEnvironment;
- config.moduleStats = { all: 0, bad: 0 };
-
- QUnit.moduleStart( name, testEnvironment );
- });
- },
-
- asyncTest: function(testName, expected, callback) {
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = 0;
- }
-
- QUnit.test(testName, expected, callback, true);
- },
-
- test: function(testName, expected, callback, async) {
- var name = testName, testEnvironment, testEnvironmentArg;
-
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = null;
- }
- // is 2nd argument a testEnvironment?
- if ( expected && typeof expected === 'object') {
- testEnvironmentArg = expected;
- expected = null;
- }
-
- if ( config.currentModule ) {
- name = config.currentModule + " module: " + name;
- }
-
- if ( !validTest(name) ) {
- return;
- }
-
- synchronize(function() {
- QUnit.testStart( testName );
-
- testEnvironment = extend({
- setup: function() {},
- teardown: function() {}
- }, config.moduleTestEnvironment);
- if (testEnvironmentArg) {
- extend(testEnvironment,testEnvironmentArg);
- }
-
- // allow utility functions to access the current test environment
- QUnit.current_testEnvironment = testEnvironment;
-
- config.assertions = [];
- config.expected = null;
-
- if ( arguments.length >= 3 ) {
- config.expected = callback;
- callback = arguments[2];
- }
-
- try {
- if ( !config.pollution ) {
- saveGlobal();
- }
-
- testEnvironment.setup.call(testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Setup failed on " + name + ": " + e.message );
- }
-
- if ( async ) {
- QUnit.stop();
- }
-
- try {
- callback.call(testEnvironment);
- } catch(e) {
- fail("Test " + name + " died, exception and test follows", e, callback);
- QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message );
- // else next test will carry the responsibility
- saveGlobal();
-
- // Restart the tests if they're blocking
- if ( config.blocking ) {
- start();
- }
- }
- });
-
- synchronize(function() {
- try {
- checkPollution();
- testEnvironment.teardown.call(testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Teardown failed on " + name + ": " + e.message );
- }
-
- try {
- QUnit.reset();
- } catch(e) {
- fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset);
- }
-
- if ( config.expected && config.expected != config.assertions.length ) {
- QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" );
- }
-
- var good = 0, bad = 0,
- tests = id("qunit-tests");
-
- config.stats.all += config.assertions.length;
- config.moduleStats.all += config.assertions.length;
-
- if ( tests ) {
- var ol = document.createElement("ol");
- ol.style.display = "none";
-
- for ( var i = 0; i < config.assertions.length; i++ ) {
- var assertion = config.assertions[i];
-
- var li = document.createElement("li");
- li.className = assertion.result ? "pass" : "fail";
- li.innerHTML = assertion.message || "(no message)";
- ol.appendChild( li );
-
- if ( assertion.result ) {
- good++;
- } else {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
-
- var b = document.createElement("strong");
- b.innerHTML = name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>";
-
- addEvent(b, "click", function() {
- var next = b.nextSibling, display = next.style.display;
- next.style.display = display === "none" ? "block" : "none";
- });
-
- addEvent(b, "dblclick", function(e) {
- var target = (e || window.event).target;
- if ( target.nodeName.toLowerCase() === "strong" ) {
- var text = "", node = target.firstChild;
-
- while ( node.nodeType === 3 ) {
- text += node.nodeValue;
- node = node.nextSibling;
- }
-
- text = text.replace(/(^\s*|\s*$)/g, "");
-
- if ( window.location ) {
- window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text);
- }
- }
- });
-
- var li = document.createElement("li");
- li.className = bad ? "fail" : "pass";
- li.appendChild( b );
- li.appendChild( ol );
- tests.appendChild( li );
-
- if ( bad ) {
- var toolbar = id("qunit-testrunner-toolbar");
- if ( toolbar ) {
- toolbar.style.display = "block";
- id("qunit-filter-pass").disabled = null;
- id("qunit-filter-missing").disabled = null;
- }
- }
-
- } else {
- for ( var i = 0; i < config.assertions.length; i++ ) {
- if ( !config.assertions[i].result ) {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
- }
-
- QUnit.testDone( testName, bad, config.assertions.length );
-
- if ( !window.setTimeout && !config.queue.length ) {
- done();
- }
- });
-
- if ( window.setTimeout && !config.doneTimer ) {
- config.doneTimer = window.setTimeout(function(){
- if ( !config.queue.length ) {
- done();
- } else {
- synchronize( done );
- }
- }, 13);
- }
- },
-
- /**
- * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
- */
- expect: function(asserts) {
- config.expected = asserts;
- },
-
- /**
- * Asserts true.
- * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
- */
- ok: function(a, msg) {
- QUnit.log(a, msg);
-
- config.assertions.push({
- result: !!a,
- message: msg
- });
- },
-
- /**
- * Checks that the first two arguments are equal, with an optional message.
- * Prints out both actual and expected values.
- *
- * Prefered to ok( actual == expected, message )
- *
- * @example equals( format("Received {0} bytes.", 2), "Received 2 bytes." );
- *
- * @param Object actual
- * @param Object expected
- * @param String message (optional)
- */
- equals: function(actual, expected, message) {
- push(expected == actual, actual, expected, message);
- },
-
- same: function(a, b, message) {
- push(QUnit.equiv(a, b), a, b, message);
- },
-
- start: function() {
- // A slight delay, to avoid any current callbacks
- if ( window.setTimeout ) {
- window.setTimeout(function() {
- if ( config.timeout ) {
- clearTimeout(config.timeout);
- }
-
- config.blocking = false;
- process();
- }, 13);
- } else {
- config.blocking = false;
- process();
- }
- },
-
- stop: function(timeout) {
- config.blocking = true;
-
- if ( timeout && window.setTimeout ) {
- config.timeout = window.setTimeout(function() {
- QUnit.ok( false, "Test timed out" );
- QUnit.start();
- }, timeout);
- }
- },
-
- /**
- * Resets the test setup. Useful for tests that modify the DOM.
- */
- reset: function() {
- if ( window.jQuery ) {
- jQuery("#main").html( config.fixture );
- jQuery.event.global = {};
- jQuery.ajaxSettings = extend({}, config.ajaxSettings);
- }
- },
-
- /**
- * Trigger an event on an element.
- *
- * @example triggerEvent( document.body, "click" );
- *
- * @param DOMElement elem
- * @param String type
- */
- triggerEvent: function( elem, type, event ) {
- if ( document.createEvent ) {
- event = document.createEvent("MouseEvents");
- event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- elem.dispatchEvent( event );
-
- } else if ( elem.fireEvent ) {
- elem.fireEvent("on"+type);
- }
- },
-
- // Safe object type checking
- is: function( type, obj ) {
- return Object.prototype.toString.call( obj ) === "[object "+ type +"]";
- },
-
- // Logging callbacks
- done: function(failures, total) {},
- log: function(result, message) {},
- testStart: function(name) {},
- testDone: function(name, failures, total) {},
- moduleStart: function(name, testEnvironment) {},
- moduleDone: function(name, failures, total) {}
-};
-
-// Maintain internal state
-var config = {
- // The queue of tests to run
- queue: [],
-
- // block until document ready
- blocking: true
-};
-
-// Load paramaters
-(function() {
- var location = window.location || { search: "", protocol: "file:" },
- GETParams = location.search.slice(1).split('&');
-
- for ( var i = 0; i < GETParams.length; i++ ) {
- GETParams[i] = decodeURIComponent( GETParams[i] );
- if ( GETParams[i] === "noglobals" ) {
- GETParams.splice( i, 1 );
- i--;
- config.noglobals = true;
- } else if ( GETParams[i].search('=') > -1 ) {
- GETParams.splice( i, 1 );
- i--;
- }
- }
-
- // restrict modules/tests by get parameters
- config.filters = GETParams;
-
- // Figure out if we're running the tests from a server or not
- QUnit.isLocal = !!(location.protocol === 'file:');
-})();
-
-// Expose the API as global variables, unless an 'exports'
-// object exists, in that case we assume we're in CommonJS
-if ( typeof exports === "undefined" || typeof require === "undefined" ) {
- extend(window, QUnit);
- window.QUnit = QUnit;
-} else {
- extend(exports, QUnit);
- exports.QUnit = QUnit;
-}
-
-if ( typeof document === "undefined" || document.readyState === "complete" ) {
- config.autorun = true;
-}
-
-addEvent(window, "load", function() {
- // Initialize the config, saving the execution queue
- var oldconfig = extend({}, config);
- QUnit.init();
- extend(config, oldconfig);
-
- config.blocking = false;
-
- var userAgent = id("qunit-userAgent");
- if ( userAgent ) {
- userAgent.innerHTML = navigator.userAgent;
- }
-
- var toolbar = id("qunit-testrunner-toolbar");
- if ( toolbar ) {
- toolbar.style.display = "none";
-
- var filter = document.createElement("input");
- filter.type = "checkbox";
- filter.id = "qunit-filter-pass";
- filter.disabled = true;
- addEvent( filter, "click", function() {
- var li = document.getElementsByTagName("li");
- for ( var i = 0; i < li.length; i++ ) {
- if ( li[i].className.indexOf("pass") > -1 ) {
- li[i].style.display = filter.checked ? "none" : "block";
- }
- }
- });
- toolbar.appendChild( filter );
-
- var label = document.createElement("label");
- label.setAttribute("for", "qunit-filter-pass");
- label.innerHTML = "Hide passed tests";
- toolbar.appendChild( label );
-
- var missing = document.createElement("input");
- missing.type = "checkbox";
- missing.id = "qunit-filter-missing";
- missing.disabled = true;
- addEvent( missing, "click", function() {
- var li = document.getElementsByTagName("li");
- for ( var i = 0; i < li.length; i++ ) {
- if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) {
- li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block";
- }
- }
- });
- toolbar.appendChild( missing );
-
- label = document.createElement("label");
- label.setAttribute("for", "qunit-filter-missing");
- label.innerHTML = "Hide missing tests (untested code is broken code)";
- toolbar.appendChild( label );
- }
-
- var main = id('main');
- if ( main ) {
- config.fixture = main.innerHTML;
- }
-
- if ( window.jQuery ) {
- config.ajaxSettings = window.jQuery.ajaxSettings;
- }
-
- QUnit.start();
-});
-
-function done() {
- if ( config.doneTimer && window.clearTimeout ) {
- window.clearTimeout( config.doneTimer );
- config.doneTimer = null;
- }
-
- if ( config.queue.length ) {
- config.doneTimer = window.setTimeout(function(){
- if ( !config.queue.length ) {
- done();
- } else {
- synchronize( done );
- }
- }, 13);
-
- return;
- }
-
- config.autorun = true;
-
- // Log the last module results
- if ( config.currentModule ) {
- QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
- }
-
- var banner = id("qunit-banner"),
- tests = id("qunit-tests"),
- html = ['Tests completed in ',
- +new Date - config.started, ' milliseconds.<br/>',
- '<span class="bad">', config.stats.all - config.stats.bad, '</span> tests of <span class="all">', config.stats.all, '</span> passed, ', config.stats.bad,' failed.'].join('');
-
- if ( banner ) {
- banner.className += " " + (config.stats.bad ? "fail" : "pass");
- }
-
- if ( tests ) {
- var result = id("qunit-testresult");
-
- if ( !result ) {
- result = document.createElement("p");
- result.id = "qunit-testresult";
- result.className = "result";
- tests.parentNode.insertBefore( result, tests.nextSibling );
- }
-
- result.innerHTML = html;
- }
-
- QUnit.done( config.stats.bad, config.stats.all );
-}
-
-function validTest( name ) {
- var i = config.filters.length,
- run = false;
-
- if ( !i ) {
- return true;
- }
-
- while ( i-- ) {
- var filter = config.filters[i],
- not = filter.charAt(0) == '!';
-
- if ( not ) {
- filter = filter.slice(1);
- }
-
- if ( name.indexOf(filter) !== -1 ) {
- return !not;
- }
-
- if ( not ) {
- run = true;
- }
- }
-
- return run;
-}
-
-function push(result, actual, expected, message) {
- message = message || (result ? "okay" : "failed");
- QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
-}
-
-function synchronize( callback ) {
- config.queue.push( callback );
-
- if ( config.autorun && !config.blocking ) {
- process();
- }
-}
-
-function process() {
- while ( config.queue.length && !config.blocking ) {
- config.queue.shift()();
- }
-}
-
-function saveGlobal() {
- config.pollution = [];
-
- if ( config.noglobals ) {
- for ( var key in window ) {
- config.pollution.push( key );
- }
- }
-}
-
-function checkPollution( name ) {
- var old = config.pollution;
- saveGlobal();
-
- var newGlobals = diff( old, config.pollution );
- if ( newGlobals.length > 0 ) {
- ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
- config.expected++;
- }
-
- var deletedGlobals = diff( config.pollution, old );
- if ( deletedGlobals.length > 0 ) {
- ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
- config.expected++;
- }
-}
-
-// returns a new Array with the elements that are in a but not in b
-function diff( a, b ) {
- var result = a.slice();
- for ( var i = 0; i < result.length; i++ ) {
- for ( var j = 0; j < b.length; j++ ) {
- if ( result[i] === b[j] ) {
- result.splice(i, 1);
- i--;
- break;
- }
- }
- }
- return result;
-}
-
-function fail(message, exception, callback) {
- if ( typeof console !== "undefined" && console.error && console.warn ) {
- console.error(message);
- console.error(exception);
- console.warn(callback.toString());
-
- } else if ( window.opera && opera.postError ) {
- opera.postError(message, exception, callback.toString);
- }
-}
-
-function extend(a, b) {
- for ( var prop in b ) {
- a[prop] = b[prop];
- }
-
- return a;
-}
-
-function addEvent(elem, type, fn) {
- if ( elem.addEventListener ) {
- elem.addEventListener( type, fn, false );
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, fn );
- } else {
- fn();
- }
-}
-
-function id(name) {
- return !!(typeof document !== "undefined" && document && document.getElementById) &&
- document.getElementById( name );
-}
-
-// Test for equality any JavaScript type.
-// Discussions and reference: http://philrathe.com/articles/equiv
-// Test suites: http://philrathe.com/tests/equiv
-// Author: Philippe Rathé <prathe@gmail.com>
-QUnit.equiv = function () {
-
- var innerEquiv; // the real equiv function
- var callers = []; // stack to decide between skip/abort functions
-
-
- // Determine what is o.
- function hoozit(o) {
- if (QUnit.is("String", o)) {
- return "string";
-
- } else if (QUnit.is("Boolean", o)) {
- return "boolean";
-
- } else if (QUnit.is("Number", o)) {
-
- if (isNaN(o)) {
- return "nan";
- } else {
- return "number";
- }
-
- } else if (typeof o === "undefined") {
- return "undefined";
-
- // consider: typeof null === object
- } else if (o === null) {
- return "null";
-
- // consider: typeof [] === object
- } else if (QUnit.is( "Array", o)) {
- return "array";
-
- // consider: typeof new Date() === object
- } else if (QUnit.is( "Date", o)) {
- return "date";
-
- // consider: /./ instanceof Object;
- // /./ instanceof RegExp;
- // typeof /./ === "function"; // => false in IE and Opera,
- // true in FF and Safari
- } else if (QUnit.is( "RegExp", o)) {
- return "regexp";
-
- } else if (typeof o === "object") {
- return "object";
-
- } else if (QUnit.is( "Function", o)) {
- return "function";
- } else {
- return undefined;
- }
- }
-
- // Call the o related callback with the given arguments.
- function bindCallbacks(o, callbacks, args) {
- var prop = hoozit(o);
- if (prop) {
- if (hoozit(callbacks[prop]) === "function") {
- return callbacks[prop].apply(callbacks, args);
- } else {
- return callbacks[prop]; // or undefined
- }
- }
- }
-
- var callbacks = function () {
-
- // for string, boolean, number and null
- function useStrictEquality(b, a) {
- if (b instanceof a.constructor || a instanceof b.constructor) {
- // to catch short annotaion VS 'new' annotation of a declaration
- // e.g. var i = 1;
- // var j = new Number(1);
- return a == b;
- } else {
- return a === b;
- }
- }
-
- return {
- "string": useStrictEquality,
- "boolean": useStrictEquality,
- "number": useStrictEquality,
- "null": useStrictEquality,
- "undefined": useStrictEquality,
-
- "nan": function (b) {
- return isNaN(b);
- },
-
- "date": function (b, a) {
- return hoozit(b) === "date" && a.valueOf() === b.valueOf();
- },
-
- "regexp": function (b, a) {
- return hoozit(b) === "regexp" &&
- a.source === b.source && // the regex itself
- a.global === b.global && // and its modifers (gmi) ...
- a.ignoreCase === b.ignoreCase &&
- a.multiline === b.multiline;
- },
-
- // - skip when the property is a method of an instance (OOP)
- // - abort otherwise,
- // initial === would have catch identical references anyway
- "function": function () {
- var caller = callers[callers.length - 1];
- return caller !== Object &&
- typeof caller !== "undefined";
- },
-
- "array": function (b, a) {
- var i;
- var len;
-
- // b could be an object literal here
- if ( ! (hoozit(b) === "array")) {
- return false;
- }
-
- len = a.length;
- if (len !== b.length) { // safe and faster
- return false;
- }
- for (i = 0; i < len; i++) {
- if ( ! innerEquiv(a[i], b[i])) {
- return false;
- }
- }
- return true;
- },
-
- "object": function (b, a) {
- var i;
- var eq = true; // unless we can proove it
- var aProperties = [], bProperties = []; // collection of strings
-
- // comparing constructors is more strict than using instanceof
- if ( a.constructor !== b.constructor) {
- return false;
- }
-
- // stack constructor before traversing properties
- callers.push(a.constructor);
-
- for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
-
- aProperties.push(i); // collect a's properties
-
- if ( ! innerEquiv(a[i], b[i])) {
- eq = false;
- }
- }
-
- callers.pop(); // unstack, we are done
-
- for (i in b) {
- bProperties.push(i); // collect b's properties
- }
-
- // Ensures identical properties name
- return eq && innerEquiv(aProperties.sort(), bProperties.sort());
- }
- };
- }();
-
- innerEquiv = function () { // can take multiple arguments
- var args = Array.prototype.slice.apply(arguments);
- if (args.length < 2) {
- return true; // end transition
- }
-
- return (function (a, b) {
- if (a === b) {
- return true; // catch the most you can
- } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) {
- return false; // don't lose time with error prone cases
- } else {
- return bindCallbacks(a, callbacks, [b, a]);
- }
-
- // apply transition with (1..n) arguments
- })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
- };
-
- return innerEquiv;
-
-}();
-
-/**
- * jsDump
- * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
- * Date: 5/15/2008
- * @projectDescription Advanced and extensible data dumping for Javascript.
- * @version 1.0.0
- * @author Ariel Flesler
- * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
- */
-QUnit.jsDump = (function() {
- function quote( str ) {
- return '"' + str.toString().replace(/"/g, '\\"') + '"';
- };
- function literal( o ) {
- return o + '';
- };
- function join( pre, arr, post ) {
- var s = jsDump.separator(),
- base = jsDump.indent(),
- inner = jsDump.indent(1);
- if ( arr.join )
- arr = arr.join( ',' + s + inner );
- if ( !arr )
- return pre + post;
- return [ pre, inner + arr, base + post ].join(s);
- };
- function array( arr ) {
- var i = arr.length, ret = Array(i);
- this.up();
- while ( i-- )
- ret[i] = this.parse( arr[i] );
- this.down();
- return join( '[', ret, ']' );
- };
-
- var reName = /^function (\w+)/;
-
- var jsDump = {
- parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
- var parser = this.parsers[ type || this.typeOf(obj) ];
- type = typeof parser;
-
- return type == 'function' ? parser.call( this, obj ) :
- type == 'string' ? parser :
- this.parsers.error;
- },
- typeOf:function( obj ) {
- var type;
- if ( obj === null ) {
- type = "null";
- } else if (typeof obj === "undefined") {
- type = "undefined";
- } else if (QUnit.is("RegExp", obj)) {
- type = "regexp";
- } else if (QUnit.is("Date", obj)) {
- type = "date";
- } else if (QUnit.is("Function", obj)) {
- type = "function";
- } else if (QUnit.is("Array", obj)) {
- type = "array";
- } else if (QUnit.is("Window", obj) || QUnit.is("global", obj)) {
- type = "window";
- } else if (QUnit.is("HTMLDocument", obj)) {
- type = "document";
- } else if (QUnit.is("HTMLCollection", obj) || QUnit.is("NodeList", obj)) {
- type = "nodelist";
- } else if (/^\[object HTML/.test(Object.prototype.toString.call( obj ))) {
- type = "node";
- } else {
- type = typeof obj;
- }
- return type;
- },
- separator:function() {
- return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
- },
- indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
- if ( !this.multiline )
- return '';
- var chr = this.indentChar;
- if ( this.HTML )
- chr = chr.replace(/\t/g,' ').replace(/ /g,'&nbsp;');
- return Array( this._depth_ + (extra||0) ).join(chr);
- },
- up:function( a ) {
- this._depth_ += a || 1;
- },
- down:function( a ) {
- this._depth_ -= a || 1;
- },
- setParser:function( name, parser ) {
- this.parsers[name] = parser;
- },
- // The next 3 are exposed so you can use them
- quote:quote,
- literal:literal,
- join:join,
- //
- _depth_: 1,
- // This is the list of parsers, to modify them, use jsDump.setParser
- parsers:{
- window: '[Window]',
- document: '[Document]',
- error:'[ERROR]', //when no parser is found, shouldn't happen
- unknown: '[Unknown]',
- 'null':'null',
- undefined:'undefined',
- 'function':function( fn ) {
- var ret = 'function',
- name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
- if ( name )
- ret += ' ' + name;
- ret += '(';
-
- ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
- return join( ret, this.parse(fn,'functionCode'), '}' );
- },
- array: array,
- nodelist: array,
- arguments: array,
- object:function( map ) {
- var ret = [ ];
- this.up();
- for ( var key in map )
- ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
- this.down();
- return join( '{', ret, '}' );
- },
- node:function( node ) {
- var open = this.HTML ? '&lt;' : '<',
- close = this.HTML ? '&gt;' : '>';
-
- var tag = node.nodeName.toLowerCase(),
- ret = open + tag;
-
- for ( var a in this.DOMAttrs ) {
- var val = node[this.DOMAttrs[a]];
- if ( val )
- ret += ' ' + a + '=' + this.parse( val, 'attribute' );
- }
- return ret + close + open + '/' + tag + close;
- },
- functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
- var l = fn.length;
- if ( !l ) return '';
-
- var args = Array(l);
- while ( l-- )
- args[l] = String.fromCharCode(97+l);//97 is 'a'
- return ' ' + args.join(', ') + ' ';
- },
- key:quote, //object calls it internally, the key part of an item in a map
- functionCode:'[code]', //function calls it internally, it's the content of the function
- attribute:quote, //node calls it internally, it's an html attribute value
- string:quote,
- date:quote,
- regexp:literal, //regex
- number:literal,
- 'boolean':literal
- },
- DOMAttrs:{//attributes to dump from nodes, name=>realName
- id:'id',
- name:'name',
- 'class':'className'
- },
- HTML:true,//if true, entities are escaped ( <, >, \t, space and \n )
- indentChar:' ',//indentation unit
- multiline:true //if true, items in a collection, are separated by a \n, else just a space.
- };
-
- return jsDump;
-})();
-
-})(this);
diff --git a/content/Explore/js/raphael-min.js b/content/Explore/js/raphael-min.js
deleted file mode 100755
index eac42bb..0000000
--- a/content/Explore/js/raphael-min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Raphael 1.0 RC1.4 - JavaScript Vector Library
- *
- * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
- */
-window.Raphael=(function(){var Y=/[, ]+/,g=document,L=window,P={was:"Raphael" in window,is:window.Raphael},f=function(){return l.apply(f,arguments);},b={},q={"clip-rect":"0 0 10e9 10e9",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},u={"clip-rect":"csv",cx:"number",cy:"number",fill:"colour","fill-opacity":"number","font-size":"number",height:"number",opacity:"number",path:"path",r:"number",rotation:"csv",rx:"number",ry:"number",scale:"csv",stroke:"colour","stroke-opacity":"number","stroke-width":"number",translation:"csv",width:"number",x:"number",y:"number"},v=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup"];f.version="1.0 RC1.4";f.type=(window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML");f.svg=!(f.vml=f.type=="VML");f.idGenerator=0;f.fn={};f.is=function(i,e){e=(e+"").toLowerCase();if(e=="undefined"&&typeof i=="undefined"){return true;}if(i==null&&e=="null"){return true;}return Object.prototype.toString.call(i).replace(/^\[object\s+|\]$/gi,"").toLowerCase()==e;};f.setWindow=function(e){L=e;g=L.document;};f.hsb2rgb=X(function(af,ad,aj){if(f.is(af,"object")&&"h" in af&&"s" in af&&"b" in af){aj=af.b;ad=af.s;af=af.h;}var aa,ab,ak;if(aj==0){return{r:0,g:0,b:0,hex:"#000"};}if(af>1||ad>1||aj>1){af/=255;ad/=255;aj/=255;}var ac=Math.floor(af*6),ag=(af*6)-ac,Z=aj*(1-ad),R=aj*(1-(ad*ag)),al=aj*(1-(ad*(1-ag)));aa=[aj,R,Z,Z,al,aj,aj][ac];ab=[al,aj,aj,R,Z,Z,al][ac];ak=[Z,Z,al,aj,aj,R,Z][ac];aa*=255;ab*=255;ak*=255;var ah={r:aa,g:ab,b:ak},e=Math.round(aa).toString(16),ae=Math.round(ab).toString(16),ai=Math.round(ak).toString(16);if(e.length==1){e="0"+e;}if(ae.length==1){ae="0"+ae;}if(ai.length==1){ai="0"+ai;}ah.hex="#"+e+ae+ai;return ah;},f);f.rgb2hsb=X(function(e,i,ad){if(f.is(e,"object")&&"r" in e&&"g" in e&&"b" in e){ad=e.b;i=e.g;e=e.r;}if(f.is(e,"string")){var af=f.getRGB(e);e=af.r;i=af.g;ad=af.b;}if(e>1||i>1||ad>1){e/=255;i/=255;ad/=255;}var ac=Math.max(e,i,ad),R=Math.min(e,i,ad),aa,Z,ab=ac;if(R==ac){return{h:0,s:0,b:ac};}else{var ae=(ac-R);Z=ae/ac;if(e==ac){aa=(i-ad)/ae;}else{if(i==ac){aa=2+((ad-e)/ae);}else{aa=4+((e-i)/ae);}}aa/=6;if(aa<0){aa+=1;}if(aa>1){aa-=1;}}return{h:aa,s:Z,b:ab};},f);f._path2string=function(){var Z="",ac;for(var R=0,aa=this.length;R<aa;R++){for(var e=0,ab=this[R].length;e<ab;e++){Z+=this[R][e];e&&e!=ab-1&&(Z+=",");}R!=aa-1&&(Z+="\n");}return Z.replace(/,(?=-)/g,"");};function X(Z,i,e){function R(){var aa=Array.prototype.splice.call(arguments,0,arguments.length),ab=aa.join("\u25ba");R.cache=R.cache||{};R.count=R.count||[];if(ab in R.cache){return e?e(R.cache[ab]):R.cache[ab];}if(R.count.length>1000){delete R.cache[R.count.unshift()];}R.count.push(ab);R.cache[ab]=Z.apply(i,aa);return e?e(R.cache[ab]):R.cache[ab];}return R;}f.getRGB=X(function(e){var af={aliceblue:"#f0f8ff",amethyst:"#96c",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},ab;if((e+"").toLowerCase() in af){e=af[e.toString().toLowerCase()];}if(!e){return{r:0,g:0,b:0,hex:"#000"};}if(e=="none"){return{r:-1,g:-1,b:-1,hex:"none"};}var R,Z,ae,ac=(e+"").match(/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i);if(ac){if(ac[2]){ae=parseInt(ac[2].substring(5),16);Z=parseInt(ac[2].substring(3,5),16);R=parseInt(ac[2].substring(1,3),16);}if(ac[3]){ae=parseInt(ac[3].substring(3)+ac[3].substring(3),16);Z=parseInt(ac[3].substring(2,3)+ac[3].substring(2,3),16);R=parseInt(ac[3].substring(1,2)+ac[3].substring(1,2),16);}if(ac[4]){ac=ac[4].split(/\s*,\s*/);R=parseFloat(ac[0]);Z=parseFloat(ac[1]);ae=parseFloat(ac[2]);}if(ac[5]){ac=ac[5].split(/\s*,\s*/);R=parseFloat(ac[0])*2.55;Z=parseFloat(ac[1])*2.55;ae=parseFloat(ac[2])*2.55;}if(ac[6]){ac=ac[6].split(/\s*,\s*/);R=parseFloat(ac[0]);Z=parseFloat(ac[1]);ae=parseFloat(ac[2]);return f.hsb2rgb(R,Z,ae);}if(ac[7]){ac=ac[7].split(/\s*,\s*/);R=parseFloat(ac[0])*2.55;Z=parseFloat(ac[1])*2.55;ae=parseFloat(ac[2])*2.55;return f.hsb2rgb(R,Z,ae);}ac={r:R,g:Z,b:ae};var i=Math.round(R).toString(16),aa=Math.round(Z).toString(16),ad=Math.round(ae).toString(16);(i.length==1)&&(i="0"+i);(aa.length==1)&&(aa="0"+aa);(ad.length==1)&&(ad="0"+ad);ac.hex="#"+i+aa+ad;ab=ac;}else{ab={r:-1,g:-1,b:-1,hex:"none"};}return ab;},f);f.getColor=function(i){var R=this.getColor.start=this.getColor.start||{h:0,s:1,b:i||0.75},e=this.hsb2rgb(R.h,R.s,R.b);R.h+=0.075;if(R.h>1){R.h=0;R.s-=0.2;if(R.s<=0){this.getColor.start={h:0,s:1,b:R.b};}}return e.hex;};f.getColor.reset=function(){delete this.start;};f.parsePathString=X(function(e){if(!e){return null;}var R={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];if(f.is(e,"array")&&f.is(e[0],"array")){i=t(e);}if(!i.length){(e+"").replace(/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(aa,Z,ad){var ac=[],ab=Z.toLowerCase();ad.replace(/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(af,ae){ae&&ac.push(+ae);});while(ac.length>=R[ab]){i.push([Z].concat(ac.splice(0,R[ab])));if(!R[ab]){break;}}});}i.toString=f._path2string;return i;});var C=X(function(ag){if(!ag){return{x:0,y:0,width:0,height:0};}ag=O(ag);var ad=0,ac=0,Z=[],R=[];for(var aa=0,af=ag.length;aa<af;aa++){if(ag[aa][0]=="M"){ad=ag[aa][1];ac=ag[aa][2];Z.push(ad);R.push(ac);}else{var ab=J(ad,ac,ag[aa][1],ag[aa][2],ag[aa][3],ag[aa][4],ag[aa][5],ag[aa][6]);Z=Z.concat(ab.min.x,ab.max.x);R=R.concat(ab.min.y,ab.max.y);}}var e=Math.min.apply(0,Z),ae=Math.min.apply(0,R);return{x:e,y:ae,width:Math.max.apply(0,Z)-e,height:Math.max.apply(0,R)-ae};}),t=function(ac){var Z=[];if(!f.is(ac,"array")||!f.is(ac&&ac[0],"array")){ac=f.parsePathString(ac);}for(var R=0,aa=ac.length;R<aa;R++){Z[R]=[];for(var e=0,ab=ac[R].length;e<ab;e++){Z[R][e]=ac[R][e];}}Z.toString=f._path2string;return Z;},c=X(function(aa){if(!f.is(aa,"array")||!f.is(aa&&aa[0],"array")){aa=f.parsePathString(aa);}var ag=[],ai=0,ah=0,al=0,ak=0,Z=0;if(aa[0][0]=="M"){ai=aa[0][1];ah=aa[0][2];al=ai;ak=ah;Z++;ag.push(["M",ai,ah]);}for(var ad=Z,am=aa.length;ad<am;ad++){var e=ag[ad]=[],aj=aa[ad];if(aj[0]!=aj[0].toLowerCase()){e[0]=aj[0].toLowerCase();switch(e[0]){case"a":e[1]=aj[1];e[2]=aj[2];e[3]=aj[3];e[4]=aj[4];e[5]=aj[5];e[6]=+(aj[6]-ai).toFixed(3);e[7]=+(aj[7]-ah).toFixed(3);break;case"v":e[1]=+(aj[1]-ah).toFixed(3);break;case"m":al=aj[1];ak=aj[2];default:for(var ac=1,ae=aj.length;ac<ae;ac++){e[ac]=+(aj[ac]-((ac%2)?ai:ah)).toFixed(3);}}}else{e=ag[ad]=[];if(aj[0]=="m"){al=aj[1]+ai;ak=aj[2]+ah;}for(var ab=0,R=aj.length;ab<R;ab++){ag[ad][ab]=aj[ab];}}var af=ag[ad].length;switch(ag[ad][0]){case"z":ai=al;ah=ak;break;case"h":ai+=+ag[ad][af-1];break;case"v":ah+=+ag[ad][af-1];break;default:ai+=+ag[ad][af-2];ah+=+ag[ad][af-1];}}ag.toString=f._path2string;return ag;},0,t),w=X(function(aa){if(!f.is(aa,"array")||!f.is(aa&&aa[0],"array")){aa=f.parsePathString(aa);}var af=[],ah=0,ag=0,ak=0,aj=0,Z=0;if(aa[0][0]=="M"){ah=+aa[0][1];ag=+aa[0][2];ak=ah;aj=ag;Z++;af[0]=["M",ah,ag];}for(var ad=Z,al=aa.length;ad<al;ad++){var e=af[ad]=[],ai=aa[ad];if(ai[0]!=(ai[0]+"").toUpperCase()){e[0]=(ai[0]+"").toUpperCase();switch(e[0]){case"A":e[1]=ai[1];e[2]=ai[2];e[3]=ai[3];e[4]=ai[4];e[5]=ai[5];e[6]=+(ai[6]+ah);e[7]=+(ai[7]+ag);break;case"V":e[1]=+ai[1]+ag;break;case"H":e[1]=+ai[1]+ah;break;case"M":ak=+ai[1]+ah;aj=+ai[2]+ag;default:for(var ac=1,ae=ai.length;ac<ae;ac++){e[ac]=+ai[ac]+((ac%2)?ah:ag);}}}else{for(var ab=0,R=ai.length;ab<R;ab++){af[ad][ab]=ai[ab];}}switch(e[0]){case"Z":ah=ak;ag=aj;break;case"H":ah=e[1];break;case"V":ag=e[1];break;default:ah=af[ad][af[ad].length-2];ag=af[ad][af[ad].length-1];}}af.toString=f._path2string;return af;},null,t),d=function(i,Z,e,R){return[i,Z,e,R,e,R];},x=function(i,Z,ab,aa,e,R){return[2/3*i+1/3*ab,2/3*Z+1/3*aa,2/3*i+1/3*e,2/3*Z+1/3*R,e,R];},r=function(ak,aP,au,ar,al,af,aa,aj,aO,am){var aq=Math.PI*120/180,e=Math.PI/180*(+al||0),ay=[],av,aL=X(function(aQ,aT,i){var aS=aQ*Math.cos(i)-aT*Math.sin(i),aR=aQ*Math.sin(i)+aT*Math.cos(i);return{x:aS,y:aR};});if(!am){av=aL(ak,aP,-e);ak=av.x;aP=av.y;av=aL(aj,aO,-e);aj=av.x;aO=av.y;var R=Math.cos(Math.PI/180*al),ah=Math.sin(Math.PI/180*al),aA=(ak-aj)/2,az=(aP-aO)/2;au=Math.max(au,Math.abs(aA));ar=Math.max(ar,Math.abs(az));var Z=au*au,aD=ar*ar,aF=(af==aa?-1:1)*Math.sqrt(Math.abs((Z*aD-Z*az*az-aD*aA*aA)/(Z*az*az+aD*aA*aA))),ao=aF*au*az/ar+(ak+aj)/2,an=aF*-ar*aA/au+(aP+aO)/2,ae=Math.asin((aP-an)/ar),ad=Math.asin((aO-an)/ar);ae=ak<ao?Math.PI-ae:ae;ad=aj<ao?Math.PI-ad:ad;ae<0&&(ae=Math.PI*2+ae);ad<0&&(ad=Math.PI*2+ad);if(aa&&ae>ad){ae=ae-Math.PI*2;}if(!aa&&ad>ae){ad=ad-Math.PI*2;}}else{ae=am[0];ad=am[1];ao=am[2];an=am[3];}var ai=ad-ae;if(Math.abs(ai)>aq){var ap=ad,at=aj,ag=aO;ad=ae+aq*(aa&&ad>ae?1:-1);aj=ao+au*Math.cos(ad);aO=an+ar*Math.sin(ad);ay=r(aj,aO,au,ar,al,0,aa,at,ag,[ad,ap,ao,an]);}ai=ad-ae;var ac=Math.cos(ae),aN=Math.sin(ae),ab=Math.cos(ad),aM=Math.sin(ad),aB=Math.tan(ai/4),aE=4/3*au*aB,aC=4/3*ar*aB,aK=[ak,aP],aJ=[ak+aE*aN,aP-aC*ac],aI=[aj+aE*aM,aO-aC*ab],aG=[aj,aO];aJ[0]=2*aK[0]-aJ[0];aJ[1]=2*aK[1]-aJ[1];if(am){return[aJ,aI,aG].concat(ay);}else{ay=[aJ,aI,aG].concat(ay).join(",").split(",");var aw=[];for(var aH=0,ax=ay.length;aH<ax;aH++){aw[aH]=aH%2?aL(ay[aH-1],ay[aH],e).y:aL(ay[aH],ay[aH+1],e).x;}return aw;}},A=X(function(i,e,ao,am,ab,aa,ad,ac,ai){var ag=Math.pow(1-ai,3)*i+Math.pow(1-ai,2)*3*ai*ao+(1-ai)*3*ai*ai*ab+Math.pow(ai,3)*ad,ae=Math.pow(1-ai,3)*e+Math.pow(1-ai,2)*3*ai*am+(1-ai)*3*ai*ai*aa+Math.pow(ai,3)*ac,ak=i+2*ai*(ao-i)+ai*ai*(ab-2*ao+i),aj=e+2*ai*(am-e)+ai*ai*(aa-2*am+e),an=ao+2*ai*(ab-ao)+ai*ai*(ad-2*ab+ao),al=am+2*ai*(aa-am)+ai*ai*(ac-2*aa+am),ah=(1-ai)*i+ai*ao,af=(1-ai)*e+ai*am,Z=(1-ai)*ab+ai*ad,R=(1-ai)*aa+ai*ac;return{x:ag,y:ae,m:{x:ak,y:aj},n:{x:an,y:al},start:{x:ah,y:af},end:{x:Z,y:R}};}),J=X(function(i,e,Z,R,am,al,ai,af){var ak=(am-2*Z+i)-(ai-2*am+Z),ah=2*(Z-i)-2*(am-Z),ae=i-Z,ac=(-ah+Math.sqrt(ah*ah-4*ak*ae))/2/ak,aa=(-ah-Math.sqrt(ah*ah-4*ak*ae))/2/ak,ag=[e,af],aj=[i,ai],ad=A(i,e,Z,R,am,al,ai,af,ac>0&&ac<1?ac:0),ab=A(i,e,Z,R,am,al,ai,af,aa>0&&aa<1?aa:0);aj=aj.concat(ad.x,ab.x);ag=ag.concat(ad.y,ab.y);ak=(al-2*R+e)-(af-2*al+R);ah=2*(R-e)-2*(al-R);ae=e-R;ac=(-ah+Math.sqrt(ah*ah-4*ak*ae))/2/ak;aa=(-ah-Math.sqrt(ah*ah-4*ak*ae))/2/ak;ad=A(i,e,Z,R,am,al,ai,af,ac>0&&ac<1?ac:0);ab=A(i,e,Z,R,am,al,ai,af,aa>0&&aa<1?aa:0);aj=aj.concat(ad.x,ab.x);ag=ag.concat(ad.y,ab.y);return{min:{x:Math.min.apply(Math,aj),y:Math.min.apply(Math,ag)},max:{x:Math.max.apply(Math,aj),y:Math.max.apply(Math,ag)}};}),O=X(function(al,ag){var aa=w(al),ah=ag&&w(ag),ai={x:0,y:0,bx:0,by:0,X:0,Y:0},e={x:0,y:0,bx:0,by:0,X:0,Y:0},ac=function(am,an){var i,ao;if(!am){return["C",an.x,an.y,an.x,an.y,an.x,an.y];}switch(am[0]){case"M":an.X=am[1];an.Y=am[2];break;case"A":am=["C"].concat(r.apply(0,[an.x,an.y].concat(am.slice(1))));break;case"S":i=an.x+(an.x-(an.bx||an.x));ao=an.y+(an.y-(an.by||an.y));am=["C",i,ao].concat(am.slice(1));break;case"T":i=an.x+(an.x-(an.bx||an.x));ao=an.y+(an.y-(an.by||an.y));am=["C"].concat(x(an.x,an.y,i,ao,am[1],am[2]));break;case"Q":am=["C"].concat(x(an.x,an.y,am[1],am[2],am[3],am[4]));break;case"L":am=["C"].concat(d(an.x,an.y,am[1],am[2]));break;case"H":am=["C"].concat(d(an.x,an.y,am[1],an.y));break;case"V":am=["C"].concat(d(an.x,an.y,an.x,am[1]));break;case"Z":am=["C"].concat(d(an.x,an.y,an.X,an.Y));break;}return am;},R=function(am,an){if(am[an].length>7){am[an].shift();var ao=am[an];while(ao.length){am.splice(an++,0,["C"].concat(ao.splice(0,6)));}am.splice(an,1);aj=Math.max(aa.length,ah&&ah.length||0);}},Z=function(aq,ap,an,am,ao){if(aq&&ap&&aq[ao][0]=="M"&&ap[ao][0]!="M"){ap.splice(ao,0,["M",am.x,am.y]);an.bx=0;an.by=0;an.x=aq[ao][1];an.y=aq[ao][2];aj=Math.max(aa.length,ah&&ah.length||0);}};for(var ae=0,aj=Math.max(aa.length,ah&&ah.length||0);ae<aj;ae++){aa[ae]=ac(aa[ae],ai);R(aa,ae);ah&&(ah[ae]=ac(ah[ae],e));ah&&R(ah,ae);Z(aa,ah,ai,e,ae);Z(ah,aa,e,ai,ae);var ad=aa[ae],ak=ah&&ah[ae],ab=ad.length,af=ah&&ak.length;ai.bx=ad[ab-4]||0;ai.by=ad[ab-3]||0;ai.x=ad[ab-2];ai.y=ad[ab-1];e.bx=ah&&(ak[af-4]||0);e.by=ah&&(ak[af-3]||0);e.x=ah&&ak[af-2];e.y=ah&&ak[af-1];}return ah?[aa,ah]:aa;},null,t),n=X(function(ah){if(f.is(ah,"string")){ah=ah.split(/\s*\-\s*/);var Z=ah.shift();if(Z.toLowerCase()=="v"){Z=90;}else{if(Z.toLowerCase()=="h"){Z=0;}else{Z=parseFloat(Z);}}Z=-Z;var af={angle:Z,type:"linear",dots:[],vector:[0,0,Math.cos(Z*Math.PI/180).toFixed(3),Math.sin(Z*Math.PI/180).toFixed(3)]},ag=1/(Math.max(Math.abs(af.vector[2]),Math.abs(af.vector[3]))||1);af.vector[2]*=ag;af.vector[3]*=ag;if(af.vector[2]<0){af.vector[0]=-af.vector[2];af.vector[2]=0;}if(af.vector[3]<0){af.vector[1]=-af.vector[3];af.vector[3]=0;}af.vector[0]=af.vector[0];af.vector[1]=af.vector[1];af.vector[2]=af.vector[2];af.vector[3]=af.vector[3];for(var ac=0,ai=ah.length;ac<ai;ac++){var e={},ae=ah[ac].match(/^([^:]*):?([\d\.]*)/);e.color=f.getRGB(ae[1]).hex;ae[2]&&(e.offset=ae[2]+"%");af.dots.push(e);}for(var ac=1,ai=af.dots.length-1;ac<ai;ac++){if(!af.dots[ac].offset){var R=parseFloat(af.dots[ac-1].offset||0),aa=false;for(var ab=ac+1;ab<ai;ab++){if(af.dots[ab].offset){aa=af.dots[ab].offset;break;}}if(!aa){aa=100;ab=ai;}aa=parseFloat(aa);var ad=(aa-R)/(ab-ac+1);for(;ac<ab;ac++){R+=ad;af.dots[ac].offset=R+"%";}}}return af;}else{return ah;}}),G=function(){var R,i,aa,Z,e;if(f.is(arguments[0],"string")||f.is(arguments[0],"object")){if(f.is(arguments[0],"string")){R=g.getElementById(arguments[0]);}else{R=arguments[0];}if(R.tagName){if(arguments[1]==null){return{container:R,width:R.style.pixelWidth||R.offsetWidth,height:R.style.pixelHeight||R.offsetHeight};}else{return{container:R,width:arguments[1],height:arguments[2]};}}}else{if(f.is(arguments[0],"number")&&arguments.length>3){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]};}}},a=function(e,R){var i=this;for(var Z in R){if(R.hasOwnProperty(Z)&&!(Z in e)){switch(typeof R[Z]){case"function":(function(aa){e[Z]=e===i?aa:function(){return aa.apply(i,arguments);};})(R[Z]);break;case"object":e[Z]=e[Z]||{};a.call(this,e[Z],R[Z]);break;default:e[Z]=R[Z];break;}}}};if(f.svg){b.svgns="http://www.w3.org/2000/svg";b.xlink="http://www.w3.org/1999/xlink";var N=function(e){return +e+(Math.floor(e)==e)*0.5;};var z=function(ab){for(var R=0,Z=ab.length;R<Z;R++){if(ab[R][0].toLowerCase()!="a"){for(var e=1,aa=ab[R].length;e<aa;e++){ab[R][e]=N(ab[R][e]);}}else{ab[R][6]=N(ab[R][6]);ab[R][7]=N(ab[R][7]);}}return ab;};var B=function(R,e){if(e){for(var i in e){if(e.hasOwnProperty(i)){R.setAttribute(i,e[i]);}}}else{return g.createElementNS(b.svgns,R);}};f.toString=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version;};var W=function(e,Z){var i=B("path");Z.canvas&&Z.canvas.appendChild(i);var R=new m(i,Z);R.type="path";F(R,{fill:"none",stroke:"#000",path:e});return R;};var M=function(ad,ab,ae){ab=n(ab);var aa=B((ab.type||"linear")+"Gradient");aa.id="r"+(f.idGenerator++).toString(36);if(ab.vector&&ab.vector.length){B(aa,{x1:ab.vector[0],y1:ab.vector[1],x2:ab.vector[2],y2:ab.vector[3]});}ae.defs.appendChild(aa);var ac=true;for(var R=0,Z=ab.dots.length;R<Z;R++){var e=B("stop");if(ab.dots[R].offset){ac=false;}B(e,{offset:ab.dots[R].offset?ab.dots[R].offset:(R==0)?"0%":"100%","stop-color":f.getRGB(ab.dots[R].color).hex||"#fff"});aa.appendChild(e);}if(ac&&ab.dots[Z-1].opacity!=null){B(e,{"stop-opacity":ab.dots[Z-1].opacity});}B(ad,{fill:"url(#"+aa.id+")",opacity:1,"fill-opacity":1});ad.style.fill="";ad.style.opacity=1;ad.style.fillOpacity=1;};var s=function(i){var e=i.getBBox();B(i.pattern,{patternTransform:f.format("translate({0},{1})",e.x,e.y)});};var F=function(ah,aq){var ak={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},am=ah.node,ai=ah.attrs,ae=ah.attr("rotation"),ab=function(ay,ax){ax=ak[(ax+"").toLowerCase()];if(ax){var av=ay.attrs["stroke-width"]||"1",at={round:av,square:av,butt:0}[ay.attrs["stroke-linecap"]||aq["stroke-linecap"]]||0,aw=[];var au=ax.length;while(au--){aw[au]=ax[au]*av+((au%2)?1:-1)*at;}B(am,{"stroke-dasharray":aw.join(",")});}};parseFloat(ae)&&ah.rotate(0,true);for(var al in aq){if(aq.hasOwnProperty(al)){if(!(al in q)){continue;}var aj=aq[al];ai[al]=aj;switch(al){case"href":case"title":case"target":var ao=am.parentNode;if(ao.tagName.toLowerCase()!="a"){var Z=B("a");ao.insertBefore(Z,am);Z.appendChild(am);ao=Z;}ao.setAttributeNS(ah.paper.xlink,al,aj);break;case"clip-rect":var i=(aj+"").split(Y);if(i.length==4){ah.clip&&ah.clip.parentNode.parentNode.removeChild(ah.clip.parentNode);var R=B("clipPath"),an=B("rect");R.id="r"+(f.idGenerator++).toString(36);B(an,{x:i[0],y:i[1],width:i[2],height:i[3]});R.appendChild(an);ah.paper.defs.appendChild(R);B(am,{"clip-path":"url(#"+R.id+")"});ah.clip=an;}if(!aj){var ap=g.getElementById(am.getAttribute("clip-path").replace(/(^url\(#|\)$)/g,""));ap&&ap.parentNode.removeChild(ap);B(am,{"clip-path":""});delete ah.clip;}break;case"path":if(aj&&ah.type=="path"){ai.path=z(w(aj));B(am,{d:ai.path});}case"width":am.setAttribute(al,aj);if(ai.fx){al="x";aj=ai.x;}else{break;}case"x":if(ai.fx){aj=-ai.x-(ai.width||0);}case"rx":if(al=="rx"&&ah.type=="rect"){break;}case"cx":am.setAttribute(al,aj);ah.pattern&&s(ah);break;case"height":am.setAttribute(al,aj);if(ai.fy){al="y";aj=ai.y;}else{break;}case"y":if(ai.fy){aj=-ai.y-(ai.height||0);}case"ry":if(al=="ry"&&ah.type=="rect"){break;}case"cy":am.setAttribute(al,aj);ah.pattern&&s(ah);break;case"r":if(ah.type=="rect"){B(am,{rx:aj,ry:aj});}else{am.setAttribute(al,aj);}break;case"src":if(ah.type=="image"){am.setAttributeNS(ah.paper.xlink,"href",aj);}break;case"stroke-width":am.style.strokeWidth=aj;am.setAttribute(al,aj);if(ai["stroke-dasharray"]){ab(ah,ai["stroke-dasharray"]);}break;case"stroke-dasharray":ab(ah,aj);break;case"rotation":ae=aj;ah.rotate(aj,true);break;case"translation":var ac=(aj+"").split(Y);ah.translate((+ac[0]+1||2)-1,(+ac[1]+1||2)-1);break;case"scale":var ac=(aj+"").split(Y);ah.scale(+ac[0]||1,+ac[1]||+ac[0]||1,+ac[2]||null,+ac[3]||null);break;case"fill":var aa=(aj+"").match(/^url\(['"]?([^\)]+)['"]?\)$/i);if(aa){var R=B("pattern"),ag=B("image");R.id="r"+(f.idGenerator++).toString(36);B(R,{x:0,y:0,patternUnits:"userSpaceOnUse"});B(ag,{x:0,y:0});ag.setAttributeNS(ah.paper.xlink,"href",aa[1]);R.appendChild(ag);var ar=g.createElement("img");ar.style.position="absolute";ar.style.top="-9999em";ar.style.left="-9999em";ar.onload=function(){B(R,{width:this.offsetWidth,height:this.offsetHeight});B(ag,{width:this.offsetWidth,height:this.offsetHeight});g.body.removeChild(this);b.safari();};g.body.appendChild(ar);ar.src=aa[1];ah.paper.defs.appendChild(R);am.style.fill="url(#"+R.id+")";B(am,{fill:"url(#"+R.id+")"});ah.pattern=R;ah.pattern&&s(ah);break;}delete aq.gradient;delete ai.gradient;if(!f.is(ai.opacity,"undefined")&&f.is(aq.opacity,"undefined")){am.style.opacity=ai.opacity;B(am,{opacity:ai.opacity});}if(!f.is(ai["fill-opacity"],"undefined")&&f.is(aq["fill-opacity"],"undefined")){am.style.fillOpacity=ai["fill-opacity"];B(am,{"fill-opacity":ai["fill-opacity"]});}case"stroke":am.style[al]=f.getRGB(aj).hex;am.setAttribute(al,f.getRGB(aj).hex);break;case"gradient":M(am,aj,ah.paper);break;case"opacity":case"fill-opacity":if(ai.gradient){var e=g.getElementById(am.getAttribute("fill").replace(/^url\(#|\)$/g,""));if(e){var ad=e.getElementsByTagName("stop");ad[ad.length-1].setAttribute("stop-opacity",aj);}break;}default:al=="font-size"&&(aj=parseInt(aj,10)+"px");var af=al.replace(/(\-.)/g,function(at){return at.substring(1).toUpperCase();});am.style[af]=aj;am.setAttribute(al,aj);break;}}}T(ah,aq);parseInt(ae,10)&&ah.rotate(ae,true);};var K=1.2;var T=function(e,aa){if(e.type!="text"||!("text" in aa||"font" in aa||"font-size" in aa||"x" in aa||"y" in aa)){return;}var af=e.attrs,R=e.node,ah=R.firstChild?parseInt(g.defaultView.getComputedStyle(R.firstChild,"").getPropertyValue("font-size"),10):10;if("text" in aa){while(R.firstChild){R.removeChild(R.firstChild);}var Z=(aa.text+"").split("\n");for(var ab=0,ag=Z.length;ab<ag;ab++){var ad=B("tspan");ab&&B(ad,{dy:ah*K,x:af.x});ad.appendChild(g.createTextNode(Z[ab]));R.appendChild(ad);}}else{var Z=R.getElementsByTagName("tspan");for(var ab=0,ag=Z.length;ab<ag;ab++){ab&&B(Z[ab],{dy:ah*K,x:af.x});}}B(R,{y:af.y});var ac=e.getBBox(),ae=af.y-(ac.y+ac.height/2);ae&&B(R,{y:af.y+ae});};var m=function(i,e){var Z=0,R=0;this[0]=i;this.node=i;this.paper=e;this.attrs=this.attrs||{};this.transformations=[];this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};};m.prototype.rotate=function(i,e,Z){if(i==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy].join(" ");}return this._.rt.deg;}var R=this.getBBox();i=(i+"").split(Y);if(i.length-1){e=parseFloat(i[1]);Z=parseFloat(i[2]);}i=parseFloat(i[0]);if(e!=null){this._.rt.deg=i;}else{this._.rt.deg+=i;}(Z==null)&&(e=null);this._.rt.cx=e;this._.rt.cy=Z;e=e==null?R.x+R.width/2:e;Z=Z==null?R.y+R.height/2:Z;if(this._.rt.deg){this.transformations[0]=f.format("rotate({0} {1} {2})",this._.rt.deg,e,Z);this.clip&&B(this.clip,{transform:f.format("rotate({0} {1} {2})",-this._.rt.deg,e,Z)});}else{this.transformations[0]="";this.clip&&B(this.clip,{transform:""});}B(this.node,{transform:this.transformations.join(" ")});return this;};m.prototype.hide=function(){this.node.style.display="none";return this;};m.prototype.show=function(){this.node.style.display="block";return this;};m.prototype.remove=function(){this.node.parentNode.removeChild(this.node);};m.prototype.getBBox=function(){if(this.type=="path"){return C(this.attrs.path);}if(this.node.style.display=="none"){this.show();var Z=true;}var ad={};try{ad=this.node.getBBox();}catch(ab){}finally{ad=ad||{};}if(this.type=="text"){ad={x:ad.x,y:Infinity,width:ad.width,height:0};for(var R=0,aa=this.node.getNumberOfChars();R<aa;R++){var ac=this.node.getExtentOfChar(R);(ac.y<ad.y)&&(ad.y=ac.y);(ac.y+ac.height-ad.y>ad.height)&&(ad.height=ac.y+ac.height-ad.y);}}Z&&this.hide();return ad;};m.prototype.attr=function(){if(arguments.length==1&&f.is(arguments[0],"string")){if(arguments[0]=="translation"){return this.translate();}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}return this.attrs[arguments[0]];}if(arguments.length==1&&f.is(arguments[0],"array")){var e={};for(var i in arguments[0]){if(arguments[0].hasOwnProperty(i)){e[arguments[0][i]]=this.attrs[arguments[0][i]];}}return e;}if(arguments.length==2){var R={};R[arguments[0]]=arguments[1];F(this,R);}else{if(arguments.length==1&&f.is(arguments[0],"object")){F(this,arguments[0]);}}return this;};m.prototype.toFront=function(){this.node.parentNode.appendChild(this.node);return this;};m.prototype.toBack=function(){if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);}return this;};m.prototype.insertAfter=function(e){if(e.node.nextSibling){e.node.parentNode.insertBefore(this.node,e.node.nextSibling);}else{e.node.parentNode.appendChild(this.node);}return this;};m.prototype.insertBefore=function(e){var i=e.node;i.parentNode.insertBefore(this.node,i);return this;};m.prototype.blur=function(e){if(e!="none"){var i=B("filter"),R=B("feGaussianBlur");i.id="r"+(f.idGenerator++).toString(36);B(R,{stdDeviation:+e||1.5});i.appendChild(R);this.paper.defs.appendChild(i);this._blur=i;B(this.node,{filter:"url(#"+i.id+")"});}else{if(this._blur){this._blur.parentNode.removeChild(this._blur);delete this._blur;}this.node.removeAttribute("filter");}};var D=function(i,e,ab,aa){e=N(e);ab=N(ab);var Z=B("circle");i.canvas&&i.canvas.appendChild(Z);var R=new m(Z,i);R.attrs={cx:e,cy:ab,r:aa,fill:"none",stroke:"#000"};R.type="circle";B(Z,R.attrs);return R;};var I=function(R,e,ad,i,ab,ac){e=N(e);ad=N(ad);var aa=B("rect");R.canvas&&R.canvas.appendChild(aa);var Z=new m(aa,R);Z.attrs={x:e,y:ad,width:i,height:ab,r:ac||0,rx:ac||0,ry:ac||0,fill:"none",stroke:"#000"};Z.type="rect";B(aa,Z.attrs);return Z;};var h=function(i,e,ac,ab,aa){e=N(e);ac=N(ac);var Z=B("ellipse");i.canvas&&i.canvas.appendChild(Z);var R=new m(Z,i);R.attrs={cx:e,cy:ac,rx:ab,ry:aa,fill:"none",stroke:"#000"};R.type="ellipse";B(Z,R.attrs);return R;};var p=function(R,ac,e,ad,i,ab){var aa=B("image");B(aa,{x:e,y:ad,width:i,height:ab,preserveAspectRatio:"none"});aa.setAttributeNS(R.xlink,"href",ac);R.canvas&&R.canvas.appendChild(aa);var Z=new m(aa,R);Z.attrs={x:e,y:ad,width:i,height:ab,src:ac};Z.type="image";return Z;};var H=function(i,e,ab,aa){var Z=B("text");B(Z,{x:e,y:ab,"text-anchor":"middle"});i.canvas&&i.canvas.appendChild(Z);var R=new m(Z,i);R.attrs={x:e,y:ab,"text-anchor":"middle",text:aa,font:q.font,stroke:"none",fill:"#000"};R.type="text";F(R,R.attrs);return R;};var E=function(i,e){this.width=i||this.width;this.height=e||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);return this;};var l=function(){var aa=G.apply(null,arguments),R=aa.container,ac=aa.x,ab=aa.y,Z=aa.width,ad=aa.height;if(!R){throw new Error("SVG container not found.");}b.canvas=B("svg");var e=b.canvas,ae=e.style;e.setAttribute("width",Z||512);b.width=Z||512;e.setAttribute("height",ad||342);b.height=ad||342;if(R==1){g.body.appendChild(e);ae.position="absolute";ae.left=ac+"px";ae.top=ab+"px";}else{if(R.firstChild){R.insertBefore(e,R.firstChild);}else{R.appendChild(e);}}R={canvas:e,clear:function(){while(this.canvas.firstChild){this.canvas.removeChild(this.canvas.firstChild);}this.desc=B("desc");this.defs=B("defs");this.desc.appendChild(g.createTextNode("Created with Rapha\u00ebl"));this.canvas.appendChild(this.desc);this.canvas.appendChild(this.defs);}};for(var i in b){if(b.hasOwnProperty(i)){if(i!="create"){R[i]=b[i];}}}a.call(R,R,f.fn);R.clear();R.raphael=f;return R;};b.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);};if({"Apple Computer, Inc.":1,"Google Inc.":1}[navigator.vendor]){b.safari=function(){var e=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){e.remove();});};}else{b.safari=function(){};}}if(f.vml){var y=function(ac){var aa=O(ac);for(var R=0,Z=aa.length;R<Z;R++){aa[R][0]=(aa[R][0]+"").toLowerCase();aa[R][0]=="z"&&(aa[R][0]="x");for(var e=1,ab=aa[R].length;e<ab;e++){aa[R][e]=Math.round(aa[R][e]);}}return(aa+"");};f.toString=function(){return"Your browser doesn\u2019t support SVG. Assuming it is Internet Explorer and falling down to VML.\nYou are running Rapha\u00ebl "+this.version;};var W=function(e,ab){var Z=V("group"),ac=Z.style;ac.position="absolute";ac.left=0;ac.top=0;ac.width=ab.width+"px";ac.height=ab.height+"px";Z.coordsize=ab.coordsize;Z.coordorigin=ab.coordorigin;var R=V("shape"),i=R.style;i.width=ab.width+"px";i.height=ab.height+"px";R.path="";R.coordsize=this.coordsize;R.coordorigin=this.coordorigin;Z.appendChild(R);var aa=new m(R,Z,ab);aa.isAbsolute=true;aa.type="path";aa.path=[];aa.Path="";if(e){aa.attrs.path=f.parsePathString(e);aa.node.path=y(aa.attrs.path);}F(aa,{fill:"none",stroke:"#000"});aa.setBox();ab.canvas.appendChild(Z);return aa;};var F=function(af,aj){af.attrs=af.attrs||{};var ah=af.node,ak=af.attrs,ac=ah.style,Z,ao=af;for(var ad in aj){if(aj.hasOwnProperty(ad)){ak[ad]=aj[ad];}}aj.href&&(ah.href=aj.href);aj.title&&(ah.title=aj.title);aj.target&&(ah.target=aj.target);if(aj.path&&af.type=="path"){ak.path=f.parsePathString(aj.path);ah.path=y(ak.path);}if(aj.rotation!=null){af.rotate(aj.rotation,true);}if(aj.translation){Z=(aj.translation+"").split(Y);af.translate(Z[0],Z[1]);}if(aj.scale){Z=(aj.scale+"").split(Y);af.scale(+Z[0]||1,+Z[1]||+Z[0]||1,+Z[2]||null,+Z[3]||null);}if("clip-rect" in aj){var e=(aj["clip-rect"]+"").split(Y);if(e.length==4){e[2]=+e[2]+(+e[0]);e[3]=+e[3]+(+e[1]);var ae=ah.clipRect||g.createElement("div"),an=ae.style,ab=ah.parentNode;an.clip=f.format("rect({0}px {2}px {3}px {1}px)",e);if(!ah.clipRect){an.position="absolute";an.top=0;an.left=0;an.width=af.paper.width+"px";an.height=af.paper.height+"px";ab.parentNode.insertBefore(ae,ab);ae.appendChild(ab);ah.clipRect=ae;}}if(!aj["clip-rect"]){ah.clipRect&&(ah.clipRect.style.clip="");}}if(af.type=="image"&&aj.src){ah.src=aj.src;}if(af.type=="image"&&aj.opacity){ah.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+(aj.opacity*100)+")";ac.filter=(ah.filterMatrix||"")+(ah.filterOpacity||"");}aj.font&&(ac.font=aj.font);aj["font-family"]&&(ac.fontFamily='"'+aj["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,"")+'"');aj["font-size"]&&(ac.fontSize=aj["font-size"]);aj["font-weight"]&&(ac.fontWeight=aj["font-weight"]);aj["font-style"]&&(ac.fontStyle=aj["font-style"]);if(aj.opacity!=null||aj["stroke-width"]!=null||aj.fill!=null||aj.stroke!=null||aj["stroke-width"]!=null||aj["stroke-opacity"]!=null||aj["fill-opacity"]!=null||aj["stroke-dasharray"]!=null||aj["stroke-miterlimit"]!=null||aj["stroke-linejoin"]!=null||aj["stroke-linecap"]!=null){ah=af.shape||ah;var ai=(ah.getElementsByTagName("fill")&&ah.getElementsByTagName("fill")[0]),al=false;!ai&&(al=ai=V("fill"));if("fill-opacity" in aj||"opacity" in aj){var i=((+ak["fill-opacity"]+1||2)-1)*((+ak.opacity+1||2)-1);i<0&&(i=0);i>1&&(i=1);ai.opacity=i;}aj.fill&&(ai.on=true);if(ai.on==null||aj.fill=="none"){ai.on=false;}if(ai.on&&aj.fill){var R=aj.fill.match(/^url\(([^\)]+)\)$/i);if(R){ai.src=R[1];ai.type="tile";}else{ai.color=f.getRGB(aj.fill).hex;ai.src="";ai.type="solid";}}al&&ah.appendChild(ai);var aa=(ah.getElementsByTagName("stroke")&&ah.getElementsByTagName("stroke")[0]),am=false;!aa&&(am=aa=V("stroke"));if((aj.stroke&&aj.stroke!="none")||aj["stroke-width"]||aj["stroke-opacity"]!=null||aj["stroke-dasharray"]||aj["stroke-miterlimit"]||aj["stroke-linejoin"]||aj["stroke-linecap"]){aa.on=true;}(aj.stroke=="none"||aa.on==null||aj.stroke==0||aj["stroke-width"]==0)&&(aa.on=false);aa.on&&aj.stroke&&(aa.color=f.getRGB(aj.stroke).hex);var i=((+ak["stroke-opacity"]+1||2)-1)*((+ak.opacity+1||2)-1);i<0&&(i=0);i>1&&(i=1);aa.opacity=i;aj["stroke-linejoin"]&&(aa.joinstyle=aj["stroke-linejoin"]||"miter");aa.miterlimit=aj["stroke-miterlimit"]||8;aj["stroke-linecap"]&&(aa.endcap={butt:"flat",square:"square",round:"round"}[aj["stroke-linecap"]]||"miter");aj["stroke-width"]&&(aa.weight=(parseFloat(aj["stroke-width"])||1)*12/16);if(aj["stroke-dasharray"]){var ag={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};aa.dashstyle=ag[aj["stroke-dasharray"]]||"";}am&&ah.appendChild(aa);}if(ao.type=="text"){var ac=b.span.style;ak.font&&(ac.font=ak.font);ak["font-family"]&&(ac.fontFamily=ak["font-family"]);ak["font-size"]&&(ac.fontSize=ak["font-size"]);ak["font-weight"]&&(ac.fontWeight=ak["font-weight"]);ak["font-style"]&&(ac.fontStyle=ak["font-style"]);b.span.innerHTML=ao.node.string.replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>");ao.W=ak.w=b.span.offsetWidth;ao.H=ak.h=b.span.offsetHeight;ao.X=ak.x;ao.Y=ak.y+Math.round(ao.H/2);switch(ak["text-anchor"]){case"start":ao.node.style["v-text-align"]="left";ao.bbx=Math.round(ao.W/2);break;case"end":ao.node.style["v-text-align"]="right";ao.bbx=-Math.round(ao.W/2);break;default:ao.node.style["v-text-align"]="center";break;}}};var o=function(i,e,aa,Z){var R=Math.round(Math.atan((parseFloat(aa)-parseFloat(i))/(parseFloat(Z)-parseFloat(e)))*57.29)||0;if(!R&&parseFloat(i)<parseFloat(e)){R=180;}R-=180;if(R<0){R+=360;}return R;};var M=function(ad,ac){ac=n(ac);ad.attrs=ad.attrs||{};var R=ad.attrs,ab=ad.node.getElementsByTagName("fill");ad.attrs.gradient=ac;ad=ad.shape||ad.node;if(ab.length){ab=ab[0];}else{ab=V("fill");}if(ac.dots.length){ab.on=true;ab.method="none";ab.type=((ac.type+"").toLowerCase()=="radial")?"gradientTitle":"gradient";if(!f.is(ac.dots[0].color,"undefined")){ab.color=f.getRGB(ac.dots[0].color).hex;}if(!f.is(ac.dots[ac.dots.length-1].color,"undefined")){ab.color2=f.getRGB(ac.dots[ac.dots.length-1].color).hex;}var ae=[];for(var Z=0,aa=ac.dots.length;Z<aa;Z++){if(ac.dots[Z].offset){ae.push(ac.dots[Z].offset+" "+f.getRGB(ac.dots[Z].color).hex);}}var e=f.is(ac.dots[ac.dots.length-1].opacity,"undefined")?(f.is(R.opacity,"undefined")?1:R.opacity):ac.dots[ac.dots.length-1].opacity;if(ae.length){ab.colors.value=ae.join(",");e=f.is(R.opacity,"undefined")?1:R.opacity;}else{ab.colors&&(ab.colors.value="0% "+ab.color);}ab.opacity=e;if(!f.is(ac.angle,"undefined")){ab.angle=(-ac.angle+270)%360;}else{if(ac.vector){ab.angle=o.apply(null,ac.vector);}}if((ac.type+"").toLowerCase()=="radial"){ab.focus="100%";ab.focusposition="0.5 0.5";}}};var m=function(aa,ac,e){var ab=0,R=0,i=0,Z=1;this[0]=aa;this.node=aa;this.X=0;this.Y=0;this.attrs={};this.Group=ac;this.paper=e;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};};m.prototype.rotate=function(i,e,R){if(i==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy].join(" ");}return this._.rt.deg;}i=(i+"").split(Y);if(i.length-1){e=parseFloat(i[1]);R=parseFloat(i[2]);}i=parseFloat(i[0]);if(e!=null){this._.rt.deg=i;}else{this._.rt.deg+=i;}(R==null)&&(e=null);this._.rt.cx=e;this._.rt.cy=R;this.setBox(this.attrs,e,R);this.Group.style.rotation=this._.rt.deg;return this;};m.prototype.setBox=function(ab,ac,aa){var R=this.Group.style,ad=(this.shape&&this.shape.style)||this.node.style;ab=ab||{};for(var ae in ab){if(ab.hasOwnProperty(ae)){this.attrs[ae]=ab[ae];}}ac=ac||this._.rt.cx;aa=aa||this._.rt.cy;var ah=this.attrs,ak,aj,al,ag;switch(this.type){case"circle":ak=ah.cx-ah.r;aj=ah.cy-ah.r;al=ag=ah.r*2;break;case"ellipse":ak=ah.cx-ah.rx;aj=ah.cy-ah.ry;al=ah.rx*2;ag=ah.ry*2;break;case"rect":case"image":ak=ah.x;aj=ah.y;al=ah.width||0;ag=ah.height||0;break;case"text":this.textpath.v=["m",Math.round(ah.x),", ",Math.round(ah.y-2),"l",Math.round(ah.x)+1,", ",Math.round(ah.y-2)].join("");ak=ah.x-Math.round(this.W/2);aj=ah.y-this.H/2;al=this.W;ag=this.H;break;case"path":if(!this.attrs.path){ak=0;aj=0;al=this.paper.width;ag=this.paper.height;}else{var af=C(this.attrs.path);ak=af.x;aj=af.y;al=af.width;ag=af.height;}break;default:ak=0;aj=0;al=this.paper.width;ag=this.paper.height;break;}ac=(ac==null)?ak+al/2:ac;aa=(aa==null)?aj+ag/2:aa;var Z=ac-this.paper.width/2,ai=aa-this.paper.height/2;if(this.type=="path"||this.type=="text"){(R.left!=Z+"px")&&(R.left=Z+"px");(R.top!=ai+"px")&&(R.top=ai+"px");this.X=this.type=="text"?ak:-Z;this.Y=this.type=="text"?aj:-ai;this.W=al;this.H=ag;(ad.left!=-Z+"px")&&(ad.left=-Z+"px");(ad.top!=-ai+"px")&&(ad.top=-ai+"px");}else{(R.left!=Z+"px")&&(R.left=Z+"px");(R.top!=ai+"px")&&(R.top=ai+"px");this.X=ak;this.Y=aj;this.W=al;this.H=ag;(R.width!=this.paper.width+"px")&&(R.width=this.paper.width+"px");(R.height!=this.paper.height+"px")&&(R.height=this.paper.height+"px");(ad.left!=ak-Z+"px")&&(ad.left=ak-Z+"px");(ad.top!=aj-ai+"px")&&(ad.top=aj-ai+"px");(ad.width!=al+"px")&&(ad.width=al+"px");(ad.height!=ag+"px")&&(ad.height=ag+"px");var am=(+ab.r||0)/(Math.min(al,ag));if(this.type=="rect"&&this.arcsize!=am&&(am||this.arcsize)){var e=V(am?"roundrect":"rect");e.arcsize=am;this.Group.appendChild(e);this.node.parentNode.removeChild(this.node);this.node=e;this.arcsize=am;F(this,this.attrs);this.setBox(this.attrs);}}};m.prototype.hide=function(){this.Group.style.display="none";return this;};m.prototype.show=function(){this.Group.style.display="block";return this;};m.prototype.getBBox=function(){if(this.type=="path"){return C(this.attrs.path);}return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H};};m.prototype.remove=function(){this[0].parentNode.removeChild(this[0]);this.Group.parentNode.removeChild(this.Group);this.shape&&this.shape.parentNode.removeChild(this.shape);};m.prototype.attr=function(){if(arguments.length==1&&f.is(arguments[0],"string")){if(arguments[0]=="translation"){return this.translate();}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}return this.attrs[arguments[0]];}if(this.attrs&&arguments.length==1&&f.is(arguments[0],"array")){var e={};for(var R=0,Z=arguments[0].length;R<Z;R++){e[arguments[0][R]]=this.attrs[arguments[0][R]];}return e;}var aa;if(arguments.length==2){aa={};aa[arguments[0]]=arguments[1];}if(arguments.length==1&&f.is(arguments[0],"object")){aa=arguments[0];}if(aa){if(aa.gradient){M(this,aa.gradient);}if(aa.text&&this.type=="text"){this.node.string=aa.text;}F(this,aa);this.setBox(this.attrs);}return this;};m.prototype.toFront=function(){this.Group.parentNode.appendChild(this.Group);return this;};m.prototype.toBack=function(){if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);}return this;};m.prototype.insertAfter=function(e){if(e.Group.nextSibling){e.Group.parentNode.insertBefore(this.Group,e.Group.nextSibling);}else{e.Group.parentNode.appendChild(this.Group);}return this;};m.prototype.insertBefore=function(e){e.Group.parentNode.insertBefore(this.Group,e.Group);return this;};m.prototype.blur=function(e){var i=this.node.style,R=i.filter;R=R.replace(/progid:DXImageTransform\.Microsoft\.Blur\(pixelradius\=[^\)]+\)/g,"");if(e!="none"){i.filter=R+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+e||1.5)+")";i.margin=f.format("-{0}px 0 0 -{0}px",Math.round(+e||1.5));}else{i.filter=R;i.margin=0;}};var D=function(i,ae,ad,e){var aa=V("group"),Z=aa.style,R=V("oval"),ac=R.style;Z.position="absolute";Z.left=0;Z.top=0;Z.width=i.width+"px";Z.height=i.height+"px";aa.coordsize=i.coordsize;aa.coordorigin=i.coordorigin;aa.appendChild(R);var ab=new m(R,aa,i);ab.type="circle";F(ab,{stroke:"#000",fill:"none"});ab.attrs.cx=ae;ab.attrs.cy=ad;ab.attrs.r=e;ab.setBox({x:ae-e,y:ad-e,width:e*2,height:e*2});i.canvas.appendChild(aa);return ab;};var I=function(i,ae,ad,af,aa,e){var ab=V("group"),Z=ab.style,R=V(e?"roundrect":"rect"),ag=(+e||0)/(Math.min(af,aa));R.arcsize=ag;Z.position="absolute";Z.left=0;Z.top=0;Z.width=i.width+"px";Z.height=i.height+"px";ab.coordsize=i.coordsize;ab.coordorigin=i.coordorigin;ab.appendChild(R);var ac=new m(R,ab,i);ac.type="rect";F(ac,{stroke:"#000"});ac.arcsize=ag;ac.setBox({x:ae,y:ad,width:af,height:aa,r:+e});i.canvas.appendChild(ab);return ac;};var h=function(e,af,ae,R,i){var ab=V("group"),aa=ab.style,Z=V("oval"),ad=Z.style;aa.position="absolute";aa.left=0;aa.top=0;aa.width=e.width+"px";aa.height=e.height+"px";ab.coordsize=e.coordsize;ab.coordorigin=e.coordorigin;ab.appendChild(Z);var ac=new m(Z,ab,e);ac.type="ellipse";F(ac,{stroke:"#000"});ac.attrs.cx=af;ac.attrs.cy=ae;ac.attrs.rx=R;ac.attrs.ry=i;ac.setBox({x:af-R,y:ae-i,width:R*2,height:i*2});e.canvas.appendChild(ab);return ac;};var p=function(i,e,af,ae,ag,aa){var ab=V("group"),Z=ab.style,R=V("image"),ad=R.style;Z.position="absolute";Z.left=0;Z.top=0;Z.width=i.width+"px";Z.height=i.height+"px";ab.coordsize=i.coordsize;ab.coordorigin=i.coordorigin;R.src=e;ab.appendChild(R);var ac=new m(R,ab,i);ac.type="image";ac.attrs.src=e;ac.attrs.x=af;ac.attrs.y=ae;ac.attrs.w=ag;ac.attrs.h=aa;ac.setBox({x:af,y:ae,width:ag,height:aa});i.canvas.appendChild(ab);return ac;};var H=function(i,af,ae,ag){var ab=V("group"),aa=ab.style,Z=V("shape"),ad=Z.style,ah=V("path"),e=ah.style,R=V("textpath");aa.position="absolute";aa.left=0;aa.top=0;aa.width=i.width+"px";aa.height=i.height+"px";ab.coordsize=i.coordsize;ab.coordorigin=i.coordorigin;ah.v=["m",Math.round(af),", ",Math.round(ae),"l",Math.round(af)+1,", ",Math.round(ae)].join("");ah.textpathok=true;ad.width=i.width;ad.height=i.height;aa.position="absolute";aa.left=0;aa.top=0;aa.width=i.width;aa.height=i.height;R.string=ag;R.on=true;Z.appendChild(R);Z.appendChild(ah);ab.appendChild(Z);var ac=new m(R,ab,i);ac.shape=Z;ac.textpath=ah;ac.type="text";ac.attrs.text=ag;ac.attrs.x=af;ac.attrs.y=ae;ac.attrs.w=1;ac.attrs.h=1;F(ac,{font:q.font,stroke:"none",fill:"#000"});ac.setBox();i.canvas.appendChild(ab);return ac;};var E=function(R,e){var i=this.canvas.style;this.width=parseFloat(R||this.width);this.height=parseFloat(e||this.height);i.width=this.width+"px";i.height=this.height+"px";i.clip="rect(0 "+this.width+"px "+this.height+"px 0)";this.coordsize=this.width+" "+this.height;return this;};g.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!g.namespaces.rvml&&g.namespaces.add("rvml","urn:schemas-microsoft-com:vml");var V=function(e){return g.createElement("<rvml:"+e+' class="rvml">');};}catch(U){var V=function(e){return g.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');};}var l=function(){var Z=G.apply(null,arguments),i=Z.container,ae=Z.height,af,R=Z.width,ad=Z.x,ac=Z.y;if(!i){throw new Error("VML container not found.");}var ab=b.canvas=g.createElement("div"),aa=ab.style;R=parseFloat(R)||"512px";ae=parseFloat(ae)||"342px";b.width=R;b.height=ae;b.coordsize=R+" "+ae;b.coordorigin="0 0";b.span=g.createElement("span");af=b.span.style;ab.appendChild(b.span);af.position="absolute";af.left="-99999px";af.top="-99999px";af.padding=0;af.margin=0;af.lineHeight=1;af.display="inline";aa.width=R+"px";aa.height=ae+"px";aa.position="absolute";aa.clip="rect(0 "+R+"px "+ae+"px 0)";if(i==1){g.body.appendChild(ab);aa.left=ad+"px";aa.top=ac+"px";i={style:{width:R,height:ae}};}else{i.style.width=R;i.style.height=ae;if(i.firstChild){i.insertBefore(ab,i.firstChild);}else{i.appendChild(ab);}}for(var e in b){if(b.hasOwnProperty(e)){i[e]=b[e];}}a.call(i,i,f.fn);i.clear=function(){while(ab.firstChild){ab.removeChild(ab.firstChild);}};i.raphael=f;return i;};b.remove=function(){this.canvas.parentNode.removeChild(this.canvas);};b.safari=function(){};}var j=(function(){if(g.addEventListener){return function(aa,R,i,e){var Z=function(ab){return i.call(e,ab);};aa.addEventListener(R,Z,false);return function(){aa.removeEventListener(R,Z,false);return true;};};}else{if(g.attachEvent){return function(ab,Z,R,i){var aa=function(ac){return R.call(i,ac||L.event);};ab.attachEvent("on"+Z,aa);var e=function(){ab.detachEvent("on"+Z,aa);return true;};if(Z=="mouseover"){ab.attachEvent("onmouseenter",aa);return function(){ab.detachEvent("onmouseenter",aa);return e();};}else{if(Z=="mouseout"){ab.attachEvent("onmouseleave",aa);return function(){ab.detachEvent("onmouseleave",aa);return e();};}}return e;};}}})();for(var Q=v.length;Q--;){(function(e){m.prototype[e]=function(i){if(f.is(i,"function")){this.events=this.events||{};this.events[e]=this.events[e]||{};this.events[e][i]=this.events[e][i]||[];this.events[e][i].push(j(this.shape||this.node,e,i,this));}return this;};m.prototype["un"+e]=function(i){this.events&&this.events[e]&&this.events[e][i]&&this.events[e][i].length&&this.events[e][i].shift()()&&!this.events[e][i].length&&delete this.events[e][i];};})(v[Q]);}b.circle=function(e,R,i){return D(this,e,R,i);};b.rect=function(e,aa,i,R,Z){return I(this,e,aa,i,R,Z);};b.ellipse=function(e,Z,R,i){return h(this,e,Z,R,i);};b.path=function(e){e&&!f.is(e,"string")&&!f.is(e[0],"array")&&(e+="");return W(f.format.apply(f,arguments),this);};b.image=function(Z,e,aa,i,R){return p(this,Z,e,aa,i,R);};b.text=function(e,R,i){return H(this,e,R,i);};b.set=function(e){arguments.length>1&&(e=Array.prototype.splice.call(arguments,0,arguments.length));return new k(e);};b.setSize=E;m.prototype.stop=function(){clearTimeout(this.animation_in_progress);return this;};m.prototype.scale=function(aj,ai,Z,R){if(aj==null&&ai==null){return{x:this._.sx,y:this._.sy,toString:function(){return this.x+" "+this.y;}};}ai=ai||aj;!+ai&&(ai=aj);var an,al,am,ak,aA=this.attrs;if(aj!=0){var ah=this.getBBox(),ae=ah.x+ah.width/2,ab=ah.y+ah.height/2,az=aj/this._.sx,ay=ai/this._.sy;Z=(+Z||Z==0)?Z:ae;R=(+R||R==0)?R:ab;var ag=Math.round(aj/Math.abs(aj)),ad=Math.round(ai/Math.abs(ai)),aq=this.node.style,aC=Z+(ae-Z)*ag*az,aB=R+(ab-R)*ad*ay;switch(this.type){case"rect":case"image":var af=aA.width*ag*az,ap=aA.height*ad*ay,ac=aC-af/2,aa=aB-ap/2;this.attr({width:af,height:ap,x:ac,y:aa});break;case"circle":case"ellipse":this.attr({rx:aA.rx*az,ry:aA.ry*ay,r:aA.r*az,cx:aC,cy:aB});break;case"path":var at=c(aA.path),au=true;for(var aw=0,ao=at.length;aw<ao;aw++){var ar=at[aw];if(ar[0].toUpperCase()=="M"&&au){continue;}else{au=false;}if(f.svg&&ar[0].toUpperCase()=="A"){ar[at[aw].length-2]*=az;ar[at[aw].length-1]*=ay;ar[1]*=az;ar[2]*=ay;ar[5]=+(ag+ad?!!+ar[5]:!+ar[5]);}else{for(var av=1,ax=ar.length;av<ax;av++){ar[av]*=(av%2)?az:ay;}}}var e=C(at),an=aC-e.x-e.width/2,al=aB-e.y-e.height/2;at=c(at);at[0][1]+=an;at[0][2]+=al;this.attr({path:at.join(" ")});break;}if(this.type in {text:1,image:1}&&(ag!=1||ad!=1)){if(this.transformations){this.transformations[2]="scale(".concat(ag,",",ad,")");this.node.setAttribute("transform",this.transformations.join(" "));an=(ag==-1)?-aA.x-(af||0):aA.x;al=(ad==-1)?-aA.y-(ap||0):aA.y;this.attr({x:an,y:al});aA.fx=ag-1;aA.fy=ad-1;}else{this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11=".concat(ag,", M12=0, M21=0, M22=",ad,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");aq.filter=(this.node.filterMatrix||"")+(this.node.filterOpacity||"");}}else{if(this.transformations){this.transformations[2]="";this.node.setAttribute("transform",this.transformations.join(" "));aA.fx=0;aA.fy=0;}else{this.node.filterMatrix="";aq.filter=(this.node.filterMatrix||"")+(this.node.filterOpacity||"");}}aA.scale=[aj,ai,Z,R].join(" ");this._.sx=aj;this._.sy=ai;}return this;};f.easing_formulas={linear:function(e){return e;},"<":function(e){return Math.pow(e,3);},">":function(e){return Math.pow(e-1,3)+1;},"<>":function(e){e=e*2;if(e<1){return Math.pow(e,3)/2;}e-=2;return(Math.pow(e,3)+2)/2;},backIn:function(i){var e=1.70158;return i*i*((e+1)*i-e);},backOut:function(i){i=i-1;var e=1.70158;return i*i*((e+1)*i+e)+1;},elastic:function(R){if(R==0||R==1){return R;}var i=0.3,e=i/4;return Math.pow(2,-10*R)*Math.sin((R-e)*(2*Math.PI)/i)+1;},bounce:function(Z){var i=7.5625,R=2.75,e;if(Z<(1/R)){e=i*Z*Z;}else{if(Z<(2/R)){Z-=(1.5/R);e=i*Z*Z+0.75;}else{if(Z<(2.5/R)){Z-=(2.25/R);e=i*Z*Z+0.9375;}else{Z-=(2.625/R);e=i*Z*Z+0.984375;}}}return e;}};m.prototype.animate=function(at,aj,ai,aa){clearTimeout(this.animation_in_progress);if(f.is(ai,"function")||!ai){aa=ai||null;}var am={},R={},ag={},af={x:0,y:0};for(var ak in at){if(at.hasOwnProperty(ak)){if(ak in u){am[ak]=this.attr(ak);(am[ak]==null)&&(am[ak]=q[ak]);R[ak]=at[ak];switch(u[ak]){case"number":ag[ak]=(R[ak]-am[ak])/aj;break;case"colour":am[ak]=f.getRGB(am[ak]);var al=f.getRGB(R[ak]);ag[ak]={r:(al.r-am[ak].r)/aj,g:(al.g-am[ak].g)/aj,b:(al.b-am[ak].b)/aj};break;case"path":var ab=O(am[ak],R[ak]);am[ak]=ab[0];R[ak]=ab[1];ag[ak]=[];for(var ao=0,ae=am[ak].length;ao<ae;ao++){ag[ak][ao]=[0];for(var an=1,aq=am[ak][ao].length;an<aq;an++){ag[ak][ao][an]=(R[ak][ao][an]-am[ak][ao][an])/aj;}}break;case"csv":var e=(at[ak]+"").split(Y),ad=(am[ak]+"").split(Y);switch(ak){case"translation":am[ak]=[0,0];ag[ak]=[e[0]/aj,e[1]/aj];break;case"rotation":am[ak]=(ad[1]==e[1]&&ad[2]==e[2])?ad:[0,e[1],e[2]];ag[ak]=[(e[0]-am[ak][0])/aj,0,0];break;case"scale":at[ak]=e;am[ak]=(am[ak]+"").split(Y);ag[ak]=[(e[0]-am[ak][0])/aj,(e[1]-am[ak][1])/aj,0,0];break;case"clip-rect":am[ak]=(am[ak]+"").split(Y);ag[ak]=[];var ao=4;while(ao--){ag[ak][ao]=(e[ao]-am[ak][ao])/aj;}break;}R[ak]=e;}}}}var Z=+new Date,ah=0,ar=function(i){return +i>255?255:+i;},ac=this;(function ap(){var av=new Date-Z,aD={},au;if(av<aj){var aB=f.easing_formulas[ai]?f.easing_formulas[ai](av/aj):av/aj;for(var az in am){if(am.hasOwnProperty(az)){switch(u[az]){case"number":au=+am[az]+aB*aj*ag[az];break;case"colour":au="rgb("+[ar(Math.round(am[az].r+aB*aj*ag[az].r)),ar(Math.round(am[az].g+aB*aj*ag[az].g)),ar(Math.round(am[az].b+aB*aj*ag[az].b))].join(",")+")";break;case"path":au=[];for(var ax=0,aE=am[az].length;ax<aE;ax++){au[ax]=[am[az][ax][0]];for(var aw=1,ay=am[az][ax].length;aw<ay;aw++){au[ax][aw]=+am[az][ax][aw]+aB*aj*ag[az][ax][aw];}au[ax]=au[ax].join(" ");}au=au.join(" ");break;case"csv":switch(az){case"translation":var aC=ag[az][0]*(av-ah),aA=ag[az][1]*(av-ah);af.x+=aC;af.y+=aA;au=[aC,aA].join(" ");break;case"rotation":au=+am[az][0]+aB*aj*ag[az][0];am[az][1]&&(au+=","+am[az][1]+","+am[az][2]);break;case"scale":au=[+am[az][0]+aB*aj*ag[az][0],+am[az][1]+aB*aj*ag[az][1],(2 in at[az]?at[az][2]:""),(3 in at[az]?at[az][3]:"")].join(" ");break;case"clip-rect":au=[];var ax=4;while(ax--){au[ax]=+am[az][ax]+aB*aj*ag[az][ax];}break;}break;}aD[az]=au;}}ac.attr(aD);ac.animation_in_progress=setTimeout(ap);f.svg&&b.safari();}else{(af.x||af.y)&&ac.translate(-af.x,-af.y);ac.attr(at);clearTimeout(ac.animation_in_progress);f.svg&&b.safari();(f.is(aa,"function"))&&aa.call(ac);}ah=av;})();return this;};m.prototype.translate=function(e,R){if(e==null){return{x:this._.tx,y:this._.ty};}this._.tx+=+e;this._.ty+=+R;switch(this.type){case"circle":case"ellipse":this.attr({cx:+e+this.attrs.cx,cy:+R+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+e+this.attrs.x,y:+R+this.attrs.y});break;case"path":var i=c(this.attrs.path);i[0][1]+=+e;i[0][2]+=+R;this.attr({path:i});break;}return this;};var k=function(e){this.items=[];this.length=0;if(e){for(var R=0,Z=e.length;R<Z;R++){if(e[R]&&(e[R].constructor==m||e[R].constructor==k)){this[this.items.length]=this.items[this.items.length]=e[R];this.length++;}}}};k.prototype.push=function(){var aa,e;for(var R=0,Z=arguments.length;R<Z;R++){aa=arguments[R];if(aa&&(aa.constructor==m||aa.constructor==k)){e=this.items.length;this[e]=this.items[e]=aa;this.length++;}}return this;};k.prototype.pop=function(){delete this[this.length--];return this.items.pop();};for(var S in m.prototype){if(m.prototype.hasOwnProperty(S)){k.prototype[S]=(function(e){return function(){for(var R=0,Z=this.items.length;R<Z;R++){this.items[R][e].apply(this.items[R],arguments);}return this;};})(S);}}k.prototype.attr=function(R,ac){if(R&&f.is(R,"array")&&f.is(R[0],"object")){for(var e=0,ab=R.length;e<ab;e++){this.items[e].attr(R[e]);}}else{for(var Z=0,aa=this.items.length;Z<aa;Z++){this.items[Z].attr.apply(this.items[Z],arguments);}}return this;};k.prototype.getBBox=function(){var e=[],ac=[],R=[],aa=[];for(var Z=this.items.length;Z--;){var ab=this.items[Z].getBBox();e.push(ab.x);ac.push(ab.y);R.push(ab.x+ab.width);aa.push(ab.y+ab.height);}e=Math.min.apply(Math,e);ac=Math.min.apply(Math,ac);return{x:e,y:ac,width:Math.max.apply(Math,R)-e,height:Math.max.apply(Math,aa)-ac};};f.registerFont=function(i){if(!i.face){return i;}this.fonts=this.fonts||{};var Z={w:i.w,face:{},glyphs:{}},R=i.face["font-family"];for(var ac in i.face){if(i.face.hasOwnProperty(ac)){Z.face[ac]=i.face[ac];}}if(this.fonts[R]){this.fonts[R].push(Z);}else{this.fonts[R]=[Z];}if(!i.svg){Z.face["units-per-em"]=parseInt(i.face["units-per-em"],10);for(var aa in i.glyphs){if(i.glyphs.hasOwnProperty(aa)){var ab=i.glyphs[aa];Z.glyphs[aa]={w:ab.w,k:{},d:ab.d&&"M"+ab.d.replace(/[mlcxtrv]/g,function(ad){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[ad]||"M";})+"z"};if(ab.k){for(var e in ab.k){if(ab.khasOwnProperty(e)){Z.glyphs[aa].k[e]=ab.k[e];}}}}}}return i;};b.getFont=function(ae,af,R,aa){aa=aa||"normal";R=R||"normal";af=+af||{normal:400,bold:700,lighter:300,bolder:800}[af]||400;var ab=f.fonts[ae];if(!ab){var Z=new RegExp("(^|\\s)"+ae.replace(/[^\w\d\s+!~.:_-]/g,"")+"(\\s|$)","i");for(var e in f.fonts){if(f.fonts.hasOwnProperty(e)){if(Z.test(e)){ab=f.fonts[e];break;}}}}var ac;if(ab){for(var ad=0,ag=ab.length;ad<ag;ad++){ac=ab[ad];if(ac.face["font-weight"]==af&&(ac.face["font-style"]==R||!ac.face["font-style"])&&ac.face["font-stretch"]==aa){break;}}}return ac;};b.print=function(ag,af,ad,R,ak){var ab=this.set(),ae=(ad+"").split(""),e=0,aj="",aa;f.is(R,"string")&&(R=this.getFont(R));if(R){aa=(ak||16)/R.face["units-per-em"];for(var ac=0,ah=ae.length;ac<ah;ac++){var Z=ac&&R.glyphs[ae[ac-1]]||{},ai=R.glyphs[ae[ac]];e+=ac?(Z.w||R.w)+(Z.k&&Z.k[ae[ac]]||0):0;ai&&ai.d&&ab.push(this.path(ai.d).attr({fill:"#000",stroke:"none",translation:[e,0]}));}ab.scale(aa,aa,0,af).translate(ag,(ak||16)/2);}return ab;};f.format=function(i){var e=f.is(arguments[1],"array")?[0].concat(arguments[1]):arguments;i&&f.is(i,"string")&&e.length-1&&(i=i.replace(/\{(\d+)\}/g,function(Z,R){return e[++R]==null?"":e[R];}));return i;};f.ninja=function(){var R=window.Raphael,i;if(P.was){window.Raphael=P.is;}else{try{delete window.Raphael;}catch(Z){window.Raphael=i;}}return R;};f.el=m.prototype;return f;})(); \ No newline at end of file
diff --git a/content/Explore/js/subject.js b/content/Explore/js/subject.js
deleted file mode 100755
index 95cf4bd..0000000
--- a/content/Explore/js/subject.js
+++ /dev/null
@@ -1,205 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma(assetList);
-
- k.ready(function() {
-
- logos;
-
- activities;
-
- k.ready(function(){
-
- //game logic
-
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 5;
- var rows = 2 + (activities.length / cells);
- var maxx = 1200;
- var cellsize = 64;
- var sz = cellsize;
- var maxy = rows * 1.5 * cellsize;
- if (maxy < 800){
- maxy = 800;
- };
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 1.7 * cellsize;
- var ystart = maxy - cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
-
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX
- y = $e.pageY
- $.each(acts, function() {
- xy = this;
- // directory structure: activity/karma/content/subject/bundle
- if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2]) && (y > xy[2] - cellsize) ) {
- pth = xy[4]+'/index.html';
- window.location = pth;
- };
- });
- });
- // ladder
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- ctx.beginPath();
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {
- break;
- };
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if (activity < activities.length){
- ctx.strokeRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.strokeRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.strokeRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) &&
- (activity < activities.length)) {
- if (row % 2 == 0) {
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.stroke();
- } else {
- x = xstart;
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.stroke();
- }
- }
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta;
- }
- }
-
- function drawarrow(x,y,sz) {
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- };
-
- function drawmilestone(activity){
- var capcolor;
- x = activity[1];
- y = activity[2];
- ctx.fillStyle = "black"
- capcolor = activity[5];
- ctx.moveTo(x,y);
- ctx.lineTo(x,y-cellsize);
- ctx.moveTo(x+cellsize, y-cellsize);
- ctx.lineTo(x+cellsize, y);
- ctx.fillText(ix, x + (cellsize * 0.3), y-(cellsize * 0.4), cellsize);
- ctx.stroke();
- ctx.beginPath();
- ctx.moveTo(x, y-cellsize);
- ctx.arc(x+0.5*cellsize,y-cellsize,0.5*cellsize,Math.PI,0,0);
- ctx.closePath();
- ctx.fillStyle = capcolor;
- ctx.fill();
- ctx.stroke();
- };
-
- function drawlogo(x, y, activity) {
- var il, ty, ls, cc;
- id = activities[activity][0];
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- if ((activities[activity].length) > 4){
- cc = activities[activity][5];
- }else{
- cc = 'cyan';
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls, cc];
- if (id == 0){
- drawmilestone(acts[idx]);
- } else {
- // draw logo
- ctx.drawImage(k.image[logos[id-1]].media, x, y - cellsize);
- if (ix > 0) {
- ctx.textAlign = 'center'
- ctx.fillText(ix, x + cellsize/2, y+cellsize/4, cellsize);
- };
- };
- }
- }
-
- draw();
-
- });
- });
-
-});
diff --git a/content/Explore/js/ui.core-draggable-resizable-dialog.js b/content/Explore/js/ui.core-draggable-resizable-dialog.js
deleted file mode 100755
index af96b59..0000000
--- a/content/Explore/js/ui.core-draggable-resizable-dialog.js
+++ /dev/null
@@ -1,2756 +0,0 @@
-/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;jQuery.ui || (function($) {
-
-var _remove = $.fn.remove,
- isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
-
-//Helper functions and ui object
-$.ui = {
- version: "1.7.2",
-
- // $.ui.plugin is deprecated. Use the proxy pattern instead.
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set || !instance.element[0].parentNode) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
-
- contains: function(a, b) {
- return document.compareDocumentPosition
- ? a.compareDocumentPosition(b) & 16
- : a !== b && a.contains(b);
- },
-
- hasScroll: function(el, a) {
-
- //If overflow is hidden, the element might have extra content, but the user wants to hide it
- if ($(el).css('overflow') == 'hidden') { return false; }
-
- var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
- has = false;
-
- if (el[scroll] > 0) { return true; }
-
- // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
- el[scroll] = 1;
- has = (el[scroll] > 0);
- el[scroll] = 0;
- return has;
- },
-
- isOverAxis: function(x, reference, size) {
- //Determines when x coordinate is over "b" element axis
- return (x > reference) && (x < (reference + size));
- },
-
- isOver: function(y, x, top, left, height, width) {
- //Determines when x, y coordinates is over "b" element
- return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
- },
-
- keyCode: {
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
-};
-
-// WAI-ARIA normalization
-if (isFF2) {
- var attr = $.attr,
- removeAttr = $.fn.removeAttr,
- ariaNS = "http://www.w3.org/2005/07/aaa",
- ariaState = /^aria-/,
- ariaRole = /^wairole:/;
-
- $.attr = function(elem, name, value) {
- var set = value !== undefined;
-
- return (name == 'role'
- ? (set
- ? attr.call(this, elem, name, "wairole:" + value)
- : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
- : (ariaState.test(name)
- ? (set
- ? elem.setAttributeNS(ariaNS,
- name.replace(ariaState, "aaa:"), value)
- : attr.call(this, elem, name.replace(ariaState, "aaa:")))
- : attr.apply(this, arguments)));
- };
-
- $.fn.removeAttr = function(name) {
- return (ariaState.test(name)
- ? this.each(function() {
- this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
- }) : removeAttr.call(this, name));
- };
-}
-
-//jQuery plugins
-$.fn.extend({
- remove: function() {
- // Safari has a native remove event which actually removes DOM elements,
- // so we have to use triggerHandler instead of trigger (#3037).
- $("*", this).add(this).each(function() {
- $(this).triggerHandler("remove");
- });
- return _remove.apply(this, arguments );
- },
-
- enableSelection: function() {
- return this
- .attr('unselectable', 'off')
- .css('MozUserSelect', '')
- .unbind('selectstart.ui');
- },
-
- disableSelection: function() {
- return this
- .attr('unselectable', 'on')
- .css('MozUserSelect', 'none')
- .bind('selectstart.ui', function() { return false; });
- },
-
- scrollParent: function() {
- var scrollParent;
- if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- }
-
- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
- }
-});
-
-
-//Additional selectors
-$.extend($.expr[':'], {
- data: function(elem, i, match) {
- return !!$.data(elem, match[3]);
- },
-
- focusable: function(element) {
- var nodeName = element.nodeName.toLowerCase(),
- tabIndex = $.attr(element, 'tabindex');
- return (/input|select|textarea|button|object/.test(nodeName)
- ? !element.disabled
- : 'a' == nodeName || 'area' == nodeName
- ? element.href || !isNaN(tabIndex)
- : !isNaN(tabIndex))
- // the element and all of its ancestors must be visible
- // the browser may report that the area is hidden
- && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
- },
-
- tabbable: function(element) {
- var tabIndex = $.attr(element, 'tabindex');
- return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
- }
-});
-
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-function getter(namespace, plugin, method, args) {
- function getMethods(type) {
- var methods = $[namespace][plugin][type] || [];
- return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
- }
-
- var methods = getMethods('getter');
- if (args.length == 1 && typeof args[0] == 'string') {
- methods = methods.concat(getMethods('getterSetter'));
- }
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- // prevent calls to internal methods
- if (isMethodCall && options.substring(0, 1) == '_') {
- return this;
- }
-
- // handle getter methods
- if (isMethodCall && getter(namespace, name, options, args)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- // handle initialization and non-getter methods
- return this.each(function() {
- var instance = $.data(this, name);
-
- // constructor
- (!instance && !isMethodCall &&
- $.data(this, name, new $[namespace][name](this, options))._init());
-
- // method call
- (instance && isMethodCall && $.isFunction(instance[options]) &&
- instance[options].apply(instance, args));
- });
- };
-
- // create widget constructor
- $[namespace] = $[namespace] || {};
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.namespace = namespace;
- this.widgetName = name;
- this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({},
- $.widget.defaults,
- $[namespace][name].defaults,
- $.metadata && $.metadata.get(element)[name],
- options);
-
- this.element = $(element)
- .bind('setData.' + name, function(event, key, value) {
- if (event.target == element) {
- return self._setData(key, value);
- }
- })
- .bind('getData.' + name, function(event, key) {
- if (event.target == element) {
- return self._getData(key);
- }
- })
- .bind('remove', function() {
- return self.destroy();
- });
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-
- // TODO: merge getter and getterSetter properties from widget prototype
- // and plugin prototype
- $[namespace][name].getterSetter = 'option';
-};
-
-$.widget.prototype = {
- _init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName)
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
- .removeAttr('aria-disabled');
- },
-
- option: function(key, value) {
- var options = key,
- self = this;
-
- if (typeof key == "string") {
- if (value === undefined) {
- return this._getData(key);
- }
- options = {};
- options[key] = value;
- }
-
- $.each(options, function(key, value) {
- self._setData(key, value);
- });
- },
- _getData: function(key) {
- return this.options[key];
- },
- _setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element
- [value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled' + ' ' +
- this.namespace + '-state-disabled')
- .attr("aria-disabled", value);
- }
- },
-
- enable: function() {
- this._setData('disabled', false);
- },
- disable: function() {
- this._setData('disabled', true);
- },
-
- _trigger: function(type, event, data) {
- var callback = this.options[type],
- eventName = (type == this.widgetEventPrefix
- ? type : this.widgetEventPrefix + type);
-
- event = $.Event(event);
- event.type = eventName;
-
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if (event.originalEvent) {
- for (var i = $.event.props.length, prop; i;) {
- prop = $.event.props[--i];
- event[prop] = event.originalEvent[prop];
- }
- }
-
- this.element.trigger(event, data);
-
- return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
- || event.isDefaultPrevented());
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- _mouseInit: function() {
- var self = this;
-
- this.element
- .bind('mousedown.'+this.widgetName, function(event) {
- return self._mouseDown(event);
- })
- .bind('click.'+this.widgetName, function(event) {
- if(self._preventClickEvent) {
- self._preventClickEvent = false;
- event.stopImmediatePropagation();
- return false;
- }
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- _mouseDown: function(event) {
- // don't let more than one widget handle mouseStart
- // TODO: figure out why we have to use originalEvent
- event.originalEvent = event.originalEvent || {};
- if (event.originalEvent.mouseHandled) { return; }
-
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this._mouseUp(event));
-
- this._mouseDownEvent = event;
-
- var self = this,
- btnIsLeft = (event.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = (this._mouseStart(event) !== false);
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(event) {
- return self._mouseMove(event);
- };
- this._mouseUpDelegate = function(event) {
- return self._mouseUp(event);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- // preventDefault() is used to prevent the selection of text here -
- // however, in Safari, this causes select boxes not to be selectable
- // anymore, so this fix is needed
- ($.browser.safari || event.preventDefault());
-
- event.originalEvent.mouseHandled = true;
- return true;
- },
-
- _mouseMove: function(event) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !event.button) {
- return this._mouseUp(event);
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted =
- (this._mouseStart(this._mouseDownEvent, event) !== false);
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
- }
-
- return !this._mouseStarted;
- },
-
- _mouseUp: function(event) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this._preventClickEvent = (event.target == this._mouseDownEvent.target);
- this._mouseStop(event);
- }
-
- return false;
- },
-
- _mouseDistanceMet: function(event) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
- ) >= this.options.distance
- );
- },
-
- _mouseDelayMet: function(event) {
- return this.mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function(event) {},
- _mouseDrag: function(event) {},
- _mouseStop: function(event) {},
- _mouseCapture: function(event) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
-/*
- * jQuery UI Draggable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
- this.element[0].style.position = 'relative';
-
- (this.options.addClasses && this.element.addClass("ui-draggable"));
- (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
-
- this._mouseInit();
-
- },
-
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element
- .removeData("draggable")
- .unbind(".draggable")
- .removeClass("ui-draggable"
- + " ui-draggable-dragging"
- + " ui-draggable-disabled");
- this._mouseDestroy();
- },
-
- _mouseCapture: function(event) {
-
- var o = this.options;
-
- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
- return false;
-
- //Quit if we're not on a valid handle
- this.handle = this._getHandle(event);
- if (!this.handle)
- return false;
-
- return true;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options;
-
- //Create and append the visible helper
- this.helper = this._createHelper(event);
-
- //Cache the helper size
- this._cacheHelperProportions();
-
- //If ddmanager is used for droppables, set the global draggable
- if($.ui.ddmanager)
- $.ui.ddmanager.current = this;
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- //Cache the margins of the original element
- this._cacheMargins();
-
- //Store the helper's css position
- this.cssPosition = this.helper.css("position");
- this.scrollParent = this.helper.scrollParent();
-
- //The element's absolute position on the page minus margins
- this.offset = this.element.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- $.extend(this.offset, {
- click: { //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
- });
-
- //Generate the original position
- this.originalPosition = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
-
- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
- if(o.cursorAt)
- this._adjustOffsetFromHelper(o.cursorAt);
-
- //Set a containment if given in the options
- if(o.containment)
- this._setContainment();
-
- //Call plugins and callbacks
- this._trigger("start", event);
-
- //Recache the helper size
- this._cacheHelperProportions();
-
- //Prepare the droppable offsets
- if ($.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
-
- this.helper.addClass("ui-draggable-dragging");
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
-
- _mouseDrag: function(event, noPropagation) {
-
- //Compute the helpers position
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- if (!noPropagation) {
- var ui = this._uiHash();
- this._trigger('drag', event, ui);
- this.position = ui.position;
- }
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- //If we are using droppables, inform the manager about the drop
- var dropped = false;
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- dropped = $.ui.ddmanager.drop(this, event);
-
- //if a drop comes from outside (a sortable)
- if(this.dropped) {
- dropped = this.dropped;
- this.dropped = false;
- }
-
- if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
- self._trigger("stop", event);
- self._clear();
- });
- } else {
- this._trigger("stop", event);
- this._clear();
- }
-
- return false;
- },
-
- _getHandle: function(event) {
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
- $(this.options.handle, this.element)
- .find("*")
- .andSelf()
- .each(function() {
- if(this == event.target) handle = true;
- });
-
- return handle;
-
- },
-
- _createHelper: function(event) {
-
- var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
-
- if(!helper.parents('body').length)
- helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
-
- if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
- helper.css("position", "absolute");
-
- return helper;
-
- },
-
- _adjustOffsetFromHelper: function(obj) {
- if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
- if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
- if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- },
-
- _getParentOffset: function() {
-
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset();
-
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
- po = { top: 0, left: 0 };
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- },
-
- _getRelativeOffset: function() {
-
- if(this.cssPosition == "relative") {
- var p = this.element.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return { top: 0, left: 0 };
- }
-
- },
-
- _cacheMargins: function() {
- this.margins = {
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
- },
-
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
-
- _setContainment: function() {
-
- var o = this.options;
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
- var ce = $(o.containment)[0]; if(!ce) return;
- var co = $(o.containment).offset();
- var over = ($(ce).css("overflow") != 'hidden');
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
- ];
- } else if(o.containment.constructor == Array) {
- this.containment = o.containment;
- }
-
- },
-
- _convertPositionTo: function(d, pos) {
-
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- return {
- top: (
- pos.top // The absolute mouse position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
- ),
- left: (
- pos.left // The absolute mouse position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
- )
- };
-
- },
-
- _generatePosition: function(event) {
-
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- // This is another very weird special case that only happens for relative elements:
- // 1. If the css position is relative
- // 2. and the scroll parent is the document or similar to the offset parent
- // we have to refresh the relative offset during the scroll so there are no jumps
- if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
- this.offset.relative = this._getRelativeOffset();
- }
-
- var pageX = event.pageX;
- var pageY = event.pageY;
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
- if(this.containment) {
- if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
- if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
- if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
- if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
- }
-
- if(o.grid) {
- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
- pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
- pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- }
-
- return {
- top: (
- pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
- ),
- left: (
- pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
- )
- };
-
- },
-
- _clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
-
- _trigger: function(type, event, ui) {
- ui = ui || this._uiHash();
- $.ui.plugin.call(this, type, [event, ui]);
- if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
- return $.widget.prototype._trigger.call(this, type, event, ui);
- },
-
- plugins: {},
-
- _uiHash: function(event) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs, //deprecated
- offset: this.positionAbs
- };
- }
-
-}));
-
-$.extend($.ui.draggable, {
- version: "1.7.2",
- eventPrefix: "drag",
- defaults: {
- addClasses: true,
- appendTo: "parent",
- axis: false,
- cancel: ":input,option",
- connectToSortable: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- delay: 0,
- distance: 1,
- grid: false,
- handle: false,
- helper: "original",
- iframeFix: false,
- opacity: false,
- refreshPositions: false,
- revert: false,
- revertDuration: 500,
- scope: "default",
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: false,
- snapMode: "both",
- snapTolerance: 20,
- stack: false,
- zIndex: false
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options,
- uiSortable = $.extend({}, ui, { item: inst.element });
- inst.sortables = [];
- $(o.connectToSortable).each(function() {
- var sortable = $.data(this, 'sortable');
- if (sortable && !sortable.options.disabled) {
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
- sortable._trigger("activate", event, uiSortable);
- }
- });
-
- },
- stop: function(event, ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable"),
- uiSortable = $.extend({}, ui, { item: inst.element });
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
-
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
-
- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
- if(this.shouldRevert) this.instance.options.revert = true;
-
- //Trigger the stop of the sortable
- this.instance._mouseStop(event);
-
- this.instance.options.helper = this.instance.options._helper;
-
- //If the helper has been the original item, restore properties in the sortable
- if(inst.options.helper == 'original')
- this.instance.currentItem.css({ top: 'auto', left: 'auto' });
-
- } else {
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
- this.instance._trigger("deactivate", event, uiSortable);
- }
-
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
- var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
- var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
- var itemHeight = o.height, itemWidth = o.width;
- var itemTop = o.top, itemLeft = o.left;
-
- return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
- };
-
- $.each(inst.sortables, function(i) {
-
- //Copy over some variables to allow calling the sortable's native _intersectsWith
- this.instance.positionAbs = inst.positionAbs;
- this.instance.helperProportions = inst.helperProportions;
- this.instance.offset.click = inst.offset.click;
-
- if(this.instance._intersectsWith(this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
-
- this.instance.isOver = 1;
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- event.target = this.instance.currentItem[0];
- this.instance._mouseCapture(event, true);
- this.instance._mouseStart(event, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst._trigger("toSortable", event);
- inst.dropped = this.instance.element; //draggable revert needs that
- //hack so receive/update callbacks work (mostly)
- inst.currentItem = inst.element;
- this.instance.fromOutside = inst;
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance._mouseDrag(event);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
-
- //Prevent reverting on this forced stop
- this.instance.options.revert = false;
-
- // The out event needs to be triggered independently
- this.instance._trigger('out', event, this.instance._uiHash(this.instance));
-
- this.instance._mouseStop(event, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst._trigger("fromSortable", event);
- inst.dropped = false; //draggable revert needs that
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(event, ui) {
- var t = $('body'), o = $(this).data('draggable').options;
- if (t.css("cursor")) o._cursor = t.css("cursor");
- t.css("cursor", o.cursor);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if (o._cursor) $('body').css("cursor", o._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(event, ui) {
- var o = $(this).data('draggable').options;
- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(event, ui) {
- $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data('draggable').options;
- if(t.css("opacity")) o._opacity = t.css("opacity");
- t.css('opacity', o.opacity);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if(o._opacity) $(ui.helper).css('opacity', o._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(event, ui) {
- var i = $(this).data("draggable");
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
- },
- drag: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options, scrolled = false;
-
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
-
- if(!o.axis || o.axis != 'x') {
- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
- else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
- }
-
- if(!o.axis || o.axis != 'y') {
- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
- else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
- }
-
- } else {
-
- if(!o.axis || o.axis != 'x') {
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(!o.axis || o.axis != 'y') {
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(i, event);
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options;
- i.snapElements = [];
-
- $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != i.element[0]) i.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options;
- var d = o.snapTolerance;
-
- var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
- if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = false;
- continue;
- }
-
- if(o.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= d;
- var bs = Math.abs(b - y1) <= d;
- var ls = Math.abs(l - x2) <= d;
- var rs = Math.abs(r - x1) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
- }
-
- var first = (ts || bs || ls || rs);
-
- if(o.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= d;
- var bs = Math.abs(b - y2) <= d;
- var ls = Math.abs(l - x1) <= d;
- var rs = Math.abs(r - x2) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
- }
-
- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
-
- };
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(event, ui) {
-
- var o = $(this).data("draggable").options;
-
- var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = o.stack.min + i;
- });
-
- this[0].style.zIndex = o.stack.min + group.length;
-
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("draggable").options;
- if(t.css("zIndex")) o._zIndex = t.css("zIndex");
- t.css('zIndex', o.zIndex);
- },
- stop: function(event, ui) {
- var o = $(this).data("draggable").options;
- if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Resizable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.resizable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- var self = this, o = this.options;
- this.element.addClass("ui-resizable");
-
- $.extend(this, {
- _aspectRatio: !!(o.aspectRatio),
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
- });
-
- //Wrap the element if it cannot hold child nodes
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
-
- //Opera fix for relative positioning
- if (/relative/.test(this.element.css('position')) && $.browser.opera)
- this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- this.element.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
- position: this.element.css('position'),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css('top'),
- left: this.element.css('left')
- })
- );
-
- //Overwrite the original this.element
- this.element = this.element.parent().data(
- "resizable", this.element.data('resizable')
- );
-
- this.elementIsWrapper = true;
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- this.originalResizeStyle = this.originalElement.css('resize');
- this.originalElement.css('resize', 'none');
-
- //Push the actual element to our proportionallyResize internal array
- this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
-
- // avoid IE jump (hard set the margin)
- this.originalElement.css({ margin: this.originalElement.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
-
- }
-
- this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
- if(this.handles.constructor == String) {
-
- if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
- var n = this.handles.split(","); this.handles = {};
-
- for(var i = 0; i < n.length; i++) {
-
- var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
- var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
-
- // increase zIndex of sw, se, ne, nw axis
- //TODO : this modifies original option
- if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
-
- //TODO : What's going on here?
- if ('se' == handle) {
- axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
- };
-
- //Insert into internal handles object and append to element
- this.handles[handle] = '.ui-resizable-'+handle;
- this.element.append(axis);
- }
-
- }
-
- this._renderAxis = function(target) {
-
- target = target || this.element;
-
- for(var i in this.handles) {
-
- if(this.handles[i].constructor == String)
- this.handles[i] = $(this.handles[i], this.element).show();
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(this.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
-
- }
-
- //TODO: What's that good for? There's not anything to be executed left
- if(!$(this.handles[i]).length)
- continue;
-
- }
- };
-
- //TODO: make renderAxis a prototype function
- this._renderAxis(this.element);
-
- this._handles = $('.ui-resizable-handle', this.element)
- .disableSelection();
-
- //Matching axis name
- this._handles.mouseover(function() {
- if (!self.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- this._handles.hide();
- $(this.element)
- .addClass("ui-resizable-autohide")
- .hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- self._handles.show();
- },
- function(){
- if (!self.resizing) {
- $(this).addClass("ui-resizable-autohide");
- self._handles.hide();
- }
- });
- }
-
- //Initialize the mouse interaction
- this._mouseInit();
-
- },
-
- destroy: function() {
-
- this._mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- //TODO: Unwrap at same DOM position
- if (this.elementIsWrapper) {
- _destroy(this.element);
- var wrapper = this.element;
- wrapper.parent().append(
- this.originalElement.css({
- position: wrapper.css('position'),
- width: wrapper.outerWidth(),
- height: wrapper.outerHeight(),
- top: wrapper.css('top'),
- left: wrapper.css('left')
- })
- ).end().remove();
- }
-
- this.originalElement.css('resize', this.originalResizeStyle);
- _destroy(this.originalElement);
-
- },
-
- _mouseCapture: function(event) {
-
- var handle = false;
- for(var i in this.handles) {
- if($(this.handles[i])[0] == event.target) handle = true;
- }
-
- return this.options.disabled || !!handle;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options, iniPos = this.element.position(), el = this.element;
-
- this.resizing = true;
- this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix for http://dev.jquery.com/ticket/1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
- el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && (/relative/).test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- if (o.containment) {
- curleft += $(o.containment).scrollLeft() || 0;
- curtop += $(o.containment).scrollTop() || 0;
- }
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
-
- //Aspect Ratio
- this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
-
- var cursor = $('.ui-resizable-' + this.axis).css('cursor');
- $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
-
- el.addClass("ui-resizable-resizing");
- this._propagate("start", event);
- return true;
- },
-
- _mouseDrag: function(event) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (this._aspectRatio || event.shiftKey)
- data = this._updateRatio(data, event);
-
- data = this._respectSize(data, event);
-
- // plugins callbacks need to be called first
- this._propagate("resize", event);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!this._helper && this._proportionallyResizeElements.length)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this._trigger('resize', event, this.ui());
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- this.resizing = false;
- var o = this.options, self = this;
-
- if(this._helper) {
- var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- self.helper.height(self.size.height);
- self.helper.width(self.size.width);
-
- if (this._helper && !o.animate) this._proportionallyResize();
- }
-
- $('body').css('cursor', 'auto');
-
- this.element.removeClass("ui-resizable-resizing");
-
- this._propagate("stop", event);
-
- if (this._helper) this.helper.remove();
- return false;
-
- },
-
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (isNumber(data.left)) this.position.left = data.left;
- if (isNumber(data.top)) this.position.top = data.top;
- if (isNumber(data.height)) this.size.height = data.height;
- if (isNumber(data.width)) this.size.width = data.width;
- },
-
- _updateRatio: function(data, event) {
-
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height * this.aspectRatio);
- else if (data.width) data.height = (csize.width / this.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
-
- _respectSize: function(data, event) {
-
- var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
-
- _proportionallyResize: function() {
-
- var o = this.options;
- if (!this._proportionallyResizeElements.length) return;
- var element = this.helper || this.element;
-
- for (var i=0; i < this._proportionallyResizeElements.length; i++) {
-
- var prel = this._proportionallyResizeElements[i];
-
- if (!this.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- this.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
-
- if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
- continue;
-
- prel.css({
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
- });
-
- };
-
- },
-
- _renderProxy: function() {
-
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(this._helper) {
-
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset TODO: This seems broken
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(this._helper).css({
- width: this.element.outerWidth() + pxyoffset,
- height: this.element.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex //TODO: Don't modify option
- });
-
- this.helper
- .appendTo("body")
- .disableSelection();
-
- } else {
- this.helper = this.element;
- }
-
- },
-
- _change: {
- e: function(event, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(event, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- sw: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- },
- ne: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- nw: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- }
- },
-
- _propagate: function(n, event) {
- $.ui.plugin.call(this, n, [event, this.ui()]);
- (n != "resize" && this._trigger(n, event, this.ui()));
- },
-
- plugins: {},
-
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- }
-
-}));
-
-$.extend($.ui.resizable, {
- version: "1.7.2",
- eventPrefix: "resize",
- defaults: {
- alsoResize: false,
- animate: false,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: false,
- autoHide: false,
- cancel: ":input,option",
- containment: false,
- delay: 0,
- distance: 1,
- ghost: false,
- grid: false,
- handles: "e,s,se",
- helper: false,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- zIndex: 1000
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options;
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera) {
- self._revertToRelativePosition = true;
- el.css({ position: 'absolute', top: 'auto', left: 'auto' });
- }
-
- el.css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable");
-
- //Opera fixing relative position
- if (self._revertToRelativePosition && $.browser.opera) {
- self._revertToRelativePosition = false;
- el.css({ position: 'relative' });
- }
-
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options;
-
- var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration,
- easing: o.animateEasing,
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self._propagate("resize", event);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
- // i'm a node, so compute top, left, right, bottom
- else {
- var element = $(ce), p = [];
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
-
- self.containerOffset = element.offset();
- self.containerPosition = element.position();
- self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options,
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
-
- if (cp.left < (self._helper ? co.left : 0)) {
- self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width / o.aspectRatio;
- self.position.left = o.helper ? co.left : 0;
- }
-
- if (cp.top < (self._helper ? co.top : 0)) {
- self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height * o.aspectRatio;
- self.position.top = self._helper ? co.top : 0;
- }
-
- self.offset.left = self.parentData.left+self.position.left;
- self.offset.top = self.parentData.top+self.position.top;
-
- var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
- hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
-
- var isParent = self.containerElement.get(0) == self.element.parent().get(0),
- isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
-
- if(isParent && isOffsetRelative) woset -= self.parentData.left;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width / self.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height * self.aspectRatio;
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
-
- if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- if (self._helper && !o.animate && (/static/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options, cs = self.size;
-
- self.ghost = self.originalElement.clone();
- self.ghost
- .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
- .addClass('ui-resizable-ghost')
- .addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-var num = function(v) {
- return parseInt(v, 10) || 0;
-};
-
-var isNumber = function(value) {
- return !isNaN(parseInt(value, 10));
-};
-
-})(jQuery);
-/*
- * jQuery UI Dialog 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
- },
-
- uiDialogClasses =
- 'ui-dialog ' +
- 'ui-widget ' +
- 'ui-widget-content ' +
- 'ui-corner-all ';
-
-$.widget("ui.dialog", {
-
- _init: function() {
- this.originalTitle = this.element.attr('title');
-
- var self = this,
- options = this.options,
-
- title = options.title || this.originalTitle || '&nbsp;',
- titleId = $.ui.dialog.getTitleId(this.element),
-
- uiDialog = (this.uiDialog = $('<div/>'))
- .appendTo(document.body)
- .hide()
- .addClass(uiDialogClasses + options.dialogClass)
- .css({
- position: 'absolute',
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
- (options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event));
- })
- .attr({
- role: 'dialog',
- 'aria-labelledby': titleId
- })
- .mousedown(function(event) {
- self.moveToTop(false, event);
- }),
-
- uiDialogContent = this.element
- .show()
- .removeAttr('title')
- .addClass(
- 'ui-dialog-content ' +
- 'ui-widget-content')
- .appendTo(uiDialog),
-
- uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>'))
- .addClass(
- 'ui-dialog-titlebar ' +
- 'ui-widget-header ' +
- 'ui-corner-all ' +
- 'ui-helper-clearfix'
- )
- .prependTo(uiDialog),
-
- uiDialogTitlebarClose = $('<a href="#"/>')
- .addClass(
- 'ui-dialog-titlebar-close ' +
- 'ui-corner-all'
- )
- .attr('role', 'button')
- .hover(
- function() {
- uiDialogTitlebarClose.addClass('ui-state-hover');
- },
- function() {
- uiDialogTitlebarClose.removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- uiDialogTitlebarClose.addClass('ui-state-focus');
- })
- .blur(function() {
- uiDialogTitlebarClose.removeClass('ui-state-focus');
- })
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function(event) {
- self.close(event);
- return false;
- })
- .appendTo(uiDialogTitlebar),
-
- uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
- .addClass(
- 'ui-icon ' +
- 'ui-icon-closethick'
- )
- .text(options.closeText)
- .appendTo(uiDialogTitlebarClose),
-
- uiDialogTitle = $('<span/>')
- .addClass('ui-dialog-title')
- .attr('id', titleId)
- .html(title)
- .prependTo(uiDialogTitlebar);
-
- uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
-
- (options.draggable && $.fn.draggable && this._makeDraggable());
- (options.resizable && $.fn.resizable && this._makeResizable());
-
- this._createButtons(options.buttons);
- this._isOpen = false;
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
-
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content ui-widget-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
-
- (this.originalTitle && this.element.attr('title', this.originalTitle));
- },
-
- close: function(event) {
- var self = this;
-
- if (false === self._trigger('beforeclose', event)) {
- return;
- }
-
- (self.overlay && self.overlay.destroy());
- self.uiDialog.unbind('keypress.ui-dialog');
-
- (self.options.hide
- ? self.uiDialog.hide(self.options.hide, function() {
- self._trigger('close', event);
- })
- : self.uiDialog.hide() && self._trigger('close', event));
-
- $.ui.dialog.overlay.resize();
-
- self._isOpen = false;
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- if (self.options.modal) {
- var maxZ = 0;
- $('.ui-dialog').each(function() {
- if (this != self.uiDialog[0]) {
- maxZ = Math.max(maxZ, $(this).css('z-index'));
- }
- });
- $.ui.dialog.maxZ = maxZ;
- }
- },
-
- isOpen: function() {
- return this._isOpen;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force, event) {
-
- if ((this.options.modal && !force)
- || (!this.options.stack && !this.options.modal)) {
- return this._trigger('focus', event);
- }
-
- if (this.options.zIndex > $.ui.dialog.maxZ) {
- $.ui.dialog.maxZ = this.options.zIndex;
- }
- (this.overlay && this.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = ++$.ui.dialog.maxZ));
-
- //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
- // http://ui.jquery.com/bugs/ticket/3193
- var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') };
- this.uiDialog.css('z-index', ++$.ui.dialog.maxZ);
- this.element.attr(saveScroll);
- this._trigger('focus', event);
- },
-
- open: function() {
- if (this._isOpen) { return; }
-
- var options = this.options,
- uiDialog = this.uiDialog;
-
- this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
- (uiDialog.next().length && uiDialog.appendTo('body'));
- this._size();
- this._position(options.position);
- uiDialog.show(options.show);
- this.moveToTop(true);
-
- // prevent tabbing out of modal dialogs
- (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) {
- if (event.keyCode != $.ui.keyCode.TAB) {
- return;
- }
-
- var tabbables = $(':tabbable', this),
- first = tabbables.filter(':first')[0],
- last = tabbables.filter(':last')[0];
-
- if (event.target == last && !event.shiftKey) {
- setTimeout(function() {
- first.focus();
- }, 1);
- } else if (event.target == first && event.shiftKey) {
- setTimeout(function() {
- last.focus();
- }, 1);
- }
- }));
-
- // set focus to the first tabbable element in the content area or the first button
- // if there are no tabbable elements, set focus on the dialog itself
- $([])
- .add(uiDialog.find('.ui-dialog-content :tabbable:first'))
- .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
- .add(uiDialog)
- .filter(':first')
- .focus();
-
- this._trigger('open');
- this._isOpen = true;
- },
-
- _createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = $('<div></div>')
- .addClass(
- 'ui-dialog-buttonpane ' +
- 'ui-widget-content ' +
- 'ui-helper-clearfix'
- );
-
- // if we already have a button pane, remove it
- this.uiDialog.find('.ui-dialog-buttonpane').remove();
-
- (typeof buttons == 'object' && buttons !== null &&
- $.each(buttons, function() { return !(hasButtons = true); }));
- if (hasButtons) {
- $.each(buttons, function(name, fn) {
- $('<button type="button"></button>')
- .addClass(
- 'ui-state-default ' +
- 'ui-corner-all'
- )
- .text(name)
- .click(function() { fn.apply(self.element[0], arguments); })
- .hover(
- function() {
- $(this).addClass('ui-state-hover');
- },
- function() {
- $(this).removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- $(this).addClass('ui-state-focus');
- })
- .blur(function() {
- $(this).removeClass('ui-state-focus');
- })
- .appendTo(uiDialogButtonPane);
- });
- uiDialogButtonPane.appendTo(this.uiDialog);
- }
- },
-
- _makeDraggable: function() {
- var self = this,
- options = this.options,
- heightBeforeDrag;
-
- this.uiDialog.draggable({
- cancel: '.ui-dialog-content',
- handle: '.ui-dialog-titlebar',
- containment: 'document',
- start: function() {
- heightBeforeDrag = options.height;
- $(this).height($(this).height()).addClass("ui-dialog-dragging");
- (options.dragStart && options.dragStart.apply(self.element[0], arguments));
- },
- drag: function() {
- (options.drag && options.drag.apply(self.element[0], arguments));
- },
- stop: function() {
- $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
- (options.dragStop && options.dragStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- },
-
- _makeResizable: function(handles) {
- handles = (handles === undefined ? this.options.resizable : handles);
- var self = this,
- options = this.options,
- resizeHandles = typeof handles == 'string'
- ? handles
- : 'n,e,s,w,se,sw,ne,nw';
-
- this.uiDialog.resizable({
- cancel: '.ui-dialog-content',
- alsoResize: this.element,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: function() {
- $(this).addClass("ui-dialog-resizing");
- (options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
- },
- resize: function() {
- (options.resize && options.resize.apply(self.element[0], arguments));
- },
- handles: resizeHandles,
- stop: function() {
- $(this).removeClass("ui-dialog-resizing");
- options.height = $(this).height();
- options.width = $(this).width();
- (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- })
- .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
- },
-
- _position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += wnd.width() - this.uiDialog.outerWidth();
- break;
- default:
- case 'center':
- pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += wnd.height() - this.uiDialog.outerHeight();
- break;
- default:
- case 'middle':
- pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2;
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- _setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "buttons":
- this._createButtons(value);
- break;
- case "closeText":
- this.uiDialogTitlebarCloseText.text(value);
- break;
- case "dialogClass":
- this.uiDialog
- .removeClass(this.options.dialogClass)
- .addClass(uiDialogClasses + value);
- break;
- case "draggable":
- (value
- ? this._makeDraggable()
- : this.uiDialog.draggable('destroy'));
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this._position(value);
- break;
- case "resizable":
- var uiDialog = this.uiDialog,
- isResizable = this.uiDialog.is(':data(resizable)');
-
- // currently resizable, becoming non-resizable
- (isResizable && !value && uiDialog.resizable('destroy'));
-
- // currently resizable, changing handles
- (isResizable && typeof value == 'string' &&
- uiDialog.resizable('option', 'handles', value));
-
- // currently non-resizable, becoming resizable
- (isResizable || this._makeResizable(value));
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).html(value || '&nbsp;');
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
-
- $.widget.prototype._setData.apply(this, arguments);
- },
-
- _size: function() {
- /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
- * divs will both have width and height set, so we need to reset them
- */
- var options = this.options;
-
- // reset content sizing
- this.element.css({
- height: 0,
- minHeight: 0,
- width: 'auto'
- });
-
- // reset wrapper sizing
- // determine the height of all the non-content elements
- var nonContentHeight = this.uiDialog.css({
- height: 'auto',
- width: options.width
- })
- .height();
-
- this.element
- .css({
- minHeight: Math.max(options.minHeight - nonContentHeight, 0),
- height: options.height == 'auto'
- ? 'auto'
- : Math.max(options.height - nonContentHeight, 0)
- });
- }
-});
-
-$.extend($.ui.dialog, {
- version: "1.7.2",
- defaults: {
- autoOpen: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- dialogClass: '',
- draggable: true,
- hide: null,
- height: 'auto',
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: 'center',
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
- },
-
- getter: 'isOpen',
-
- uuid: 0,
- maxZ: 0,
-
- getTitleId: function($el) {
- return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid);
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- maxZ: 0,
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(event) { return event + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- // handle $(el).dialog().dialog('close') (see #4065)
- if ($.ui.dialog.overlay.instances.length) {
- $(document).bind($.ui.dialog.overlay.events, function(event) {
- var dialogZ = $(event.target).parents('.ui-dialog').css('zIndex') || 0;
- return (dialogZ > $.ui.dialog.overlay.maxZ);
- });
- }
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(event) {
- (dialog.options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event));
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div></div>').appendTo(document.body)
- .addClass('ui-widget-overlay').css({
- width: this.width(),
- height: this.height()
- });
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- var maxZ = 0;
- $.each(this.instances, function() {
- maxZ = Math.max(maxZ, this.css('z-index'));
- });
- this.maxZ = maxZ;
- },
-
- height: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
diff --git a/content/Explore/js/ui.core.js b/content/Explore/js/ui.core.js
deleted file mode 100755
index 5493e0a..0000000
--- a/content/Explore/js/ui.core.js
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;jQuery.ui || (function($) {
-
-var _remove = $.fn.remove,
- isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
-
-//Helper functions and ui object
-$.ui = {
- version: "1.7.2",
-
- // $.ui.plugin is deprecated. Use the proxy pattern instead.
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set || !instance.element[0].parentNode) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
-
- contains: function(a, b) {
- return document.compareDocumentPosition
- ? a.compareDocumentPosition(b) & 16
- : a !== b && a.contains(b);
- },
-
- hasScroll: function(el, a) {
-
- //If overflow is hidden, the element might have extra content, but the user wants to hide it
- if ($(el).css('overflow') == 'hidden') { return false; }
-
- var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
- has = false;
-
- if (el[scroll] > 0) { return true; }
-
- // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
- el[scroll] = 1;
- has = (el[scroll] > 0);
- el[scroll] = 0;
- return has;
- },
-
- isOverAxis: function(x, reference, size) {
- //Determines when x coordinate is over "b" element axis
- return (x > reference) && (x < (reference + size));
- },
-
- isOver: function(y, x, top, left, height, width) {
- //Determines when x, y coordinates is over "b" element
- return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
- },
-
- keyCode: {
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
-};
-
-// WAI-ARIA normalization
-if (isFF2) {
- var attr = $.attr,
- removeAttr = $.fn.removeAttr,
- ariaNS = "http://www.w3.org/2005/07/aaa",
- ariaState = /^aria-/,
- ariaRole = /^wairole:/;
-
- $.attr = function(elem, name, value) {
- var set = value !== undefined;
-
- return (name == 'role'
- ? (set
- ? attr.call(this, elem, name, "wairole:" + value)
- : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
- : (ariaState.test(name)
- ? (set
- ? elem.setAttributeNS(ariaNS,
- name.replace(ariaState, "aaa:"), value)
- : attr.call(this, elem, name.replace(ariaState, "aaa:")))
- : attr.apply(this, arguments)));
- };
-
- $.fn.removeAttr = function(name) {
- return (ariaState.test(name)
- ? this.each(function() {
- this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
- }) : removeAttr.call(this, name));
- };
-}
-
-//jQuery plugins
-$.fn.extend({
- remove: function() {
- // Safari has a native remove event which actually removes DOM elements,
- // so we have to use triggerHandler instead of trigger (#3037).
- $("*", this).add(this).each(function() {
- $(this).triggerHandler("remove");
- });
- return _remove.apply(this, arguments );
- },
-
- enableSelection: function() {
- return this
- .attr('unselectable', 'off')
- .css('MozUserSelect', '')
- .unbind('selectstart.ui');
- },
-
- disableSelection: function() {
- return this
- .attr('unselectable', 'on')
- .css('MozUserSelect', 'none')
- .bind('selectstart.ui', function() { return false; });
- },
-
- scrollParent: function() {
- var scrollParent;
- if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- }
-
- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
- }
-});
-
-
-//Additional selectors
-$.extend($.expr[':'], {
- data: function(elem, i, match) {
- return !!$.data(elem, match[3]);
- },
-
- focusable: function(element) {
- var nodeName = element.nodeName.toLowerCase(),
- tabIndex = $.attr(element, 'tabindex');
- return (/input|select|textarea|button|object/.test(nodeName)
- ? !element.disabled
- : 'a' == nodeName || 'area' == nodeName
- ? element.href || !isNaN(tabIndex)
- : !isNaN(tabIndex))
- // the element and all of its ancestors must be visible
- // the browser may report that the area is hidden
- && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
- },
-
- tabbable: function(element) {
- var tabIndex = $.attr(element, 'tabindex');
- return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
- }
-});
-
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-function getter(namespace, plugin, method, args) {
- function getMethods(type) {
- var methods = $[namespace][plugin][type] || [];
- return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
- }
-
- var methods = getMethods('getter');
- if (args.length == 1 && typeof args[0] == 'string') {
- methods = methods.concat(getMethods('getterSetter'));
- }
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- // prevent calls to internal methods
- if (isMethodCall && options.substring(0, 1) == '_') {
- return this;
- }
-
- // handle getter methods
- if (isMethodCall && getter(namespace, name, options, args)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- // handle initialization and non-getter methods
- return this.each(function() {
- var instance = $.data(this, name);
-
- // constructor
- (!instance && !isMethodCall &&
- $.data(this, name, new $[namespace][name](this, options))._init());
-
- // method call
- (instance && isMethodCall && $.isFunction(instance[options]) &&
- instance[options].apply(instance, args));
- });
- };
-
- // create widget constructor
- $[namespace] = $[namespace] || {};
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.namespace = namespace;
- this.widgetName = name;
- this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({},
- $.widget.defaults,
- $[namespace][name].defaults,
- $.metadata && $.metadata.get(element)[name],
- options);
-
- this.element = $(element)
- .bind('setData.' + name, function(event, key, value) {
- if (event.target == element) {
- return self._setData(key, value);
- }
- })
- .bind('getData.' + name, function(event, key) {
- if (event.target == element) {
- return self._getData(key);
- }
- })
- .bind('remove', function() {
- return self.destroy();
- });
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-
- // TODO: merge getter and getterSetter properties from widget prototype
- // and plugin prototype
- $[namespace][name].getterSetter = 'option';
-};
-
-$.widget.prototype = {
- _init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName)
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
- .removeAttr('aria-disabled');
- },
-
- option: function(key, value) {
- var options = key,
- self = this;
-
- if (typeof key == "string") {
- if (value === undefined) {
- return this._getData(key);
- }
- options = {};
- options[key] = value;
- }
-
- $.each(options, function(key, value) {
- self._setData(key, value);
- });
- },
- _getData: function(key) {
- return this.options[key];
- },
- _setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element
- [value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled' + ' ' +
- this.namespace + '-state-disabled')
- .attr("aria-disabled", value);
- }
- },
-
- enable: function() {
- this._setData('disabled', false);
- },
- disable: function() {
- this._setData('disabled', true);
- },
-
- _trigger: function(type, event, data) {
- var callback = this.options[type],
- eventName = (type == this.widgetEventPrefix
- ? type : this.widgetEventPrefix + type);
-
- event = $.Event(event);
- event.type = eventName;
-
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if (event.originalEvent) {
- for (var i = $.event.props.length, prop; i;) {
- prop = $.event.props[--i];
- event[prop] = event.originalEvent[prop];
- }
- }
-
- this.element.trigger(event, data);
-
- return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
- || event.isDefaultPrevented());
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- _mouseInit: function() {
- var self = this;
-
- this.element
- .bind('mousedown.'+this.widgetName, function(event) {
- return self._mouseDown(event);
- })
- .bind('click.'+this.widgetName, function(event) {
- if(self._preventClickEvent) {
- self._preventClickEvent = false;
- event.stopImmediatePropagation();
- return false;
- }
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- _mouseDown: function(event) {
- // don't let more than one widget handle mouseStart
- // TODO: figure out why we have to use originalEvent
- event.originalEvent = event.originalEvent || {};
- if (event.originalEvent.mouseHandled) { return; }
-
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this._mouseUp(event));
-
- this._mouseDownEvent = event;
-
- var self = this,
- btnIsLeft = (event.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = (this._mouseStart(event) !== false);
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(event) {
- return self._mouseMove(event);
- };
- this._mouseUpDelegate = function(event) {
- return self._mouseUp(event);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- // preventDefault() is used to prevent the selection of text here -
- // however, in Safari, this causes select boxes not to be selectable
- // anymore, so this fix is needed
- ($.browser.safari || event.preventDefault());
-
- event.originalEvent.mouseHandled = true;
- return true;
- },
-
- _mouseMove: function(event) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !event.button) {
- return this._mouseUp(event);
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted =
- (this._mouseStart(this._mouseDownEvent, event) !== false);
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
- }
-
- return !this._mouseStarted;
- },
-
- _mouseUp: function(event) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this._preventClickEvent = (event.target == this._mouseDownEvent.target);
- this._mouseStop(event);
- }
-
- return false;
- },
-
- _mouseDistanceMet: function(event) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
- ) >= this.options.distance
- );
- },
-
- _mouseDelayMet: function(event) {
- return this.mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function(event) {},
- _mouseDrag: function(event) {},
- _mouseStop: function(event) {},
- _mouseCapture: function(event) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
diff --git a/content/Explore/js/ui.dialog.js b/content/Explore/js/ui.dialog.js
deleted file mode 100755
index fdd5b26..0000000
--- a/content/Explore/js/ui.dialog.js
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * jQuery UI Dialog 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
- },
-
- uiDialogClasses =
- 'ui-dialog ' +
- 'ui-widget ' +
- 'ui-widget-content ' +
- 'ui-corner-all ';
-
-$.widget("ui.dialog", {
-
- _init: function() {
- this.originalTitle = this.element.attr('title');
-
- var self = this,
- options = this.options,
-
- title = options.title || this.originalTitle || '&nbsp;',
- titleId = $.ui.dialog.getTitleId(this.element),
-
- uiDialog = (this.uiDialog = $('<div/>'))
- .appendTo(document.body)
- .hide()
- .addClass(uiDialogClasses + options.dialogClass)
- .css({
- position: 'absolute',
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
- (options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event));
- })
- .attr({
- role: 'dialog',
- 'aria-labelledby': titleId
- })
- .mousedown(function(event) {
- self.moveToTop(false, event);
- }),
-
- uiDialogContent = this.element
- .show()
- .removeAttr('title')
- .addClass(
- 'ui-dialog-content ' +
- 'ui-widget-content')
- .appendTo(uiDialog),
-
- uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>'))
- .addClass(
- 'ui-dialog-titlebar ' +
- 'ui-widget-header ' +
- 'ui-corner-all ' +
- 'ui-helper-clearfix'
- )
- .prependTo(uiDialog),
-
- uiDialogTitlebarClose = $('<a href="#"/>')
- .addClass(
- 'ui-dialog-titlebar-close ' +
- 'ui-corner-all'
- )
- .attr('role', 'button')
- .hover(
- function() {
- uiDialogTitlebarClose.addClass('ui-state-hover');
- },
- function() {
- uiDialogTitlebarClose.removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- uiDialogTitlebarClose.addClass('ui-state-focus');
- })
- .blur(function() {
- uiDialogTitlebarClose.removeClass('ui-state-focus');
- })
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function(event) {
- self.close(event);
- return false;
- })
- .appendTo(uiDialogTitlebar),
-
- uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
- .addClass(
- 'ui-icon ' +
- 'ui-icon-closethick'
- )
- .text(options.closeText)
- .appendTo(uiDialogTitlebarClose),
-
- uiDialogTitle = $('<span/>')
- .addClass('ui-dialog-title')
- .attr('id', titleId)
- .html(title)
- .prependTo(uiDialogTitlebar);
-
- uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
-
- (options.draggable && $.fn.draggable && this._makeDraggable());
- (options.resizable && $.fn.resizable && this._makeResizable());
-
- this._createButtons(options.buttons);
- this._isOpen = false;
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
-
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content ui-widget-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
-
- (this.originalTitle && this.element.attr('title', this.originalTitle));
- },
-
- close: function(event) {
- var self = this;
-
- if (false === self._trigger('beforeclose', event)) {
- return;
- }
-
- (self.overlay && self.overlay.destroy());
- self.uiDialog.unbind('keypress.ui-dialog');
-
- (self.options.hide
- ? self.uiDialog.hide(self.options.hide, function() {
- self._trigger('close', event);
- })
- : self.uiDialog.hide() && self._trigger('close', event));
-
- $.ui.dialog.overlay.resize();
-
- self._isOpen = false;
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- if (self.options.modal) {
- var maxZ = 0;
- $('.ui-dialog').each(function() {
- if (this != self.uiDialog[0]) {
- maxZ = Math.max(maxZ, $(this).css('z-index'));
- }
- });
- $.ui.dialog.maxZ = maxZ;
- }
- },
-
- isOpen: function() {
- return this._isOpen;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force, event) {
-
- if ((this.options.modal && !force)
- || (!this.options.stack && !this.options.modal)) {
- return this._trigger('focus', event);
- }
-
- if (this.options.zIndex > $.ui.dialog.maxZ) {
- $.ui.dialog.maxZ = this.options.zIndex;
- }
- (this.overlay && this.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = ++$.ui.dialog.maxZ));
-
- //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
- // http://ui.jquery.com/bugs/ticket/3193
- var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') };
- this.uiDialog.css('z-index', ++$.ui.dialog.maxZ);
- this.element.attr(saveScroll);
- this._trigger('focus', event);
- },
-
- open: function() {
- if (this._isOpen) { return; }
-
- var options = this.options,
- uiDialog = this.uiDialog;
-
- this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
- (uiDialog.next().length && uiDialog.appendTo('body'));
- this._size();
- this._position(options.position);
- uiDialog.show(options.show);
- this.moveToTop(true);
-
- // prevent tabbing out of modal dialogs
- (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) {
- if (event.keyCode != $.ui.keyCode.TAB) {
- return;
- }
-
- var tabbables = $(':tabbable', this),
- first = tabbables.filter(':first')[0],
- last = tabbables.filter(':last')[0];
-
- if (event.target == last && !event.shiftKey) {
- setTimeout(function() {
- first.focus();
- }, 1);
- } else if (event.target == first && event.shiftKey) {
- setTimeout(function() {
- last.focus();
- }, 1);
- }
- }));
-
- // set focus to the first tabbable element in the content area or the first button
- // if there are no tabbable elements, set focus on the dialog itself
- $([])
- .add(uiDialog.find('.ui-dialog-content :tabbable:first'))
- .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
- .add(uiDialog)
- .filter(':first')
- .focus();
-
- this._trigger('open');
- this._isOpen = true;
- },
-
- _createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = $('<div></div>')
- .addClass(
- 'ui-dialog-buttonpane ' +
- 'ui-widget-content ' +
- 'ui-helper-clearfix'
- );
-
- // if we already have a button pane, remove it
- this.uiDialog.find('.ui-dialog-buttonpane').remove();
-
- (typeof buttons == 'object' && buttons !== null &&
- $.each(buttons, function() { return !(hasButtons = true); }));
- if (hasButtons) {
- $.each(buttons, function(name, fn) {
- $('<button type="button"></button>')
- .addClass(
- 'ui-state-default ' +
- 'ui-corner-all'
- )
- .text(name)
- .click(function() { fn.apply(self.element[0], arguments); })
- .hover(
- function() {
- $(this).addClass('ui-state-hover');
- },
- function() {
- $(this).removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- $(this).addClass('ui-state-focus');
- })
- .blur(function() {
- $(this).removeClass('ui-state-focus');
- })
- .appendTo(uiDialogButtonPane);
- });
- uiDialogButtonPane.appendTo(this.uiDialog);
- }
- },
-
- _makeDraggable: function() {
- var self = this,
- options = this.options,
- heightBeforeDrag;
-
- this.uiDialog.draggable({
- cancel: '.ui-dialog-content',
- handle: '.ui-dialog-titlebar',
- containment: 'document',
- start: function() {
- heightBeforeDrag = options.height;
- $(this).height($(this).height()).addClass("ui-dialog-dragging");
- (options.dragStart && options.dragStart.apply(self.element[0], arguments));
- },
- drag: function() {
- (options.drag && options.drag.apply(self.element[0], arguments));
- },
- stop: function() {
- $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
- (options.dragStop && options.dragStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- },
-
- _makeResizable: function(handles) {
- handles = (handles === undefined ? this.options.resizable : handles);
- var self = this,
- options = this.options,
- resizeHandles = typeof handles == 'string'
- ? handles
- : 'n,e,s,w,se,sw,ne,nw';
-
- this.uiDialog.resizable({
- cancel: '.ui-dialog-content',
- alsoResize: this.element,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: function() {
- $(this).addClass("ui-dialog-resizing");
- (options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
- },
- resize: function() {
- (options.resize && options.resize.apply(self.element[0], arguments));
- },
- handles: resizeHandles,
- stop: function() {
- $(this).removeClass("ui-dialog-resizing");
- options.height = $(this).height();
- options.width = $(this).width();
- (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- })
- .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
- },
-
- _position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += wnd.width() - this.uiDialog.outerWidth();
- break;
- default:
- case 'center':
- pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += wnd.height() - this.uiDialog.outerHeight();
- break;
- default:
- case 'middle':
- pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2;
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- _setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "buttons":
- this._createButtons(value);
- break;
- case "closeText":
- this.uiDialogTitlebarCloseText.text(value);
- break;
- case "dialogClass":
- this.uiDialog
- .removeClass(this.options.dialogClass)
- .addClass(uiDialogClasses + value);
- break;
- case "draggable":
- (value
- ? this._makeDraggable()
- : this.uiDialog.draggable('destroy'));
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this._position(value);
- break;
- case "resizable":
- var uiDialog = this.uiDialog,
- isResizable = this.uiDialog.is(':data(resizable)');
-
- // currently resizable, becoming non-resizable
- (isResizable && !value && uiDialog.resizable('destroy'));
-
- // currently resizable, changing handles
- (isResizable && typeof value == 'string' &&
- uiDialog.resizable('option', 'handles', value));
-
- // currently non-resizable, becoming resizable
- (isResizable || this._makeResizable(value));
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).html(value || '&nbsp;');
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
-
- $.widget.prototype._setData.apply(this, arguments);
- },
-
- _size: function() {
- /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
- * divs will both have width and height set, so we need to reset them
- */
- var options = this.options;
-
- // reset content sizing
- this.element.css({
- height: 0,
- minHeight: 0,
- width: 'auto'
- });
-
- // reset wrapper sizing
- // determine the height of all the non-content elements
- var nonContentHeight = this.uiDialog.css({
- height: 'auto',
- width: options.width
- })
- .height();
-
- this.element
- .css({
- minHeight: Math.max(options.minHeight - nonContentHeight, 0),
- height: options.height == 'auto'
- ? 'auto'
- : Math.max(options.height - nonContentHeight, 0)
- });
- }
-});
-
-$.extend($.ui.dialog, {
- version: "1.7.2",
- defaults: {
- autoOpen: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- dialogClass: '',
- draggable: true,
- hide: null,
- height: 'auto',
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: 'center',
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
- },
-
- getter: 'isOpen',
-
- uuid: 0,
- maxZ: 0,
-
- getTitleId: function($el) {
- return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid);
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- maxZ: 0,
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(event) { return event + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- // handle $(el).dialog().dialog('close') (see #4065)
- if ($.ui.dialog.overlay.instances.length) {
- $(document).bind($.ui.dialog.overlay.events, function(event) {
- var dialogZ = $(event.target).parents('.ui-dialog').css('zIndex') || 0;
- return (dialogZ > $.ui.dialog.overlay.maxZ);
- });
- }
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(event) {
- (dialog.options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event));
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div></div>').appendTo(document.body)
- .addClass('ui-widget-overlay').css({
- width: this.width(),
- height: this.height()
- });
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- var maxZ = 0;
- $.each(this.instances, function() {
- maxZ = Math.max(maxZ, this.css('z-index'));
- });
- this.maxZ = maxZ;
- },
-
- height: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
diff --git a/content/Explore/js/ui.draggable.js b/content/Explore/js/ui.draggable.js
deleted file mode 100755
index 0402f0e..0000000
--- a/content/Explore/js/ui.draggable.js
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
- * jQuery UI Draggable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
- this.element[0].style.position = 'relative';
-
- (this.options.addClasses && this.element.addClass("ui-draggable"));
- (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
-
- this._mouseInit();
-
- },
-
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element
- .removeData("draggable")
- .unbind(".draggable")
- .removeClass("ui-draggable"
- + " ui-draggable-dragging"
- + " ui-draggable-disabled");
- this._mouseDestroy();
- },
-
- _mouseCapture: function(event) {
-
- var o = this.options;
-
- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
- return false;
-
- //Quit if we're not on a valid handle
- this.handle = this._getHandle(event);
- if (!this.handle)
- return false;
-
- return true;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options;
-
- //Create and append the visible helper
- this.helper = this._createHelper(event);
-
- //Cache the helper size
- this._cacheHelperProportions();
-
- //If ddmanager is used for droppables, set the global draggable
- if($.ui.ddmanager)
- $.ui.ddmanager.current = this;
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- //Cache the margins of the original element
- this._cacheMargins();
-
- //Store the helper's css position
- this.cssPosition = this.helper.css("position");
- this.scrollParent = this.helper.scrollParent();
-
- //The element's absolute position on the page minus margins
- this.offset = this.element.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- $.extend(this.offset, {
- click: { //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
- });
-
- //Generate the original position
- this.originalPosition = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
-
- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
- if(o.cursorAt)
- this._adjustOffsetFromHelper(o.cursorAt);
-
- //Set a containment if given in the options
- if(o.containment)
- this._setContainment();
-
- //Call plugins and callbacks
- this._trigger("start", event);
-
- //Recache the helper size
- this._cacheHelperProportions();
-
- //Prepare the droppable offsets
- if ($.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
-
- this.helper.addClass("ui-draggable-dragging");
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
-
- _mouseDrag: function(event, noPropagation) {
-
- //Compute the helpers position
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- if (!noPropagation) {
- var ui = this._uiHash();
- this._trigger('drag', event, ui);
- this.position = ui.position;
- }
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- //If we are using droppables, inform the manager about the drop
- var dropped = false;
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- dropped = $.ui.ddmanager.drop(this, event);
-
- //if a drop comes from outside (a sortable)
- if(this.dropped) {
- dropped = this.dropped;
- this.dropped = false;
- }
-
- if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
- self._trigger("stop", event);
- self._clear();
- });
- } else {
- this._trigger("stop", event);
- this._clear();
- }
-
- return false;
- },
-
- _getHandle: function(event) {
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
- $(this.options.handle, this.element)
- .find("*")
- .andSelf()
- .each(function() {
- if(this == event.target) handle = true;
- });
-
- return handle;
-
- },
-
- _createHelper: function(event) {
-
- var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
-
- if(!helper.parents('body').length)
- helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
-
- if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
- helper.css("position", "absolute");
-
- return helper;
-
- },
-
- _adjustOffsetFromHelper: function(obj) {
- if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
- if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
- if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- },
-
- _getParentOffset: function() {
-
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset();
-
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
- po = { top: 0, left: 0 };
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- },
-
- _getRelativeOffset: function() {
-
- if(this.cssPosition == "relative") {
- var p = this.element.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return { top: 0, left: 0 };
- }
-
- },
-
- _cacheMargins: function() {
- this.margins = {
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
- },
-
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
-
- _setContainment: function() {
-
- var o = this.options;
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
- var ce = $(o.containment)[0]; if(!ce) return;
- var co = $(o.containment).offset();
- var over = ($(ce).css("overflow") != 'hidden');
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
- ];
- } else if(o.containment.constructor == Array) {
- this.containment = o.containment;
- }
-
- },
-
- _convertPositionTo: function(d, pos) {
-
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- return {
- top: (
- pos.top // The absolute mouse position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
- ),
- left: (
- pos.left // The absolute mouse position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
- )
- };
-
- },
-
- _generatePosition: function(event) {
-
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- // This is another very weird special case that only happens for relative elements:
- // 1. If the css position is relative
- // 2. and the scroll parent is the document or similar to the offset parent
- // we have to refresh the relative offset during the scroll so there are no jumps
- if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
- this.offset.relative = this._getRelativeOffset();
- }
-
- var pageX = event.pageX;
- var pageY = event.pageY;
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
- if(this.containment) {
- if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
- if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
- if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
- if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
- }
-
- if(o.grid) {
- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
- pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
- pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- }
-
- return {
- top: (
- pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
- ),
- left: (
- pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
- )
- };
-
- },
-
- _clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
-
- _trigger: function(type, event, ui) {
- ui = ui || this._uiHash();
- $.ui.plugin.call(this, type, [event, ui]);
- if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
- return $.widget.prototype._trigger.call(this, type, event, ui);
- },
-
- plugins: {},
-
- _uiHash: function(event) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs, //deprecated
- offset: this.positionAbs
- };
- }
-
-}));
-
-$.extend($.ui.draggable, {
- version: "1.7.2",
- eventPrefix: "drag",
- defaults: {
- addClasses: true,
- appendTo: "parent",
- axis: false,
- cancel: ":input,option",
- connectToSortable: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- delay: 0,
- distance: 1,
- grid: false,
- handle: false,
- helper: "original",
- iframeFix: false,
- opacity: false,
- refreshPositions: false,
- revert: false,
- revertDuration: 500,
- scope: "default",
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: false,
- snapMode: "both",
- snapTolerance: 20,
- stack: false,
- zIndex: false
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options,
- uiSortable = $.extend({}, ui, { item: inst.element });
- inst.sortables = [];
- $(o.connectToSortable).each(function() {
- var sortable = $.data(this, 'sortable');
- if (sortable && !sortable.options.disabled) {
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
- sortable._trigger("activate", event, uiSortable);
- }
- });
-
- },
- stop: function(event, ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable"),
- uiSortable = $.extend({}, ui, { item: inst.element });
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
-
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
-
- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
- if(this.shouldRevert) this.instance.options.revert = true;
-
- //Trigger the stop of the sortable
- this.instance._mouseStop(event);
-
- this.instance.options.helper = this.instance.options._helper;
-
- //If the helper has been the original item, restore properties in the sortable
- if(inst.options.helper == 'original')
- this.instance.currentItem.css({ top: 'auto', left: 'auto' });
-
- } else {
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
- this.instance._trigger("deactivate", event, uiSortable);
- }
-
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
- var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
- var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
- var itemHeight = o.height, itemWidth = o.width;
- var itemTop = o.top, itemLeft = o.left;
-
- return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
- };
-
- $.each(inst.sortables, function(i) {
-
- //Copy over some variables to allow calling the sortable's native _intersectsWith
- this.instance.positionAbs = inst.positionAbs;
- this.instance.helperProportions = inst.helperProportions;
- this.instance.offset.click = inst.offset.click;
-
- if(this.instance._intersectsWith(this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
-
- this.instance.isOver = 1;
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- event.target = this.instance.currentItem[0];
- this.instance._mouseCapture(event, true);
- this.instance._mouseStart(event, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst._trigger("toSortable", event);
- inst.dropped = this.instance.element; //draggable revert needs that
- //hack so receive/update callbacks work (mostly)
- inst.currentItem = inst.element;
- this.instance.fromOutside = inst;
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance._mouseDrag(event);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
-
- //Prevent reverting on this forced stop
- this.instance.options.revert = false;
-
- // The out event needs to be triggered independently
- this.instance._trigger('out', event, this.instance._uiHash(this.instance));
-
- this.instance._mouseStop(event, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst._trigger("fromSortable", event);
- inst.dropped = false; //draggable revert needs that
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(event, ui) {
- var t = $('body'), o = $(this).data('draggable').options;
- if (t.css("cursor")) o._cursor = t.css("cursor");
- t.css("cursor", o.cursor);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if (o._cursor) $('body').css("cursor", o._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(event, ui) {
- var o = $(this).data('draggable').options;
- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(event, ui) {
- $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data('draggable').options;
- if(t.css("opacity")) o._opacity = t.css("opacity");
- t.css('opacity', o.opacity);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if(o._opacity) $(ui.helper).css('opacity', o._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(event, ui) {
- var i = $(this).data("draggable");
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
- },
- drag: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options, scrolled = false;
-
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
-
- if(!o.axis || o.axis != 'x') {
- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
- else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
- }
-
- if(!o.axis || o.axis != 'y') {
- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
- else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
- }
-
- } else {
-
- if(!o.axis || o.axis != 'x') {
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(!o.axis || o.axis != 'y') {
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(i, event);
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options;
- i.snapElements = [];
-
- $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != i.element[0]) i.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options;
- var d = o.snapTolerance;
-
- var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
- if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = false;
- continue;
- }
-
- if(o.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= d;
- var bs = Math.abs(b - y1) <= d;
- var ls = Math.abs(l - x2) <= d;
- var rs = Math.abs(r - x1) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
- }
-
- var first = (ts || bs || ls || rs);
-
- if(o.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= d;
- var bs = Math.abs(b - y2) <= d;
- var ls = Math.abs(l - x1) <= d;
- var rs = Math.abs(r - x2) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
- }
-
- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
-
- };
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(event, ui) {
-
- var o = $(this).data("draggable").options;
-
- var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = o.stack.min + i;
- });
-
- this[0].style.zIndex = o.stack.min + group.length;
-
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("draggable").options;
- if(t.css("zIndex")) o._zIndex = t.css("zIndex");
- t.css('zIndex', o.zIndex);
- },
- stop: function(event, ui) {
- var o = $(this).data("draggable").options;
- if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
- }
-});
-
-})(jQuery);
diff --git a/content/Explore/js/ui.droppable.js b/content/Explore/js/ui.droppable.js
deleted file mode 100755
index 8e7be33..0000000
--- a/content/Explore/js/ui.droppable.js
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * jQuery UI Droppable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- */
-(function($) {
-
-$.widget("ui.droppable", {
-
- _init: function() {
-
- var o = this.options, accept = o.accept;
- this.isover = 0; this.isout = 1;
-
- this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
- return d.is(accept);
- };
-
- //Store the droppable's proportions
- this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
-
- // Add the reference and positions to the manager
- $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
- $.ui.ddmanager.droppables[this.options.scope].push(this);
-
- (this.options.addClasses && this.element.addClass("ui-droppable"));
-
- },
-
- destroy: function() {
- var drop = $.ui.ddmanager.droppables[this.options.scope];
- for ( var i = 0; i < drop.length; i++ )
- if ( drop[i] == this )
- drop.splice(i, 1);
-
- this.element
- .removeClass("ui-droppable ui-droppable-disabled")
- .removeData("droppable")
- .unbind(".droppable");
- },
-
- _setData: function(key, value) {
-
- if(key == 'accept') {
- this.options.accept = value && $.isFunction(value) ? value : function(d) {
- return d.is(value);
- };
- } else {
- $.widget.prototype._setData.apply(this, arguments);
- }
-
- },
-
- _activate: function(event) {
- var draggable = $.ui.ddmanager.current;
- if(this.options.activeClass) this.element.addClass(this.options.activeClass);
- (draggable && this._trigger('activate', event, this.ui(draggable)));
- },
-
- _deactivate: function(event) {
- var draggable = $.ui.ddmanager.current;
- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
- (draggable && this._trigger('deactivate', event, this.ui(draggable)));
- },
-
- _over: function(event) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
- this._trigger('over', event, this.ui(draggable));
- }
-
- },
-
- _out: function(event) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
- this._trigger('out', event, this.ui(draggable));
- }
-
- },
-
- _drop: function(event,custom) {
-
- var draggable = custom || $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
-
- var childrenIntersection = false;
- this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
- var inst = $.data(this, 'droppable');
- if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
- childrenIntersection = true; return false;
- }
- });
- if(childrenIntersection) return false;
-
- if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
- this._trigger('drop', event, this.ui(draggable));
- return this.element;
- }
-
- return false;
-
- },
-
- ui: function(c) {
- return {
- draggable: (c.currentItem || c.element),
- helper: c.helper,
- position: c.position,
- absolutePosition: c.positionAbs, //deprecated
- offset: c.positionAbs
- };
- }
-
-});
-
-$.extend($.ui.droppable, {
- version: "1.7.2",
- eventPrefix: 'drop',
- defaults: {
- accept: '*',
- activeClass: false,
- addClasses: true,
- greedy: false,
- hoverClass: false,
- scope: 'default',
- tolerance: 'intersect'
- }
-});
-
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
-
- if (!droppable.offset) return false;
-
- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
- var l = droppable.offset.left, r = l + droppable.proportions.width,
- t = droppable.offset.top, b = t + droppable.proportions.height;
-
- switch (toleranceMode) {
- case 'fit':
- return (l < x1 && x2 < r
- && t < y1 && y2 < b);
- break;
- case 'intersect':
- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
- && x2 - (draggable.helperProportions.width / 2) < r // Left Half
- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
- break;
- case 'pointer':
- var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
- draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
- isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
- return isOver;
- break;
- case 'touch':
- return (
- (y1 >= t && y1 <= b) || // Top edge touching
- (y2 >= t && y2 <= b) || // Bottom edge touching
- (y1 < t && y2 > b) // Surrounded vertically
- ) && (
- (x1 >= l && x1 <= r) || // Left edge touching
- (x2 >= l && x2 <= r) || // Right edge touching
- (x1 < l && x2 > r) // Surrounded horizontally
- );
- break;
- default:
- return false;
- break;
- }
-
-};
-
-/*
- This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
- current: null,
- droppables: { 'default': [] },
- prepareOffsets: function(t, event) {
-
- var m = $.ui.ddmanager.droppables[t.options.scope];
- var type = event ? event.type : null; // workaround for #2317
- var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
-
- droppablesLoop: for (var i = 0; i < m.length; i++) {
-
- if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
- for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
- m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
-
- m[i].offset = m[i].element.offset();
- m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
-
- if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
-
- }
-
- },
- drop: function(draggable, event) {
-
- var dropped = false;
- $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
-
- if(!this.options) return;
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
- dropped = this._drop.call(this, event);
-
- if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- this.isout = 1; this.isover = 0;
- this._deactivate.call(this, event);
- }
-
- });
- return dropped;
-
- },
- drag: function(draggable, event) {
-
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
-
- //Run through all droppables and check their positions based on specific tolerance options
-
- $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
-
- if(this.options.disabled || this.greedyChild || !this.visible) return;
- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
-
- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
- if(!c) return;
-
- var parentInstance;
- if (this.options.greedy) {
- var parent = this.element.parents(':data(droppable):eq(0)');
- if (parent.length) {
- parentInstance = $.data(parent[0], 'droppable');
- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
- }
- }
-
- // we just moved into a greedy child
- if (parentInstance && c == 'isover') {
- parentInstance['isover'] = 0;
- parentInstance['isout'] = 1;
- parentInstance._out.call(parentInstance, event);
- }
-
- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
- this[c == "isover" ? "_over" : "_out"].call(this, event);
-
- // we just moved out of a greedy child
- if (parentInstance && c == 'isout') {
- parentInstance['isout'] = 0;
- parentInstance['isover'] = 1;
- parentInstance._over.call(parentInstance, event);
- }
- });
-
- }
-};
-
-})(jQuery);
diff --git a/content/Explore/js/ui.feedback.js b/content/Explore/js/ui.feedback.js
deleted file mode 100755
index 1bd650f..0000000
--- a/content/Explore/js/ui.feedback.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @fileOverview a scoreboard widget
-* @author Bryan Berry <bryan@olenepal.org>
-* uses MIT License
-*/
-
-
-
-(function($){
-
- // This is a dummy function, just here as placeholder to
- // to make the jsdoc tool happy
- /** @name $.ui.feedback
- * @namespace Feedback widget
- */
- $.ui.feedback = function(){};
-
- $.widget('ui.feedback',
- /** @lends $.ui.feedback.prototype */
- {
- /** Displays the correct icon in the center of the screen
- * and plays the sound "correct" if loaded
- */
- correct: function(){
- var $correct = this.$correct.css('display','block');
- setTimeout ( function() {
- $correct.fadeOut(500);
- }, 500);
- if (Karma && Karma.audio && Karma.audio.correct){
- Karma.audio.correct.play();
- }
-
- },
- /** Displays the incorrect icon in the center of the screen
- * and plays the sound "incorrect" if loaded
- */
- incorrect: function(){
-
- var $incorrect = this.$incorrect.css('display','block');
- setTimeout ( function() {
- $incorrect.fadeOut(500);
- }, 500);
-
- //this.$incorrect.css('display','block').fadeOut(3000);
- if (Karma && Karma.audio && Karma.audio.incorrect){
- Karma.audio.incorrect.play();
- }
-
- },
- /** Display a happy face and text that says "You win!"
- *
- */
- win: function(){
- this.$win.show();
- this.$overlay.show();
- },
- /** Display an unhappy face and text that says "You lose!"
- *
- */
- lose: function(){
- this.$lose.show();
- this.$overlay.show();
- },
- _init : function(){
- var self = this;
-
- this.element
- .addClass('ui-feedback')
- .css({position:'absolute',
- top: '40%', left: '40%'});
-
- this.$correct = $('<div></div>')
- .addClass('ui-feedback-correct')
- .appendTo(this.element);
-
- this.$incorrect = $('<div></div>')
- .addClass('ui-feedback-incorrect')
- .appendTo(this.element);
-
- this.$win = $("<div class='ui-feedback-over'>" +
- "<div class='ui-feedback-win'></div>" +
- "<div class='ui-feedback-txt'>You win!" +
- "</div></div>")
- .click(
- function(){
- self.$win.hide();
- self.$overlay.hide();
- }
- )
- .appendTo(this.element);
-
- this.$lose = $("<div class='ui-feedback-over'>" +
- "<div class='ui-feedback-lose'></div>" +
- "<div class='ui-feedback-txt'>You lose!" +
- "</div></div>")
- .click(
- function(){
- self.$lose.hide();
- self.$overlay.hide();
- }
- )
- .appendTo(this.element);
-
- this.$overlay = $('<div></div>')
- .addClass('ui-feedback-overlay')
- .appendTo($('body'));
-
-
-
- $('body')
- .bind('feedbackCorrect', function(){
- self.correct();
- })
- .bind('feedbackIncorrect', function(){
- self.incorrect();
- });
-
- },
- /** Removes the feedback widget and all related data from the DOM */
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.feedback.getter = [];
-
- /** Default settings for the feedback widget
- * @namespace Default settings for the feedback widget
- * @extends $.ui.feedback
- */
- $.ui.feedback.defaults = {
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/Explore/js/ui.kFooter.js b/content/Explore/js/ui.kFooter.js
deleted file mode 100755
index d5ede51..0000000
--- a/content/Explore/js/ui.kFooter.js
+++ /dev/null
@@ -1,369 +0,0 @@
-/**
-* @fileOverview a footer widget
-* @author Bryan Berry <bryan@olenepal.org>
-* uses MIT License
-*/
-
-
-
-(function($){
-
- // This is a dummy function, just here as placeholder to
- // to make the jsdoc tool happy
- /** @name $.ui.kFooter
- * @namespace kFooter widget
- * @example Emits the event kFooterWinGame when the maxScore is reached <br />
- * Emits the event kFooterRestart when game restarted <br />
- * Start button emits kFooterStart event when clicked <br />
- * Restart button emits kFooterRestart event when clicked <br />
- * Pause button emits the kFooterPause event when clicked <br />
- */
- $.ui.kFooter = function(){};
-
- $.widget('ui.kFooter',
- /** @lends $.ui.kFooter.prototype */
- {
- /** Gets the current score
- * @returns {Number} current score
- */
- getScore : function(){
- return this._getData('score');
- },
- /** Sets the current score
- * @param {Number} newScore new score
- */
- setScore : function(newScore){
- this._setData('score', parseInt(newScore));
- this._refresh();
- },
- /** Gets the current total
- * @returns {Number} current total
- */
- getTotal : function(){
- return this._getData('total');
- },
- /** Sets the current total
- * @param {Number} newTotal new total
- */
- setTotal : function(newTotal){
- this._setData('total', parseInt(newTotal));
- this._refresh();
- },
- /**
- * Resets the score and total to initial values and triggers
- * the "kFooterRestart" event
- */
- restart : function(){
- this.element.trigger('kFooterRestart');
- this._setData('score', this._getData('initialScore'));
- this._setData('total', this._getData('initialTotal'));
- this._refresh();
- },
- /** Increments the score by 1 or by the supplied numeric argument
- * @param {Number} [val] increment value
- */
- inc : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') + incVal);
- this._refresh();
- if(this._getData('winScore') === this._getData('score')){
- this.element.trigger('kFooterWinGame');
- }
- },
- /** Increments the total by 1 or by the supplied numeric argument
- * @param {Number} [val] increment value
- */
- incTotal : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') + incVal);
- this._refresh();
- },
- /** Decrements the score by 1 or by the supplied numeric argument
- * @param {Number} [val] decrement value
- */
- dec : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') - decVal);
- this._refresh();
- },
- /** Decrements the total by 1 or by the supplied numeric argument
- * @param {Number} [val] decrement value
- */
- decTotal : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') - decVal);
- this._refresh();
- },
- /** Start the timer, defaults to 0:00 if no arguments supplied
- * @param {Number} [minutes] value for minutes, default to 0
- * @param {Number} [seconds] value for seconds, default to 0
- */
- startTimer : function(minutes, seconds){
- var timerRunning = this._getData('timerRunning')|| false;
-
- if (this._$timer && timerRunning === false){
- var mins = minutes || 0;
- var secs = seconds || 0;
- var timerId = null;
- var self = this;
-
-
- this._setData('mins', mins);
- this._setData('secs', secs);
-
- var addLeadingZero = function(num){
- if(''.concat(num).length === 1){
- return "0".concat(num);
- } else {
- return num;
- }
-
- };
-
- var increaseTimer = function(){
- if (self._getData('timerRunning') === false){
- return;
- }
-
- var s = self._getData('secs') + 1;
- var m = null;
- var timerId = null;
-
- if (s < 60) {
- self._setData('secs', s);
- self._$timerSecs.text(self._n(addLeadingZero(s)));
- } else {
- s = 0;
- m = self._getData('mins') + 1;
- self._$timerSecs.text(self._n(addLeadingZero(s)));
- self._$timerMins.text(self._n(addLeadingZero(m)));
- self._setData('secs', s);
- self._setData('mins', m);
- }
-
- timerId = setTimeout(increaseTimer, 1000);
- self._setData('timerId', timerId);
-
- };
-
- timerId = setTimeout(increaseTimer , 1000);
-
- this._setData('timerRunning', true);
- this._setData('timerId', timerId);
- }
- },
- /** Stop the timer
- */
- stopTimer : function(){
- this._setData('timerRunning', false);
- },
- _c : function(val){
- if($.i18n){
- return $._c('$.ui.kFooter', val);
- }
- return val;
- },
- _n : function(val, loc){
- if ($.i18n){
- return $._n(val, loc);
- }
- return val;
- },
- _init : function(){
-
- var divDisplay = "inline";
- var score = this.options.score;
- var total = this.options.total;
- var self = this;
-
- var options = $.extend({}, $.ui.kFooter.defaults, this.options);
-
- this._setData('initialScore', parseInt(options.score));
- this._setData('initialTotal', parseInt(options.total));
- this._setData('score', parseInt(options.score));
- this._setData('total', parseInt(options.total));
- this._setData('winScore', parseInt(options.winningScore));
- this._setData('locale', options.locale);
-
-
- this.element.addClass('ui-widget ui-widget-content ' +
- ' ui-kFooter');
-
-
- var $kFooter = $("<ul></ul>");
-
-
- if(options.scoreboard === true){
-
- var $scoreboard = $("<li class='left'>" + this._c("Score") +
- "</li>" + "<li class='left'>" +
- "<span id='kFooterScore' class='ui-corner-all number'>" +
- this._n(score) + "</span></li>" +
- "<li class='left'>" + this._c("Total") + "</li>" +
- "<li class='left'><span id='kFooterTotal' " +
- "class='ui-corner-all number'>" +
- this._n(total) + "</span></li>")
- .appendTo($kFooter);
-
- this._score = $('#kFooterScore', $scoreboard);
- this._total = $('#kFooterTotal', $scoreboard);
-
- }
-
- if(options.timer === true){
- this._$timer = $("<li class='left'>" + this._c("Timer") +
- "</li>" +
- "<li class='left'><span id='kFooterMins'" +
- "class='ui-corner-all" +
- " number timer'>" + this._n("00") +
- "</span></li>" +
- "<li class='left'><span id='kFooterSecs'" +
- "class='ui-corner-all " +
- "number timer'>"+ this._n("00") +
- "</span></li>")
- .appendTo($kFooter);
-
- this._$timerMins = $('#kFooterMins', this._$timer);
- this._$timerSecs = $('#kFooterSecs', this._$timer);
- }
-
- //if options.checkAnswerBtn === true
-
- if (options.restartButton === true){
- var $restartButton = $("<li class='right'><button " +
- "class='ui-corner-all ui-state-default'>" +
- "<span class='ui-icon ui-icon-arrowrefresh-1-w'>" +
- "</span>" +
- "<span class='text left'>" +
- this._c('Play Again') +
- "</span></button></li>")
- .click(function(){
- self.startTimer();
- self.restart();
- })
- .appendTo($kFooter);
- }
-
- if (options.pauseButton === true){
- var $pauseButton = $("<li class='right'><button " +
- "class='ui-corner-all ui-state-default'>" +
- "<span class='ui-icon ui-icon-pause'>" +
- "</span>" +
- "<span class='text left'>" + this._c('Pause') +
- "</span></button></li>")
- .click(function(){
- self.stopTimer();
- self.element.trigger('kFooterPause');
- })
- .appendTo($kFooter);
- }
-
- if (options.startButton === true){
- var $startButton = $("<li class='right'><button " +
- "class='ui-corner-all ui-state-default'>" +
- "<span class='ui-icon ui-icon-play'>" +
- "</span>" +
- "<span class='text left'>" + this._c('Start') +
- "</span></button></li>")
- .click(function(){
- self.startTimer();
- self.element.trigger('kFooterStart');
- })
- .appendTo($kFooter);
- }
-
- $('button', $kFooter).hover(
- function(){
- $(this).addClass("ui-state-hover");
- },
- function(){
- $(this).removeClass("ui-state-hover");
- });
-
-
- // Check if any html w/in this.element, if so wrap it in <li> </li>
- // and add to $kFooter later
- var $userHtml = this.element
- .children()
- .appendTo($kFooter);
-
-
- $userHtml.wrap('<li class="left"></li>');
-
- //get rid of userHtml
- this.element.empty();
-
- this.element.append($kFooter);
-
- },
- _refresh : function(){
- this._score.text(this._n(this._getData('score')));
- this._total.text(this._n(this._getData('total')));
- },
- /** Removes the kFooter widget and all related data from the DOM */
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.kFooter.getter = ['getScore', 'getTotal', '_n', '_' ];
-
- $.ui.kFooter.i18n = {};
-
-
- /** Default settings for the kFooter widget
- * @namespace Default settings for the kFooter widget
- * @extends $.ui.kFooter
- */
- $.ui.kFooter.defaults = {
- /** Initial score
- * @type Number
- * @default 0
- */
- score: 0,
- /** Initial total
- * @type Number
- * @default 0
- */
- total: 0,
- /** The score that will win the game
- * @type Number
- * @default 0
- */
- winningScore: 0,
- /** Default locale, valid options are "en" and "ne"
- * @type String
- * @default "en"
- */
- locale: "ne",
- /** Display the scoreboard
- * @type boolean
- * @default true
- */
- scoreboard: true,
- /** Display the Start Button
- * @type boolean
- * @default false
- */
- startButton: false,
- /** Display the Retart Button
- * @type boolean
- * @default true
- */
- restartButton: true,
- /** Display the Pause Button
- * @type boolean
- * @default false
- */
- pauseButton: false,
- /** Display the timer
- * @type boolean
- * @default false
- */
- timer: false
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/Explore/js/ui.resizable.js b/content/Explore/js/ui.resizable.js
deleted file mode 100755
index 6172d6c..0000000
--- a/content/Explore/js/ui.resizable.js
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * jQuery UI Resizable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.resizable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- var self = this, o = this.options;
- this.element.addClass("ui-resizable");
-
- $.extend(this, {
- _aspectRatio: !!(o.aspectRatio),
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
- });
-
- //Wrap the element if it cannot hold child nodes
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
-
- //Opera fix for relative positioning
- if (/relative/.test(this.element.css('position')) && $.browser.opera)
- this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- this.element.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
- position: this.element.css('position'),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css('top'),
- left: this.element.css('left')
- })
- );
-
- //Overwrite the original this.element
- this.element = this.element.parent().data(
- "resizable", this.element.data('resizable')
- );
-
- this.elementIsWrapper = true;
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- this.originalResizeStyle = this.originalElement.css('resize');
- this.originalElement.css('resize', 'none');
-
- //Push the actual element to our proportionallyResize internal array
- this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
-
- // avoid IE jump (hard set the margin)
- this.originalElement.css({ margin: this.originalElement.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
-
- }
-
- this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
- if(this.handles.constructor == String) {
-
- if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
- var n = this.handles.split(","); this.handles = {};
-
- for(var i = 0; i < n.length; i++) {
-
- var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
- var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
-
- // increase zIndex of sw, se, ne, nw axis
- //TODO : this modifies original option
- if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
-
- //TODO : What's going on here?
- if ('se' == handle) {
- axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
- };
-
- //Insert into internal handles object and append to element
- this.handles[handle] = '.ui-resizable-'+handle;
- this.element.append(axis);
- }
-
- }
-
- this._renderAxis = function(target) {
-
- target = target || this.element;
-
- for(var i in this.handles) {
-
- if(this.handles[i].constructor == String)
- this.handles[i] = $(this.handles[i], this.element).show();
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(this.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
-
- }
-
- //TODO: What's that good for? There's not anything to be executed left
- if(!$(this.handles[i]).length)
- continue;
-
- }
- };
-
- //TODO: make renderAxis a prototype function
- this._renderAxis(this.element);
-
- this._handles = $('.ui-resizable-handle', this.element)
- .disableSelection();
-
- //Matching axis name
- this._handles.mouseover(function() {
- if (!self.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- this._handles.hide();
- $(this.element)
- .addClass("ui-resizable-autohide")
- .hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- self._handles.show();
- },
- function(){
- if (!self.resizing) {
- $(this).addClass("ui-resizable-autohide");
- self._handles.hide();
- }
- });
- }
-
- //Initialize the mouse interaction
- this._mouseInit();
-
- },
-
- destroy: function() {
-
- this._mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- //TODO: Unwrap at same DOM position
- if (this.elementIsWrapper) {
- _destroy(this.element);
- var wrapper = this.element;
- wrapper.parent().append(
- this.originalElement.css({
- position: wrapper.css('position'),
- width: wrapper.outerWidth(),
- height: wrapper.outerHeight(),
- top: wrapper.css('top'),
- left: wrapper.css('left')
- })
- ).end().remove();
- }
-
- this.originalElement.css('resize', this.originalResizeStyle);
- _destroy(this.originalElement);
-
- },
-
- _mouseCapture: function(event) {
-
- var handle = false;
- for(var i in this.handles) {
- if($(this.handles[i])[0] == event.target) handle = true;
- }
-
- return this.options.disabled || !!handle;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options, iniPos = this.element.position(), el = this.element;
-
- this.resizing = true;
- this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix for http://dev.jquery.com/ticket/1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
- el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && (/relative/).test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- if (o.containment) {
- curleft += $(o.containment).scrollLeft() || 0;
- curtop += $(o.containment).scrollTop() || 0;
- }
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
-
- //Aspect Ratio
- this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
-
- var cursor = $('.ui-resizable-' + this.axis).css('cursor');
- $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
-
- el.addClass("ui-resizable-resizing");
- this._propagate("start", event);
- return true;
- },
-
- _mouseDrag: function(event) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (this._aspectRatio || event.shiftKey)
- data = this._updateRatio(data, event);
-
- data = this._respectSize(data, event);
-
- // plugins callbacks need to be called first
- this._propagate("resize", event);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!this._helper && this._proportionallyResizeElements.length)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this._trigger('resize', event, this.ui());
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- this.resizing = false;
- var o = this.options, self = this;
-
- if(this._helper) {
- var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- self.helper.height(self.size.height);
- self.helper.width(self.size.width);
-
- if (this._helper && !o.animate) this._proportionallyResize();
- }
-
- $('body').css('cursor', 'auto');
-
- this.element.removeClass("ui-resizable-resizing");
-
- this._propagate("stop", event);
-
- if (this._helper) this.helper.remove();
- return false;
-
- },
-
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (isNumber(data.left)) this.position.left = data.left;
- if (isNumber(data.top)) this.position.top = data.top;
- if (isNumber(data.height)) this.size.height = data.height;
- if (isNumber(data.width)) this.size.width = data.width;
- },
-
- _updateRatio: function(data, event) {
-
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height * this.aspectRatio);
- else if (data.width) data.height = (csize.width / this.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
-
- _respectSize: function(data, event) {
-
- var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
-
- _proportionallyResize: function() {
-
- var o = this.options;
- if (!this._proportionallyResizeElements.length) return;
- var element = this.helper || this.element;
-
- for (var i=0; i < this._proportionallyResizeElements.length; i++) {
-
- var prel = this._proportionallyResizeElements[i];
-
- if (!this.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- this.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
-
- if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
- continue;
-
- prel.css({
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
- });
-
- };
-
- },
-
- _renderProxy: function() {
-
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(this._helper) {
-
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset TODO: This seems broken
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(this._helper).css({
- width: this.element.outerWidth() + pxyoffset,
- height: this.element.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex //TODO: Don't modify option
- });
-
- this.helper
- .appendTo("body")
- .disableSelection();
-
- } else {
- this.helper = this.element;
- }
-
- },
-
- _change: {
- e: function(event, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(event, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- sw: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- },
- ne: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- nw: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- }
- },
-
- _propagate: function(n, event) {
- $.ui.plugin.call(this, n, [event, this.ui()]);
- (n != "resize" && this._trigger(n, event, this.ui()));
- },
-
- plugins: {},
-
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- }
-
-}));
-
-$.extend($.ui.resizable, {
- version: "1.7.2",
- eventPrefix: "resize",
- defaults: {
- alsoResize: false,
- animate: false,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: false,
- autoHide: false,
- cancel: ":input,option",
- containment: false,
- delay: 0,
- distance: 1,
- ghost: false,
- grid: false,
- handles: "e,s,se",
- helper: false,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- zIndex: 1000
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options;
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera) {
- self._revertToRelativePosition = true;
- el.css({ position: 'absolute', top: 'auto', left: 'auto' });
- }
-
- el.css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable");
-
- //Opera fixing relative position
- if (self._revertToRelativePosition && $.browser.opera) {
- self._revertToRelativePosition = false;
- el.css({ position: 'relative' });
- }
-
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options;
-
- var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration,
- easing: o.animateEasing,
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self._propagate("resize", event);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
- // i'm a node, so compute top, left, right, bottom
- else {
- var element = $(ce), p = [];
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
-
- self.containerOffset = element.offset();
- self.containerPosition = element.position();
- self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options,
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
-
- if (cp.left < (self._helper ? co.left : 0)) {
- self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width / o.aspectRatio;
- self.position.left = o.helper ? co.left : 0;
- }
-
- if (cp.top < (self._helper ? co.top : 0)) {
- self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height * o.aspectRatio;
- self.position.top = self._helper ? co.top : 0;
- }
-
- self.offset.left = self.parentData.left+self.position.left;
- self.offset.top = self.parentData.top+self.position.top;
-
- var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
- hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
-
- var isParent = self.containerElement.get(0) == self.element.parent().get(0),
- isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
-
- if(isParent && isOffsetRelative) woset -= self.parentData.left;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width / self.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height * self.aspectRatio;
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
-
- if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- if (self._helper && !o.animate && (/static/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options, cs = self.size;
-
- self.ghost = self.originalElement.clone();
- self.ghost
- .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
- .addClass('ui-resizable-ghost')
- .addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-var num = function(v) {
- return parseInt(v, 10) || 0;
-};
-
-var isNumber = function(value) {
- return !isNaN(parseInt(value, 10));
-};
-
-})(jQuery);
diff --git a/content/Explore/js/ui.scoreboard.js b/content/Explore/js/ui.scoreboard.js
deleted file mode 100755
index 53a930a..0000000
--- a/content/Explore/js/ui.scoreboard.js
+++ /dev/null
@@ -1,107 +0,0 @@
-(function($){
- $.widget('ui.scoreboard',
- {
- getScore : function(){
- return this._getData('score');
- },
- setScore : function(newScore){
- this._setData('score', parseInt(newScore));
- this._refresh();
- },
- getTotal : function(){
- return this._getData('total');
- },
- setTotal : function(newTotal){
- this._setData('total', parseInt(newTotal));
- this._refresh();
- },
- reset : function(){
- this._setData('score', this._getData('initialScore'));
- this._setData('total', this._getData('initialTotal'));
- this._refresh();
- },
- inc : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') + incVal);
- this._refresh();
- if(this._getData('winScore') === this._getData('score')){
- this.element.trigger('winGame');
- }
- },
- incTotal : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') + incVal);
- this._refresh();
- },
- dec : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') - decVal);
- this._refresh();
- },
- decTotal : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') - decVal);
- this._refresh();
- },
- _init : function(){
-
- var divDisplay = "inline";
- var score = this.options.score;
- var total = this.options.total;
- var layoutId = "h";
- var self = this;
-
-
- this._setData('initialScore', parseInt(this.options.score));
- this._setData('initialTotal', parseInt(this.options.total));
- this._setData('score', parseInt(this.options.score));
- this._setData('total', parseInt(this.options.total));
- this._setData('winScore', parseInt(this.options.winningScore) || 0);
-
- if(this.options.layout === "vertical"){
- layoutId = "v";
- }
-
- this.evWinGame = document.createEvent('Events');
-
- this.element.addClass('ui-scoreboard-container-' + layoutId +
- ' ui-widget ui-widget-content ui-corner-all');
-
- var clone = $('<div>')
- .addClass('ui-scoreboard-spacing-' + layoutId);
- this._scoreText = $("<div>Score</div>")
- .addClass('ui-scoreboard-spacing-'+ layoutId +
- ' ui-corner-all ui-scoreboard-text')
- .appendTo(this.element);
- this._score = $("<div>" + score + "</div>")
- .addClass('ui-scoreboard-spacing-' + layoutId +
- ' ui-scoreboard-number-' + layoutId)
- .appendTo(this.element);
- $("<div>Total</div>")
- .addClass('ui-scoreboard-spacing-' + layoutId +
- ' ui-corner-all ' +
- 'ui-scoreboard-text')
- .appendTo(this.element);
- this._total = $("<div>" + total + "</div>")
- .addClass('ui-scoreboard-spacing-' + layoutId +
- ' ui-scoreboard-number-' + layoutId)
- .appendTo(this.element);
- },
- _refresh : function(){
- this._score.text(this._getData('score'));
- this._total.text(this._getData('total'));
- },
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.scoreboard.getter = ['getScore', 'getTotal'];
- $.ui.scoreboard.defaults = {
- score: 0, total: 0, layout: "horizontal", winningScore: 0
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/Mathematics/activities_p4.js b/content/Mathematics/activities_p4.js
deleted file mode 100644
index 7e1c324..0000000
--- a/content/Mathematics/activities_p4.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var activities = [
- ['0',1,'map4','milestone','map411m01','cyan'],
- ['0',2,'map4','milestone','map411m02','cyan'],
- ['0',3,'map4','milestone','map411m03','cyan'],
- ['0',4,'map4','milestone','map411m04','cyan'],
- ['0',5,'map4','milestone','map411m05','cyan'],
- ['0',6,'map4','milestone','map411m06','cyan'],
- ['0',7,'map4','milestone','map411m07','cyan'],
- ['0',8,'map4','milestone','map411m08','cyan'],
- ['0',9,'map4','milestone','map411m09','cyan'],
- ['0',10,'map4','milestone','map411m10','cyan'],
- ['0',11,'map4','milestone','map411m11','cyan'],
- ['0',12,'map4','milestone','map411m12','cyan'],
- ['0',13,'map4','milestone','map411m13','cyan'],
- ['0',14,'map4','milestone','map411m14','cyan'],
- ['0',15,'map4','milestone','map411m15','cyan'],
-];
-var assetList= [];
-var logos = [];
diff --git a/content/Mathematics/activities_p5.js b/content/Mathematics/activities_p5.js
deleted file mode 100644
index cecb4b9..0000000
--- a/content/Mathematics/activities_p5.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var activities = [
- ['0',1,'map5','milestone','map511m01','cyan'],
- ['0',2,'map5','milestone','map511m02','cyan'],
- ['0',3,'map5','milestone','map511m03','cyan'],
- ['0',4,'map5','milestone','map511m04','cyan'],
- ['0',5,'map5','milestone','map511m05','cyan'],
- ['0',6,'map5','milestone','map511m06','cyan'],
- ['0',7,'map5','milestone','map511m07','cyan'],
- ['0',8,'map5','milestone','map511m08','cyan'],
- ['0',9,'map5','milestone','map511m09','cyan'],
- ['0',10,'map5','milestone','map511m10','cyan'],
- ['0',11,'map5','milestone','map511m11','cyan'],
- ['0',12,'map5','milestone','map511m12','cyan'],
- ['0',13,'map5','milestone','map511m13','cyan'],
- ['0',14,'map5','milestone','map511m14','cyan'],
- ['0',15,'map5','milestone','map511m15','cyan'],
- ['0',16,'map5','milestone','map511m16','cyan'],
- ['0',17,'map5','milestone','map511m17','cyan'],
- ['0',18,'map5','milestone','map511m18','cyan'],
-];
-var assetList= [];
-var logos = [];
diff --git a/content/Mathematics/activities_p6.js b/content/Mathematics/activities_p6.js
deleted file mode 100644
index 1d3cbd5..0000000
--- a/content/Mathematics/activities_p6.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var activities = [
- ['0',1,'map6','milestone','map611m01','cyan'],
- ['0',2,'map6','milestone','map611m02','cyan'],
- ['0',3,'map6','milestone','map611m03','cyan'],
- ['0',4,'map6','milestone','map611m04','cyan'],
- ['0',5,'map6','milestone','map611m05','cyan'],
- ['0',6,'map6','milestone','map611m06','cyan'],
- ['0',7,'map6','milestone','map611m07','cyan'],
- ['0',8,'map6','milestone','map611m08','cyan'],
- ['0',9,'map6','milestone','map611m09','cyan'],
- ['0',10,'map6','milestone','map611m10','cyan'],
- ['0',11,'map6','milestone','map611m11','cyan'],
- ['0',12,'map6','milestone','map611m12','cyan'],
- ['0',13,'map6','milestone','map611m13','cyan'],
- ['0',14,'map6','milestone','map611m14','cyan'],
- ['0',15,'map6','milestone','map611m15','cyan'],
- ['0',16,'map6','milestone','map611m16','cyan'],
- ['0',17,'map6','milestone','map611m17','cyan'],
- ['0',18,'map6','milestone','map611m18','cyan'],
- ['0',19,'map6','milestone','map611m20','cyan'],
- ['0',20,'map6','milestone','map611m21','cyan'],
-];
-var assetList= [];
-var logos = [];
diff --git a/content/Mathematics/index.html b/content/Mathematics/index.html
deleted file mode 100755
index 806d2c3..0000000
--- a/content/Mathematics/index.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Mathematics </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/learner_subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- Mathematics
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/Mathematics/p4.html b/content/Mathematics/p4.html
deleted file mode 100755
index db551a9..0000000
--- a/content/Mathematics/p4.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities_p4.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/Mathematics/p5.html b/content/Mathematics/p5.html
deleted file mode 100755
index fd39bfa..0000000
--- a/content/Mathematics/p5.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities_p5.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div></div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/Mathematics/p6.html b/content/Mathematics/p6.html
deleted file mode 100755
index e20f618..0000000
--- a/content/Mathematics/p6.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>English </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../css/global.css" />
- <link type="image/ico" rel="icon" href="../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../js/karma.js"></script>
- <script type="text/javascript" src="../js/global.js"></script>
- <script type="text/javascript" src="../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../js/subject.js"></script>
- <script type="text/javascript" src="../js/navigation.js"></script>
- <script type="text/javascript" src="activities_p6.js"></script>
- </head>
- <body>
- <div id="header">
- <div class="topbtn_left">
- <div title="home" id="linkHome" class="linkHome"></div>
- </div>
- <div id="lesson_title">
- <img src="../assets/image/title_block_lt.png" width="33" height="75" align = "absmiddle" />
- English
- <img src="../assets/image/title_block_rt.png" width="33" height="75" align = "absmiddle" />
- </div>
- <div class="topbtn_right">
- <div title="Quit" id="linkQuit" class="linkQuit"></div>
- </div>
- </div>
- <canvas id="ladder"/>
- </body>
-</html>
diff --git a/content/assets/audio/noclip.ogg b/content/assets/audio/noclip.ogg
deleted file mode 100755
index 3ba4812..0000000
--- a/content/assets/audio/noclip.ogg
+++ /dev/null
Binary files differ
diff --git a/content/assets/default/image/favicon.ico b/content/assets/default/image/favicon.ico
deleted file mode 100755
index 20bf7f1..0000000
--- a/content/assets/default/image/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/background.jpg b/content/assets/image/background.jpg
deleted file mode 100755
index 14d4b0f..0000000
--- a/content/assets/image/background.jpg
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/bg_footer.png b/content/assets/image/bg_footer.png
deleted file mode 100755
index 8982264..0000000
--- a/content/assets/image/bg_footer.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/bg_header.png b/content/assets/image/bg_header.png
deleted file mode 100755
index 98213f7..0000000
--- a/content/assets/image/bg_header.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/bg_title_block.png b/content/assets/image/bg_title_block.png
deleted file mode 100755
index 2c9dacf..0000000
--- a/content/assets/image/bg_title_block.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_back.png b/content/assets/image/btn_back.png
deleted file mode 100755
index d9fbf14..0000000
--- a/content/assets/image/btn_back.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_back_hover.png b/content/assets/image/btn_back_hover.png
deleted file mode 100755
index 0911fcc..0000000
--- a/content/assets/image/btn_back_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_back_subject.png b/content/assets/image/btn_back_subject.png
deleted file mode 100755
index b057304..0000000
--- a/content/assets/image/btn_back_subject.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_help.png b/content/assets/image/btn_help.png
deleted file mode 100755
index 6753e9c..0000000
--- a/content/assets/image/btn_help.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_help_hover.png b/content/assets/image/btn_help_hover.png
deleted file mode 100755
index d3ccd92..0000000
--- a/content/assets/image/btn_help_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_next.png b/content/assets/image/btn_next.png
deleted file mode 100755
index 9d70993..0000000
--- a/content/assets/image/btn_next.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_next_hover.png b/content/assets/image/btn_next_hover.png
deleted file mode 100755
index 2cd4d37..0000000
--- a/content/assets/image/btn_next_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_ole.png b/content/assets/image/btn_ole.png
deleted file mode 100755
index 0e775e9..0000000
--- a/content/assets/image/btn_ole.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_ole_hover.png b/content/assets/image/btn_ole_hover.png
deleted file mode 100755
index c43c5f7..0000000
--- a/content/assets/image/btn_ole_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_play_again.png b/content/assets/image/btn_play_again.png
deleted file mode 100755
index 3594d18..0000000
--- a/content/assets/image/btn_play_again.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_play_again_hover.png b/content/assets/image/btn_play_again_hover.png
deleted file mode 100755
index ebb8f8c..0000000
--- a/content/assets/image/btn_play_again_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_play_again_mouse_down.png b/content/assets/image/btn_play_again_mouse_down.png
deleted file mode 100755
index 07d6e45..0000000
--- a/content/assets/image/btn_play_again_mouse_down.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_start.png b/content/assets/image/btn_start.png
deleted file mode 100755
index 32e5f20..0000000
--- a/content/assets/image/btn_start.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_start_hover.png b/content/assets/image/btn_start_hover.png
deleted file mode 100755
index 811ce78..0000000
--- a/content/assets/image/btn_start_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/btn_start_mouse_down.png b/content/assets/image/btn_start_mouse_down.png
deleted file mode 100755
index 5acd43b..0000000
--- a/content/assets/image/btn_start_mouse_down.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/english.png b/content/assets/image/english.png
deleted file mode 100755
index 6a3eaab..0000000
--- a/content/assets/image/english.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/explore.png b/content/assets/image/explore.png
deleted file mode 100644
index 9a32220..0000000
--- a/content/assets/image/explore.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/favicon.ico b/content/assets/image/favicon.ico
deleted file mode 100755
index 7a08617..0000000
--- a/content/assets/image/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/library.gif b/content/assets/image/library.gif
deleted file mode 100755
index 171c437..0000000
--- a/content/assets/image/library.gif
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/mathematics.png b/content/assets/image/mathematics.png
deleted file mode 100755
index e8a6ee2..0000000
--- a/content/assets/image/mathematics.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/next.png b/content/assets/image/next.png
deleted file mode 100644
index 69df909..0000000
--- a/content/assets/image/next.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/picClock.png b/content/assets/image/picClock.png
deleted file mode 100755
index 63e50e2..0000000
--- a/content/assets/image/picClock.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/title_block_lt.png b/content/assets/image/title_block_lt.png
deleted file mode 100755
index 4696182..0000000
--- a/content/assets/image/title_block_lt.png
+++ /dev/null
Binary files differ
diff --git a/content/assets/image/title_block_rt.png b/content/assets/image/title_block_rt.png
deleted file mode 100755
index 37cc44a..0000000
--- a/content/assets/image/title_block_rt.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/arrow_down_white.png b/content/css/images/arrow_down_white.png
deleted file mode 100755
index e2b247a..0000000
--- a/content/css/images/arrow_down_white.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/arrow_down_white.svg b/content/css/images/arrow_down_white.svg
deleted file mode 100755
index fb2cb26..0000000
--- a/content/css/images/arrow_down_white.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="32"
- height="32"
- viewBox="0 0 32 32"
- id="Layer_1"
- xml:space="preserve"><defs
- id="defs7" />
-<path
- d="m 32,16.016 -5.672,-5.664 c 0,0 -3.18,3.18 -6.312,6.312 V 0 H 11.993 V 16.664 L 5.673,10.344 0,16.016 16,32 32,16.016 z"
- id="path3"
- style="fill:#ffffff" />
-</svg> \ No newline at end of file
diff --git a/content/css/images/back_button_hover.png b/content/css/images/back_button_hover.png
deleted file mode 100755
index 084f4ea..0000000
--- a/content/css/images/back_button_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/back_button_start.png b/content/css/images/back_button_start.png
deleted file mode 100755
index 31ab319..0000000
--- a/content/css/images/back_button_start.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/bg.png b/content/css/images/bg.png
deleted file mode 100755
index 7483a94..0000000
--- a/content/css/images/bg.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/bg_footer.png b/content/css/images/bg_footer.png
deleted file mode 100755
index 4bd44fa..0000000
--- a/content/css/images/bg_footer.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/bg_header.png b/content/css/images/bg_header.png
deleted file mode 100755
index f421817..0000000
--- a/content/css/images/bg_header.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/bg_title_block.png b/content/css/images/bg_title_block.png
deleted file mode 100755
index 7311891..0000000
--- a/content/css/images/bg_title_block.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_back.png b/content/css/images/btn_back.png
deleted file mode 100755
index d9fbf14..0000000
--- a/content/css/images/btn_back.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_back_hover.png b/content/css/images/btn_back_hover.png
deleted file mode 100755
index 0911fcc..0000000
--- a/content/css/images/btn_back_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_help.png b/content/css/images/btn_help.png
deleted file mode 100755
index 6753e9c..0000000
--- a/content/css/images/btn_help.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_help_hover.png b/content/css/images/btn_help_hover.png
deleted file mode 100755
index d3ccd92..0000000
--- a/content/css/images/btn_help_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_minus.png b/content/css/images/btn_minus.png
deleted file mode 100755
index 9a7320d..0000000
--- a/content/css/images/btn_minus.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_minus25x25.png b/content/css/images/btn_minus25x25.png
deleted file mode 100755
index 7ffcc91..0000000
--- a/content/css/images/btn_minus25x25.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_minus_hover.png b/content/css/images/btn_minus_hover.png
deleted file mode 100755
index f8203b4..0000000
--- a/content/css/images/btn_minus_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_ole.png b/content/css/images/btn_ole.png
deleted file mode 100755
index 0e775e9..0000000
--- a/content/css/images/btn_ole.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_ole_hover.png b/content/css/images/btn_ole_hover.png
deleted file mode 100755
index c43c5f7..0000000
--- a/content/css/images/btn_ole_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_plus.png b/content/css/images/btn_plus.png
deleted file mode 100755
index 4600d5d..0000000
--- a/content/css/images/btn_plus.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_plus25x25.png b/content/css/images/btn_plus25x25.png
deleted file mode 100755
index 7e4d381..0000000
--- a/content/css/images/btn_plus25x25.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/btn_plus_hover.png b/content/css/images/btn_plus_hover.png
deleted file mode 100755
index e08e45a..0000000
--- a/content/css/images/btn_plus_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/correct.png b/content/css/images/correct.png
deleted file mode 100755
index f2dbc5a..0000000
--- a/content/css/images/correct.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/correct200x178.png b/content/css/images/correct200x178.png
deleted file mode 100755
index a203da6..0000000
--- a/content/css/images/correct200x178.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/correct200x190.png b/content/css/images/correct200x190.png
deleted file mode 100755
index 907cf79..0000000
--- a/content/css/images/correct200x190.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/epaath_bg_footer.png b/content/css/images/epaath_bg_footer.png
deleted file mode 100755
index 4bd44fa..0000000
--- a/content/css/images/epaath_bg_footer.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/epaath_bg_header.png b/content/css/images/epaath_bg_header.png
deleted file mode 100755
index f421817..0000000
--- a/content/css/images/epaath_bg_header.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/happy-face.png b/content/css/images/happy-face.png
deleted file mode 100755
index 0bd21e7..0000000
--- a/content/css/images/happy-face.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/incorrect.png b/content/css/images/incorrect.png
deleted file mode 100755
index edfe9c5..0000000
--- a/content/css/images/incorrect.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/incorrect200x178.png b/content/css/images/incorrect200x178.png
deleted file mode 100755
index f988c6a..0000000
--- a/content/css/images/incorrect200x178.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/incorrect200x190.png b/content/css/images/incorrect200x190.png
deleted file mode 100755
index 9eb58e8..0000000
--- a/content/css/images/incorrect200x190.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/oleHelp.png b/content/css/images/oleHelp.png
deleted file mode 100755
index 8fca480..0000000
--- a/content/css/images/oleHelp.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/ole_logo.png b/content/css/images/ole_logo.png
deleted file mode 100755
index 0b409ac..0000000
--- a/content/css/images/ole_logo.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/sad-face.png b/content/css/images/sad-face.png
deleted file mode 100755
index 1523519..0000000
--- a/content/css/images/sad-face.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/start_page.png b/content/css/images/start_page.png
deleted file mode 100755
index 08c0e2f..0000000
--- a/content/css/images/start_page.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/title_block_lt.png b/content/css/images/title_block_lt.png
deleted file mode 100755
index b1c0e90..0000000
--- a/content/css/images/title_block_lt.png
+++ /dev/null
Binary files differ
diff --git a/content/css/images/title_block_rt.png b/content/css/images/title_block_rt.png
deleted file mode 100755
index 275daaf..0000000
--- a/content/css/images/title_block_rt.png
+++ /dev/null
Binary files differ
diff --git a/content/css/intro.css b/content/css/intro.css
deleted file mode 100755
index 6b8be70..0000000
--- a/content/css/intro.css
+++ /dev/null
@@ -1,97 +0,0 @@
-body {
-padding-left:15%;
-width:70%;
-}
-#header {
-background-color:transparent;
-height:140px;
-position:relative;
-width:100%;
-}
-#headerBg1 {
-display:inline;
-float:left;
-margin-left: 3%;
-}
-/*#headerBg2{
-display:inline;
-float:left;
-margin-left: 10%;
-}*/
-#header ul {
--moz-border-radius-bottomleft:5px;
--moz-border-radius-bottomright:5px;
--moz-border-radius-topleft:5px;
--moz-border-radius-topright:5px;
--webkit-border-bottom-left-radius:5px;
--webkit-border-bottom-right-radius:5px;
--webkit-border-top-left-radius:5px;
--webkit-border-top-right-radius:5px;
-background-color:#EEF7FB;
-border:1px solid black;
-/*bottom:0;
-position:absolute;*/
-width:95%;
-float:left;
-}
-#header ul li {
-display:inline;
-list-style-type:none;
-padding:10px;
-}
-#header ul li a {
-text-decoration:none;
-}
-#intro {
-float:left;
-padding-top:10px;
-width:100%;
-}
-#introText {
-display:inline;
-float:left;
-width:70%;
-margin-right: 2%;
-}
-#introText a {
-text-decoration:none;
-}
-#blurb{
- font-size:larger;
- font-weight:bolder;
-}
-#imgHolder {
-display:inline;
-float:left;
-width:20%;
-margin-top: 1%;
-}
-#demos {
-float:left;
-width:100%;
-}
-#demos .imgs {
-margin-left:5%;
-margin-right:5%;
-width:100%;
-}
-#demos img {
--moz-border-radius-bottomleft:5px;
--moz-border-radius-bottomright:5px;
--moz-border-radius-topleft:5px;
--moz-border-radius-topright:5px;
--webkit-border-bottom-left-radius:5px;
--webkit-border-bottom-right-radius:5px;
--webkit-border-top-left-radius:5px;
--webkit-border-top-right-radius:5px;
-border:1px solid black;
-margin:5px;
-padding-left:5px;
-padding-right:5px;
-}
-#footer {
-float:left;
-font-size:smaller;
-padding-top:50px;
-width:100%;
-} \ No newline at end of file
diff --git a/content/css/jquery.svg.css b/content/css/jquery.svg.css
deleted file mode 100755
index c181ec1..0000000
--- a/content/css/jquery.svg.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-
-svg\:svg {
- display: none;
-}
-
-.svg_error {
- color: red;
- font-weight: bold;
-}
diff --git a/content/css/jquizme.css b/content/css/jquizme.css
deleted file mode 100644
index 3d8c424..0000000
--- a/content/css/jquizme.css
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-jQuizMe 2.1 - 12/15/09 Programmed and CopyWrited by Larry Battle 2008 - 2009
-*/
-.quiz-el{
- background: #ffaa33;
- font-size: 1.1em;
- font-family: Arial, Verdana, Helvetica, sans-serif;
- position: relative;
- padding: 0.2em;
- width: 600px;
-}
-.quiz-el div{
- padding: 0.2em;
-}
-.quiz-el input{
- font-size: 0.8em;
-}
-/* .q-innerArea = .q-header, .q-help, .q-prob, .q-intro, .q-gameOver */
-.q-innerArea{
- background: #ffdd77;
- position:relative;
- clear: both;
- color: black;
-}
-.q-header, .q-help, .q-review-menu {
- border-bottom: thin black solid;
-}
-.q-intro{
- padding: 0.2em;
-}
-.q-title{
- overflow: hidden;
- width: 80%;
- margin: 0;
-}
-/*This is a hack, because IE fails on float:right.*/
-.q-counter{
- position: absolute;
- top: 0%;
- right: 0%;
- margin: 1%;
- padding: 0%;
-}
-.q-counter{
- float: right;
-}
-.q-help{
- position: relative;
- clear:both;
-}
-/*.q-probArea = .q-ques, .q-ansSel, .q-result */
-.q-probArea{
- background: #eee;
- border: thin black solid;
- font-size: 1.2em;
- position: relative;
-}
-.q-help-menu{
- width: 97%;
-}
-.q-help-info{
- clear:both;
-}
-.q-quit-area, .q-review-arrows{
- display: inline;
- width: auto;
-}
-.q-quit-area{
- float: right;
-}
-.q-review-arrows{
- position: relative; /*IE hack.*/
- width: 2.3em;
-}
-.q-center{
- text-align: center;
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-.q-gameOver .q-statTotal{
- color: blue;
-}
-.q-quesInput{
- width: 95%;
-}
-.q-ol{
- list-style-type: upper-alpha;
- list-style-position: inside;
- padding: 0;
- margin: 0;
-}
-.q-ol-li{
- margin: 0.4em auto 0.4em auto;
-}
-.q-ol-hover{
- background: #777777;
-}
-.q-ol-active{
- background: black;
- color: #ccffaa;
-}
-/*IE displays the wrong width for <select> tags.*/
-.q-select{
- width : 80%;
-}
-.q-select{
- font-size: 0.8em;
- width: 100%;
-}
-.q-timer-area{
- display:block;
- text-align:center;
- width: auto;
-}
-.q-review-menu{
- text-align: center;
- width: auto;
-}
-.q-reviewBar-btns{
- position: relative;
- display: inline-block;
- width: 49%;
-}
-.q-rightArrow{
- float:right;
-}
-.q-leftArrow{
- float:left;
-}
-.q-timer-area{
- line-height: 0;
- height:0;
-}
diff --git a/content/css/kDoc.css b/content/css/kDoc.css
deleted file mode 100755
index 5bf5f0b..0000000
--- a/content/css/kDoc.css
+++ /dev/null
@@ -1,28 +0,0 @@
-#kDoc{
- background-color: white;
- width: 100%;
- height: 100%;
-
-}
-
-.zoom{
- display: inline-block;
- width: 25px;
- height: 25px;
- background-repeat: no-repeat;
-}
-
-.zoom.zoom-in {
- background-image: url(images/btn_plus25x25.png);
-}
-
-.zoom.zoom-out {
- background-image: url(images/btn_minus25x25.png);
-}
-
-
-#iframeLessonPlan{
- width:100%;
- height: 90%;
-
-} \ No newline at end of file
diff --git a/content/css/kStart.css b/content/css/kStart.css
deleted file mode 100755
index 03a41c2..0000000
--- a/content/css/kStart.css
+++ /dev/null
@@ -1,195 +0,0 @@
-#kStart {
- /*width: 1200px;
- height: 884px;
- */
- position:relative;
- margin:0px auto;
- text-align:center;
- width: 1200px;
- height: 900px;
- overflow:hidden;
- background-image: url(./images/bg.png);
- -moz-background-size: 100% 100%;
- -webkit-background-size: 100% 100%;
-}
-
-#kStart .center{
- /* width: 100%;
- float: left;*/
- width: 800px
- margin-left: auto;
- margin-right: auto;
- text-align: center;
-}
-
-#kStart #top{
- height: 13%;
- width: 100%;
- color: #8a72c4;
-}
-
- #backBtn{
- background-image: url(images/back_button_start.png);
- position: absolute;
- width: 60px;
- height: 60px;
- margin-top: 10px;
- margin-left: 10px;
- opacity: 1.0;
- cursor:pointer;
- }
-
- #backBtn:hover{
- background-image: url(images/back_button_hover.png);
- }
-
- #topMiddle{
- margin-top: 1%;
- color: white;
- }
-
- #topDesc{
-
- }
-
- #topE-Paath{
- font-size: 2em;
- margin-top: 1%;
- }
-
-
-
-#kStart #middle{
- border: 2px solid white;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- color: white;
- height: 70%;
- width: 90%;
- margin-left: auto;
- margin-right: auto;
- position:relative;
- background-color: rgba(0,0,200,0.3);
-}
-
- #grade{
- margin-top: 0.5em;
- }
-
- #gradeText{
- font-size: 2.5em;
- }
-
- #gradeNum{
- font-size: 2.5em;
- }
-
- #subject{
- font-size: 3em;
- }
-
- #lessonTitle{
- margin-top: 1em;
- }
-
- #lessonTitle>a{
- font-size: 2.5em;
- color: yellow;
- text-decoration: none;
- }
-
- #lessonTitle>a:hover{
- /*font-size: 2.9em;*/
- color: #FFFFE0;
- }
-
-
- #lessonDesc{
- font-size: 2em;
- margin-top: 0.2em;
- }
-
- #kStart #middle .button{
- position: absolute;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- background-color: purple;
- margin-left: 0.5em;
- margin-right: 0.5em;
- margin-bottom: 0.5em;
- padding-top:0.2em;
- padding-bottom: 0.2em;
- padding-left: 0.5em;
- padding-right: 0.5em;
- font-size: 1.5em;
- border: 1px black solid;
- }
-
- #kStart #middle .button:hover{
- /*opacity: 0.8;*/
- border: 2px white solid;
- }
-
- #kStart #middle .button a{
- text-decoration: none;
- }
-
- #kStart #middle .button div{
- text-align: center;
- color: white;
- }
-
- #teachersNoteBtn{
- position:absolute;
- right:18em;
- bottom: 8em;
- }
-
- #lessonPlanBtn{
- position:absolute;
- right:18em;
- bottom: 8em;
- }
-
-#kStart #bottom{
-height: 15%;
-width: 100%;
-color: white;
-}
-
- #logo{
- display: block;
- width: 320px;
- height: 60px;
- float: none;
- background-image: url(images/ole_logo.png);
- background-repeat: no-repeat;
- margin-left:auto;
- margin-right:auto;
- margin-top: 0.8em;
- cursor:pointer;
- z-index: 5;
- }
- #logoHelp{
- display:none;
- position:absolute;
- bottom: 7em;
- left: 12em;
- width: 872px;
- height:444px;
- background-image: url(images/oleHelp.png);
- z-index:4;
- }
-
-#kStart #copyright{
- position: fixed;
- left: 5px;
- bottom: 0px;
- color: white;
- font-size: smaller;
-}
-
- #kStart #copyright a{
- color: white;
- opacity:0.8;
- } \ No newline at end of file
diff --git a/content/css/karma.css b/content/css/karma.css
deleted file mode 100755
index 7481928..0000000
--- a/content/css/karma.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/* import nepal's Themeroller theme */
-@import url(./ui.base.css);
-@import url(./theme/jquery-ui-1.7.2.custom.css);
-@import url(./ui.dialog.css);
-@import url(./ui.resizable.css);
-@import url(./ui.feedback.css);
-
-/* special hack for the current karma-loader notification */
-@media screen {
- #karma-loader{
- position:absolute;
- top:0;
- left:0;
- padding: 2px 2px 1px 5px;
- font-size: 12px;
- background: #0066cc;
- color: #ffffff;
-
- }
- #karma-loader.status{
- left:110px;
- }
-}
-
-body{
- padding: 0px;
- margin: 0 auto 0 auto;
- width: 1200px;
- height: 900px;
- overflow: hidden;
- position: relative;
- background-color: purple;
-}
-
-#kMain {
- width: 1200px;
- height: 760px;
- float: left;
- clear: both;
- background-color: white;
-}
-
-/* for first-time users */
-#kMain #itWorks{
- text-align: center;
- font-size: 4em;
-}
-
-
diff --git a/content/css/kglobal.css b/content/css/kglobal.css
deleted file mode 100755
index bef0b1a..0000000
--- a/content/css/kglobal.css
+++ /dev/null
@@ -1,141 +0,0 @@
-@CHARSET "UTF-8";
-/****** Page Styles ****/
-
-/* Designed for 1200*900 px screen resolution */
-
-body {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10pt;
- margin: 0px;
- background-color: #FFFFCC;
-}
-#header {
- background-image: url(../assets/image/bg_header.png);
- background-repeat: repeat-x;
- height: 75px;
- width: 100%;
- position: absolute;
- left: 0px;
- top: 0px;
- z-index:10;
-}
-#topbtn_left {
- float: left;
- height: 60px;
- width: 60px;
- padding-top: 6px;
- padding-left: 15px;
-}
-
-#lesson_title {
- float: left;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 16pt;
- font-weight: bold;
- color: #FFFFFF;
- margin-left: 10px;
- background-image: url(../assets/image/bg_title_block.png);
-}
-#topbtn_right {
- float: right;
- height: 60px;
- width: 60px;
- padding-top: 6px;
- padding-right: 15px;
-}
- #linkHelp{
- width: 60px; height: 60px;
- background:url(../assets/image/btn_help.png);
- cursor:pointer;
- }
- #linkHelp:hover{
- background:url(../assets/image/btn_help_hover.png);
- }
- #linkOle{
- cursor:pointer;
- width: 60px; height: 60px;
- background:url(../assets/image/btn_ole.png);
- }
- #linkOle:hover{
- background:url(../assets/image/btn_ole_hover.png);
- }
-#footer {
- position:relative;
- background-image: url(../assets/image/bg_footer.png);
- background-repeat: repeat-x;
- height: 75px;
- width: 100%;
- left: 0px;
- bottom: 0px;
-}
-#score_box {
- float: left;
- padding-left: 5px;
- padding-top: 0.7em;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- color: #FFFF00;
- font-size: 16pt;
- font-weight: bold;
-}
-#botbtn_right {
- float: right;
- height: 55px;
- padding-right: 5px;
- padding-top: 10px;
-}
-
- #linkStart{
- cursor:pointer;
- width: 251px; height: 55px;
- background:url(../assets/image/btn_start.png);
- }
- #linkStart:hover{
- background:url(../assets/image/btn_start_hover.png);
- }
- #linkStart:active{
- background:url(../assets/image/btn_start_mouse_down.png);
- }
- #linkPlayAgain{
- cursor:pointer;
- width: 251px; height: 55px;
- background:url(../assets/image/btn_play_again.png);
- }
- #linkPlayAgain:hover{
- background:url(../assets/image/btn_play_again_hover.png);
- }
- #linkPlayAgain:active{
- background:url(../assets/image/btn_play_again_mouse_down.png);
- }
-#timerBar {
-
- position: absolute;
- left: 30%;
- bottom: 25%;
- width: 210px;
- height:35px;
- padding-left: 10px;
- color: #FFFF00;
- font-size: 16pt;
- font-weight: bold;
- }
- #picClock{
- float:left;
- width:32px;
- height: 32px;
- background: url(../assets/image/picClock.png);
- }
-
- .timerBoxes{ /* Show the timer running after the game has began.... */
- float:right;
- width: 50px;
- height: 35px;
- border: 2px dotted green;
- color: blue;
- text-align:center;
- font : bold 25px Arial Black, Times New Roman;
- background: #ACC;
- }
-
-/**** End of the page style ****/
-
-
diff --git a/content/css/qunit.css b/content/css/qunit.css
deleted file mode 100755
index 4542933..0000000
--- a/content/css/qunit.css
+++ /dev/null
@@ -1,17 +0,0 @@
-h1#qunit-header { padding: 15px; font-size: large; background-color: #06b; color: white; font-family: 'trebuchet ms', verdana, arial; margin: 0; }
-h1#qunit-header a { color: white; }
-
-h2#qunit-banner { height: 2em; border-bottom: 1px solid white; background-color: #eee; margin: 0; font-family: 'trebuchet ms', verdana, arial; }
-h2#qunit-banner.pass { background-color: green; }
-h2#qunit-banner.fail { background-color: red; }
-
-h2#qunit-userAgent { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal; font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; }
-
-div#qunit-testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; font-family: 'trebuchet ms', verdana, arial; margin: 0; font-size: 10pt; }
-
-ol#qunit-tests { font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; }
-ol#qunit-tests li strong { cursor:pointer; }
-ol#qunit-tests .pass { color: green; }
-ol#qunit-tests .fail { color: red; }
-
-p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }
diff --git a/content/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/content/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
deleted file mode 100755
index 5b5dab2..0000000
--- a/content/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png b/content/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
deleted file mode 100755
index 0852ec3..0000000
--- a/content/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_flat_75_ffffff_40x100.png b/content/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
deleted file mode 100755
index ac8b229..0000000
--- a/content/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/content/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
deleted file mode 100755
index ad3d634..0000000
--- a/content/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_glass_65_e774ec_1x400.png b/content/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
deleted file mode 100755
index a47d762..0000000
--- a/content/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_glass_75_f49aec_1x400.png b/content/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
deleted file mode 100755
index 1f8d100..0000000
--- a/content/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png b/content/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
deleted file mode 100755
index d3ffeef..0000000
--- a/content/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png b/content/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
deleted file mode 100755
index 708667b..0000000
--- a/content/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/content/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
deleted file mode 100755
index 0e05810..0000000
--- a/content/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_222222_256x240.png b/content/css/theme/images/ui-icons_222222_256x240.png
deleted file mode 100755
index ee039dc..0000000
--- a/content/css/theme/images/ui-icons_222222_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_222222_768x720.png b/content/css/theme/images/ui-icons_222222_768x720.png
deleted file mode 100755
index 2437773..0000000
--- a/content/css/theme/images/ui-icons_222222_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_2e83ff_256x240.png b/content/css/theme/images/ui-icons_2e83ff_256x240.png
deleted file mode 100755
index 45e8928..0000000
--- a/content/css/theme/images/ui-icons_2e83ff_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_2e83ff_768x720.png b/content/css/theme/images/ui-icons_2e83ff_768x720.png
deleted file mode 100755
index 9727a25..0000000
--- a/content/css/theme/images/ui-icons_2e83ff_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_454545_256x240.png b/content/css/theme/images/ui-icons_454545_256x240.png
deleted file mode 100755
index 7ec70d1..0000000
--- a/content/css/theme/images/ui-icons_454545_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_454545_768x720.png b/content/css/theme/images/ui-icons_454545_768x720.png
deleted file mode 100755
index 761d947..0000000
--- a/content/css/theme/images/ui-icons_454545_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_7811a2_256x240.png b/content/css/theme/images/ui-icons_7811a2_256x240.png
deleted file mode 100755
index d51567c..0000000
--- a/content/css/theme/images/ui-icons_7811a2_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_7811a2_768x720.png b/content/css/theme/images/ui-icons_7811a2_768x720.png
deleted file mode 100755
index cb1d7a2..0000000
--- a/content/css/theme/images/ui-icons_7811a2_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_cd0a0a_256x240.png b/content/css/theme/images/ui-icons_cd0a0a_256x240.png
deleted file mode 100755
index 7930a55..0000000
--- a/content/css/theme/images/ui-icons_cd0a0a_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/images/ui-icons_cd0a0a_768x720.png b/content/css/theme/images/ui-icons_cd0a0a_768x720.png
deleted file mode 100755
index 788be14..0000000
--- a/content/css/theme/images/ui-icons_cd0a0a_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/css/theme/jquery-ui-1.7.2.custom.css b/content/css/theme/jquery-ui-1.7.2.custom.css
deleted file mode 100755
index 2a9e5c7..0000000
--- a/content/css/theme/jquery-ui-1.7.2.custom.css
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-*/
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-
-
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.5em&cornerRadius=4px&bgColorHeader=f49aec&bgTextureHeader=02_glass.png&bgImgOpacityHeader=75&borderColorHeader=e774ec&fcHeader=222222&iconColorHeader=7811a2&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=e774ec&fcContent=222222&iconColorContent=222222&bgColorDefault=f8a5f0&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=e774ec&fcDefault=555555&iconColorDefault=7811a2&bgColorHover=fdd9f9&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=e774ec&fcHover=212121&iconColorHover=7811a2&bgColorActive=e774ec&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=e774ec&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=d13db4&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=fbd0f3&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=2px&offsetTopShadow=4px&offsetLeftShadow=4px&cornerRadiusShadow=4px
-*/
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.5em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #e774ec; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #e774ec; background: #f49aec url(images/ui-bg_glass_75_f49aec_1x400.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
-.ui-widget-header a { color: #222222; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #e774ec; background: #f8a5f0 url(images/ui-bg_glass_75_f8a5f0_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #e774ec; background: #fdd9f9 url(images/ui-bg_glass_75_fdd9f9_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; }
-.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #e774ec; background: #e774ec url(images/ui-bg_glass_65_e774ec_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #d13db4; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_inset-soft_95_fef1ec_1x100.png) 50% bottom repeat-x; color: #cd0a0a; }
-.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 48px; height: 48px; background-image: url(images/ui-icons_222222_768x720.png); }
-.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_768x720.png); }
-.ui-widget-header .ui-icon {background-image: url(images/ui-icons_7811a2_768x720.png); }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_7811a2_768x720.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_7811a2_768x720.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_768x720.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_768x720.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_768x720.png); }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -48px 0; }
-.ui-icon-carat-1-e { background-position: -96px 0; }
-.ui-icon-carat-1-se { background-position: -144px 0; }
-.ui-icon-carat-1-s { background-position: -192px 0; }
-.ui-icon-carat-1-sw { background-position: -240px 0; }
-.ui-icon-carat-1-w { background-position: -288px 0; }
-.ui-icon-carat-1-nw { background-position: -336px 0; }
-.ui-icon-carat-2-n-s { background-position: -384px 0; }
-.ui-icon-carat-2-e-w { background-position: -432px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -48px; }
-.ui-icon-triangle-1-ne { background-position: -48px -48px; }
-.ui-icon-triangle-1-e { background-position: -96px -48px; }
-.ui-icon-triangle-1-se { background-position: -144px -48px; }
-.ui-icon-triangle-1-s { background-position: -192px -48px; }
-.ui-icon-triangle-1-sw { background-position: -240px -48px; }
-.ui-icon-triangle-1-w { background-position: -288px -48px; }
-.ui-icon-triangle-1-nw { background-position: -336px -48px; }
-.ui-icon-triangle-2-n-s { background-position: -384px -48px; }
-.ui-icon-triangle-2-e-w { background-position: -432px -48px; }
-.ui-icon-arrow-1-n { background-position: 0 -96px; }
-.ui-icon-arrow-1-ne { background-position: -48px -96px; }
-.ui-icon-arrow-1-e { background-position: -96px -96px; }
-.ui-icon-arrow-1-se { background-position: -144px -96px; }
-.ui-icon-arrow-1-s { background-position: -192px -96px; }
-.ui-icon-arrow-1-sw { background-position: -240px -96px; }
-.ui-icon-arrow-1-w { background-position: -288px -96px; }
-.ui-icon-arrow-1-nw { background-position: -336px -96px; }
-.ui-icon-arrow-2-n-s { background-position: -384px -96px; }
-.ui-icon-arrow-2-ne-sw { background-position: -432px -96px; }
-.ui-icon-arrow-2-e-w { background-position: -480px -96px; }
-.ui-icon-arrow-2-se-nw { background-position: -528px -96px; }
-.ui-icon-arrowstop-1-n { background-position: -576px -96px; }
-.ui-icon-arrowstop-1-e { background-position: -624px -96px; }
-.ui-icon-arrowstop-1-s { background-position: -672px -96px; }
-.ui-icon-arrowstop-1-w { background-position: -720px -96px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -144px; }
-.ui-icon-arrowthick-1-ne { background-position: -48px -144px; }
-.ui-icon-arrowthick-1-e { background-position: -96px -144px; }
-.ui-icon-arrowthick-1-se { background-position: -144px -144px; }
-.ui-icon-arrowthick-1-s { background-position: -192px -144px; }
-.ui-icon-arrowthick-1-sw { background-position: -240px -144px; }
-.ui-icon-arrowthick-1-w { background-position: -288px -144px; }
-.ui-icon-arrowthick-1-nw { background-position: -336px -144px; }
-.ui-icon-arrowthick-2-n-s { background-position: -384px -144px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -432px -144px; }
-.ui-icon-arrowthick-2-e-w { background-position: -480px -144px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -528px -144px; }
-.ui-icon-arrowthickstop-1-n { background-position: -576px -144px; }
-.ui-icon-arrowthickstop-1-e { background-position: -624px -144px; }
-.ui-icon-arrowthickstop-1-s { background-position: -672px -144px; }
-.ui-icon-arrowthickstop-1-w { background-position: -720px -144px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -192px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -48px -192px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -96px -192px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -144px -192px; }
-.ui-icon-arrowreturn-1-w { background-position: -192px -192px; }
-.ui-icon-arrowreturn-1-n { background-position: -240px -192px; }
-.ui-icon-arrowreturn-1-e { background-position: -288px -192px; }
-.ui-icon-arrowreturn-1-s { background-position: -336px -192px; }
-.ui-icon-arrowrefresh-1-w { background-position: -384px -192px; }
-.ui-icon-arrowrefresh-1-n { background-position: -432px -192px; }
-.ui-icon-arrowrefresh-1-e { background-position: -480px -192px; }
-.ui-icon-arrowrefresh-1-s { background-position: -528px -192px; }
-.ui-icon-arrow-4 { background-position: 0 -240px; }
-.ui-icon-arrow-4-diag { background-position: -48px -240px; }
-.ui-icon-extlink { background-position: -96px -240px; }
-.ui-icon-newwin { background-position: -144px -240px; }
-.ui-icon-refresh { background-position: -192px -240px; }
-.ui-icon-shuffle { background-position: -240px -240px; }
-.ui-icon-transfer-e-w { background-position: -288px -240px; }
-.ui-icon-transferthick-e-w { background-position: -336px -240px; }
-.ui-icon-folder-collapsed { background-position: 0 -288px; }
-.ui-icon-folder-open { background-position: -48px -288px; }
-.ui-icon-document { background-position: -96px -288px; }
-.ui-icon-document-b { background-position: -144px -288px; }
-.ui-icon-note { background-position: -192px -288px; }
-.ui-icon-mail-closed { background-position: -240px -288px; }
-.ui-icon-mail-open { background-position: -288px -288px; }
-.ui-icon-suitcase { background-position: -336px -288px; }
-.ui-icon-comment { background-position: -384px -288px; }
-.ui-icon-person { background-position: -432px -288px; }
-.ui-icon-print { background-position: -480px -288px; }
-.ui-icon-trash { background-position: -528px -288px; }
-.ui-icon-locked { background-position: -576px -288px; }
-.ui-icon-unlocked { background-position: -624px -288px; }
-.ui-icon-bookmark { background-position: -672px -288px; }
-.ui-icon-tag { background-position: -720px -288px; }
-.ui-icon-home { background-position: 0 -336px; }
-.ui-icon-flag { background-position: -48px -336px; }
-.ui-icon-calendar { background-position: -96px -336px; }
-.ui-icon-cart { background-position: -144px -336px; }
-.ui-icon-pencil { background-position: -192px -336px; }
-.ui-icon-clock { background-position: -240px -336px; }
-.ui-icon-disk { background-position: -288px -336px; }
-.ui-icon-calculator { background-position: -336px -336px; }
-.ui-icon-zoomin { background-position: -384px -336px; }
-.ui-icon-zoomout { background-position: -432px -336px; }
-.ui-icon-search { background-position: -480px -336px; }
-.ui-icon-wrench { background-position: -528px -336px; }
-.ui-icon-gear { background-position: -576px -336px; }
-.ui-icon-heart { background-position: -624px -336px; }
-.ui-icon-star { background-position: -672px -336px; }
-.ui-icon-link { background-position: -720px -336px; }
-.ui-icon-cancel { background-position: 0 -384px; }
-.ui-icon-plus { background-position: -48px -384px; }
-.ui-icon-plusthick { background-position: -96px -384px; }
-.ui-icon-minus { background-position: -144px -384px; }
-.ui-icon-minusthick { background-position: -192px -384px; }
-.ui-icon-close { background-position: -240px -384px; }
-.ui-icon-closethick { background-position: -288px -384px; }
-.ui-icon-key { background-position: -336px -384px; }
-.ui-icon-lightbulb { background-position: -384px -384px; }
-.ui-icon-scissors { background-position: -432px -384px; }
-.ui-icon-clipboard { background-position: -480px -384px; }
-.ui-icon-copy { background-position: -528px -384px; }
-.ui-icon-contact { background-position: -576px -384px; }
-.ui-icon-image { background-position: -624px -384px; }
-.ui-icon-video { background-position: -672px -384px; }
-.ui-icon-script { background-position: -720px -384px; }
-.ui-icon-alert { background-position: 0 -432px; }
-.ui-icon-info { background-position: -48px -432px; }
-.ui-icon-notice { background-position: -96px -432px; }
-.ui-icon-help { background-position: -144px -432px; }
-.ui-icon-check { background-position: -192px -432px; }
-.ui-icon-bullet { background-position: -240px -432px; }
-.ui-icon-radio-off { background-position: -288px -432px; }
-.ui-icon-radio-on { background-position: -336px -432px; }
-.ui-icon-pin-w { background-position: -384px -432px; }
-.ui-icon-pin-s { background-position: -432px -432px; }
-.ui-icon-play { background-position: 0 -480px; }
-.ui-icon-pause { background-position: -48px -480px; }
-.ui-icon-seek-next { background-position: -96px -480px; }
-.ui-icon-seek-prev { background-position: -144px -480px; }
-.ui-icon-seek-end { background-position: -192px -480px; }
-.ui-icon-seek-first { background-position: -240px -480px; }
-.ui-icon-stop { background-position: -288px -480px; }
-.ui-icon-eject { background-position: -336px -480px; }
-.ui-icon-volume-off { background-position: -384px -480px; }
-.ui-icon-volume-on { background-position: -432px -480px; }
-.ui-icon-power { background-position: 0 -528px; }
-.ui-icon-signal-diag { background-position: -48px -528px; }
-.ui-icon-signal { background-position: -96px -528px; }
-.ui-icon-battery-0 { background-position: -144px -528px; }
-.ui-icon-battery-1 { background-position: -192px -528px; }
-.ui-icon-battery-2 { background-position: -240px -528px; }
-.ui-icon-battery-3 { background-position: -288px -528px; }
-.ui-icon-circle-plus { background-position: 0 -576px; }
-.ui-icon-circle-minus { background-position: -48px -576px; }
-.ui-icon-circle-close { background-position: -96px -576px; }
-.ui-icon-circle-triangle-e { background-position: -144px -576px; }
-.ui-icon-circle-triangle-s { background-position: -192px -576px; }
-.ui-icon-circle-triangle-w { background-position: -240px -576px; }
-.ui-icon-circle-triangle-n { background-position: -288px -576px; }
-.ui-icon-circle-arrow-e { background-position: -336px -576px; }
-.ui-icon-circle-arrow-s { background-position: -384px -576px; }
-.ui-icon-circle-arrow-w { background-position: -432px -576px; }
-.ui-icon-circle-arrow-n { background-position: -480px -576px; }
-.ui-icon-circle-zoomin { background-position: -528px -576px; }
-.ui-icon-circle-zoomout { background-position: -576px -576px; }
-.ui-icon-circle-check { background-position: -624px -576px; }
-.ui-icon-circlesmall-plus { background-position: 0 -624px; }
-.ui-icon-circlesmall-minus { background-position: -48px -624px; }
-.ui-icon-circlesmall-close { background-position: -96px -624px; }
-.ui-icon-squaresmall-plus { background-position: -144px -624px; }
-.ui-icon-squaresmall-minus { background-position: -192px -624px; }
-.ui-icon-squaresmall-close { background-position: -240px -624px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -672px; }
-.ui-icon-grip-dotted-horizontal { background-position: -48px -672px; }
-.ui-icon-grip-solid-vertical { background-position: -96px -672px; }
-.ui-icon-grip-solid-horizontal { background-position: -144px -672px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -192px -672px; }
-.ui-icon-grip-diagonal-se { background-position: -240px -672px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
-.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
-.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
-.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
-.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
-.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
-.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
-.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
-
-/* Overlays */
-.ui-widget-overlay { background: #fbd0f3 url(images/ui-bg_flat_0_fbd0f3_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
-.ui-widget-shadow { margin: 4px 0 0 4px; padding: 2px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 4px; -webkit-border-radius: 4px; }/* Accordion
-----------------------------------*/
-.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
-.ui-accordion .ui-accordion-li-fix { display: inline; }
-.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
-.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
-.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
-.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
-.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker
-----------------------------------*/
-.ui-datepicker { width: 17em; padding: .2em .2em 0; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; }
-
-/* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
- position: absolute; /*must have*/
- z-index: -1; /*must have*/
- filter: mask(); /*must have*/
- top: -4px; /*must have*/
- left: -4px; /*must have*/
- width: 200px; /*must have*/
- height: 200px; /*must have*/
-}/* Dialog
-----------------------------------*/
-.ui-dialog { position: relative; padding: .2em; width: 300px; }
-.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
-/* Progressbar
-----------------------------------*/
-.ui-progressbar { height:2em; text-align: left; }
-.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
-----------------------------------*/
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
-----------------------------------*/
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
-----------------------------------*/
-.ui-tabs { padding: .2em; zoom: 1; }
-.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
-.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
diff --git a/content/css/ui.all.css b/content/css/ui.all.css
deleted file mode 100755
index 543e4c3..0000000
--- a/content/css/ui.all.css
+++ /dev/null
@@ -1,2 +0,0 @@
-@import "ui.base.css";
-@import "ui.theme.css";
diff --git a/content/css/ui.base.css b/content/css/ui.base.css
deleted file mode 100755
index ba53841..0000000
--- a/content/css/ui.base.css
+++ /dev/null
@@ -1,2 +0,0 @@
-@import url("ui.core.css");
-@import url("ui.tabs.css"); \ No newline at end of file
diff --git a/content/css/ui.core.css b/content/css/ui.core.css
deleted file mode 100755
index c2f18f2..0000000
--- a/content/css/ui.core.css
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-*/
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } \ No newline at end of file
diff --git a/content/css/ui.dialog.css b/content/css/ui.dialog.css
deleted file mode 100755
index 2997595..0000000
--- a/content/css/ui.dialog.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Dialog
-----------------------------------*/
-.ui-dialog { position: relative; padding: .2em; width: 300px; }
-.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
diff --git a/content/css/ui.feedback.css b/content/css/ui.feedback.css
deleted file mode 100755
index 7eed05f..0000000
--- a/content/css/ui.feedback.css
+++ /dev/null
@@ -1,56 +0,0 @@
-.ui-feedback div{
- width: 200px;
- height: 178px;
- position: absolute;
- background-repeat: no-repeat;
-}
-
-.ui-feedback .ui-feedback-correct{
- display:none;
- background-image: url(./images/correct200x190.png);
-}
-
-.ui-feedback .ui-feedback-incorrect{
- display:none;
- background-image: url(./images/incorrect200x190.png);
-}
-
-
-.ui-feedback .ui-feedback-over{
- display: none;
- width: 184px;
- height: 240px;
- overflow: visible;
- cursor: pointer;
- z-index: 10;
-}
-
-.ui-feedback .ui-feedback-over .ui-feedback-win{
- width: 184px;
- height: 222px;
- background-image: url(./images/happy-face.png);
- overflow: visible;
-}
-
-
-.ui-feedback .ui-feedback-over .ui-feedback-lose{
- width: 184px;
- height: 222px;
- background-image: url(./images/sad-face.png);
- overflow: visible;
-}
-
-.ui-feedback .ui-feedback-txt{
- color:purple;
- font-size:3em;
- margin-top:-50px;
- width:300px;
-}
-
-.ui-feedback-overlay {
- position: absolute;
- display: none;
- width: 100%;
- height: 100%;
- background-color: rgba(255,255,255, 0.6);
-} \ No newline at end of file
diff --git a/content/css/ui.kFooter.css b/content/css/ui.kFooter.css
deleted file mode 100755
index 5a0944b..0000000
--- a/content/css/ui.kFooter.css
+++ /dev/null
@@ -1,56 +0,0 @@
-.ui-kFooter{
- background-image: url('./images/bg_footer.png');
- background-repeat: repeat;
- height: 70px;
- width: 100%;
- margin:0;
- padding: 0;
- float: left;
- clear: both;
- border-style: none;
- color: #FFFF00;
-}
-
-
-.ui-kFooter>ul{
- margin-left: 0px;
- padding-left: 5px;
- list-style: none;
-}
-.ui-kFooter>ul>li{
- display:inline;
- margin-right: 10px;
- margin-left: 0px;
-}
-
-
-.ui-kFooter .left{
- float: left;
-}
-
-.ui-kFooter .right{
- float: right;
-}
-
-.ui-kFooter .number{
- background-color:white;
- color: black;
- padding-left:0.4em;
- padding-right:0.4em;
-}
-
-
-.ui-kFooter button{
- cursor:pointer;
- margin-top: -10px;
-}
-
-.ui-kFooter button span{
- float: left;
-}
-
-.ui-kFooter button .text{
- color: #7811a2;
-padding-top: 10px;
-font-weight: bold;
-}
diff --git a/content/css/ui.kHeader.css b/content/css/ui.kHeader.css
deleted file mode 100755
index 4b4bb99..0000000
--- a/content/css/ui.kHeader.css
+++ /dev/null
@@ -1,160 +0,0 @@
-#kHeader{
- background-image: url('./images/bg_header.png');
- background-repeat: repeat-x;
- height: 70px;
- width: 100%;
- margin: 0;
- float: left;
- clear: both;
- border: none;
-}
-
- #kHeader .left{
- float: left;
- }
-
- #kHeader .right{
- float: right;
- }
-
- #kHeader>ul{
- margin: 0;
- margin-left: 5px;
- padding: 0;
- }
-
- #kHeader>ul>li{
- display:inline;
- margin: 0;
- padding: 0;
- margin-top: 5px;
- margin-right:15px;
- }
-
- #kHeader .kHeader-btn{
- width: 60px;
- height: 60px;
- display: block;
- cursor:pointer;
- }
-
- #kHeader .kHeader-back{
- background-image:url(./images/btn_back.png);
- }
-
- #kHeader .kHeader-back:hover{
- background:url('./images/btn_back_hover.png');
- }
-
- #kHeader .kHeader-title {
- font-weight: bold;
- color: #FFFFFF;
- margin-top: 10px;
- border:4px solid #e774ec;
- padding: 5px 20px 5px 20px;
- -moz-border-radius:25px;
- -webkit-border-radius: 25px;
- }
-
- #kHeader .kHeader-title span{
- float:left;
- }
-
- #kHeader .kHeader-title .kHeader-kDoc{
- background-image: url(images/arrow_down_white.png);
- background-repeat: no-repeat;
- width: 22px;
- height: 22px;
- cursor: pointer;
- margin-left: 10px;
- margin-top: 3px;
- position: relative;
- }
-
- #kHeader .kHeader-title .kHeader-kDoc .drop-down{
- display: none;
- position: absolute;
- top: 22px;
- left: -20px;
- width: 90px;
- background-color: rgba(0, 0, 0, 0.8);
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border: 1px solid white;
- padding-left: 5px;
- }
- #kHeader .kHeader-title .kHeader-kDoc .drop-down a{
- color: white;
- text-decoration: none;
- font-size: 0.6em;
-
- }
-
- #kHeader .kHeader-title .kHeader-kDoc .drop-down a:hover{
- text-decoration: underline;
- }
-
- #kHeader .kHeader-zoomIn{
- background-image: url(images/btn_plus.png);
- }
-
- #kHeader .kHeader-zoomOut{
- background-image: url(images/btn_minus.png);
- }
-
- #kHeader .kHeader-zoomIn:hover{
- -moz-border-radius: 90px;
- -webkit-border-radius: 90px;
- border: 3px solid rgba(0,0,230, 0.8);
- margin-top:2px;
- margin-left:-6px;
- }
-
- #kHeader .kHeader-zoomOut:hover{
- -moz-border-radius: 90px;
- -webkit-border-radius: 90px;
- border: 3px solid rgba(0,0,230, 0.8);
- margin-top:2px;
- margin-left:-6px;
- }
-
- #kHeader .kHeader-brand{
- background-image:url(./images/btn_ole.png);
- }
-
- #kHeader .kHeader-brand:hover{
- background-image:url(./images/btn_ole_hover.png);
- }
-
- #kHeader .kHeader-help{
- background-image:url(./images/btn_help.png);
- }
-
- #kHeader .kHeader-help:hover{
- background-image:url(./images/btn_help_hover.png);
- }
-
- /* Styles for Help Text */
- .kHeader-help{
- top: 20px !important;
- }
-
- .kHeader-help>div:first>span:first{
- font-size:larger;
- }
-
- .kHeader-help .ui-dialog-titlebar-close {
- top: 10px;
- margin-right: 20px;
- }
-
- .kHeader-help .ui-dialog-content{
- font-size: 0.8em;
- }
-
- #kHeader .kHeader-preload-img{
- height:0;
- width:0;
- display:inline;
- }
-
diff --git a/content/css/ui.resizable.css b/content/css/ui.resizable.css
deleted file mode 100755
index 44efeb2..0000000
--- a/content/css/ui.resizable.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Resizable
-----------------------------------*/
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file
diff --git a/content/css/ui.scoreboard.css b/content/css/ui.scoreboard.css
deleted file mode 100755
index 11cdbb5..0000000
--- a/content/css/ui.scoreboard.css
+++ /dev/null
@@ -1,62 +0,0 @@
-.ui-scoreboard-container-h{
-max-width: 800em;
-max-height: 200px;
-float:left;
-padding-top:0.4em;
-padding-bottom:0.4em;
-}
-
-.ui-scoreboard-spacing-h{
-max-width: 200em;
-max-height: 300em;
-display:inline;
-margin-left:0.2em;
-margin-right:0.4em;
-}
-
-.ui-scoreboard-text{
-font-size:larger;
-text-align: center;
-}
-
-.ui-scoreboard-number-h {
-background-color:black;
-color: white;
-padding-left:0.4em;
-padding-right:0.4em;
-font-size:larger;
-}
-
-.ui-scoreboard-button{
-float:right;
-cursor:pointer;
-}
-
-button .ui-scoreboard-icon{
-float: left;
-margin-right:0.3em;
-}
-.ui-scoreboard-container-v{
-max-width: 200px;
-max-height: 400px;
-float:left;
-padding-top:0.4em;
-padding-bottom:0.4em;
-}
-.ui-scoreboard-spacing-v{
-display:block;
-margin: 0.4em;
-}
-
-.ui-scoreboard-number-v{
-background-color:black;
-color: white;
-width: 1em;
-text-align:center;
-margin-left:auto;
-margin-right: auto;
-padding:0.4em;
-font-size:larger;
-}
-
-
diff --git a/content/css/ui.tabs.css b/content/css/ui.tabs.css
deleted file mode 100755
index 3ca6b9a..0000000
--- a/content/css/ui.tabs.css
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Tabs
-----------------------------------*/
-.ui-tabs { padding: .2em; zoom: 1; }
-.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
-.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
diff --git a/content/css/ui.theme.css b/content/css/ui.theme.css
deleted file mode 100755
index 6e40c73..0000000
--- a/content/css/ui.theme.css
+++ /dev/null
@@ -1,245 +0,0 @@
-
-
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-* To view and modify this theme, visit http://jqueryui.com/themeroller/
-*/
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
-.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(../assets/default/images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
-.ui-widget-content a { color: #222222/*{fcContent}*/; }
-.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(../assets/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
-.ui-widget-header a { color: #222222/*{fcHeader}*/; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(../assets/default/images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; outline: none; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; outline: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(../assets/default/images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; outline: none; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; outline: none; }
-.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(../assets/default/images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; outline: none; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; outline: none; text-decoration: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(../assets/default/images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
-.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(../assets/default/images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
-.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: url(../assets/default/images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
-.ui-widget-content .ui-icon {background-image: url(../assets/default/images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
-.ui-widget-header .ui-icon {background-image: url(../assets/default/images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
-.ui-state-default .ui-icon { background-image: url(../assets/default/images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../assets/default/images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
-.ui-state-active .ui-icon {background-image: url(../assets/default/images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
-.ui-state-highlight .ui-icon {background-image: url(../assets/default/images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../assets/default/images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; }
-
-/* Overlays */
-.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(../assets/default/images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
-.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(../assets/default/images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file
diff --git a/content/index.html b/content/index.html
deleted file mode 100755
index b6be074..0000000
--- a/content/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Learn</title>
-<meta charset="UTF-8"/>
-<link rel="stylesheet" href="menu.css" type="text/css"/>
-<script type="text/javascript" src="../js/jquery-1.4.js"></script>
-<script type="text/javascript">
-$(function(){
- $('#content')
- .load('http://localhost:8008/cgi-bin/fetch_milestone.py')
-});
-</script>
-</head>
-<body>
-<div id="content"/>
-</body>
-</html>
diff --git a/content/js/common.js b/content/js/common.js
deleted file mode 100755
index 9888313..0000000
--- a/content/js/common.js
+++ /dev/null
@@ -1,218 +0,0 @@
-// This file can replace global.js in karma.
-
-function padLeft(str, pad_character, length) {
- str = str.toString();
- pad_character = pad_character.toString();
- while (str.length < length) {
- str = pad_character + str;
- }
- return str;
-}
-
-function controlButtonClickCallback($button, callback) {
- $button.click(function () {
- if (!$button.data('disabled')) {
- callback();
- }
- });
-}
-
-function enableControlButton($button) {
- $button
- .css({opacity: 1, cursor: 'pointer'})
- .data('disabled', false);
-}
-
-function disableControlButton($button) {
- $button
- .css({opacity: 0.3, cursor: 'default'})
- .data('disabled', true);
-}
-
-function setUpLinkBackLesson() {
- $('#linkBackLesson')
- .click(function () {
- window.location = '../../../MenuStage.html';
- });
-}
-
-function setUpStartAndPlayAgainButtons(karma, initialize, start_game) {
- // Why two buttons?
- // Why not:
- // * only a play button?
- // -or-
- // * a button that is initially play, later replay?
- disableControlButton($('#linkPlayAgain'));
- disableControlButton($('#LinkCheck'));
- controlButtonClickCallback($('#linkStart'),
- function () {
- disableControlButton($('#linkStart'));
- enableControlButton($('#linkPlayAgain'));
- enableControlButton($('#linkCheck'));
- start_game(karma);
- });
- controlButtonClickCallback($('#linkCheck'),
- function () {
- enableControlButton($('#linkStart'));
- disableControlButton($('#LinkCheck'));
- check_answer(karma);
- });
- controlButtonClickCallback($('#linkPlayAgain'),
- function () { start_game(karma); });
-}
-
-
-function setUpHelp() {
- $help = $('#help');
- $('#linkHelp')
- .click(function () { $help.slideDown(2000); })
- .mouseout(function () { $help.slideUp(2000); });
-}
-
-/*
- * initialize is called once before the game is started. It is passed
- * the karma object as an argument.
- * Each time a game is started or restarted, starte_game is called
- * with the karma object as an argument.
- */
-function setUpLesson(initialize, start_game) {
- $(function () {
- disableSelection($('body').get()[0]);
- $('#linkPrevScreen').hide();
- $('#linkNextScreen').hide();
- $('#linkCheck').show();
- var karma = lesson_karma();
- karma.ready(
- function () {
- setUpLinkBackLesson();
- setUpStartAndPlayAgainButtons(karma, initialize, start_game);
- setUpHelp();
- initialize(karma);
- });
- });
-}
-
-function setUpMultiScreenLesson(draw_screen_fns) {
- $(function () {
- disableSelection($('body').get()[0]);
- $('#linkPrevScreen').hide();
- $('#linkNextScreen').hide();
-
- var karma = lesson_karma();
- var $content = $('#content'); // TBD: error if absent
- var current_screen = 0;
-
- var gotoScreen = function(i) {
- current_screen = i;
- updateScreen();
- };
-
- var updateScreen = function () {
- $content.empty();
- draw_screen_fns[current_screen](karma, $content);
- if (current_screen == 0) {
- $('#linkPrevScreen').hide();
- } else {
- $('#linkPrevScreen').show();
- }
- if (current_screen == draw_screen_fns.length - 1) {
- $('#linkNextScreen').hide();
- } else {
- $('#linkNextScreen').show();
- }
- };
-
- $('#linkNextScreen')
- .click(function () {
- /*
- karma.audio.trigger.play();
- */
- ++current_screen;
- updateScreen();
- });
- $('#linkPrevScreen')
- .click(function () {
- /*
- karma.audio.trigger.play();\
- */
- --current_screen;
- updateScreen();
- });
-
- karma.ready(
- function () {
- setUpLinkBackLesson();
- setUpStartAndPlayAgainButtons(karma, initialize, start_game);
- setUpHelp();
- current_screen = 0;
- updateScreen();
- });
- });
-}
-
-function goToScreen(screen) {
- current_screen = screen;
- updateScreen();
-}
-
-function disableSelection(target) {
- if (typeof target.onselectstart != 'undefined') { //IE
- target.onselectstart = function () { return false; };
- } else if (typeof target.style.MozUserSelect != 'undefined') { //Firefox
- target.style.MozUserSelect = 'none';
- } else if (typeof target.style.KhtmlUserSelect != 'undefined') { //Webkit
- target.style.KhtmlUserSelect = 'none';
- } else { //Opera
- target.onmousedown = function () { return false; };
- target.style.cursor = 'default';
- }
-}
-
-function disableImageDragging(img) {
- $(img).mousedown(function (event) { event.preventDefault(); });
-}
-
-// TBD: move to Karma
-function randomElement(collection) {
- return collection[Karma.random(0, collection.length - 1)];
-}
-
-// TBD: move to Karma
-function range(lower, upper) {
- var result = [];
- for (var i = lower; i < upper; ++i) {
- result.push(i);
- }
- return result;
-}
-
-Karma.createImg = function (name, disable_dragging) {
- disable_dragging = typeof(disable_dragging) != 'undefined' ? disable_dragging : true;
- if (!this.image[name]) {
- alert('Missing image: ' + name);
- }
- var result = $(document.createElement('img'))
- .attr('src', this.image[name].src);
- if (disable_dragging) {
- disableImageDragging(result);
- }
- return result;
-};
-
-Karma.random = Karma.rand;
-
-function createDiv(id) {
- var result = $(document.createElement('div'));
- if (typeof(id) != 'undefined') {
- result.attr('id', id);
- }
- return result;
-}
-
-// Return 'n' elements from 'all', amongst which 'x'.
-function randomElementsIncluding(all, x, n) {
- var others = all.filter(function (y) { return x != y; });
- var result = Karma.shuffle(others).slice(0, n - 1);
- result.push(x);
- return Karma.shuffle(result);
-}
diff --git a/content/js/explore.js b/content/js/explore.js
deleted file mode 100755
index 135455d..0000000
--- a/content/js/explore.js
+++ /dev/null
@@ -1,219 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma(assetList);
-
- k.ready(function() {
-
- logos;
-
- activities;
-
- k.ready(function(){
-
- //game logic
-
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 5;
- var rows = 2 + (activities.length / cells);
- var maxx = 1200;
- var cellsize = 64;
- var sz = cellsize;
- var maxy = rows * 1.5 * cellsize;
- if (maxy < 800){
- maxy = 800;
- };
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 1.7 * cellsize;
- var ystart = maxy - cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
-
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX
- y = $e.pageY
- $.each(acts, function() {
- xy = this;
- // directory structure: activity/karma/content/subject/bundle
- // check - if color == Blue, go to milestone; else, download it
- if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2]) && (y > xy[2] - cellsize) ) {
- if xy[5] == 'Blue'{
- pth = xy[4]+'/index.html';
- window.location = pth;
- } else {
- pth = 'http://localhost:8008/cgi-bin/fetch_milestone.py?' + xy[0];
- };
- });
- });
- // ladder
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- ctx.beginPath();
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {
- break;
- };
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if (activity < activities.length){
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.fillstyle='yellow';
- ctx.fillRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) &&
- (activity < activities.length)) {
- if (row % 2 == 0) {
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.closePath();
- ctx.fillStyle='yellow'
- ctx.fill()
- } else {
- x = xstart;
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.closePath();
- ctx.fillStyle='yellow'
- ctx.fill()
- }
- }
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta;
- }
- }
-
- function drawarrow(x,y,sz) {
- ctx.fillStyle = 'black'
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.stroke();
- };
-
- function drawmilestone(activity){
- var capcolor;
- x = activity[1];
- y = activity[2];
- capcolor = activity[5];
- ctx.fillStyle = 'chartreuse';
- ctx.fillRect(x,y-cellsize,cellsize,cellsize);
- ctx.fillStyle = 'black'
- ctx.fillText(ix, x + (cellsize * 0.3), y-(cellsize * 0.4), cellsize);
- ctx.beginPath();
- ctx.moveTo(x, y-cellsize);
- ctx.arc(x+0.5*cellsize,y-cellsize,0.5*cellsize,Math.PI,0,0);
- ctx.closePath();
- ctx.fillStyle = capcolor;
- ctx.fill();
- ctx.fillStyle = 'yellow';
- };
-
- function drawlogo(x, y, activity) {
- var il, ty, ls, cc;
- id = activities[activity][0];
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- if ((activities[activity].length) > 4){
- cc = activities[activity][5];
- }else{
- cc = 'cyan';
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls, cc];
- if (id == 0){
- drawmilestone(acts[idx]);
- } else {
- // draw logo
- alert('draw logo - should not happen');
- ctx.drawImage(k.image[logos[id-1]].media, x, y - cellsize);
- if (ix > 0) {
- ctx.textAlign = 'center'
- ctx.fillStyle = 'black'
- ctx.fillText(ix, x + cellsize/2, y+cellsize/4, cellsize);
- };
- };
- }
- }
-
- draw();
-
- });
- });
-
-});
diff --git a/content/js/global.js b/content/js/global.js
deleted file mode 100755
index b19e821..0000000
--- a/content/js/global.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Functions that are common in all lessons
- *
- */
-
-var flag_start = 0,i,j,flag;
-
-function linkHome(){
- pth = 'http://localhost:8008/content/index.html';
- window.location = pth;
-};
-function linkEnglish(){
- url = window.location+"";
- grade = url.charAt(url.length-1);
- last = url.charAt(url.length-3)+url.charAt(url.length-2)+grade;
- pth = 'http://localhost:8008/content/English';
- pos = url.indexOf('?F');
- if (pos<0){
- window.location = pth + '/index.html';
- }else{
- tpth = pth + '/p'+grade+'.html'+last;
- window.location = tpth;
- }
-};
-function linkMathematics(){
- url = window.location+"";
- grade = url.charAt(url.length-1);
- last = url.charAt(url.length-3)+url.charAt(url.length-2)+grade;
- pth = 'http://localhost:8008/content/Mathematics';
- pos = url.indexOf('?F');
- if (pos<0){
- window.location = 'content/Mathematics/index.html'
- }else{
- tpth = pth + '/p'+grade+'.html'+last;
- window.location = tpth;
- }
-};
-function linkExplore(){
- pth = 'http://localhost:8008/content/Explore/index.html';
- window.location = pth;
-};
-function goback(){
- url = window.location+"";
- levels = url.split('/');
- last = levels.pop();
- levels.pop()
- levels.push(last);
- newurl = levels.join('/');
- window.location = newurl
-}
-function apply(){
- items = (window.location+"").split('/');
- score = '70';
- subject = items[4];
- milestone = items[5];
- activity = items[6];
- $('#content').load('http://localhost:8008/cgi-bin/results.py',{
- 'score':score,
- 'subject':subject,
- 'milestone':milestone,
- 'activity':activity
- },function(responseText, status, xhr){
- if (responseText==1){ goback();
- } else if (responseText==2){ gobackOne();
- } else if (responseText==3){ gobackTwo();
- };
- });
-}
-function quit(){
- window.close();
-}
-
-function edit(){
-
- url = window.location+"";
- items = url.split('/');
- items.shift();
- items.shift();
- items.shift();
- newurl = items.join('/');
- pth = 'http://localhost:8008/contentedit.html?'+newurl;
- window.location = pth;
-}
-
-//enable or disable the control buttons
-function controlButtonDisplay(button,status){
- var opacity;
- if(status === 'enabled'){
- opacity = 1;
- cursor = 'pointer';
- }else{
- opacity = .3;
- cursor = 'default';
- }
- var buttonCss = {
- 'opacity':opacity,
- 'cursor':cursor
- };
- $('#'+button).css(buttonCss);
-}
-//generate a random numbers between two limits
-function genRand( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-/*
- Function to generate a set of random numbers and assign it to a variable supplied
- @params: randVar - > The variable in which the random numbers to be stored
- lower -> lower number
- upper -> upper number
- include lower and upper limit
- Currently it generates numbers betweem 0-upper (exclude upper)
-*/
-function shuffleNumbers(randVar,lower,upper) {
- var total_nums = upper-lower;
- randVar[0] = genRand(0,total_nums-1);
- for(i= 1; i < total_nums; i++){
- do{
- flag = 0;
- randVar[i] = genRand(0,total_nums-1);
- for(j=0; j<i; j++){
- if(randVar[i] === randVar[j]){
- flag++;
- }
- }
- }while(flag != 0 ); //end of do while loop
- }
-}
-
-
diff --git a/content/js/global.js~ b/content/js/global.js~
deleted file mode 100755
index 4479363..0000000
--- a/content/js/global.js~
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Functions that are common in all lessons
- *
- */
-
-var flag_start = 0,i,j,flag;
-var path = '../../../MenuStage.html'; // MenuStage.html path for the location of flash interface
-
-function gotoMainStage(){
- window.location = path;
-}
-//enable or disable the control buttons
-function controlButtonDisplay(button,status){
- var opacity;
- if(status === 'enabled'){
- opacity = 1;
- cursor = 'pointer';
- }else{
- opacity = .3;
- cursor = 'default';
- }
- var buttonCss = {
- 'opacity':opacity,
- 'cursor':cursor
- };
- $('#'+button).css(buttonCss);
-}
-//generate a random numbers between two limits
-function genRand( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-/*
- Function to generate a set of random numbers and assign it to a variable supplied
- @params: randVar - > The variable in which the random numbers to be stored
- lower -> lower number
- upper -> upper number
- include lower and upper limit
- Currently it generates numbers betweem 0-upper (exclude upper)
-*/
-function shuffleNumbers(randVar,lower,upper) {
- var total_nums = upper-lower;
- randVar[0] = genRand(0,total_nums-1);
- for(i= 1; i < total_nums; i++){
- do{
- flag = 0;
- randVar[i] = genRand(0,total_nums-1);
- for(j=0; j<i; j++){
- if(randVar[i] === randVar[j]){
- flag++;
- }
- }
- }while(flag != 0 ); //end of do while loop
- }
-}
-
-
diff --git a/content/js/jquery-1.3.2.min.js b/content/js/jquery-1.3.2.min.js
deleted file mode 100755
index b1ae21d..0000000
--- a/content/js/jquery-1.3.2.min.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
-/*
- * Sizzle CSS Selector Engine - v0.9.3
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/content/js/jquery-1.4.js b/content/js/jquery-1.4.js
deleted file mode 100755
index a448490..0000000
--- a/content/js/jquery-1.4.js
+++ /dev/null
@@ -1,5999 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.4
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://docs.jquery.com/License
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Jan 13 15:23:05 2010 -0500
- */
-(function( window, undefined ) {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context );
- },
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
-
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // A simple way to check for HTML strings or ID strings
- // (both of which we optimize for)
- quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
-
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/,
-
- // Check if a string has a non-whitespace character in it
- rnotwhite = /\S/,
-
- // Used for trimming whitespace
- rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
- // Keep a UserAgent string for use with jQuery.browser
- userAgent = navigator.userAgent,
-
- // For matching the engine and version of the browser
- browserMatch,
-
- // Has the ready events already been bound?
- readyBound = false,
-
- // The functions to execute on DOM ready
- readyList = [],
-
- // The ready event handler
- DOMContentLoaded,
-
- // Save a reference to some core methods
- toString = Object.prototype.toString,
- hasOwnProperty = Object.prototype.hasOwnProperty,
- push = Array.prototype.push,
- slice = Array.prototype.slice,
- indexOf = Array.prototype.indexOf;
-
-jQuery.fn = jQuery.prototype = {
- init: function( selector, context ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), or $(undefined)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- match = quickExpr.exec( selector );
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- doc = (context ? context.ownerDocument || context : document);
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- ret = rsingleTag.exec( selector );
-
- if ( ret ) {
- if ( jQuery.isPlainObject( context ) ) {
- selector = [ document.createElement( ret[1] ) ];
- jQuery.fn.attr.call( selector, context, true );
-
- } else {
- selector = [ doc.createElement( ret[1] ) ];
- }
-
- } else {
- ret = buildFragment( [ match[1] ], [ doc ] );
- selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
- }
-
- // HANDLE: $("#id")
- } else {
- elem = document.getElementById( match[2] );
-
- if ( elem ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id !== match[2] ) {
- return rootjQuery.find( selector );
- }
-
- // Otherwise, we inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $("TAG")
- } else if ( !context && /^\w+$/.test( selector ) ) {
- this.selector = selector;
- this.context = document;
- selector = document.getElementsByTagName( selector );
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return (context || rootjQuery).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return jQuery( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if (selector.selector !== undefined) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.isArray( selector ) ?
- this.setArray( selector ) :
- jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.4",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return slice.call( this, 0 );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num == null ?
-
- // Return a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = jQuery( elems || null );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" ) {
- ret.selector = this.selector + (this.selector ? " " : "") + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Force the current matched set of elements to become
- // the specified array of elements (destroying the stack in the process)
- // You should use pushStack() in order to do this, but maintain the stack
- setArray: function( elems ) {
- // Resetting the length to 0, then using the native Array push
- // is a super-fast way to populate an object with array-like properties
- this.length = 0;
- push.apply( this, elems );
-
- return this;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Attach the listeners
- jQuery.bindReady();
-
- // If the DOM is already ready
- if ( jQuery.isReady ) {
- // Execute the function immediately
- fn.call( document, jQuery );
-
- // Otherwise, remember the function for later
- } else if ( readyList ) {
- // Add the function to the wait list
- readyList.push( fn );
- }
-
- return this;
- },
-
- eq: function( i ) {
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, +i + 1 );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ),
- "slice", slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || jQuery(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: [].sort,
- splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
- // copy reference to target object
- var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( length === i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging object literal values or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
- var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
- : jQuery.isArray(copy) ? [] : {};
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend({
- noConflict: function( deep ) {
- window.$ = _$;
-
- if ( deep ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // Handle when the DOM is ready
- ready: function() {
- // Make sure that the DOM is not already loaded
- if ( !jQuery.isReady ) {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 13 );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If there are functions bound, to execute
- if ( readyList ) {
- // Execute all of them
- var fn, i = 0;
- while ( (fn = readyList[ i++ ]) ) {
- fn.call( document, jQuery );
- }
-
- // Reset the list of functions
- readyList = null;
- }
-
- // Trigger any bound ready events
- if ( jQuery.fn.triggerHandler ) {
- jQuery( document ).triggerHandler( "ready" );
- }
- }
- },
-
- bindReady: function() {
- if ( readyBound ) {
- return;
- }
-
- readyBound = true;
-
- // Catch cases where $(document).ready() is called after the
- // browser event has already occurred.
- if ( document.readyState === "complete" ) {
- return jQuery.ready();
- }
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent("onreadystatechange", DOMContentLoaded);
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var toplevel = false;
-
- try {
- toplevel = window.frameElement == null;
- } catch(e) {}
-
- if ( document.documentElement.doScroll && toplevel ) {
- doScrollCheck();
- }
- }
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return toString.call(obj) === "[object Function]";
- },
-
- isArray: function( obj ) {
- return toString.call(obj) === "[object Array]";
- },
-
- isPlainObject: function( obj ) {
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
- return false;
- }
-
- // Not own constructor property must be Object
- if ( obj.constructor
- && !hasOwnProperty.call(obj, "constructor")
- && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || hasOwnProperty.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- for ( var name in obj ) {
- return false;
- }
- return true;
- },
-
- noop: function() {},
-
- // Evalulates a script in a global context
- globalEval: function( data ) {
- if ( data && rnotwhite.test(data) ) {
- // Inspired by code by Andrea Giammarchi
- // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
- var head = document.getElementsByTagName("head")[0] || document.documentElement,
- script = document.createElement("script");
-
- script.type = "text/javascript";
-
- if ( jQuery.support.scriptEval ) {
- script.appendChild( document.createTextNode( data ) );
- } else {
- script.text = data;
- }
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709).
- head.insertBefore( script, head.firstChild );
- head.removeChild( script );
- }
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0,
- length = object.length,
- isObj = length === undefined || jQuery.isFunction(object);
-
- if ( args ) {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.apply( object[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( object[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( var value = object[0];
- i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
- }
- }
-
- return object;
- },
-
- trim: function( text ) {
- return (text || "").replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( array, results ) {
- var ret = results || [];
-
- if ( array != null ) {
- // The window, strings (and functions) also have 'length'
- // The extra typeof function check is to prevent crashes
- // in Safari 2 (See: #3039)
- if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
- push.call( ret, array );
- } else {
- jQuery.merge( ret, array );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, array ) {
- if ( array.indexOf ) {
- return array.indexOf( elem );
- }
-
- for ( var i = 0, length = array.length; i < length; i++ ) {
- if ( array[ i ] === elem ) {
- return i;
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var i = first.length, j = 0;
-
- if ( typeof second.length === "number" ) {
- for ( var l = second.length; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var ret = [];
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- if ( !inv !== !callback( elems[ i ], i ) ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var ret = [], value;
-
- // Go through the array, translating each of the items to their
- // new value (or values).
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- return ret.concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- proxy: function( fn, proxy, thisObject ) {
- if ( arguments.length === 2 ) {
- if ( typeof proxy === "string" ) {
- thisObject = fn;
- fn = thisObject[ proxy ];
- proxy = undefined;
-
- } else if ( proxy && !jQuery.isFunction( proxy ) ) {
- thisObject = proxy;
- proxy = undefined;
- }
- }
-
- if ( !proxy && fn ) {
- proxy = function() {
- return fn.apply( thisObject || this, arguments );
- };
- }
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- if ( fn ) {
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
- }
-
- // So proxy can be declared as an argument
- return proxy;
- },
-
- // Use of jQuery.browser is frowned upon.
- // More details: http://docs.jquery.com/Utilities/jQuery.browser
- uaMatch: function( ua ) {
- var ret = { browser: "" };
-
- ua = ua.toLowerCase();
-
- if ( /webkit/.test( ua ) ) {
- ret = { browser: "webkit", version: /webkit[\/ ]([\w.]+)/ };
-
- } else if ( /opera/.test( ua ) ) {
- ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/ };
-
- } else if ( /msie/.test( ua ) ) {
- ret = { browser: "msie", version: /msie ([\w.]+)/ };
-
- } else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
- ret = { browser: "mozilla", version: /rv:([\w.]+)/ };
- }
-
- ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
-
- return ret;
- },
-
- browser: {}
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
- jQuery.browser[ browserMatch.browser ] = true;
- jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
- jQuery.browser.safari = true;
-}
-
-if ( indexOf ) {
- jQuery.inArray = function( elem, array ) {
- return indexOf.call( array, elem );
- };
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- };
-
-} else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
- if ( jQuery.isReady ) {
- return;
- }
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch( error ) {
- setTimeout( doScrollCheck, 1 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
-}
-
-if ( indexOf ) {
- jQuery.inArray = function( elem, array ) {
- return indexOf.call( array, elem );
- };
-}
-
-function evalScript( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
-}
-
-// Mutifunctional method to get and set values to a collection
-// The value/s can be optionally by executed if its a function
-function access( elems, key, value, exec, fn, pass ) {
- var length = elems.length;
-
- // Setting many attributes
- if ( typeof key === "object" ) {
- for ( var k in key ) {
- access( elems, k, key[k], exec, fn, value );
- }
- return elems;
- }
-
- // Setting one attribute
- if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = !pass && exec && jQuery.isFunction(value);
-
- for ( var i = 0; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
-
- return elems;
- }
-
- // Getting an attribute
- return length ? fn( elems[0], key ) : null;
-}
-
-function now() {
- return (new Date).getTime();
-}
-(function() {
-
- jQuery.support = {};
-
- var root = document.documentElement,
- script = document.createElement("script"),
- div = document.createElement("div"),
- id = "script" + now();
-
- div.style.display = "none";
- div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
- var all = div.getElementsByTagName("*"),
- a = div.getElementsByTagName("a")[0];
-
- // Can't get basic test support
- if ( !all || !all.length || !a ) {
- return;
- }
-
- jQuery.support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: div.firstChild.nodeType === 3,
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText insted)
- style: /red/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: a.getAttribute("href") === "/a",
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.55$/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: div.getElementsByTagName("input")[0].value === "on",
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
-
- // Will be defined later
- scriptEval: false,
- noCloneEvent: true,
- boxModel: null
- };
-
- script.type = "text/javascript";
- try {
- script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
- } catch(e) {}
-
- root.insertBefore( script, root.firstChild );
-
- // Make sure that the execution of code works by injecting a script
- // tag with appendChild/createTextNode
- // (IE doesn't support this, fails, and uses .text instead)
- if ( window[ id ] ) {
- jQuery.support.scriptEval = true;
- delete window[ id ];
- }
-
- root.removeChild( script );
-
- if ( div.attachEvent && div.fireEvent ) {
- div.attachEvent("onclick", function click() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- jQuery.support.noCloneEvent = false;
- div.detachEvent("onclick", click);
- });
- div.cloneNode(true).fireEvent("onclick");
- }
-
- // Figure out if the W3C box model works as expected
- // document.body must exist before we can do this
- // TODO: This timeout is temporary until I move ready into core.js.
- jQuery(function() {
- var div = document.createElement("div");
- div.style.width = div.style.paddingLeft = "1px";
-
- document.body.appendChild( div );
- jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
- document.body.removeChild( div ).style.display = 'none';
- div = null;
- });
-
- // Technique from Juriy Zaytsev
- // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
- var eventSupported = function( eventName ) {
- var el = document.createElement("div");
- eventName = "on" + eventName;
-
- var isSupported = (eventName in el);
- if ( !isSupported ) {
- el.setAttribute(eventName, "return;");
- isSupported = typeof el[eventName] === "function";
- }
- el = null;
-
- return isSupported;
- };
-
- jQuery.support.submitBubbles = eventSupported("submit");
- jQuery.support.changeBubbles = eventSupported("change");
-
- // release memory in IE
- root = script = div = all = a = null;
-})();
-
-jQuery.props = {
- "for": "htmlFor",
- "class": "className",
- readonly: "readOnly",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- rowspan: "rowSpan",
- colspan: "colSpan",
- tabindex: "tabIndex",
- usemap: "useMap",
- frameborder: "frameBorder"
-};
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
-var emptyObject = {};
-
-jQuery.extend({
- cache: {},
-
- expando:expando,
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- "object": true,
- "applet": true
- },
-
- data: function( elem, name, data ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- return;
- }
-
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ], cache = jQuery.cache, thisCache;
-
- // Handle the case where there's no name immediately
- if ( !name && !id ) {
- return null;
- }
-
- // Compute a unique ID for the element
- if ( !id ) {
- id = ++uuid;
- }
-
- // Avoid generating a new cache unless none exists and we
- // want to manipulate it.
- if ( typeof name === "object" ) {
- elem[ expando ] = id;
- thisCache = cache[ id ] = jQuery.extend(true, {}, name);
- } else if ( cache[ id ] ) {
- thisCache = cache[ id ];
- } else if ( typeof data === "undefined" ) {
- thisCache = emptyObject;
- } else {
- thisCache = cache[ id ] = {};
- }
-
- // Prevent overriding the named cache with undefined values
- if ( data !== undefined ) {
- elem[ expando ] = id;
- thisCache[ name ] = data;
- }
-
- return typeof name === "string" ? thisCache[ name ] : thisCache;
- },
-
- removeData: function( elem, name ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- return;
- }
-
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
-
- // If we want to remove a specific section of the element's data
- if ( name ) {
- if ( thisCache ) {
- // Remove the section of cache data
- delete thisCache[ name ];
-
- // If we've removed all the data, remove the element's cache
- if ( jQuery.isEmptyObject(thisCache) ) {
- jQuery.removeData( elem );
- }
- }
-
- // Otherwise, we want to remove all of the element's data
- } else {
- // Clean up the element expando
- try {
- delete elem[ expando ];
- } catch( e ) {
- // IE has trouble directly removing the expando
- // but it's ok with using removeAttribute
- if ( elem.removeAttribute ) {
- elem.removeAttribute( expando );
- }
- }
-
- // Completely remove the data cache
- delete cache[ id ];
- }
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- if ( typeof key === "undefined" && this.length ) {
- return jQuery.data( this[0] );
-
- } else if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- var parts = key.split(".");
- parts[1] = parts[1] ? "." + parts[1] : "";
-
- if ( value === undefined ) {
- var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
- if ( data === undefined && this.length ) {
- data = jQuery.data( this[0], key );
- }
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- } else {
- return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
- jQuery.data( this, key, value );
- });
- }
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-jQuery.extend({
- queue: function( elem, type, data ) {
- if ( !elem ) {
- return;
- }
-
- type = (type || "fx") + "queue";
- var q = jQuery.data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( !data ) {
- return q || [];
- }
-
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery.data( elem, type, jQuery.makeArray(data) );
-
- } else {
- q.push( data );
- }
-
- return q;
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ), fn = queue.shift();
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- }
-
- if ( fn ) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift("inprogress");
- }
-
- fn.call(elem, function() {
- jQuery.dequeue(elem, type);
- });
- }
- }
-});
-
-jQuery.fn.extend({
- queue: function( type, data ) {
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- }
-
- if ( data === undefined ) {
- return jQuery.queue( this[0], type );
- }
- return this.each(function( i, elem ) {
- var queue = jQuery.queue( this, type, data );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
-
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
- type = type || "fx";
-
- return this.queue( type, function() {
- var elem = this;
- setTimeout(function() {
- jQuery.dequeue( elem, type );
- }, time );
- });
- },
-
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- }
-});
-var rclass = /[\n\t]/g,
- rspace = /\s+/,
- rreturn = /\r/g,
- rspecialurl = /href|src|style/,
- rtype = /(button|input)/i,
- rfocusable = /(button|input|object|select|textarea)/i,
- rclickable = /^(a|area)$/i,
- rradiocheck = /radio|checkbox/;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return access( this, name, value, true, jQuery.attr );
- },
-
- removeAttr: function( name, fn ) {
- return this.each(function(){
- jQuery.attr( this, name, "" );
- if ( this.nodeType === 1 ) {
- this.removeAttribute( name );
- }
- });
- },
-
- addClass: function( value ) {
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.addClass( value.call(this, i, self.attr("class")) );
- });
- }
-
- if ( value && typeof value === "string" ) {
- var classNames = (value || "").split( rspace );
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
-
- if ( elem.nodeType === 1 ) {
- if ( !elem.className ) {
- elem.className = value;
-
- } else {
- var className = " " + elem.className + " ";
- for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
- elem.className += " " + classNames[c];
- }
- }
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.removeClass( value.call(this, i, self.attr("class")) );
- });
- }
-
- if ( (value && typeof value === "string") || value === undefined ) {
- var classNames = (value || "").split(rspace);
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
-
- if ( elem.nodeType === 1 && elem.className ) {
- if ( value ) {
- var className = (" " + elem.className + " ").replace(rclass, " ");
- for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
- className = className.replace(" " + classNames[c] + " ", " ");
- }
- elem.className = className.substring(1, className.length - 1);
-
- } else {
- elem.className = "";
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value, isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className, i = 0, self = jQuery(this),
- state = stateVal,
- classNames = value.split( rspace );
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space seperated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- } else if ( type === "undefined" || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery.data( this, "__className__", this.className );
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ";
- for ( var i = 0, l = this.length; i < l; i++ ) {
- if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- if ( value === undefined ) {
- var elem = this[0];
-
- if ( elem ) {
- if ( jQuery.nodeName( elem, "option" ) ) {
- return (elem.attributes.value || {}).specified ? elem.value : elem.text;
- }
-
- // We need to handle select boxes special
- if ( jQuery.nodeName( elem, "select" ) ) {
- var index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
-
- // Nothing was selected
- if ( index < 0 ) {
- return null;
- }
-
- // Loop through all the selected options
- for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
- var option = options[ i ];
-
- if ( option.selected ) {
- // Get the specifc value for the option
- value = jQuery(option).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- }
-
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
-
-
- // Everything else, we just grab the value
- return (elem.value || "").replace(rreturn, "");
-
- }
-
- return undefined;
- }
-
- var isFunction = jQuery.isFunction(value);
-
- return this.each(function(i) {
- var self = jQuery(this), val = value;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call(this, i, self.val());
- }
-
- // Typecast each time if the value is a Function and the appended
- // value is therefore different each time.
- if ( typeof val === "number" ) {
- val += "";
- }
-
- if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
- this.checked = jQuery.inArray( self.val(), val ) >= 0;
-
- } else if ( jQuery.nodeName( this, "select" ) ) {
- var values = jQuery.makeArray(val);
-
- jQuery( "option", this ).each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- this.selectedIndex = -1;
- }
-
- } else {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- attrFn: {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true
- },
-
- attr: function( elem, name, value, pass ) {
- // don't set attributes on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
- return undefined;
- }
-
- if ( pass && name in jQuery.attrFn ) {
- return jQuery(elem)[name](value);
- }
-
- var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
- // Whether we are setting (or getting)
- set = value !== undefined;
-
- // Try to normalize/fix the name
- name = notxml && jQuery.props[ name ] || name;
-
- // Only do all the following if this is a node (faster for style)
- if ( elem.nodeType === 1 ) {
- // These attributes require special treatment
- var special = rspecialurl.test( name );
-
- // Safari mis-reports the default selected property of an option
- // Accessing the parent's selectedIndex property fixes it
- if ( name === "selected" && !jQuery.support.optSelected ) {
- var parent = elem.parentNode;
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- }
-
- // If applicable, access the attribute via the DOM 0 way
- if ( name in elem && notxml && !special ) {
- if ( set ) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
- throw "type property can't be changed";
- }
-
- elem[ name ] = value;
- }
-
- // browsers index elements by id/name on forms, give priority to attributes.
- if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
- return elem.getAttributeNode( name ).nodeValue;
- }
-
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- if ( name === "tabIndex" ) {
- var attributeNode = elem.getAttributeNode( "tabIndex" );
-
- return attributeNode && attributeNode.specified ?
- attributeNode.value :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
-
- return elem[ name ];
- }
-
- if ( !jQuery.support.style && notxml && name === "style" ) {
- if ( set ) {
- elem.style.cssText = "" + value;
- }
-
- return elem.style.cssText;
- }
-
- if ( set ) {
- // convert the value to a string (all browsers do this but IE) see #1070
- elem.setAttribute( name, "" + value );
- }
-
- var attr = !jQuery.support.hrefNormalized && notxml && special ?
- // Some attributes require a special call on IE
- elem.getAttribute( name, 2 ) :
- elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return attr === null ? undefined : attr;
- }
-
- // elem is actually elem.style ... set the style
- // Using attr for specific style information is now deprecated. Use style insead.
- return jQuery.style( elem, name, value );
- }
-});
-var fcleanup = function( nm ) {
- return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
- return "\\" + ch;
- });
-};
-
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code originated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
- // Bind an event to an element
- // Original by Dean Edwards
- add: function( elem, types, handler, data ) {
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // For whatever reason, IE has trouble passing the window object
- // around, causing it to be cloned in the process
- if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
- elem = window;
- }
-
- // Make sure that the function being executed has a unique ID
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // if data is passed, bind to handler
- if ( data !== undefined ) {
- // Create temporary function pointer to original handler
- var fn = handler;
-
- // Create unique handler function, wrapped around original handler
- handler = jQuery.proxy( fn );
-
- // Store data in unique handler
- handler.data = data;
- }
-
- // Init the element's event structure
- var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
- handle = jQuery.data( elem, "handle" ), eventHandle;
-
- if ( !handle ) {
- eventHandle = function() {
- // Handle the second event of a trigger and when
- // an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
- jQuery.event.handle.apply( eventHandle.elem, arguments ) :
- undefined;
- };
-
- handle = jQuery.data( elem, "handle", eventHandle );
- }
-
- // If no handle is found then we must be trying to bind to one of the
- // banned noData elements
- if ( !handle ) {
- return;
- }
-
- // Add elem as a property of the handle function
- // This is to prevent a memory leak with non-native
- // event in IE.
- handle.elem = elem;
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- types = types.split( /\s+/ );
- var type, i=0;
- while ( (type = types[ i++ ]) ) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- handler.type = namespaces.slice(0).sort().join(".");
-
- // Get the current list of functions bound to this event
- var handlers = events[ type ],
- special = this.special[ type ] || {};
-
-
-
- // Init the event handler queue
- if ( !handlers ) {
- handlers = events[ type ] = {};
-
- // Check for a special event handler
- // Only use addEventListener/attachEvent if the special
- // events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
- // Bind the global event handler to the element
- if ( elem.addEventListener ) {
- elem.addEventListener( type, handle, false );
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, handle );
- }
- }
- }
-
- if ( special.add ) {
- var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
- if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
- modifiedHandler.guid = modifiedHandler.guid || handler.guid;
- handler = modifiedHandler;
- }
- }
-
- // Add the function to the element's handler list
- handlers[ handler.guid ] = handler;
-
- // Keep track of which events have been used, for global triggering
- this.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- global: {},
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler ) {
- // don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- var events = jQuery.data( elem, "events" ), ret, type, fn;
-
- if ( events ) {
- // Unbind all events for the element
- if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
- for ( type in events ) {
- this.remove( elem, type + (types || "") );
- }
- } else {
- // types is actually an event object here
- if ( types.type ) {
- handler = types.handler;
- types = types.type;
- }
-
- // Handle multiple events separated by a space
- // jQuery(...).unbind("mouseover mouseout", fn);
- types = types.split(/\s+/);
- var i = 0;
- while ( (type = types[ i++ ]) ) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- var all = !namespaces.length,
- cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
- namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
- special = this.special[ type ] || {};
-
- if ( events[ type ] ) {
- // remove the given handler for the given type
- if ( handler ) {
- fn = events[ type ][ handler.guid ];
- delete events[ type ][ handler.guid ];
-
- // remove all handlers for the given type
- } else {
- for ( var handle in events[ type ] ) {
- // Handle the removal of namespaced events
- if ( all || namespace.test( events[ type ][ handle ].type ) ) {
- delete events[ type ][ handle ];
- }
- }
- }
-
- if ( special.remove ) {
- special.remove.call( elem, namespaces, fn);
- }
-
- // remove generic event handler if no more handlers exist
- for ( ret in events[ type ] ) {
- break;
- }
- if ( !ret ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
- } else if ( elem.detachEvent ) {
- elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
- }
- }
- ret = null;
- delete events[ type ];
- }
- }
- }
- }
-
- // Remove the expando if it's no longer used
- for ( ret in events ) {
- break;
- }
- if ( !ret ) {
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) {
- handle.elem = null;
- }
- jQuery.removeData( elem, "events" );
- jQuery.removeData( elem, "handle" );
- }
- }
- },
-
- // bubbling is internal
- trigger: function( event, data, elem /*, bubbling */ ) {
- // Event object or event type
- var type = event.type || event,
- bubbling = arguments[3];
-
- if ( !bubbling ) {
- event = typeof event === "object" ?
- // jQuery.Event object
- event[expando] ? event :
- // Object literal
- jQuery.extend( jQuery.Event(type), event ) :
- // Just the event type (string)
- jQuery.Event(type);
-
- if ( type.indexOf("!") >= 0 ) {
- event.type = type = type.slice(0, -1);
- event.exclusive = true;
- }
-
- // Handle a global trigger
- if ( !elem ) {
- // Don't bubble custom events when global (to avoid too much overhead)
- event.stopPropagation();
-
- // Only trigger if we've ever bound an event for it
- if ( this.global[ type ] ) {
- jQuery.each( jQuery.cache, function() {
- if ( this.events && this.events[type] ) {
- jQuery.event.trigger( event, data, this.handle.elem );
- }
- });
- }
- }
-
- // Handle triggering a single element
-
- // don't do events on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
- return undefined;
- }
-
- // Clean up in case it is reused
- event.result = undefined;
- event.target = elem;
-
- // Clone the incoming data, if any
- data = jQuery.makeArray( data );
- data.unshift( event );
- }
-
- event.currentTarget = elem;
-
- // Trigger the event, it is assumed that "handle" is a function
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) {
- handle.apply( elem, data );
- }
-
- var nativeFn, nativeHandler;
- try {
- if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
- nativeFn = elem[ type ];
- nativeHandler = elem[ "on" + type ];
- }
- // prevent IE from throwing an error for some elements with some event types, see #3533
- } catch (e) {}
-
- var isClick = jQuery.nodeName(elem, "a") && type === "click";
-
- // Trigger the native events (except for clicks on links)
- if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
- this.triggered = true;
- try {
- elem[ type ]();
- // prevent IE from throwing an error for some hidden elements
- } catch (e) {}
-
- // Handle triggering native .onfoo handlers
- } else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
- event.result = false;
- }
-
- this.triggered = false;
-
- if ( !event.isPropagationStopped() ) {
- var parent = elem.parentNode || elem.ownerDocument;
- if ( parent ) {
- jQuery.event.trigger( event, data, parent, true );
- }
- }
- },
-
- handle: function( event ) {
- // returned undefined or false
- var all, handlers;
-
- event = arguments[0] = jQuery.event.fix( event || window.event );
- event.currentTarget = this;
-
- // Namespaced event handlers
- var namespaces = event.type.split(".");
- event.type = namespaces.shift();
-
- // Cache this now, all = true means, any handler
- all = !namespaces.length && !event.exclusive;
-
- var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
-
- handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
-
- for ( var j in handlers ) {
- var handler = handlers[ j ];
-
- // Filter the functions by class
- if ( all || namespace.test(handler.type) ) {
- // Pass in a reference to the handler function itself
- // So that we can later remove it
- event.handler = handler;
- event.data = handler.data;
-
- var ret = handler.apply( this, arguments );
-
- if ( ret !== undefined ) {
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
-
- if ( event.isImmediatePropagationStopped() ) {
- break;
- }
-
- }
- }
-
- return event.result;
- },
-
- props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
- fix: function( event ) {
- if ( event[ expando ] ) {
- return event;
- }
-
- // store a copy of the original event object
- // and "clone" to set read-only properties
- var originalEvent = event;
- event = jQuery.Event( originalEvent );
-
- for ( var i = this.props.length, prop; i; ) {
- prop = this.props[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary
- if ( !event.target ) {
- event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
- }
-
- // check if target is a textnode (safari)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && event.fromElement ) {
- event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
- }
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && event.clientX != null ) {
- var doc = document.documentElement, body = document.body;
- event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
- event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
- }
-
- // Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
- event.which = event.charCode || event.keyCode;
- }
-
- // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
- if ( !event.metaKey && event.ctrlKey ) {
- event.metaKey = event.ctrlKey;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if ( !event.which && event.button !== undefined ) {
- event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
- }
-
- return event;
- },
-
- // Deprecated, use jQuery.guid instead
- guid: 1E8,
-
- // Deprecated, use jQuery.proxy instead
- proxy: jQuery.proxy,
-
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: jQuery.bindReady,
- teardown: jQuery.noop
- },
-
- live: {
- add: function( proxy, data, namespaces, live ) {
- jQuery.extend( proxy, data || {} );
-
- proxy.guid += data.selector + data.live;
- jQuery.event.add( this, data.live, liveHandler, data );
-
- },
-
- remove: function( namespaces ) {
- if ( namespaces.length ) {
- var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
-
- jQuery.each( (jQuery.data(this, "events").live || {}), function() {
- if ( name.test(this.type) ) {
- remove++;
- }
- });
-
- if ( remove < 1 ) {
- jQuery.event.remove( this, namespaces[0], liveHandler );
- }
- }
- },
- special: {}
- },
- beforeunload: {
- setup: function( data, namespaces, fn ) {
- // We only want to do this special case on windows
- if ( this.setInterval ) {
- this.onbeforeunload = fn;
- }
-
- return false;
- },
- teardown: function( namespaces, fn ) {
- if ( this.onbeforeunload === fn ) {
- this.onbeforeunload = null;
- }
- }
- }
- }
-};
-
-jQuery.Event = function( src ) {
- // Allow instantiation without the 'new' keyword
- if ( !this.preventDefault ) {
- return new jQuery.Event( src );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
- // Event type
- } else {
- this.type = src;
- }
-
- // timeStamp is buggy for some events on Firefox(#3843)
- // So we won't rely on the native value
- this.timeStamp = now();
-
- // Mark it as fixed
- this[ expando ] = true;
-};
-
-function returnFalse() {
- return false;
-}
-function returnTrue() {
- return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
- }
- // otherwise set the returnValue property of the original event to false (IE)
- e.returnValue = false;
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-
-// Checks if an event happened on an element within another element
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function( event ) {
- // Check if mouse(over|out) are still within the same parent element
- var parent = event.relatedTarget;
-
- // Traverse up the tree
- while ( parent && parent !== this ) {
- // Firefox sometimes assigns relatedTarget a XUL element
- // which we cannot access the parentNode property of
- try {
- parent = parent.parentNode;
-
- // assuming we've left the element since we most likely mousedover a xul element
- } catch(e) {
- break;
- }
- }
-
- if ( parent !== this ) {
- // set the correct event type
- event.type = event.data;
-
- // handle event if we actually just moused on to a non sub-element
- jQuery.event.handle.apply( this, arguments );
- }
-
-},
-
-// In case of event delegation, we only need to rename the event.type,
-// liveHandler will take care of the rest.
-delegate = function( event ) {
- event.type = event.data;
- jQuery.event.handle.apply( this, arguments );
-};
-
-// Create mouseenter and mouseleave events
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- setup: function( data ) {
- jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
- },
- teardown: function( data ) {
- jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
- }
- };
-});
-
-// submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-jQuery.event.special.submit = {
- setup: function( data, namespaces, fn ) {
- if ( this.nodeName.toLowerCase() !== "form" ) {
- jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
- return trigger( "submit", this, arguments );
- }
- });
-
- jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
- return trigger( "submit", this, arguments );
- }
- });
-
- } else {
- return false;
- }
- },
-
- remove: function( namespaces, fn ) {
- jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
- jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
- }
-};
-
-}
-
-// change delegation, happens here so we have bind.
-if ( !jQuery.support.changeBubbles ) {
-
-var formElems = /textarea|input|select/i;
-
-function getVal( elem ) {
- var type = elem.type, val = elem.value;
-
- if ( type === "radio" || type === "checkbox" ) {
- val = elem.checked;
-
- } else if ( type === "select-multiple" ) {
- val = elem.selectedIndex > -1 ?
- jQuery.map( elem.options, function( elem ) {
- return elem.selected;
- }).join("-") :
- "";
-
- } else if ( elem.nodeName.toLowerCase() === "select" ) {
- val = elem.selectedIndex;
- }
-
- return val;
-}
-
-function testChange( e ) {
- var elem = e.target, data, val;
-
- if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
- return;
- }
-
- data = jQuery.data( elem, "_change_data" );
- val = getVal(elem);
-
- if ( val === data ) {
- return;
- }
-
- // the current data will be also retrieved by beforeactivate
- if ( e.type !== "focusout" || elem.type !== "radio" ) {
- jQuery.data( elem, "_change_data", val );
- }
-
- if ( elem.type !== "select" && (data != null || val) ) {
- e.type = "change";
- return jQuery.event.trigger( e, arguments[1], this );
- }
-}
-
-jQuery.event.special.change = {
- filters: {
- focusout: testChange,
-
- click: function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
- return testChange.call( this, e );
- }
- },
-
- // Change has to be called before submit
- // Keydown will be called before keypress, which is used in submit-event delegation
- keydown: function( e ) {
- var elem = e.target, type = elem.type;
-
- if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
- (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
- type === "select-multiple" ) {
- return testChange.call( this, e );
- }
- },
-
- // Beforeactivate happens also before the previous element is blurred
- // with this event you can't trigger a change event, but you can store
- // information/focus[in] is not needed anymore
- beforeactivate: function( e ) {
- var elem = e.target;
-
- if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
- jQuery.data( elem, "_change_data", getVal(elem) );
- }
- }
- },
- setup: function( data, namespaces, fn ) {
- for ( var type in changeFilters ) {
- jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
- }
-
- return formElems.test( this.nodeName );
- },
- remove: function( namespaces, fn ) {
- for ( var type in changeFilters ) {
- jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
- }
-
- return formElems.test( this.nodeName );
- }
-};
-
-var changeFilters = jQuery.event.special.change.filters;
-
-}
-
-function trigger( type, elem, args ) {
- args[0].type = type;
- return jQuery.event.handle.apply( elem, args );
-}
-
-// Create "bubbling" focus and blur events
-if ( document.addEventListener ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
- jQuery.event.special[ fix ] = {
- setup: function() {
- this.addEventListener( orig, handler, true );
- },
- teardown: function() {
- this.removeEventListener( orig, handler, true );
- }
- };
-
- function handler( e ) {
- e = jQuery.event.fix( e );
- e.type = fix;
- return jQuery.event.handle.call( this, e );
- }
- });
-}
-
-jQuery.each(["bind", "one"], function( i, name ) {
- jQuery.fn[ name ] = function( type, data, fn ) {
- // Handle object literals
- if ( typeof type === "object" ) {
- for ( var key in type ) {
- this[ name ](key, data, type[key], fn);
- }
- return this;
- }
-
- if ( jQuery.isFunction( data ) ) {
- thisObject = fn;
- fn = data;
- data = undefined;
- }
-
- var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
- jQuery( this ).unbind( event, handler );
- return fn.apply( this, arguments );
- }) : fn;
-
- return type === "unload" && name !== "one" ?
- this.one( type, data, fn, thisObject ) :
- this.each(function() {
- jQuery.event.add( this, type, handler, data );
- });
- };
-});
-
-jQuery.fn.extend({
- unbind: function( type, fn ) {
- // Handle object literals
- if ( typeof type === "object" && !type.preventDefault ) {
- for ( var key in type ) {
- this.unbind(key, type[key]);
- }
- return this;
- }
-
- return this.each(function() {
- jQuery.event.remove( this, type, fn );
- });
- },
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
-
- triggerHandler: function( type, data ) {
- if ( this[0] ) {
- var event = jQuery.Event( type );
- event.preventDefault();
- event.stopPropagation();
- jQuery.event.trigger( event, data, this[0] );
- return event.result;
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments, i = 1;
-
- // link all the functions, so any of them can unbind this click handler
- while ( i < args.length ) {
- jQuery.proxy( fn, args[ i++ ] );
- }
-
- return this.click( jQuery.proxy( fn, function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- }));
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- },
-
- live: function( type, data, fn ) {
- if ( jQuery.isFunction( data ) ) {
- fn = data;
- data = undefined;
- }
-
- jQuery( this.context ).bind( liveConvert( type, this.selector ), {
- data: data, selector: this.selector, live: type
- }, fn );
-
- return this;
- },
-
- die: function( type, fn ) {
- jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
- return this;
- }
-});
-
-function liveHandler( event ) {
- var stop = true, elems = [], selectors = [], args = arguments,
- related, match, fn, elem, j, i, data,
- live = jQuery.extend({}, jQuery.data( this, "events" ).live);
-
- for ( j in live ) {
- fn = live[j];
- if ( fn.live === event.type ||
- fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
-
- data = fn.data;
- if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
- !data.beforeFilter[event.type](event)) ) {
- selectors.push( fn.selector );
- }
- } else {
- delete live[j];
- }
- }
-
- match = jQuery( event.target ).closest( selectors, event.currentTarget );
-
- for ( i = 0, l = match.length; i < l; i++ ) {
- for ( j in live ) {
- fn = live[j];
- elem = match[i].elem;
- related = null;
-
- if ( match[i].selector === fn.selector ) {
- // Those two events require additional checking
- if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
- related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
- }
-
- if ( !related || related !== elem ) {
- elems.push({ elem: elem, fn: fn });
- }
- }
- }
- }
-
- for ( i = 0, l = elems.length; i < l; i++ ) {
- match = elems[i];
- event.currentTarget = match.elem;
- event.data = match.fn.data;
- if ( match.fn.apply( match.elem, args ) === false ) {
- stop = false;
- break;
- }
- }
-
- return stop;
-}
-
-function liveConvert( type, selector ) {
- return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
-}
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( fn ) {
- return fn ? this.bind( name, fn ) : this.trigger( name );
- };
-
- if ( jQuery.attrFn ) {
- jQuery.attrFn[ name ] = true;
- }
-});
-
-// Prevent memory leaks in IE
-// Window isn't included so as not to unbind existing unload events
-// More info:
-// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-if ( window.attachEvent && !window.addEventListener ) {
- window.attachEvent("onunload", function() {
- for ( var id in jQuery.cache ) {
- if ( jQuery.cache[ id ].handle ) {
- // Try/Catch is to handle iframes being unloaded, see #4280
- try {
- jQuery.event.remove( jQuery.cache[ id ].handle.elem );
- } catch(e) {}
- }
- }
- });
-}
-/*!
- * Sizzle CSS Selector Engine - v1.0
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- done = 0,
- toString = Object.prototype.toString,
- hasDuplicate = false,
- baseHasDuplicate = true;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-// Thus far that includes Google Chrome.
-[0, 0].sort(function(){
- baseHasDuplicate = false;
- return 0;
-});
-
-var Sizzle = function(selector, context, results, seed) {
- results = results || [];
- var origContext = context = context || document;
-
- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
- return [];
- }
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
- soFar = selector;
-
- // Reset the position of the chunker regexp (start from head)
- while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
- soFar = m[3];
-
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = m[3];
- break;
- }
- }
-
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context );
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
-
- while ( parts.length ) {
- selector = parts.shift();
-
- if ( Expr.relative[ selector ] ) {
- selector += parts.shift();
- }
-
- set = posProcess( selector, set );
- }
- }
- } else {
- // Take a shortcut and set the context if the root selector is an ID
- // (but not if it'll be faster if the inner selector is an ID)
- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
- var ret = Sizzle.find( parts.shift(), context, contextXML );
- context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
- }
-
- if ( context ) {
- var ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
- set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
-
- if ( parts.length > 0 ) {
- checkSet = makeArray(set);
- } else {
- prune = false;
- }
-
- while ( parts.length ) {
- var cur = parts.pop(), pop = cur;
-
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if ( pop == null ) {
- pop = context;
- }
-
- Expr.relative[ cur ]( checkSet, pop, contextXML );
- }
- } else {
- checkSet = parts = [];
- }
- }
-
- if ( !checkSet ) {
- checkSet = set;
- }
-
- if ( !checkSet ) {
- throw "Syntax error, unrecognized expression: " + (cur || selector);
- }
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
- } else if ( context && context.nodeType === 1 ) {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
- } else {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
- }
- } else {
- makeArray( checkSet, results );
- }
-
- if ( extra ) {
- Sizzle( extra, origContext, results, seed );
- Sizzle.uniqueSort( results );
- }
-
- return results;
-};
-
-Sizzle.uniqueSort = function(results){
- if ( sortOrder ) {
- hasDuplicate = baseHasDuplicate;
- results.sort(sortOrder);
-
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[i-1] ) {
- results.splice(i--, 1);
- }
- }
- }
- }
-
- return results;
-};
-
-Sizzle.matches = function(expr, set){
- return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
- var set, match;
-
- if ( !expr ) {
- return [];
- }
-
- for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
- var type = Expr.order[i], match;
-
- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
- var left = match[1];
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace(/\\/g, "");
- set = Expr.find[ type ]( match, context, isXML );
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = context.getElementsByTagName("*");
- }
-
- return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
- var old = expr, result = [], curLoop = set, match, anyFound,
- isXMLFilter = set && set[0] && isXML(set[0]);
-
- while ( expr && set.length ) {
- for ( var type in Expr.filter ) {
- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
- var filter = Expr.filter[ type ], found, item, left = match[1];
- anyFound = false;
-
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) === "\\" ) {
- continue;
- }
-
- if ( curLoop === result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- var pass = not ^ !!found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
- } else {
- curLoop[i] = false;
- }
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
-
- expr = expr.replace( Expr.match[ type ], "" );
-
- if ( !anyFound ) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if ( expr === old ) {
- if ( anyFound == null ) {
- throw "Syntax error, unrecognized expression: " + expr;
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
- leftMatch: {},
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
- attrHandle: {
- href: function(elem){
- return elem.getAttribute("href");
- }
- },
- relative: {
- "+": function(checkSet, part){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !/\W/.test(part),
- isPartStrNotTag = isPartStr && !isTag;
-
- if ( isTag ) {
- part = part.toLowerCase();
- }
-
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
- elem || false :
- elem === part;
- }
- }
-
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
- }
- },
- ">": function(checkSet, part){
- var isPartStr = typeof part === "string";
-
- if ( isPartStr && !/\W/.test(part) ) {
- part = part.toLowerCase();
-
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
- }
- }
- } else {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
- }
- }
- },
- "": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( typeof part === "string" && !/\W/.test(part) ) {
- var nodeCheck = part = part.toLowerCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
- },
- "~": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( typeof part === "string" && !/\W/.test(part) ) {
- var nodeCheck = part = part.toLowerCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
- }
- },
- find: {
- ID: function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? [m] : [];
- }
- },
- NAME: function(match, context){
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [], results = context.getElementsByName(match[1]);
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
- TAG: function(match, context){
- return context.getElementsByTagName(match[1]);
- }
- },
- preFilter: {
- CLASS: function(match, curLoop, inplace, result, not, isXML){
- match = " " + match[1].replace(/\\/g, "") + " ";
-
- if ( isXML ) {
- return match;
- }
-
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
- if ( !inplace ) {
- result.push( elem );
- }
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
- ID: function(match){
- return match[1].replace(/\\/g, "");
- },
- TAG: function(match, curLoop){
- return match[1].toLowerCase();
- },
- CHILD: function(match){
- if ( match[1] === "nth" ) {
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
- ATTR: function(match, curLoop, inplace, result, not, isXML){
- var name = match[1].replace(/\\/g, "");
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
- }
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
- PSEUDO: function(match, curLoop, inplace, result, not){
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
- return false;
- }
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
- }
-
- return match;
- },
- POS: function(match){
- match.unshift( true );
- return match;
- }
- },
- filters: {
- enabled: function(elem){
- return elem.disabled === false && elem.type !== "hidden";
- },
- disabled: function(elem){
- return elem.disabled === true;
- },
- checked: function(elem){
- return elem.checked === true;
- },
- selected: function(elem){
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- elem.parentNode.selectedIndex;
- return elem.selected === true;
- },
- parent: function(elem){
- return !!elem.firstChild;
- },
- empty: function(elem){
- return !elem.firstChild;
- },
- has: function(elem, i, match){
- return !!Sizzle( match[3], elem ).length;
- },
- header: function(elem){
- return /h\d/i.test( elem.nodeName );
- },
- text: function(elem){
- return "text" === elem.type;
- },
- radio: function(elem){
- return "radio" === elem.type;
- },
- checkbox: function(elem){
- return "checkbox" === elem.type;
- },
- file: function(elem){
- return "file" === elem.type;
- },
- password: function(elem){
- return "password" === elem.type;
- },
- submit: function(elem){
- return "submit" === elem.type;
- },
- image: function(elem){
- return "image" === elem.type;
- },
- reset: function(elem){
- return "reset" === elem.type;
- },
- button: function(elem){
- return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
- },
- input: function(elem){
- return /input|select|textarea|button/i.test(elem.nodeName);
- }
- },
- setFilters: {
- first: function(elem, i){
- return i === 0;
- },
- last: function(elem, i, match, array){
- return i === array.length - 1;
- },
- even: function(elem, i){
- return i % 2 === 0;
- },
- odd: function(elem, i){
- return i % 2 === 1;
- },
- lt: function(elem, i, match){
- return i < match[3] - 0;
- },
- gt: function(elem, i, match){
- return i > match[3] - 0;
- },
- nth: function(elem, i, match){
- return match[3] - 0 === i;
- },
- eq: function(elem, i, match){
- return match[3] - 0 === i;
- }
- },
- filter: {
- PSEUDO: function(elem, match, i, array){
- var name = match[1], filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var i = 0, l = not.length; i < l; i++ ) {
- if ( not[i] === elem ) {
- return false;
- }
- }
-
- return true;
- } else {
- throw "Syntax error, unrecognized expression: " + name;
- }
- },
- CHILD: function(elem, match){
- var type = match[1], node = elem;
- switch (type) {
- case 'only':
- case 'first':
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
- if ( type === "first" ) {
- return true;
- }
- node = elem;
- case 'last':
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
- return true;
- case 'nth':
- var first = match[2], last = match[3];
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- var doneName = match[0],
- parent = elem.parentNode;
-
- if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
- var count = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
- parent.sizcache = doneName;
- }
-
- var diff = elem.nodeIndex - last;
- if ( first === 0 ) {
- return diff === 0;
- } else {
- return ( diff % first === 0 && diff / first >= 0 );
- }
- }
- },
- ID: function(elem, match){
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
- TAG: function(elem, match){
- return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
- },
- CLASS: function(elem, match){
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
- },
- ATTR: function(elem, match){
- var name = match[1],
- result = Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value !== check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
- POS: function(elem, match, i, array){
- var name = match[2], filter = Expr.setFilters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
- return "\\" + (num - 0 + 1);
- }));
-}
-
-var makeArray = function(array, results) {
- array = Array.prototype.slice.call( array, 0 );
-
- if ( results ) {
- results.push.apply( results, array );
- return results;
- }
-
- return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-try {
- Array.prototype.slice.call( document.documentElement.childNodes, 0 );
-
-// Provide a fallback method if it does not work
-} catch(e){
- makeArray = function(array, results) {
- var ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
- } else {
- if ( typeof array.length === "number" ) {
- for ( var i = 0, l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
- } else {
- for ( var i = 0; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
- }
-
- return ret;
- };
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
- if ( a == b ) {
- hasDuplicate = true;
- }
- return a.compareDocumentPosition ? -1 : 1;
- }
-
- var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( "sourceIndex" in document.documentElement ) {
- sortOrder = function( a, b ) {
- if ( !a.sourceIndex || !b.sourceIndex ) {
- if ( a == b ) {
- hasDuplicate = true;
- }
- return a.sourceIndex ? -1 : 1;
- }
-
- var ret = a.sourceIndex - b.sourceIndex;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( document.createRange ) {
- sortOrder = function( a, b ) {
- if ( !a.ownerDocument || !b.ownerDocument ) {
- if ( a == b ) {
- hasDuplicate = true;
- }
- return a.ownerDocument ? -1 : 1;
- }
-
- var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
- aRange.setStart(a, 0);
- aRange.setEnd(a, 0);
- bRange.setStart(b, 0);
- bRange.setEnd(b, 0);
- var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-}
-
-// Utility function for retreiving the text value of an array of DOM nodes
-function getText( elems ) {
- var ret = "", elem;
-
- for ( var i = 0; elems[i]; i++ ) {
- elem = elems[i];
-
- // Get the text from text nodes and CDATA nodes
- if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
- ret += elem.nodeValue;
-
- // Traverse everything else, except comment nodes
- } else if ( elem.nodeType !== 8 ) {
- ret += getText( elem.childNodes );
- }
- }
-
- return ret;
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("div"),
- id = "script" + (new Date).getTime();
- form.innerHTML = "<a name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- var root = document.documentElement;
- root.insertBefore( form, root.firstChild );
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( document.getElementById( id ) ) {
- Expr.find.ID = function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
- }
- };
-
- Expr.filter.ID = function(elem, match){
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild( form );
- root = form = null; // release memory in IE
-})();
-
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
-
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function(match, context){
- var results = context.getElementsByTagName(match[1]);
-
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
-
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
- Expr.attrHandle.href = function(elem){
- return elem.getAttribute("href", 2);
- };
- }
-
- div = null; // release memory in IE
-})();
-
-if ( document.querySelectorAll ) {
- (function(){
- var oldSizzle = Sizzle, div = document.createElement("div");
- div.innerHTML = "<p class='TEST'></p>";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function(query, context, extra, seed){
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && context.nodeType === 9 && !isXML(context) ) {
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(e){}
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- for ( var prop in oldSizzle ) {
- Sizzle[ prop ] = oldSizzle[ prop ];
- }
-
- div = null; // release memory in IE
- })();
-}
-
-(function(){
- var div = document.createElement("div");
-
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
- // Opera can't find a second classname (in 9.6)
- // Also, make sure that getElementsByClassName actually exists
- if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
- return;
- }
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 ) {
- return;
- }
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function(match, context, isXML) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-
- div = null; // release memory in IE
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 && !isXML ){
- elem.sizcache = doneName;
- elem.sizset = i;
- }
-
- if ( elem.nodeName.toLowerCase() === cur ) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
-
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-var contains = document.compareDocumentPosition ? function(a, b){
- return a.compareDocumentPosition(b) & 16;
-} : function(a, b){
- return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function(selector, context){
- var tmpSet = [], later = "", match,
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet );
- }
-
- return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.getText = getText;
-jQuery.isXMLDoc = isXML;
-jQuery.contains = contains;
-
-return;
-
-window.Sizzle = Sizzle;
-
-})();
-var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
- slice = Array.prototype.slice;
-
-// Implement the identical functionality for filter and not
-var winnow = function( elements, qualifier, keep ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- return !!qualifier.call( elem, i, elem ) === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return (elem === qualifier) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, elements );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
- });
-};
-
-jQuery.fn.extend({
- find: function( selector ) {
- var ret = this.pushStack( "", "find", selector ), length = 0;
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- length = ret.length;
- jQuery.find( selector, this[i], ret );
-
- if ( i > 0 ) {
- // Make sure that the results are unique
- for ( var n = length; n < ret.length; n++ ) {
- for ( var r = 0; r < length; r++ ) {
- if ( ret[r] === ret[n] ) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
-
- has: function( target ) {
- var targets = jQuery( target );
- return this.filter(function() {
- for ( var i = 0, l = targets.length; i < l; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
- },
-
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
- },
-
- is: function( selector ) {
- return !!selector && jQuery.filter( selector, this ).length > 0;
- },
-
- closest: function( selectors, context ) {
- if ( jQuery.isArray( selectors ) ) {
- var ret = [], cur = this[0], match, matches = {}, selector;
-
- if ( cur && selectors.length ) {
- for ( var i = 0, l = selectors.length; i < l; i++ ) {
- selector = selectors[i];
-
- if ( !matches[selector] ) {
- matches[selector] = jQuery.expr.match.POS.test( selector ) ?
- jQuery( selector, context || this.context ) :
- selector;
- }
- }
-
- while ( cur && cur.ownerDocument && cur !== context ) {
- for ( selector in matches ) {
- match = matches[selector];
-
- if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
- ret.push({ selector: selector, elem: cur });
- delete matches[selector];
- }
- }
- cur = cur.parentNode;
- }
- }
-
- return ret;
- }
-
- var pos = jQuery.expr.match.POS.test( selectors ) ?
- jQuery( selectors, context || this.context ) : null;
-
- return this.map(function( i, cur ) {
- while ( cur && cur.ownerDocument && cur !== context ) {
- if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
- return cur;
- }
- cur = cur.parentNode;
- }
- return null;
- });
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
- if ( !elem || typeof elem === "string" ) {
- return jQuery.inArray( this[0],
- // If it receives a string, the selector is used
- // If it receives nothing, the siblings are used
- elem ? jQuery( elem ) : this.parent().children() );
- }
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem, this );
- },
-
- add: function( selector, context ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context || this.context ) :
- jQuery.makeArray( selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
- all :
- jQuery.unique( all ) );
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- }
-});
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return jQuery.nth( elem, 2, "nextSibling" );
- },
- prev: function( elem ) {
- return jQuery.nth( elem, 2, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( elem.parentNode.firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return jQuery.nodeName( elem, "iframe" ) ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.makeArray( elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var ret = jQuery.map( this, fn, until );
-
- if ( !runtil.test( name ) ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- ret = this.length > 1 ? jQuery.unique( ret ) : ret;
-
- if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
-
- return this.pushStack( ret, name, slice.call(arguments).join(",") );
- };
-});
-
-jQuery.extend({
- filter: function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return jQuery.find.matches(expr, elems);
- },
-
- dir: function( elem, dir, until ) {
- var matched = [], cur = elem[dir];
- while ( cur && cur.nodeType !== 9 && (until === undefined || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- nth: function( cur, result, dir, elem ) {
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] ) {
- if ( cur.nodeType === 1 && ++num === result ) {
- break;
- }
- }
-
- return cur;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
- rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
- rtagName = /<([\w:]+)/,
- rtbody = /<tbody/i,
- rhtml = /<|&\w+;/,
- fcloseTag = function( all, front, tag ) {
- return rselfClosing.test( tag ) ?
- all :
- front + "></" + tag + ">";
- },
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- area: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- };
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
- text: function( text ) {
- if ( jQuery.isFunction(text) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- return self.text( text.call(this, i, self.text()) );
- });
- }
-
- if ( typeof text !== "object" && text !== undefined ) {
- return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
- }
-
- return jQuery.getText( this );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append(this);
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- return this.each(function() {
- var self = jQuery( this ), contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- return this.each(function() {
- jQuery( this ).wrapAll( html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- } else if ( arguments.length ) {
- var set = jQuery(arguments[0]);
- set.push.apply( set, this.toArray() );
- return this.pushStack( set, "before", arguments );
- }
- },
-
- after: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- } else if ( arguments.length ) {
- var set = this.pushStack( this, "after", arguments );
- set.push.apply( set, jQuery(arguments[0]).toArray() );
- return set;
- }
- },
-
- clone: function( events ) {
- // Do the clone
- var ret = this.map(function() {
- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
- // IE copies events bound via attachEvent when
- // using cloneNode. Calling detachEvent on the
- // clone will also remove the events from the orignal
- // In order to get around this, we use innerHTML.
- // Unfortunately, this means some modifications to
- // attributes in IE that are actually only stored
- // as properties will not be copied (such as the
- // the name attribute on an input).
- var html = this.outerHTML, ownerDocument = this.ownerDocument;
- if ( !html ) {
- var div = ownerDocument.createElement("div");
- div.appendChild( this.cloneNode(true) );
- html = div.innerHTML;
- }
-
- return jQuery.clean([html.replace(rinlinejQuery, "")
- .replace(rleadingWhitespace, "")], ownerDocument)[0];
- } else {
- return this.cloneNode(true);
- }
- });
-
- // Copy the events from the original to the clone
- if ( events === true ) {
- cloneCopyEvent( this, ret );
- cloneCopyEvent( this.find("*"), ret.find("*") );
- }
-
- // Return the cloned set
- return ret;
- },
-
- html: function( value ) {
- if ( value === undefined ) {
- return this[0] && this[0].nodeType === 1 ?
- this[0].innerHTML.replace(rinlinejQuery, "") :
- null;
-
- // See if we can take a shortcut and just use innerHTML
- } else if ( typeof value === "string" && !/<script/i.test( value ) &&
- (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
- !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
-
- try {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( this[i].nodeType === 1 ) {
- cleanData( this[i].getElementsByTagName("*") );
- this[i].innerHTML = value;
- }
- }
-
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {
- this.empty().append( value );
- }
-
- } else if ( jQuery.isFunction( value ) ) {
- this.each(function(i){
- var self = jQuery(this), old = self.html();
- self.empty().append(function(){
- return value.call( this, i, old );
- });
- });
-
- } else {
- this.empty().append( value );
- }
-
- return this;
- },
-
- replaceWith: function( value ) {
- if ( this[0] && this[0].parentNode ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( !jQuery.isFunction( value ) ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling, parent = this.parentNode;
-
- jQuery(this).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- } else {
- return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
- }
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
- var results, first, value = args[0], scripts = [];
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call(this, i, table ? self.html() : undefined);
- return self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- // If we're in a fragment, just use that instead of building a new one
- if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
- results = { fragment: args[0].parentNode };
- } else {
- results = buildFragment( args, this, scripts );
- }
-
- first = results.fragment.firstChild;
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- callback.call(
- table ?
- root(this[i], first) :
- this[i],
- results.cacheable || this.length > 1 || i > 0 ?
- results.fragment.cloneNode(true) :
- results.fragment
- );
- }
- }
-
- if ( scripts ) {
- jQuery.each( scripts, evalScript );
- }
- }
-
- return this;
-
- function root( elem, cur ) {
- return jQuery.nodeName(elem, "table") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
- }
- }
-});
-
-function cloneCopyEvent(orig, ret) {
- var i = 0;
-
- ret.each(function() {
- if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
- return;
- }
-
- var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
-
- if ( events ) {
- delete curData.handle;
- curData.events = {};
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
- }
- });
-}
-
-function buildFragment( args, nodes, scripts ) {
- var fragment, cacheable, cached, cacheresults, doc;
-
- if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 ) {
- cacheable = true;
- cacheresults = jQuery.fragments[ args[0] ];
- if ( cacheresults ) {
- if ( cacheresults !== 1 ) {
- fragment = cacheresults;
- }
- cached = true;
- }
- }
-
- if ( !fragment ) {
- doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, scripts );
- }
-
- if ( cacheable ) {
- jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
- }
-
- return { fragment: fragment, cacheable: cacheable };
-}
-
-jQuery.fragments = {};
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var ret = [], insert = jQuery( selector );
-
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = (i > 0 ? this.clone(true) : this).get();
- jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
- ret = ret.concat( elems );
- }
- return this.pushStack( ret, name, insert.selector );
- };
-});
-
-jQuery.each({
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
- if ( !keepData && this.nodeType === 1 ) {
- cleanData( this.getElementsByTagName("*") );
- cleanData( [ this ] );
- }
-
- if ( this.parentNode ) {
- this.parentNode.removeChild( this );
- }
- }
- },
-
- empty: function() {
- // Remove element nodes and prevent memory leaks
- if ( this.nodeType === 1 ) {
- cleanData( this.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( this.firstChild ) {
- this.removeChild( this.firstChild );
- }
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function() {
- return this.each( fn, arguments );
- };
-});
-
-jQuery.extend({
- clean: function( elems, context, fragment, scripts ) {
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" ) {
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
- }
-
- var ret = [];
-
- jQuery.each(elems, function( i, elem ) {
- if ( typeof elem === "number" ) {
- elem += "";
- }
-
- if ( !elem ) {
- return;
- }
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" && !rhtml.test( elem ) ) {
- elem = context.createTextNode( elem );
-
- } else if ( typeof elem === "string" ) {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, fcloseTag);
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
- wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0],
- div = context.createElement("div");
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( depth-- ) {
- div = div.lastChild;
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = rtbody.test(elem),
- tbody = tag === "table" && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( var j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
-
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
- }
-
- elem = jQuery.makeArray( div.childNodes );
- }
-
- if ( elem.nodeType ) {
- ret.push( elem );
- } else {
- ret = jQuery.merge( ret, elem );
- }
-
- });
-
- if ( fragment ) {
- for ( var i = 0; ret[i]; i++ ) {
- if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
- scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
- } else {
- if ( ret[i].nodeType === 1 ) {
- ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
- }
- fragment.appendChild( ret[i] );
- }
- }
- }
-
- return ret;
- }
-});
-
-function cleanData( elems ) {
- for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
- if ( !jQuery.noData[elem.nodeName.toLowerCase()] && (id = elem[expando]) ) {
- delete jQuery.cache[ id ];
- }
- }
-}
-// exclude the following css properties to add px
-var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
- ralpha = /alpha\([^)]*\)/,
- ropacity = /opacity=([^)]*)/,
- rfloat = /float/i,
- rdashAlpha = /-([a-z])/ig,
- rupper = /([A-Z])/g,
- rnumpx = /^-?\d+(?:px)?$/i,
- rnum = /^-?\d/,
-
- cssShow = { position: "absolute", visibility: "hidden", display:"block" },
- cssWidth = [ "Left", "Right" ],
- cssHeight = [ "Top", "Bottom" ],
-
- // cache check for defaultView.getComputedStyle
- getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
- // normalize float css property
- styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn.css = function( name, value ) {
- return access( this, name, value, true, function( elem, name, value ) {
- if ( value === undefined ) {
- return jQuery.curCSS( elem, name );
- }
-
- if ( typeof value === "number" && !rexclude.test(name) ) {
- value += "px";
- }
-
- jQuery.style( elem, name, value );
- });
-};
-
-jQuery.extend({
- style: function( elem, name, value ) {
- // don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
- return undefined;
- }
-
- // ignore negative width and height values #1599
- if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
- value = undefined;
- }
-
- var style = elem.style || elem, set = value !== undefined;
-
- // IE uses filters for opacity
- if ( !jQuery.support.opacity && name === "opacity" ) {
- if ( set ) {
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // Set the alpha filter to set the opacity
- var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
- var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
- style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
- }
-
- return style.filter && style.filter.indexOf("opacity=") >= 0 ?
- (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
- "";
- }
-
- // Make sure we're using the right name for getting the float value
- if ( rfloat.test( name ) ) {
- name = styleFloat;
- }
-
- name = name.replace(rdashAlpha, fcamelCase);
-
- if ( set ) {
- style[ name ] = value;
- }
-
- return style[ name ];
- },
-
- css: function( elem, name, force, extra ) {
- if ( name === "width" || name === "height" ) {
- var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
-
- function getWH() {
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
-
- if ( extra === "border" ) {
- return;
- }
-
- jQuery.each( which, function() {
- if ( !extra ) {
- val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
- }
-
- if ( extra === "margin" ) {
- val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
- } else {
- val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
- }
- });
- }
-
- if ( elem.offsetWidth !== 0 ) {
- getWH();
- } else {
- jQuery.swap( elem, props, getWH );
- }
-
- return Math.max(0, Math.round(val));
- }
-
- return jQuery.curCSS( elem, name, force );
- },
-
- curCSS: function( elem, name, force ) {
- var ret, style = elem.style, filter;
-
- // IE uses filters for opacity
- if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
- ret = ropacity.test(elem.currentStyle.filter || "") ?
- (parseFloat(RegExp.$1) / 100) + "" :
- "";
-
- return ret === "" ?
- "1" :
- ret;
- }
-
- // Make sure we're using the right name for getting the float value
- if ( rfloat.test( name ) ) {
- name = styleFloat;
- }
-
- if ( !force && style && style[ name ] ) {
- ret = style[ name ];
-
- } else if ( getComputedStyle ) {
-
- // Only "float" is needed here
- if ( rfloat.test( name ) ) {
- name = "float";
- }
-
- name = name.replace( rupper, "-$1" ).toLowerCase();
-
- var defaultView = elem.ownerDocument.defaultView;
-
- if ( !defaultView ) {
- return null;
- }
-
- var computedStyle = defaultView.getComputedStyle( elem, null );
-
- if ( computedStyle ) {
- ret = computedStyle.getPropertyValue( name );
- }
-
- // We should always get a number back from opacity
- if ( name === "opacity" && ret === "" ) {
- ret = "1";
- }
-
- } else if ( elem.currentStyle ) {
- var camelCase = name.replace(rdashAlpha, fcamelCase);
-
- ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
- // Remember the original values
- var left = style.left, rsLeft = elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
- style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret;
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {};
-
- // Remember the old values, and insert the new ones
- for ( var name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- callback.call( elem );
-
- // Revert the old values
- for ( var name in options ) {
- elem.style[ name ] = old[ name ];
- }
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth, height = elem.offsetHeight,
- skip = elem.nodeName.toLowerCase() === "tr";
-
- return width === 0 && height === 0 && !skip ?
- true :
- width > 0 && height > 0 && !skip ?
- false :
- jQuery.curCSS(elem, "display") === "none";
- };
-
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
-var jsc = now(),
- rscript = /<script(.|\s)*?\/script>/gi,
- rselectTextarea = /select|textarea/i,
- rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
- jsre = /=\?(&|$)/,
- rquery = /\?/,
- rts = /(\?|&)_=.*?(&|$)/,
- rurl = /^(\w+:)?\/\/([^\/?#]+)/,
- r20 = /%20/g;
-
-jQuery.fn.extend({
- // Keep a copy of the old load
- _load: jQuery.fn.load,
-
- load: function( url, params, callback ) {
- if ( typeof url !== "string" ) {
- return this._load( url );
-
- // Don't do a request if no elements are being requested
- } else if ( !this.length ) {
- return this;
- }
-
- var off = url.indexOf(" ");
- if ( off >= 0 ) {
- var selector = url.slice(off, url.length);
- url = url.slice(0, off);
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = null;
-
- // Otherwise, build a param string
- } else if ( typeof params === "object" ) {
- params = jQuery.param( params, jQuery.ajaxSettings.traditional );
- type = "POST";
- }
- }
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- context:this,
- complete: function( res, status ) {
- // If successful, inject the HTML into all the matched elements
- if ( status === "success" || status === "notmodified" ) {
- // See if a selector was specified
- this.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div />")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(res.responseText.replace(rscript, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- res.responseText );
- }
-
- if ( callback ) {
- this.each( callback, [res.responseText, status, res] );
- }
- }
- });
-
- return this;
- },
-
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
- serializeArray: function() {
- return this.map(function() {
- return this.elements ? jQuery.makeArray(this.elements) : this;
- })
- .filter(function() {
- return this.name && !this.disabled &&
- (this.checked || rselectTextarea.test(this.nodeName) ||
- rinput.test(this.type));
- })
- .map(function( i, elem ) {
- var val = jQuery(this).val();
-
- return val == null ?
- null :
- jQuery.isArray(val) ?
- jQuery.map( val, function( val, i ) {
- return { name: elem.name, value: val };
- }) :
- { name: elem.name, value: val };
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
- jQuery.fn[o] = function( f ) {
- return this.bind(o, f);
- };
-});
-
-jQuery.extend({
-
- get: function( url, data, callback, type ) {
- // shift arguments if data argument was omited
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = null;
- }
-
- return jQuery.ajax({
- type: "GET",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- getScript: function( url, callback ) {
- return jQuery.get(url, null, callback, "script");
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get(url, data, callback, "json");
- },
-
- post: function( url, data, callback, type ) {
- // shift arguments if data argument was omited
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = {};
- }
-
- return jQuery.ajax({
- type: "POST",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- ajaxSetup: function( settings ) {
- jQuery.extend( jQuery.ajaxSettings, settings );
- },
-
- ajaxSettings: {
- url: location.href,
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- username: null,
- password: null,
- traditional: false,
- */
- // Create the request object; Microsoft failed to properly
- // implement the XMLHttpRequest in IE7 (can't request local files),
- // so we use the ActiveXObject when it is available
- // This function can be overriden by calling jQuery.ajaxSetup
- xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
- function() {
- return new window.XMLHttpRequest();
- } :
- function() {
- try {
- return new window.ActiveXObject("Microsoft.XMLHTTP");
- } catch(e) {}
- },
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- script: "text/javascript, application/javascript",
- json: "application/json, text/javascript",
- text: "text/plain",
- _default: "*/*"
- }
- },
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajax: function( origSettings ) {
- var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
-
- var jsonp, status, data,
- callbackContext = s.context || s,
- type = s.type.toUpperCase();
-
- // convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Handle JSONP Parameter Callbacks
- if ( s.dataType === "jsonp" ) {
- if ( type === "GET" ) {
- if ( !jsre.test( s.url ) ) {
- s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
- }
- } else if ( !s.data || !jsre.test(s.data) ) {
- s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
- }
- s.dataType = "json";
- }
-
- // Build temporary JSONP function
- if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
- jsonp = s.jsonpCallback || ("jsonp" + jsc++);
-
- // Replace the =? sequence both in the query string and the data
- if ( s.data ) {
- s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
- }
-
- s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
- // We need to make sure
- // that a JSONP style response is executed properly
- s.dataType = "script";
-
- // Handle JSONP-style loading
- window[ jsonp ] = window[ jsonp ] || function( tmp ) {
- data = tmp;
- success();
- complete();
- // Garbage collect
- window[ jsonp ] = undefined;
-
- try {
- delete window[ jsonp ];
- } catch(e) {}
-
- if ( head ) {
- head.removeChild( script );
- }
- };
- }
-
- if ( s.dataType === "script" && s.cache === null ) {
- s.cache = false;
- }
-
- if ( s.cache === false && type === "GET" ) {
- var ts = now();
-
- // try replacing _= if it is there
- var ret = s.url.replace(rts, "$1_=" + ts + "$2");
-
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
- }
-
- // If data is available, append data to url for get requests
- if ( s.data && type === "GET" ) {
- s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
- }
-
- // Watch for a new set of requests
- if ( s.global && ! jQuery.active++ ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // Matches an absolute URL, and saves the domain
- var parts = rurl.exec( s.url ),
- remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
-
- // If we're requesting a remote document
- // and trying to load JSON or Script with a GET
- if ( s.dataType === "script" && type === "GET" && remote ) {
- var head = document.getElementsByTagName("head")[0] || document.documentElement;
- var script = document.createElement("script");
- script.src = s.url;
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- // Handle Script loading
- if ( !jsonp ) {
- var done = false;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function() {
- if ( !done && (!this.readyState ||
- this.readyState === "loaded" || this.readyState === "complete") ) {
- done = true;
- success();
- complete();
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
- if ( head && script.parentNode ) {
- head.removeChild( script );
- }
- }
- };
- }
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709 and #4378).
- head.insertBefore( script, head.firstChild );
-
- // We handle everything using the script element injection
- return undefined;
- }
-
- var requestDone = false;
-
- // Create the request object
- var xhr = s.xhr();
-
- if ( !xhr ) {
- return;
- }
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if ( s.username ) {
- xhr.open(type, s.url, s.async, s.username, s.password);
- } else {
- xhr.open(type, s.url, s.async);
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- // Set the correct header, if data is being sent
- if ( s.data || origSettings && origSettings.contentType ) {
- xhr.setRequestHeader("Content-Type", s.contentType);
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[s.url] ) {
- xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
- }
-
- if ( jQuery.etag[s.url] ) {
- xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
- }
- }
-
- // Set header so the called script knows that it's an XMLHttpRequest
- // Only send the header if it's not a remote XHR
- if ( !remote ) {
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- }
-
- // Set the Accepts header for the server, depending on the dataType
- xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
- s.accepts[ s.dataType ] + ", */*" :
- s.accepts._default );
- } catch(e) {}
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active ) {
- jQuery.event.trigger( "ajaxStop" );
- }
-
- // close opended socket
- xhr.abort();
- return false;
- }
-
- if ( s.global ) {
- trigger("ajaxSend", [xhr, s]);
- }
-
- // Wait for a response to come back
- var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
- // The request was aborted
- if ( !xhr || xhr.readyState === 0 ) {
- // Opera doesn't call onreadystatechange before this point
- // so we simulate the call
- if ( !requestDone ) {
- complete();
- }
-
- requestDone = true;
- if ( xhr ) {
- xhr.onreadystatechange = jQuery.noop;
- }
-
- // The transfer is complete and the data is available, or the request timed out
- } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
- requestDone = true;
- xhr.onreadystatechange = jQuery.noop;
-
- status = isTimeout === "timeout" ?
- "timeout" :
- !jQuery.httpSuccess( xhr ) ?
- "error" :
- s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
- "notmodified" :
- "success";
-
- if ( status === "success" ) {
- // Watch for, and catch, XML document parse errors
- try {
- // process the data (runs the xml through httpData regardless of callback)
- data = jQuery.httpData( xhr, s.dataType, s );
- } catch(e) {
- status = "parsererror";
- }
- }
-
- // Make sure that the request was successful or notmodified
- if ( status === "success" || status === "notmodified" ) {
- // JSONP handles its own success callback
- if ( !jsonp ) {
- success();
- }
- } else {
- jQuery.handleError(s, xhr, status);
- }
-
- // Fire the complete handlers
- complete();
-
- if ( isTimeout === "timeout" ) {
- xhr.abort();
- }
-
- // Stop memory leaks
- if ( s.async ) {
- xhr = null;
- }
- }
- };
-
- // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
- // Opera doesn't fire onreadystatechange at all on abort
- try {
- var oldAbort = xhr.abort;
- xhr.abort = function() {
- if ( xhr ) {
- oldAbort.call( xhr );
- if ( xhr ) {
- xhr.readyState = 0;
- }
- }
-
- onreadystatechange();
- };
- } catch(e) { }
-
- // Timeout checker
- if ( s.async && s.timeout > 0 ) {
- setTimeout(function() {
- // Check to see if the request is still happening
- if ( xhr && !requestDone ) {
- onreadystatechange( "timeout" );
- }
- }, s.timeout);
- }
-
- // Send the data
- try {
- xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
- } catch(e) {
- jQuery.handleError(s, xhr, null, e);
- // Fire the complete handlers
- complete();
- }
-
- // firefox 1.5 doesn't fire statechange for sync requests
- if ( !s.async ) {
- onreadystatechange();
- }
-
- function success() {
- // If a local callback was specified, fire it and pass it the data
- if ( s.success ) {
- s.success.call( callbackContext, data, status, xhr );
- }
-
- // Fire the global callback
- if ( s.global ) {
- trigger( "ajaxSuccess", [xhr, s] );
- }
- }
-
- function complete() {
- // Process result
- if ( s.complete ) {
- s.complete.call( callbackContext, xhr, status);
- }
-
- // The request was completed
- if ( s.global ) {
- trigger( "ajaxComplete", [xhr, s] );
- }
-
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
-
- function trigger(type, args) {
- (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
- }
-
- // return XMLHttpRequest to allow aborting the request etc.
- return xhr;
- },
-
- handleError: function( s, xhr, status, e ) {
- // If a local callback was specified, fire it
- if ( s.error ) {
- s.error.call( s.context || window, xhr, status, e );
- }
-
- // Fire the global callback
- if ( s.global ) {
- (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
- }
- },
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Determines if an XMLHttpRequest was successful or not
- httpSuccess: function( xhr ) {
- try {
- // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
- return !xhr.status && location.protocol === "file:" ||
- // Opera returns 0 when status is 304
- ( xhr.status >= 200 && xhr.status < 300 ) ||
- xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
- } catch(e) {}
-
- return false;
- },
-
- // Determines if an XMLHttpRequest returns NotModified
- httpNotModified: function( xhr, url ) {
- var lastModified = xhr.getResponseHeader("Last-Modified"),
- etag = xhr.getResponseHeader("Etag");
-
- if ( lastModified ) {
- jQuery.lastModified[url] = lastModified;
- }
-
- if ( etag ) {
- jQuery.etag[url] = etag;
- }
-
- // Opera returns 0 when status is 304
- return xhr.status === 304 || xhr.status === 0;
- },
-
- httpData: function( xhr, type, s ) {
- var ct = xhr.getResponseHeader("content-type") || "",
- xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
- data = xml ? xhr.responseXML : xhr.responseText;
-
- if ( xml && data.documentElement.nodeName === "parsererror" ) {
- throw "parsererror";
- }
-
- // Allow a pre-filtering function to sanitize the response
- // s is checked to keep backwards compatibility
- if ( s && s.dataFilter ) {
- data = s.dataFilter( data, type );
- }
-
- // The filter can actually parse the response
- if ( typeof data === "string" ) {
- // Get the JavaScript object, if JSON is used.
- if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if (/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
-
- // Try to use the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- data = window.JSON.parse( data );
-
- } else {
- data = (new Function("return " + data))();
- }
-
- } else {
- throw "Invalid JSON: " + data;
- }
-
- // If the type is "script", eval it in global context
- } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
- jQuery.globalEval( data );
- }
- }
-
- return data;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a, traditional ) {
-
- var s = [];
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings.traditional;
- }
-
- function add( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction(value) ? value() : value;
- s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray(a) || a.jquery ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- jQuery.each( a, function buildParams( prefix, obj ) {
-
- if ( jQuery.isArray(obj) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional ) {
- // Treat each array item as a scalar.
- add( prefix, v );
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
- }
- });
-
- } else if ( !traditional && obj != null && typeof obj === "object" ) {
- // Serialize object item.
- jQuery.each( obj, function( k, v ) {
- buildParams( prefix + "[" + k + "]", v );
- });
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
- });
- }
-
- // Return the resulting serialization
- return s.join("&").replace(r20, "+");
- }
-
-});
-var elemdisplay = {},
- rfxtypes = /toggle|show|hide/,
- rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ];
-
-jQuery.fn.extend({
- show: function( speed, callback ) {
- if ( speed != null ) {
- return this.animate( genFx("show", 3), speed, callback);
-
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var old = jQuery.data(this[i], "olddisplay");
-
- this[i].style.display = old || "";
-
- if ( jQuery.css(this[i], "display") === "none" ) {
- var nodeName = this[i].nodeName, display;
-
- if ( elemdisplay[ nodeName ] ) {
- display = elemdisplay[ nodeName ];
-
- } else {
- var elem = jQuery("<" + nodeName + " />").appendTo("body");
-
- display = elem.css("display");
-
- if ( display === "none" ) {
- display = "block";
- }
-
- elem.remove();
-
- elemdisplay[ nodeName ] = display;
- }
-
- jQuery.data(this[i], "olddisplay", display);
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var j = 0, k = this.length; j < k; j++ ) {
- this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
- }
-
- return this;
- }
- },
-
- hide: function( speed, callback ) {
- if ( speed != null ) {
- return this.animate( genFx("hide", 3), speed, callback);
-
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var old = jQuery.data(this[i], "olddisplay");
- if ( !old && old !== "none" ) {
- jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var j = 0, k = this.length; j < k; j++ ) {
- this[j].style.display = "none";
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2 ) {
- var bool = typeof fn === "boolean";
-
- if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
- this._toggle.apply( this, arguments );
-
- } else if ( fn == null || bool ) {
- this.each(function() {
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- });
-
- } else {
- this.animate(genFx("toggle", 3), fn, fn2);
- }
-
- return this;
- },
-
- fadeTo: function( speed, to, callback ) {
- return this.filter(":hidden").css("opacity", 0).show().end()
- .animate({opacity: to}, speed, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed(speed, easing, callback);
-
- if ( jQuery.isEmptyObject( prop ) ) {
- return this.each( optall.complete );
- }
-
- return this[ optall.queue === false ? "each" : "queue" ](function() {
- var opt = jQuery.extend({}, optall), p,
- hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
- self = this;
-
- for ( p in prop ) {
- var name = p.replace(rdashAlpha, fcamelCase);
-
- if ( p !== name ) {
- prop[ name ] = prop[ p ];
- delete prop[ p ];
- p = name;
- }
-
- if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
- return opt.complete.call(this);
- }
-
- if ( ( p === "height" || p === "width" ) && this.style ) {
- // Store display property
- opt.display = jQuery.css(this, "display");
-
- // Make sure that nothing sneaks out
- opt.overflow = this.style.overflow;
- }
-
- if ( jQuery.isArray( prop[p] ) ) {
- // Create (if needed) and add to specialEasing
- (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
- prop[p] = prop[p][0];
- }
- }
-
- if ( opt.overflow != null ) {
- this.style.overflow = "hidden";
- }
-
- opt.curAnim = jQuery.extend({}, prop);
-
- jQuery.each( prop, function( name, val ) {
- var e = new jQuery.fx( self, opt, name );
-
- if ( rfxtypes.test(val) ) {
- e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-
- } else {
- var parts = rfxnum.exec(val),
- start = e.cur(true) || 0;
-
- if ( parts ) {
- var end = parseFloat( parts[2] ),
- unit = parts[3] || "px";
-
- // We need to compute starting value
- if ( unit !== "px" ) {
- self.style[ name ] = (end || 1) + unit;
- start = ((end || 1) / e.cur(true)) * start;
- self.style[ name ] = start + unit;
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] ) {
- end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
- }
-
- e.custom( start, end, unit );
-
- } else {
- e.custom( start, val, "" );
- }
- }
- });
-
- // For JS strict compliance
- return true;
- });
- },
-
- stop: function( clearQueue, gotoEnd ) {
- var timers = jQuery.timers;
-
- if ( clearQueue ) {
- this.queue([]);
- }
-
- this.each(function() {
- // go in reverse order so anything added to the queue during the loop is ignored
- for ( var i = timers.length - 1; i >= 0; i-- ) {
- if ( timers[i].elem === this ) {
- if (gotoEnd) {
- // force the next step to be the last
- timers[i](true);
- }
-
- timers.splice(i, 1);
- }
- }
- });
-
- // start the next in the queue if the last step wasn't forced
- if ( !gotoEnd ) {
- this.dequeue();
- }
-
- return this;
- }
-
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show", 1),
- slideUp: genFx("hide", 1),
- slideToggle: genFx("toggle", 1),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, callback ) {
- return this.animate( props, speed, callback );
- };
-});
-
-jQuery.extend({
- speed: function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? speed : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
-
- // Queueing
- opt.old = opt.complete;
- opt.complete = function() {
- if ( opt.queue !== false ) {
- jQuery(this).dequeue();
- }
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p, n, firstNum, diff ) {
- return firstNum + diff * p;
- },
- swing: function( p, n, firstNum, diff ) {
- return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ) {
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- if ( !options.orig ) {
- options.orig = {};
- }
- }
-
-});
-
-jQuery.fx.prototype = {
- // Simple function for setting a style value
- update: function() {
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
- // Set display property to block for height/width animations
- if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
- this.elem.style.display = "block";
- }
- },
-
- // Get the current size
- cur: function( force ) {
- if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
- return this.elem[ this.prop ];
- }
-
- var r = parseFloat(jQuery.css(this.elem, this.prop, force));
- return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
- },
-
- // Start an animation from one number to another
- custom: function( from, to, unit ) {
- this.startTime = now();
- this.start = from;
- this.end = to;
- this.unit = unit || this.unit || "px";
- this.now = this.start;
- this.pos = this.state = 0;
-
- var self = this;
- function t( gotoEnd ) {
- return self.step(gotoEnd);
- }
-
- t.elem = this.elem;
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval(jQuery.fx.tick, 13);
- }
- },
-
- // Simple 'show' function
- show: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any
- // flash of content
- this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
-
- // Start by showing the element
- jQuery( this.elem ).show();
- },
-
- // Simple 'hide' function
- hide: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom(this.cur(), 0);
- },
-
- // Each step of an animation
- step: function( gotoEnd ) {
- var t = now(), done = true;
-
- if ( gotoEnd || t >= this.options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- this.options.curAnim[ this.prop ] = true;
-
- for ( var i in this.options.curAnim ) {
- if ( this.options.curAnim[i] !== true ) {
- done = false;
- }
- }
-
- if ( done ) {
- if ( this.options.display != null ) {
- // Reset the overflow
- this.elem.style.overflow = this.options.overflow;
-
- // Reset the display
- var old = jQuery.data(this.elem, "olddisplay");
- this.elem.style.display = old ? old : this.options.display;
-
- if ( jQuery.css(this.elem, "display") === "none" ) {
- this.elem.style.display = "block";
- }
- }
-
- // Hide the element if the "hide" operation was done
- if ( this.options.hide ) {
- jQuery(this.elem).hide();
- }
-
- // Reset the properties, if the item has been hidden or shown
- if ( this.options.hide || this.options.show ) {
- for ( var p in this.options.curAnim ) {
- jQuery.style(this.elem, p, this.options.orig[p]);
- }
- }
-
- // Execute the complete function
- this.options.complete.call( this.elem );
- }
-
- return false;
-
- } else {
- var n = t - this.startTime;
- this.state = n / this.options.duration;
-
- // Perform the easing function, defaults to swing
- var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
- var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
- this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
- this.now = this.start + ((this.end - this.start) * this.pos);
-
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-};
-
-jQuery.extend( jQuery.fx, {
- tick: function() {
- var timers = jQuery.timers;
-
- for ( var i = 0; i < timers.length; i++ ) {
- if ( !timers[i]() ) {
- timers.splice(i--, 1);
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- },
-
- stop: function() {
- clearInterval( timerId );
- timerId = null;
- },
-
- speeds: {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
-
- step: {
- opacity: function( fx ) {
- jQuery.style(fx.elem, "opacity", fx.now);
- },
-
- _default: function( fx ) {
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
- } else {
- fx.elem[ fx.prop ] = fx.now;
- }
- }
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-
-function genFx( type, num ) {
- var obj = {};
-
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
- obj[ this ] = type;
- });
-
- return obj;
-}
-if ( "getBoundingClientRect" in document.documentElement ) {
- jQuery.fn.offset = function( options ) {
- var elem = this[0];
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
- clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
- top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
- left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
-
- return { top: top, left: left };
- };
-
-} else {
- jQuery.fn.offset = function( options ) {
- var elem = this[0];
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- jQuery.offset.initialize();
-
- var offsetParent = elem.offsetParent, prevOffsetParent = elem,
- doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
- body = doc.body, defaultView = doc.defaultView,
- prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
- top = elem.offsetTop, left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
- break;
- }
-
- computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
- top -= elem.scrollTop;
- left -= elem.scrollLeft;
-
- if ( elem === offsetParent ) {
- top += elem.offsetTop;
- left += elem.offsetLeft;
-
- if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
- }
-
- if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
- top += body.offsetTop;
- left += body.offsetLeft;
- }
-
- if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
- top += Math.max( docElem.scrollTop, body.scrollTop );
- left += Math.max( docElem.scrollLeft, body.scrollLeft );
- }
-
- return { top: top, left: left };
- };
-}
-
-jQuery.offset = {
- initialize: function() {
- var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
- html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-
- jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
-
- container.innerHTML = html;
- body.insertBefore( container, body.firstChild );
- innerDiv = container.firstChild;
- checkDiv = innerDiv.firstChild;
- td = innerDiv.nextSibling.firstChild.firstChild;
-
- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
- checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
- // safari subtracts parent border width here which is 5px
- this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
- checkDiv.style.position = checkDiv.style.top = "";
-
- innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
- this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
-
- body.removeChild( container );
- body = container = innerDiv = checkDiv = table = td = null;
- jQuery.offset.initialize = jQuery.noop;
- },
-
- bodyOffset: function( body ) {
- var top = body.offsetTop, left = body.offsetLeft;
-
- jQuery.offset.initialize();
-
- if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
- top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
- left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
- }
-
- return { top: top, left: left };
- },
-
- setOffset: function( elem, options, i ) {
- // set position first, in-case top/left are set even on static elem
- if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
- elem.style.position = "relative";
- }
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
- curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- var props = {
- top: (options.top - curOffset.top) + curTop,
- left: (options.left - curOffset.left) + curLeft
- };
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
- position: function() {
- if ( !this[0] ) {
- return null;
- }
-
- var elem = this[0],
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
- offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
- parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( ["Left", "Top"], function( i, name ) {
- var method = "scroll" + name;
-
- jQuery.fn[ method ] = function(val) {
- var elem = this[0], win;
-
- if ( !elem ) {
- return null;
- }
-
- if ( val !== undefined ) {
- // Set the scroll offset
- return this.each(function() {
- win = getWindow( this );
-
- if ( win ) {
- win.scrollTo(
- !i ? val : jQuery(win).scrollLeft(),
- i ? val : jQuery(win).scrollTop()
- );
-
- } else {
- this[ method ] = val;
- }
- });
- } else {
- win = getWindow( elem );
-
- // Return the scroll offset
- return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
- jQuery.support.boxModel && win.document.documentElement[ method ] ||
- win.document.body[ method ] :
- elem[ method ];
- }
- };
-});
-
-function getWindow( elem ) {
- return ("scrollTo" in elem && elem.document) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function( i, name ) {
-
- var type = name.toLowerCase();
-
- // innerHeight and innerWidth
- jQuery.fn["inner" + name] = function() {
- return this[0] ?
- jQuery.css( this[0], type, false, "padding" ) :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn["outer" + name] = function( margin ) {
- return this[0] ?
- jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
- null;
- };
-
- jQuery.fn[ type ] = function( size ) {
- // Get window width or height
- var elem = this[0];
- if ( !elem ) {
- return size == null ? null : this;
- }
-
- return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
- // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
- elem.document.body[ "client" + name ] :
-
- // Get document width or height
- (elem.nodeType === 9) ? // is it a document
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- Math.max(
- elem.documentElement["client" + name],
- elem.body["scroll" + name], elem.documentElement["scroll" + name],
- elem.body["offset" + name], elem.documentElement["offset" + name]
- ) :
-
- // Get or set width or height on the element
- size === undefined ?
- // Get width or height on the element
- jQuery.css( elem, type ) :
-
- // Set the width or height on the element (default to pixels if value is unitless)
- this.css( type, typeof size === "string" ? size : size + "px" );
- };
-
-});
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-})(window);
diff --git a/content/js/jquery-1.js b/content/js/jquery-1.js
deleted file mode 100755
index 9263574..0000000
--- a/content/js/jquery-1.js
+++ /dev/null
@@ -1,4376 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){
-
-var
- // Will speed up references to window, and allows munging its name.
- window = this,
- // Will speed up references to undefined, and allows munging its name.
- undefined,
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- jQuery = window.jQuery = window.$ = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context );
- },
-
- // A simple way to check for HTML strings or ID strings
- // (both of which we optimize for)
- quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/;
-
-jQuery.fn = jQuery.prototype = {
- init: function( selector, context ) {
- // Make sure that a selection was provided
- selector = selector || document;
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this[0] = selector;
- this.length = 1;
- this.context = selector;
- return this;
- }
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- var match = quickExpr.exec( selector );
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] )
- selector = jQuery.clean( [ match[1] ], context );
-
- // HANDLE: $("#id")
- else {
- var elem = document.getElementById( match[3] );
-
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem && elem.id != match[3] )
- return jQuery().find( selector );
-
- // Otherwise, we inject the element directly into the jQuery object
- var ret = jQuery( elem || [] );
- ret.context = document;
- ret.selector = selector;
- return ret;
- }
-
- // HANDLE: $(expr, [context])
- // (which is just equivalent to: $(content).find(expr)
- } else
- return jQuery( context ).find( selector );
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) )
- return jQuery( document ).ready( selector );
-
- // Make sure that old selector state is passed along
- if ( selector.selector && selector.context ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return this.setArray(jQuery.isArray( selector ) ?
- selector :
- jQuery.makeArray(selector));
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.3.2",
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num === undefined ?
-
- // Return a 'clean' array
- Array.prototype.slice.call( this ) :
-
- // Return just the object
- this[ num ];
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = jQuery( elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" )
- ret.selector = this.selector + (this.selector ? " " : "") + selector;
- else if ( name )
- ret.selector = this.selector + "." + name + "(" + selector + ")";
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Force the current matched set of elements to become
- // the specified array of elements (destroying the stack in the process)
- // You should use pushStack() in order to do this, but maintain the stack
- setArray: function( elems ) {
- // Resetting the length to 0, then using the native Array push
- // is a super-fast way to populate an object with array-like properties
- this.length = 0;
- Array.prototype.push.apply( this, elems );
-
- return this;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem && elem.jquery ? elem[0] : elem
- , this );
- },
-
- attr: function( name, value, type ) {
- var options = name;
-
- // Look for the case where we're accessing a style value
- if ( typeof name === "string" )
- if ( value === undefined )
- return this[0] && jQuery[ type || "attr" ]( this[0], name );
-
- else {
- options = {};
- options[ name ] = value;
- }
-
- // Check to see if we're setting style values
- return this.each(function(i){
- // Set all the styles
- for ( name in options )
- jQuery.attr(
- type ?
- this.style :
- this,
- name, jQuery.prop( this, options[ name ], type, i, name )
- );
- });
- },
-
- css: function( key, value ) {
- // ignore negative width and height values
- if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
- value = undefined;
- return this.attr( key, value, "curCSS" );
- },
-
- text: function( text ) {
- if ( typeof text !== "object" && text != null )
- return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
-
- var ret = "";
-
- jQuery.each( text || this, function(){
- jQuery.each( this.childNodes, function(){
- if ( this.nodeType != 8 )
- ret += this.nodeType != 1 ?
- this.nodeValue :
- jQuery.fn.text( [ this ] );
- });
- });
-
- return ret;
- },
-
- wrapAll: function( html ) {
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).clone();
-
- if ( this[0].parentNode )
- wrap.insertBefore( this[0] );
-
- wrap.map(function(){
- var elem = this;
-
- while ( elem.firstChild )
- elem = elem.firstChild;
-
- return elem;
- }).append(this);
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- return this.each(function(){
- jQuery( this ).contents().wrapAll( html );
- });
- },
-
- wrap: function( html ) {
- return this.each(function(){
- jQuery( this ).wrapAll( html );
- });
- },
-
- append: function() {
- return this.domManip(arguments, true, function(elem){
- if (this.nodeType == 1)
- this.appendChild( elem );
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function(elem){
- if (this.nodeType == 1)
- this.insertBefore( elem, this.firstChild );
- });
- },
-
- before: function() {
- return this.domManip(arguments, false, function(elem){
- this.parentNode.insertBefore( elem, this );
- });
- },
-
- after: function() {
- return this.domManip(arguments, false, function(elem){
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- },
-
- end: function() {
- return this.prevObject || jQuery( [] );
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: [].push,
- sort: [].sort,
- splice: [].splice,
-
- find: function( selector ) {
- if ( this.length === 1 ) {
- var ret = this.pushStack( [], "find", selector );
- ret.length = 0;
- jQuery.find( selector, this[0], ret );
- return ret;
- } else {
- return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
- return jQuery.find( selector, elem );
- })), "find", selector );
- }
- },
-
- clone: function( events ) {
- // Do the clone
- var ret = this.map(function(){
- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
- // IE copies events bound via attachEvent when
- // using cloneNode. Calling detachEvent on the
- // clone will also remove the events from the orignal
- // In order to get around this, we use innerHTML.
- // Unfortunately, this means some modifications to
- // attributes in IE that are actually only stored
- // as properties will not be copied (such as the
- // the name attribute on an input).
- var html = this.outerHTML;
- if ( !html ) {
- var div = this.ownerDocument.createElement("div");
- div.appendChild( this.cloneNode(true) );
- html = div.innerHTML;
- }
-
- return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
- } else
- return this.cloneNode(true);
- });
-
- // Copy the events from the original to the clone
- if ( events === true ) {
- var orig = this.find("*").andSelf(), i = 0;
-
- ret.find("*").andSelf().each(function(){
- if ( this.nodeName !== orig[i].nodeName )
- return;
-
- var events = jQuery.data( orig[i], "events" );
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
-
- i++;
- });
- }
-
- // Return the cloned set
- return ret;
- },
-
- filter: function( selector ) {
- return this.pushStack(
- jQuery.isFunction( selector ) &&
- jQuery.grep(this, function(elem, i){
- return selector.call( elem, i );
- }) ||
-
- jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
- return elem.nodeType === 1;
- }) ), "filter", selector );
- },
-
- closest: function( selector ) {
- var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
- closer = 0;
-
- return this.map(function(){
- var cur = this;
- while ( cur && cur.ownerDocument ) {
- if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
- jQuery.data(cur, "closest", closer);
- return cur;
- }
- cur = cur.parentNode;
- closer++;
- }
- });
- },
-
- not: function( selector ) {
- if ( typeof selector === "string" )
- // test special case where just one selector is passed in
- if ( isSimple.test( selector ) )
- return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
- else
- selector = jQuery.multiFilter( selector, this );
-
- var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
- return this.filter(function() {
- return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
- });
- },
-
- add: function( selector ) {
- return this.pushStack( jQuery.unique( jQuery.merge(
- this.get(),
- typeof selector === "string" ?
- jQuery( selector ) :
- jQuery.makeArray( selector )
- )));
- },
-
- is: function( selector ) {
- return !!selector && jQuery.multiFilter( selector, this ).length > 0;
- },
-
- hasClass: function( selector ) {
- return !!selector && this.is( "." + selector );
- },
-
- val: function( value ) {
- if ( value === undefined ) {
- var elem = this[0];
-
- if ( elem ) {
- if( jQuery.nodeName( elem, 'option' ) )
- return (elem.attributes.value || {}).specified ? elem.value : elem.text;
-
- // We need to handle select boxes special
- if ( jQuery.nodeName( elem, "select" ) ) {
- var index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type == "select-one";
-
- // Nothing was selected
- if ( index < 0 )
- return null;
-
- // Loop through all the selected options
- for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
- var option = options[ i ];
-
- if ( option.selected ) {
- // Get the specifc value for the option
- value = jQuery(option).val();
-
- // We don't need an array for one selects
- if ( one )
- return value;
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- }
-
- // Everything else, we just grab the value
- return (elem.value || "").replace(/\r/g, "");
-
- }
-
- return undefined;
- }
-
- if ( typeof value === "number" )
- value += '';
-
- return this.each(function(){
- if ( this.nodeType != 1 )
- return;
-
- if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
- this.checked = (jQuery.inArray(this.value, value) >= 0 ||
- jQuery.inArray(this.name, value) >= 0);
-
- else if ( jQuery.nodeName( this, "select" ) ) {
- var values = jQuery.makeArray(value);
-
- jQuery( "option", this ).each(function(){
- this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
- jQuery.inArray( this.text, values ) >= 0);
- });
-
- if ( !values.length )
- this.selectedIndex = -1;
-
- } else
- this.value = value;
- });
- },
-
- html: function( value ) {
- return value === undefined ?
- (this[0] ?
- this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") :
- null) :
- this.empty().append( value );
- },
-
- replaceWith: function( value ) {
- return this.after( value ).remove();
- },
-
- eq: function( i ) {
- return this.slice( i, +i + 1 );
- },
-
- slice: function() {
- return this.pushStack( Array.prototype.slice.apply( this, arguments ),
- "slice", Array.prototype.slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function(elem, i){
- return callback.call( elem, i, elem );
- }));
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- },
-
- domManip: function( args, table, callback ) {
- if ( this[0] ) {
- var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
- scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
- first = fragment.firstChild;
-
- if ( first )
- for ( var i = 0, l = this.length; i < l; i++ )
- callback.call( root(this[i], first), this.length > 1 || i > 0 ?
- fragment.cloneNode(true) : fragment );
-
- if ( scripts )
- jQuery.each( scripts, evalScript );
- }
-
- return this;
-
- function root( elem, cur ) {
- return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
- }
- }
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-function evalScript( i, elem ) {
- if ( elem.src )
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
-
- else
- jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-
- if ( elem.parentNode )
- elem.parentNode.removeChild( elem );
-}
-
-function now(){
- return +new Date;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
- // copy reference to target object
- var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) )
- target = {};
-
- // extend jQuery itself if only one argument is passed
- if ( length == i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ )
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null )
- // Extend the base object
- for ( var name in options ) {
- var src = target[ name ], copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy )
- continue;
-
- // Recurse if we're merging object values
- if ( deep && copy && typeof copy === "object" && !copy.nodeType )
- target[ name ] = jQuery.extend( deep,
- // Never move original objects, clone them
- src || ( copy.length != null ? [ ] : { } )
- , copy );
-
- // Don't bring in undefined values
- else if ( copy !== undefined )
- target[ name ] = copy;
-
- }
-
- // Return the modified object
- return target;
-};
-
-// exclude the following css properties to add px
-var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
- // cache defaultView
- defaultView = document.defaultView || {},
- toString = Object.prototype.toString;
-
-jQuery.extend({
- noConflict: function( deep ) {
- window.$ = _$;
-
- if ( deep )
- window.jQuery = _jQuery;
-
- return jQuery;
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return toString.call(obj) === "[object Function]";
- },
-
- isArray: function( obj ) {
- return toString.call(obj) === "[object Array]";
- },
-
- // check if an element is in a (or is an) XML document
- isXMLDoc: function( elem ) {
- return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
- !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
- },
-
- // Evalulates a script in a global context
- globalEval: function( data ) {
- if ( data && /\S/.test(data) ) {
- // Inspired by code by Andrea Giammarchi
- // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
- var head = document.getElementsByTagName("head")[0] || document.documentElement,
- script = document.createElement("script");
-
- script.type = "text/javascript";
- if ( jQuery.support.scriptEval )
- script.appendChild( document.createTextNode( data ) );
- else
- script.text = data;
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709).
- head.insertBefore( script, head.firstChild );
- head.removeChild( script );
- }
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0, length = object.length;
-
- if ( args ) {
- if ( length === undefined ) {
- for ( name in object )
- if ( callback.apply( object[ name ], args ) === false )
- break;
- } else
- for ( ; i < length; )
- if ( callback.apply( object[ i++ ], args ) === false )
- break;
-
- // A special, fast, case for the most common use of each
- } else {
- if ( length === undefined ) {
- for ( name in object )
- if ( callback.call( object[ name ], name, object[ name ] ) === false )
- break;
- } else
- for ( var value = object[0];
- i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
- }
-
- return object;
- },
-
- prop: function( elem, value, type, i, name ) {
- // Handle executable functions
- if ( jQuery.isFunction( value ) )
- value = value.call( elem, i );
-
- // Handle passing in a number to a CSS property
- return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
- value + "px" :
- value;
- },
-
- className: {
- // internal only, use addClass("class")
- add: function( elem, classNames ) {
- jQuery.each((classNames || "").split(/\s+/), function(i, className){
- if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
- elem.className += (elem.className ? " " : "") + className;
- });
- },
-
- // internal only, use removeClass("class")
- remove: function( elem, classNames ) {
- if (elem.nodeType == 1)
- elem.className = classNames !== undefined ?
- jQuery.grep(elem.className.split(/\s+/), function(className){
- return !jQuery.className.has( classNames, className );
- }).join(" ") :
- "";
- },
-
- // internal only, use hasClass("class")
- has: function( elem, className ) {
- return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
- }
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {};
- // Remember the old values, and insert the new ones
- for ( var name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- callback.call( elem );
-
- // Revert the old values
- for ( var name in options )
- elem.style[ name ] = old[ name ];
- },
-
- css: function( elem, name, force, extra ) {
- if ( name == "width" || name == "height" ) {
- var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
-
- function getWH() {
- val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
-
- if ( extra === "border" )
- return;
-
- jQuery.each( which, function() {
- if ( !extra )
- val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
- if ( extra === "margin" )
- val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
- else
- val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
- });
- }
-
- if ( elem.offsetWidth !== 0 )
- getWH();
- else
- jQuery.swap( elem, props, getWH );
-
- return Math.max(0, Math.round(val));
- }
-
- return jQuery.curCSS( elem, name, force );
- },
-
- curCSS: function( elem, name, force ) {
- var ret, style = elem.style;
-
- // We need to handle opacity special in IE
- if ( name == "opacity" && !jQuery.support.opacity ) {
- ret = jQuery.attr( style, "opacity" );
-
- return ret == "" ?
- "1" :
- ret;
- }
-
- // Make sure we're using the right name for getting the float value
- if ( name.match( /float/i ) )
- name = styleFloat;
-
- if ( !force && style && style[ name ] )
- ret = style[ name ];
-
- else if ( defaultView.getComputedStyle ) {
-
- // Only "float" is needed here
- if ( name.match( /float/i ) )
- name = "float";
-
- name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
-
- var computedStyle = defaultView.getComputedStyle( elem, null );
-
- if ( computedStyle )
- ret = computedStyle.getPropertyValue( name );
-
- // We should always get a number back from opacity
- if ( name == "opacity" && ret == "" )
- ret = "1";
-
- } else if ( elem.currentStyle ) {
- var camelCase = name.replace(/\-(\w)/g, function(all, letter){
- return letter.toUpperCase();
- });
-
- ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
- // Remember the original values
- var left = style.left, rsLeft = elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
- style.left = ret || 0;
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret;
- },
-
- clean: function( elems, context, fragment ) {
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" )
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
- var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
- if ( match )
- return [ context.createElement( match[1] ) ];
- }
-
- var ret = [], scripts = [], div = context.createElement("div");
-
- jQuery.each(elems, function(i, elem){
- if ( typeof elem === "number" )
- elem += '';
-
- if ( !elem )
- return;
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" ) {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
- return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
- all :
- front + "></" + tag + ">";
- });
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
-
- var wrap =
- // option or optgroup
- !tags.indexOf("<opt") &&
- [ 1, "<select multiple='multiple'>", "</select>" ] ||
-
- !tags.indexOf("<leg") &&
- [ 1, "<fieldset>", "</fieldset>" ] ||
-
- tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
- [ 1, "<table>", "</table>" ] ||
-
- !tags.indexOf("<tr") &&
- [ 2, "<table><tbody>", "</tbody></table>" ] ||
-
- // <thead> matched above
- (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
- [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
-
- !tags.indexOf("<col") &&
- [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
-
- // IE can't serialize <link> and <script> tags normally
- !jQuery.support.htmlSerialize &&
- [ 1, "div<div>", "</div>" ] ||
-
- [ 0, "", "" ];
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( wrap[0]-- )
- div = div.lastChild;
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = /<tbody/i.test(elem),
- tbody = !tags.indexOf("<table") && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] == "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( var j = tbody.length - 1; j >= 0 ; --j )
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
-
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
- div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
-
- elem = jQuery.makeArray( div.childNodes );
- }
-
- if ( elem.nodeType )
- ret.push( elem );
- else
- ret = jQuery.merge( ret, elem );
-
- });
-
- if ( fragment ) {
- for ( var i = 0; ret[i]; i++ ) {
- if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
- scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
- } else {
- if ( ret[i].nodeType === 1 )
- ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
- fragment.appendChild( ret[i] );
- }
- }
-
- return scripts;
- }
-
- return ret;
- },
-
- attr: function( elem, name, value ) {
- // don't set attributes on text and comment nodes
- if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
- return undefined;
-
- var notxml = !jQuery.isXMLDoc( elem ),
- // Whether we are setting (or getting)
- set = value !== undefined;
-
- // Try to normalize/fix the name
- name = notxml && jQuery.props[ name ] || name;
-
- // Only do all the following if this is a node (faster for style)
- // IE elem.getAttribute passes even for style
- if ( elem.tagName ) {
-
- // These attributes require special treatment
- var special = /href|src|style/.test( name );
-
- // Safari mis-reports the default selected property of a hidden option
- // Accessing the parent's selectedIndex property fixes it
- if ( name == "selected" && elem.parentNode )
- elem.parentNode.selectedIndex;
-
- // If applicable, access the attribute via the DOM 0 way
- if ( name in elem && notxml && !special ) {
- if ( set ){
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
- throw "type property can't be changed";
-
- elem[ name ] = value;
- }
-
- // browsers index elements by id/name on forms, give priority to attributes.
- if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
- return elem.getAttributeNode( name ).nodeValue;
-
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- if ( name == "tabIndex" ) {
- var attributeNode = elem.getAttributeNode( "tabIndex" );
- return attributeNode && attributeNode.specified
- ? attributeNode.value
- : elem.nodeName.match(/(button|input|object|select|textarea)/i)
- ? 0
- : elem.nodeName.match(/^(a|area)$/i) && elem.href
- ? 0
- : undefined;
- }
-
- return elem[ name ];
- }
-
- if ( !jQuery.support.style && notxml && name == "style" )
- return jQuery.attr( elem.style, "cssText", value );
-
- if ( set )
- // convert the value to a string (all browsers do this but IE) see #1070
- elem.setAttribute( name, "" + value );
-
- var attr = !jQuery.support.hrefNormalized && notxml && special
- // Some attributes require a special call on IE
- ? elem.getAttribute( name, 2 )
- : elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return attr === null ? undefined : attr;
- }
-
- // elem is actually elem.style ... set the style
-
- // IE uses filters for opacity
- if ( !jQuery.support.opacity && name == "opacity" ) {
- if ( set ) {
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- elem.zoom = 1;
-
- // Set the alpha filter to set the opacity
- elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
- (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
- }
-
- return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
- (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
- "";
- }
-
- name = name.replace(/-([a-z])/ig, function(all, letter){
- return letter.toUpperCase();
- });
-
- if ( set )
- elem[ name ] = value;
-
- return elem[ name ];
- },
-
- trim: function( text ) {
- return (text || "").replace( /^\s+|\s+$/g, "" );
- },
-
- makeArray: function( array ) {
- var ret = [];
-
- if( array != null ){
- var i = array.length;
- // The window, strings (and functions) also have 'length'
- if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
- ret[0] = array;
- else
- while( i )
- ret[--i] = array[i];
- }
-
- return ret;
- },
-
- inArray: function( elem, array ) {
- for ( var i = 0, length = array.length; i < length; i++ )
- // Use === because on IE, window == document
- if ( array[ i ] === elem )
- return i;
-
- return -1;
- },
-
- merge: function( first, second ) {
- // We have to loop this way because IE & Opera overwrite the length
- // expando of getElementsByTagName
- var i = 0, elem, pos = first.length;
- // Also, we need to make sure that the correct elements are being returned
- // (IE returns comment nodes in a '*' query)
- if ( !jQuery.support.getAll ) {
- while ( (elem = second[ i++ ]) != null )
- if ( elem.nodeType != 8 )
- first[ pos++ ] = elem;
-
- } else
- while ( (elem = second[ i++ ]) != null )
- first[ pos++ ] = elem;
-
- return first;
- },
-
- unique: function( array ) {
- var ret = [], done = {};
-
- try {
-
- for ( var i = 0, length = array.length; i < length; i++ ) {
- var id = jQuery.data( array[ i ] );
-
- if ( !done[ id ] ) {
- done[ id ] = true;
- ret.push( array[ i ] );
- }
- }
-
- } catch( e ) {
- ret = array;
- }
-
- return ret;
- },
-
- grep: function( elems, callback, inv ) {
- var ret = [];
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ )
- if ( !inv != !callback( elems[ i ], i ) )
- ret.push( elems[ i ] );
-
- return ret;
- },
-
- map: function( elems, callback ) {
- var ret = [];
-
- // Go through the array, translating each of the items to their
- // new value (or values).
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- var value = callback( elems[ i ], i );
-
- if ( value != null )
- ret[ ret.length ] = value;
- }
-
- return ret.concat.apply( [], ret );
- }
-});
-
-// Use of jQuery.browser is deprecated.
-// It's included for backwards compatibility and plugins,
-// although they should work to migrate away.
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
- version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
- safari: /webkit/.test( userAgent ),
- opera: /opera/.test( userAgent ),
- msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
- mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
-};
-
-jQuery.each({
- parent: function(elem){return elem.parentNode;},
- parents: function(elem){return jQuery.dir(elem,"parentNode");},
- next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
- prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
- nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
- prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
- siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
- children: function(elem){return jQuery.sibling(elem.firstChild);},
- contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
-}, function(name, fn){
- jQuery.fn[ name ] = function( selector ) {
- var ret = jQuery.map( this, fn );
-
- if ( selector && typeof selector == "string" )
- ret = jQuery.multiFilter( selector, ret );
-
- return this.pushStack( jQuery.unique( ret ), name, selector );
- };
-});
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function(name, original){
- jQuery.fn[ name ] = function( selector ) {
- var ret = [], insert = jQuery( selector );
-
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = (i > 0 ? this.clone(true) : this).get();
- jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
- ret = ret.concat( elems );
- }
-
- return this.pushStack( ret, name, selector );
- };
-});
-
-jQuery.each({
- removeAttr: function( name ) {
- jQuery.attr( this, name, "" );
- if (this.nodeType == 1)
- this.removeAttribute( name );
- },
-
- addClass: function( classNames ) {
- jQuery.className.add( this, classNames );
- },
-
- removeClass: function( classNames ) {
- jQuery.className.remove( this, classNames );
- },
-
- toggleClass: function( classNames, state ) {
- if( typeof state !== "boolean" )
- state = !jQuery.className.has( this, classNames );
- jQuery.className[ state ? "add" : "remove" ]( this, classNames );
- },
-
- remove: function( selector ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
- // Prevent memory leaks
- jQuery( "*", this ).add([this]).each(function(){
- jQuery.event.remove(this);
- jQuery.removeData(this);
- });
- if (this.parentNode)
- this.parentNode.removeChild( this );
- }
- },
-
- empty: function() {
- // Remove element nodes and prevent memory leaks
- jQuery(this).children().remove();
-
- // Remove any remaining nodes
- while ( this.firstChild )
- this.removeChild( this.firstChild );
- }
-}, function(name, fn){
- jQuery.fn[ name ] = function(){
- return this.each( fn, arguments );
- };
-});
-
-// Helper function used by the dimensions and offset modules
-function num(elem, prop) {
- return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
-}
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
-
-jQuery.extend({
- cache: {},
-
- data: function( elem, name, data ) {
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ];
-
- // Compute a unique ID for the element
- if ( !id )
- id = elem[ expando ] = ++uuid;
-
- // Only generate the data cache if we're
- // trying to access or manipulate it
- if ( name && !jQuery.cache[ id ] )
- jQuery.cache[ id ] = {};
-
- // Prevent overriding the named cache with undefined values
- if ( data !== undefined )
- jQuery.cache[ id ][ name ] = data;
-
- // Return the named cache data, or the ID for the element
- return name ?
- jQuery.cache[ id ][ name ] :
- id;
- },
-
- removeData: function( elem, name ) {
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ];
-
- // If we want to remove a specific section of the element's data
- if ( name ) {
- if ( jQuery.cache[ id ] ) {
- // Remove the section of cache data
- delete jQuery.cache[ id ][ name ];
-
- // If we've removed all the data, remove the element's cache
- name = "";
-
- for ( name in jQuery.cache[ id ] )
- break;
-
- if ( !name )
- jQuery.removeData( elem );
- }
-
- // Otherwise, we want to remove all of the element's data
- } else {
- // Clean up the element expando
- try {
- delete elem[ expando ];
- } catch(e){
- // IE has trouble directly removing the expando
- // but it's ok with using removeAttribute
- if ( elem.removeAttribute )
- elem.removeAttribute( expando );
- }
-
- // Completely remove the data cache
- delete jQuery.cache[ id ];
- }
- },
- queue: function( elem, type, data ) {
- if ( elem ){
-
- type = (type || "fx") + "queue";
-
- var q = jQuery.data( elem, type );
-
- if ( !q || jQuery.isArray(data) )
- q = jQuery.data( elem, type, jQuery.makeArray(data) );
- else if( data )
- q.push( data );
-
- }
- return q;
- },
-
- dequeue: function( elem, type ){
- var queue = jQuery.queue( elem, type ),
- fn = queue.shift();
-
- if( !type || type === "fx" )
- fn = queue[0];
-
- if( fn !== undefined )
- fn.call(elem);
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ){
- var parts = key.split(".");
- parts[1] = parts[1] ? "." + parts[1] : "";
-
- if ( value === undefined ) {
- var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
- if ( data === undefined && this.length )
- data = jQuery.data( this[0], key );
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- } else
- return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
- jQuery.data( this, key, value );
- });
- },
-
- removeData: function( key ){
- return this.each(function(){
- jQuery.removeData( this, key );
- });
- },
- queue: function(type, data){
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- }
-
- if ( data === undefined )
- return jQuery.queue( this[0], type );
-
- return this.each(function(){
- var queue = jQuery.queue( this, type, data );
-
- if( type == "fx" && queue.length == 1 )
- queue[0].call(this);
- });
- },
- dequeue: function(type){
- return this.each(function(){
- jQuery.dequeue( this, type );
- });
- }
-});/*!
- * Sizzle CSS Selector Engine - v0.9.3
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
- done = 0,
- toString = Object.prototype.toString;
-
-var Sizzle = function(selector, context, results, seed) {
- results = results || [];
- context = context || document;
-
- if ( context.nodeType !== 1 && context.nodeType !== 9 )
- return [];
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- var parts = [], m, set, checkSet, check, mode, extra, prune = true;
-
- // Reset the position of the chunker regexp (start from head)
- chunker.lastIndex = 0;
-
- while ( (m = chunker.exec(selector)) !== null ) {
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = RegExp.rightContext;
- break;
- }
- }
-
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context );
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
-
- while ( parts.length ) {
- selector = parts.shift();
-
- if ( Expr.relative[ selector ] )
- selector += parts.shift();
-
- set = posProcess( selector, set );
- }
- }
- } else {
- var ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
- set = Sizzle.filter( ret.expr, ret.set );
-
- if ( parts.length > 0 ) {
- checkSet = makeArray(set);
- } else {
- prune = false;
- }
-
- while ( parts.length ) {
- var cur = parts.pop(), pop = cur;
-
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if ( pop == null ) {
- pop = context;
- }
-
- Expr.relative[ cur ]( checkSet, pop, isXML(context) );
- }
- }
-
- if ( !checkSet ) {
- checkSet = set;
- }
-
- if ( !checkSet ) {
- throw "Syntax error, unrecognized expression: " + (cur || selector);
- }
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
- } else if ( context.nodeType === 1 ) {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
- } else {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
- }
- } else {
- makeArray( checkSet, results );
- }
-
- if ( extra ) {
- Sizzle( extra, context, results, seed );
-
- if ( sortOrder ) {
- hasDuplicate = false;
- results.sort(sortOrder);
-
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[i-1] ) {
- results.splice(i--, 1);
- }
- }
- }
- }
- }
-
- return results;
-};
-
-Sizzle.matches = function(expr, set){
- return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
- var set, match;
-
- if ( !expr ) {
- return [];
- }
-
- for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
- var type = Expr.order[i], match;
-
- if ( (match = Expr.match[ type ].exec( expr )) ) {
- var left = RegExp.leftContext;
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace(/\\/g, "");
- set = Expr.find[ type ]( match, context, isXML );
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = context.getElementsByTagName("*");
- }
-
- return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
- var old = expr, result = [], curLoop = set, match, anyFound,
- isXMLFilter = set && set[0] && isXML(set[0]);
-
- while ( expr && set.length ) {
- for ( var type in Expr.filter ) {
- if ( (match = Expr.match[ type ].exec( expr )) != null ) {
- var filter = Expr.filter[ type ], found, item;
- anyFound = false;
-
- if ( curLoop == result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- var pass = not ^ !!found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
- } else {
- curLoop[i] = false;
- }
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
-
- expr = expr.replace( Expr.match[ type ], "" );
-
- if ( !anyFound ) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if ( expr == old ) {
- if ( anyFound == null ) {
- throw "Syntax error, unrecognized expression: " + expr;
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
- },
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
- attrHandle: {
- href: function(elem){
- return elem.getAttribute("href");
- }
- },
- relative: {
- "+": function(checkSet, part, isXML){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !/\W/.test(part),
- isPartStrNotTag = isPartStr && !isTag;
-
- if ( isTag && !isXML ) {
- part = part.toUpperCase();
- }
-
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
- elem || false :
- elem === part;
- }
- }
-
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
- }
- },
- ">": function(checkSet, part, isXML){
- var isPartStr = typeof part === "string";
-
- if ( isPartStr && !/\W/.test(part) ) {
- part = isXML ? part : part.toUpperCase();
-
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName === part ? parent : false;
- }
- }
- } else {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
- }
- }
- },
- "": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( !part.match(/\W/) ) {
- var nodeCheck = part = isXML ? part : part.toUpperCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
- },
- "~": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( typeof part === "string" && !part.match(/\W/) ) {
- var nodeCheck = part = isXML ? part : part.toUpperCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
- }
- },
- find: {
- ID: function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? [m] : [];
- }
- },
- NAME: function(match, context, isXML){
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [], results = context.getElementsByName(match[1]);
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
- TAG: function(match, context){
- return context.getElementsByTagName(match[1]);
- }
- },
- preFilter: {
- CLASS: function(match, curLoop, inplace, result, not, isXML){
- match = " " + match[1].replace(/\\/g, "") + " ";
-
- if ( isXML ) {
- return match;
- }
-
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
- if ( !inplace )
- result.push( elem );
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
- ID: function(match){
- return match[1].replace(/\\/g, "");
- },
- TAG: function(match, curLoop){
- for ( var i = 0; curLoop[i] === false; i++ ){}
- return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
- },
- CHILD: function(match){
- if ( match[1] == "nth" ) {
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
- match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
- ATTR: function(match, curLoop, inplace, result, not, isXML){
- var name = match[1].replace(/\\/g, "");
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
- }
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
- PSEUDO: function(match, curLoop, inplace, result, not){
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
- return false;
- }
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
- }
-
- return match;
- },
- POS: function(match){
- match.unshift( true );
- return match;
- }
- },
- filters: {
- enabled: function(elem){
- return elem.disabled === false && elem.type !== "hidden";
- },
- disabled: function(elem){
- return elem.disabled === true;
- },
- checked: function(elem){
- return elem.checked === true;
- },
- selected: function(elem){
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- elem.parentNode.selectedIndex;
- return elem.selected === true;
- },
- parent: function(elem){
- return !!elem.firstChild;
- },
- empty: function(elem){
- return !elem.firstChild;
- },
- has: function(elem, i, match){
- return !!Sizzle( match[3], elem ).length;
- },
- header: function(elem){
- return /h\d/i.test( elem.nodeName );
- },
- text: function(elem){
- return "text" === elem.type;
- },
- radio: function(elem){
- return "radio" === elem.type;
- },
- checkbox: function(elem){
- return "checkbox" === elem.type;
- },
- file: function(elem){
- return "file" === elem.type;
- },
- password: function(elem){
- return "password" === elem.type;
- },
- submit: function(elem){
- return "submit" === elem.type;
- },
- image: function(elem){
- return "image" === elem.type;
- },
- reset: function(elem){
- return "reset" === elem.type;
- },
- button: function(elem){
- return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
- },
- input: function(elem){
- return /input|select|textarea|button/i.test(elem.nodeName);
- }
- },
- setFilters: {
- first: function(elem, i){
- return i === 0;
- },
- last: function(elem, i, match, array){
- return i === array.length - 1;
- },
- even: function(elem, i){
- return i % 2 === 0;
- },
- odd: function(elem, i){
- return i % 2 === 1;
- },
- lt: function(elem, i, match){
- return i < match[3] - 0;
- },
- gt: function(elem, i, match){
- return i > match[3] - 0;
- },
- nth: function(elem, i, match){
- return match[3] - 0 == i;
- },
- eq: function(elem, i, match){
- return match[3] - 0 == i;
- }
- },
- filter: {
- PSEUDO: function(elem, match, i, array){
- var name = match[1], filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var i = 0, l = not.length; i < l; i++ ) {
- if ( not[i] === elem ) {
- return false;
- }
- }
-
- return true;
- }
- },
- CHILD: function(elem, match){
- var type = match[1], node = elem;
- switch (type) {
- case 'only':
- case 'first':
- while (node = node.previousSibling) {
- if ( node.nodeType === 1 ) return false;
- }
- if ( type == 'first') return true;
- node = elem;
- case 'last':
- while (node = node.nextSibling) {
- if ( node.nodeType === 1 ) return false;
- }
- return true;
- case 'nth':
- var first = match[2], last = match[3];
-
- if ( first == 1 && last == 0 ) {
- return true;
- }
-
- var doneName = match[0],
- parent = elem.parentNode;
-
- if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
- var count = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
- parent.sizcache = doneName;
- }
-
- var diff = elem.nodeIndex - last;
- if ( first == 0 ) {
- return diff == 0;
- } else {
- return ( diff % first == 0 && diff / first >= 0 );
- }
- }
- },
- ID: function(elem, match){
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
- TAG: function(elem, match){
- return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
- },
- CLASS: function(elem, match){
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
- },
- ATTR: function(elem, match){
- var name = match[1],
- result = Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value != check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
- POS: function(elem, match, i, array){
- var name = match[2], filter = Expr.setFilters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
- Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-}
-
-var makeArray = function(array, results) {
- array = Array.prototype.slice.call( array );
-
- if ( results ) {
- results.push.apply( results, array );
- return results;
- }
-
- return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-try {
- Array.prototype.slice.call( document.documentElement.childNodes );
-
-// Provide a fallback method if it does not work
-} catch(e){
- makeArray = function(array, results) {
- var ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
- } else {
- if ( typeof array.length === "number" ) {
- for ( var i = 0, l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
- } else {
- for ( var i = 0; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
- }
-
- return ret;
- };
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
- var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( "sourceIndex" in document.documentElement ) {
- sortOrder = function( a, b ) {
- var ret = a.sourceIndex - b.sourceIndex;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( document.createRange ) {
- sortOrder = function( a, b ) {
- var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
- aRange.selectNode(a);
- aRange.collapse(true);
- bRange.selectNode(b);
- bRange.collapse(true);
- var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("form"),
- id = "script" + (new Date).getTime();
- form.innerHTML = "<input name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- var root = document.documentElement;
- root.insertBefore( form, root.firstChild );
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( !!document.getElementById( id ) ) {
- Expr.find.ID = function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
- }
- };
-
- Expr.filter.ID = function(elem, match){
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild( form );
-})();
-
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
-
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function(match, context){
- var results = context.getElementsByTagName(match[1]);
-
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
-
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
- Expr.attrHandle.href = function(elem){
- return elem.getAttribute("href", 2);
- };
- }
-})();
-
-if ( document.querySelectorAll ) (function(){
- var oldSizzle = Sizzle, div = document.createElement("div");
- div.innerHTML = "<p class='TEST'></p>";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function(query, context, extra, seed){
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && context.nodeType === 9 && !isXML(context) ) {
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(e){}
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- Sizzle.find = oldSizzle.find;
- Sizzle.filter = oldSizzle.filter;
- Sizzle.selectors = oldSizzle.selectors;
- Sizzle.matches = oldSizzle.matches;
-})();
-
-if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
- var div = document.createElement("div");
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
- // Opera can't find a second classname (in 9.6)
- if ( div.getElementsByClassName("e").length === 0 )
- return;
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 )
- return;
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function(match, context, isXML) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- var sibDir = dir == "previousSibling" && !isXML;
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- if ( sibDir && elem.nodeType === 1 ){
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 && !isXML ){
- elem.sizcache = doneName;
- elem.sizset = i;
- }
-
- if ( elem.nodeName === cur ) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- var sibDir = dir == "previousSibling" && !isXML;
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- if ( sibDir && elem.nodeType === 1 ) {
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
-
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-var contains = document.compareDocumentPosition ? function(a, b){
- return a.compareDocumentPosition(b) & 16;
-} : function(a, b){
- return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
- return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
- !!elem.ownerDocument && isXML( elem.ownerDocument );
-};
-
-var posProcess = function(selector, context){
- var tmpSet = [], later = "", match,
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet );
- }
-
- return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-jQuery.find = Sizzle;
-jQuery.filter = Sizzle.filter;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-
-Sizzle.selectors.filters.hidden = function(elem){
- return elem.offsetWidth === 0 || elem.offsetHeight === 0;
-};
-
-Sizzle.selectors.filters.visible = function(elem){
- return elem.offsetWidth > 0 || elem.offsetHeight > 0;
-};
-
-Sizzle.selectors.filters.animated = function(elem){
- return jQuery.grep(jQuery.timers, function(fn){
- return elem === fn.elem;
- }).length;
-};
-
-jQuery.multiFilter = function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return Sizzle.matches(expr, elems);
-};
-
-jQuery.dir = function( elem, dir ){
- var matched = [], cur = elem[dir];
- while ( cur && cur != document ) {
- if ( cur.nodeType == 1 )
- matched.push( cur );
- cur = cur[dir];
- }
- return matched;
-};
-
-jQuery.nth = function(cur, result, dir, elem){
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] )
- if ( cur.nodeType == 1 && ++num == result )
- break;
-
- return cur;
-};
-
-jQuery.sibling = function(n, elem){
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType == 1 && n != elem )
- r.push( n );
- }
-
- return r;
-};
-
-return;
-
-window.Sizzle = Sizzle;
-
-})();
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code originated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
- // Bind an event to an element
- // Original by Dean Edwards
- add: function(elem, types, handler, data) {
- if ( elem.nodeType == 3 || elem.nodeType == 8 )
- return;
-
- // For whatever reason, IE has trouble passing the window object
- // around, causing it to be cloned in the process
- if ( elem.setInterval && elem != window )
- elem = window;
-
- // Make sure that the function being executed has a unique ID
- if ( !handler.guid )
- handler.guid = this.guid++;
-
- // if data is passed, bind to handler
- if ( data !== undefined ) {
- // Create temporary function pointer to original handler
- var fn = handler;
-
- // Create unique handler function, wrapped around original handler
- handler = this.proxy( fn );
-
- // Store data in unique handler
- handler.data = data;
- }
-
- // Init the element's event structure
- var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
- handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
- // Handle the second event of a trigger and when
- // an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
- jQuery.event.handle.apply(arguments.callee.elem, arguments) :
- undefined;
- });
- // Add elem as a property of the handle function
- // This is to prevent a memory leak with non-native
- // event in IE.
- handle.elem = elem;
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- jQuery.each(types.split(/\s+/), function(index, type) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- handler.type = namespaces.slice().sort().join(".");
-
- // Get the current list of functions bound to this event
- var handlers = events[type];
-
- if ( jQuery.event.specialAll[type] )
- jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
-
- // Init the event handler queue
- if (!handlers) {
- handlers = events[type] = {};
-
- // Check for a special event handler
- // Only use addEventListener/attachEvent if the special
- // events handler returns false
- if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
- // Bind the global event handler to the element
- if (elem.addEventListener)
- elem.addEventListener(type, handle, false);
- else if (elem.attachEvent)
- elem.attachEvent("on" + type, handle);
- }
- }
-
- // Add the function to the element's handler list
- handlers[handler.guid] = handler;
-
- // Keep track of which events have been used, for global triggering
- jQuery.event.global[type] = true;
- });
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- guid: 1,
- global: {},
-
- // Detach an event or set of events from an element
- remove: function(elem, types, handler) {
- // don't do events on text and comment nodes
- if ( elem.nodeType == 3 || elem.nodeType == 8 )
- return;
-
- var events = jQuery.data(elem, "events"), ret, index;
-
- if ( events ) {
- // Unbind all events for the element
- if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
- for ( var type in events )
- this.remove( elem, type + (types || "") );
- else {
- // types is actually an event object here
- if ( types.type ) {
- handler = types.handler;
- types = types.type;
- }
-
- // Handle multiple events seperated by a space
- // jQuery(...).unbind("mouseover mouseout", fn);
- jQuery.each(types.split(/\s+/), function(index, type){
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
-
- if ( events[type] ) {
- // remove the given handler for the given type
- if ( handler )
- delete events[type][handler.guid];
-
- // remove all handlers for the given type
- else
- for ( var handle in events[type] )
- // Handle the removal of namespaced events
- if ( namespace.test(events[type][handle].type) )
- delete events[type][handle];
-
- if ( jQuery.event.specialAll[type] )
- jQuery.event.specialAll[type].teardown.call(elem, namespaces);
-
- // remove generic event handler if no more handlers exist
- for ( ret in events[type] ) break;
- if ( !ret ) {
- if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
- if (elem.removeEventListener)
- elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
- else if (elem.detachEvent)
- elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
- }
- ret = null;
- delete events[type];
- }
- }
- });
- }
-
- // Remove the expando if it's no longer used
- for ( ret in events ) break;
- if ( !ret ) {
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) handle.elem = null;
- jQuery.removeData( elem, "events" );
- jQuery.removeData( elem, "handle" );
- }
- }
- },
-
- // bubbling is internal
- trigger: function( event, data, elem, bubbling ) {
- // Event object or event type
- var type = event.type || event;
-
- if( !bubbling ){
- event = typeof event === "object" ?
- // jQuery.Event object
- event[expando] ? event :
- // Object literal
- jQuery.extend( jQuery.Event(type), event ) :
- // Just the event type (string)
- jQuery.Event(type);
-
- if ( type.indexOf("!") >= 0 ) {
- event.type = type = type.slice(0, -1);
- event.exclusive = true;
- }
-
- // Handle a global trigger
- if ( !elem ) {
- // Don't bubble custom events when global (to avoid too much overhead)
- event.stopPropagation();
- // Only trigger if we've ever bound an event for it
- if ( this.global[type] )
- jQuery.each( jQuery.cache, function(){
- if ( this.events && this.events[type] )
- jQuery.event.trigger( event, data, this.handle.elem );
- });
- }
-
- // Handle triggering a single element
-
- // don't do events on text and comment nodes
- if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
- return undefined;
-
- // Clean up in case it is reused
- event.result = undefined;
- event.target = elem;
-
- // Clone the incoming data, if any
- data = jQuery.makeArray(data);
- data.unshift( event );
- }
-
- event.currentTarget = elem;
-
- // Trigger the event, it is assumed that "handle" is a function
- var handle = jQuery.data(elem, "handle");
- if ( handle )
- handle.apply( elem, data );
-
- // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
- if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
- event.result = false;
-
- // Trigger the native events (except for clicks on links)
- if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
- this.triggered = true;
- try {
- elem[ type ]();
- // prevent IE from throwing an error for some hidden elements
- } catch (e) {}
- }
-
- this.triggered = false;
-
- if ( !event.isPropagationStopped() ) {
- var parent = elem.parentNode || elem.ownerDocument;
- if ( parent )
- jQuery.event.trigger(event, data, parent, true);
- }
- },
-
- handle: function(event) {
- // returned undefined or false
- var all, handlers;
-
- event = arguments[0] = jQuery.event.fix( event || window.event );
- event.currentTarget = this;
-
- // Namespaced event handlers
- var namespaces = event.type.split(".");
- event.type = namespaces.shift();
-
- // Cache this now, all = true means, any handler
- all = !namespaces.length && !event.exclusive;
-
- var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
-
- handlers = ( jQuery.data(this, "events") || {} )[event.type];
-
- for ( var j in handlers ) {
- var handler = handlers[j];
-
- // Filter the functions by class
- if ( all || namespace.test(handler.type) ) {
- // Pass in a reference to the handler function itself
- // So that we can later remove it
- event.handler = handler;
- event.data = handler.data;
-
- var ret = handler.apply(this, arguments);
-
- if( ret !== undefined ){
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
-
- if( event.isImmediatePropagationStopped() )
- break;
-
- }
- }
- },
-
- props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
- fix: function(event) {
- if ( event[expando] )
- return event;
-
- // store a copy of the original event object
- // and "clone" to set read-only properties
- var originalEvent = event;
- event = jQuery.Event( originalEvent );
-
- for ( var i = this.props.length, prop; i; ){
- prop = this.props[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary
- if ( !event.target )
- event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
-
- // check if target is a textnode (safari)
- if ( event.target.nodeType == 3 )
- event.target = event.target.parentNode;
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && event.fromElement )
- event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && event.clientX != null ) {
- var doc = document.documentElement, body = document.body;
- event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
- event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
- }
-
- // Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
- event.which = event.charCode || event.keyCode;
-
- // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
- if ( !event.metaKey && event.ctrlKey )
- event.metaKey = event.ctrlKey;
-
- // Add which for click: 1 == left; 2 == middle; 3 == right
- // Note: button is not normalized, so don't use it
- if ( !event.which && event.button )
- event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-
- return event;
- },
-
- proxy: function( fn, proxy ){
- proxy = proxy || function(){ return fn.apply(this, arguments); };
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
- // So proxy can be declared as an argument
- return proxy;
- },
-
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: bindReady,
- teardown: function() {}
- }
- },
-
- specialAll: {
- live: {
- setup: function( selector, namespaces ){
- jQuery.event.add( this, namespaces[0], liveHandler );
- },
- teardown: function( namespaces ){
- if ( namespaces.length ) {
- var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
-
- jQuery.each( (jQuery.data(this, "events").live || {}), function(){
- if ( name.test(this.type) )
- remove++;
- });
-
- if ( remove < 1 )
- jQuery.event.remove( this, namespaces[0], liveHandler );
- }
- }
- }
- }
-};
-
-jQuery.Event = function( src ){
- // Allow instantiation without the 'new' keyword
- if( !this.preventDefault )
- return new jQuery.Event(src);
-
- // Event object
- if( src && src.type ){
- this.originalEvent = src;
- this.type = src.type;
- // Event type
- }else
- this.type = src;
-
- // timeStamp is buggy for some events on Firefox(#3843)
- // So we won't rely on the native value
- this.timeStamp = now();
-
- // Mark it as fixed
- this[expando] = true;
-};
-
-function returnFalse(){
- return false;
-}
-function returnTrue(){
- return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if( !e )
- return;
- // if preventDefault exists run it on the original event
- if (e.preventDefault)
- e.preventDefault();
- // otherwise set the returnValue property of the original event to false (IE)
- e.returnValue = false;
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if( !e )
- return;
- // if stopPropagation exists run it on the original event
- if (e.stopPropagation)
- e.stopPropagation();
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation:function(){
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-// Checks if an event happened on an element within another element
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function(event) {
- // Check if mouse(over|out) are still within the same parent element
- var parent = event.relatedTarget;
- // Traverse up the tree
- while ( parent && parent != this )
- try { parent = parent.parentNode; }
- catch(e) { parent = this; }
-
- if( parent != this ){
- // set the correct event type
- event.type = event.data;
- // handle event if we actually just moused on to a non sub-element
- jQuery.event.handle.apply( this, arguments );
- }
-};
-
-jQuery.each({
- mouseover: 'mouseenter',
- mouseout: 'mouseleave'
-}, function( orig, fix ){
- jQuery.event.special[ fix ] = {
- setup: function(){
- jQuery.event.add( this, orig, withinElement, fix );
- },
- teardown: function(){
- jQuery.event.remove( this, orig, withinElement );
- }
- };
-});
-
-jQuery.fn.extend({
- bind: function( type, data, fn ) {
- return type == "unload" ? this.one(type, data, fn) : this.each(function(){
- jQuery.event.add( this, type, fn || data, fn && data );
- });
- },
-
- one: function( type, data, fn ) {
- var one = jQuery.event.proxy( fn || data, function(event) {
- jQuery(this).unbind(event, one);
- return (fn || data).apply( this, arguments );
- });
- return this.each(function(){
- jQuery.event.add( this, type, one, fn && data);
- });
- },
-
- unbind: function( type, fn ) {
- return this.each(function(){
- jQuery.event.remove( this, type, fn );
- });
- },
-
- trigger: function( type, data ) {
- return this.each(function(){
- jQuery.event.trigger( type, data, this );
- });
- },
-
- triggerHandler: function( type, data ) {
- if( this[0] ){
- var event = jQuery.Event(type);
- event.preventDefault();
- event.stopPropagation();
- jQuery.event.trigger( event, data, this[0] );
- return event.result;
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments, i = 1;
-
- // link all the functions, so any of them can unbind this click handler
- while( i < args.length )
- jQuery.event.proxy( fn, args[i++] );
-
- return this.click( jQuery.event.proxy( fn, function(event) {
- // Figure out which function to execute
- this.lastToggle = ( this.lastToggle || 0 ) % i;
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ this.lastToggle++ ].apply( this, arguments ) || false;
- }));
- },
-
- hover: function(fnOver, fnOut) {
- return this.mouseenter(fnOver).mouseleave(fnOut);
- },
-
- ready: function(fn) {
- // Attach the listeners
- bindReady();
-
- // If the DOM is already ready
- if ( jQuery.isReady )
- // Execute the function immediately
- fn.call( document, jQuery );
-
- // Otherwise, remember the function for later
- else
- // Add the function to the wait list
- jQuery.readyList.push( fn );
-
- return this;
- },
-
- live: function( type, fn ){
- var proxy = jQuery.event.proxy( fn );
- proxy.guid += this.selector + type;
-
- jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
-
- return this;
- },
-
- die: function( type, fn ){
- jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
- return this;
- }
-});
-
-function liveHandler( event ){
- var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
- stop = true,
- elems = [];
-
- jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
- if ( check.test(fn.type) ) {
- var elem = jQuery(event.target).closest(fn.data)[0];
- if ( elem )
- elems.push({ elem: elem, fn: fn });
- }
- });
-
- elems.sort(function(a,b) {
- return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
- });
-
- jQuery.each(elems, function(){
- if ( this.fn.call(this.elem, event, this.fn.data) === false )
- return (stop = false);
- });
-
- return stop;
-}
-
-function liveConvert(type, selector){
- return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
-}
-
-jQuery.extend({
- isReady: false,
- readyList: [],
- // Handle when the DOM is ready
- ready: function() {
- // Make sure that the DOM is not already loaded
- if ( !jQuery.isReady ) {
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If there are functions bound, to execute
- if ( jQuery.readyList ) {
- // Execute all of them
- jQuery.each( jQuery.readyList, function(){
- this.call( document, jQuery );
- });
-
- // Reset the list of functions
- jQuery.readyList = null;
- }
-
- // Trigger any bound ready events
- jQuery(document).triggerHandler("ready");
- }
- }
-});
-
-var readyBound = false;
-
-function bindReady(){
- if ( readyBound ) return;
- readyBound = true;
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", function(){
- document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
- jQuery.ready();
- }, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent("onreadystatechange", function(){
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", arguments.callee );
- jQuery.ready();
- }
- });
-
- // If IE and not an iframe
- // continually check to see if the document is ready
- if ( document.documentElement.doScroll && window == window.top ) (function(){
- if ( jQuery.isReady ) return;
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch( error ) {
- setTimeout( arguments.callee, 0 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
- })();
- }
-
- // A fallback to window.onload, that will always work
- jQuery.event.add( window, "load", jQuery.ready );
-}
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
- "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
- "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
-
- // Handle event binding
- jQuery.fn[name] = function(fn){
- return fn ? this.bind(name, fn) : this.trigger(name);
- };
-});
-
-// Prevent memory leaks in IE
-// And prevent errors on refresh with events like mouseover in other browsers
-// Window isn't included so as not to unbind existing unload events
-jQuery( window ).bind( 'unload', function(){
- for ( var id in jQuery.cache )
- // Skip the window
- if ( id != 1 && jQuery.cache[ id ].handle )
- jQuery.event.remove( jQuery.cache[ id ].handle.elem );
-});
-(function(){
-
- jQuery.support = {};
-
- var root = document.documentElement,
- script = document.createElement("script"),
- div = document.createElement("div"),
- id = "script" + (new Date).getTime();
-
- div.style.display = "none";
- div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
-
- var all = div.getElementsByTagName("*"),
- a = div.getElementsByTagName("a")[0];
-
- // Can't get basic test support
- if ( !all || !all.length || !a ) {
- return;
- }
-
- jQuery.support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: div.firstChild.nodeType == 3,
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that you can get all elements in an <object> element
- // IE 7 always returns no results
- objectAll: !!div.getElementsByTagName("object")[0]
- .getElementsByTagName("*").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText insted)
- style: /red/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: a.getAttribute("href") === "/a",
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- opacity: a.style.opacity === "0.5",
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Will be defined later
- scriptEval: false,
- noCloneEvent: true,
- boxModel: null
- };
-
- script.type = "text/javascript";
- try {
- script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
- } catch(e){}
-
- root.insertBefore( script, root.firstChild );
-
- // Make sure that the execution of code works by injecting a script
- // tag with appendChild/createTextNode
- // (IE doesn't support this, fails, and uses .text instead)
- if ( window[ id ] ) {
- jQuery.support.scriptEval = true;
- delete window[ id ];
- }
-
- root.removeChild( script );
-
- if ( div.attachEvent && div.fireEvent ) {
- div.attachEvent("onclick", function(){
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- jQuery.support.noCloneEvent = false;
- div.detachEvent("onclick", arguments.callee);
- });
- div.cloneNode(true).fireEvent("onclick");
- }
-
- // Figure out if the W3C box model works as expected
- // document.body must exist before we can do this
- jQuery(function(){
- var div = document.createElement("div");
- div.style.width = div.style.paddingLeft = "1px";
-
- document.body.appendChild( div );
- jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
- document.body.removeChild( div ).style.display = 'none';
- });
-})();
-
-var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
-
-jQuery.props = {
- "for": "htmlFor",
- "class": "className",
- "float": styleFloat,
- cssFloat: styleFloat,
- styleFloat: styleFloat,
- readonly: "readOnly",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- rowspan: "rowSpan",
- tabindex: "tabIndex"
-};
-jQuery.fn.extend({
- // Keep a copy of the old load
- _load: jQuery.fn.load,
-
- load: function( url, params, callback ) {
- if ( typeof url !== "string" )
- return this._load( url );
-
- var off = url.indexOf(" ");
- if ( off >= 0 ) {
- var selector = url.slice(off, url.length);
- url = url.slice(0, off);
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params )
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = null;
-
- // Otherwise, build a param string
- } else if( typeof params === "object" ) {
- params = jQuery.param( params );
- type = "POST";
- }
-
- var self = this;
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- complete: function(res, status){
- // If successful, inject the HTML into all the matched elements
- if ( status == "success" || status == "notmodified" )
- // See if a selector was specified
- self.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div/>")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- res.responseText );
-
- if( callback )
- self.each( callback, [res.responseText, status, res] );
- }
- });
- return this;
- },
-
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
- serializeArray: function() {
- return this.map(function(){
- return this.elements ? jQuery.makeArray(this.elements) : this;
- })
- .filter(function(){
- return this.name && !this.disabled &&
- (this.checked || /select|textarea/i.test(this.nodeName) ||
- /text|hidden|password|search/i.test(this.type));
- })
- .map(function(i, elem){
- var val = jQuery(this).val();
- return val == null ? null :
- jQuery.isArray(val) ?
- jQuery.map( val, function(val, i){
- return {name: elem.name, value: val};
- }) :
- {name: elem.name, value: val};
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
- jQuery.fn[o] = function(f){
- return this.bind(o, f);
- };
-});
-
-var jsc = now();
-
-jQuery.extend({
-
- get: function( url, data, callback, type ) {
- // shift arguments if data argument was ommited
- if ( jQuery.isFunction( data ) ) {
- callback = data;
- data = null;
- }
-
- return jQuery.ajax({
- type: "GET",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- getScript: function( url, callback ) {
- return jQuery.get(url, null, callback, "script");
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get(url, data, callback, "json");
- },
-
- post: function( url, data, callback, type ) {
- if ( jQuery.isFunction( data ) ) {
- callback = data;
- data = {};
- }
-
- return jQuery.ajax({
- type: "POST",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- ajaxSetup: function( settings ) {
- jQuery.extend( jQuery.ajaxSettings, settings );
- },
-
- ajaxSettings: {
- url: location.href,
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- username: null,
- password: null,
- */
- // Create the request object; Microsoft failed to properly
- // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
- // This function can be overriden by calling jQuery.ajaxSetup
- xhr:function(){
- return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
- },
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- script: "text/javascript, application/javascript",
- json: "application/json, text/javascript",
- text: "text/plain",
- _default: "*/*"
- }
- },
-
- // Last-Modified header cache for next request
- lastModified: {},
-
- ajax: function( s ) {
- // Extend the settings, but re-extend 's' so that it can be
- // checked again later (in the test suite, specifically)
- s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
- var jsonp, jsre = /=\?(&|$)/g, status, data,
- type = s.type.toUpperCase();
-
- // convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" )
- s.data = jQuery.param(s.data);
-
- // Handle JSONP Parameter Callbacks
- if ( s.dataType == "jsonp" ) {
- if ( type == "GET" ) {
- if ( !s.url.match(jsre) )
- s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
- } else if ( !s.data || !s.data.match(jsre) )
- s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
- s.dataType = "json";
- }
-
- // Build temporary JSONP function
- if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
- jsonp = "jsonp" + jsc++;
-
- // Replace the =? sequence both in the query string and the data
- if ( s.data )
- s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
- s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
- // We need to make sure
- // that a JSONP style response is executed properly
- s.dataType = "script";
-
- // Handle JSONP-style loading
- window[ jsonp ] = function(tmp){
- data = tmp;
- success();
- complete();
- // Garbage collect
- window[ jsonp ] = undefined;
- try{ delete window[ jsonp ]; } catch(e){}
- if ( head )
- head.removeChild( script );
- };
- }
-
- if ( s.dataType == "script" && s.cache == null )
- s.cache = false;
-
- if ( s.cache === false && type == "GET" ) {
- var ts = now();
- // try replacing _= if it is there
- var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
- }
-
- // If data is available, append data to url for get requests
- if ( s.data && type == "GET" ) {
- s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
- // IE likes to send both get and post data, prevent this
- s.data = null;
- }
-
- // Watch for a new set of requests
- if ( s.global && ! jQuery.active++ )
- jQuery.event.trigger( "ajaxStart" );
-
- // Matches an absolute URL, and saves the domain
- var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
-
- // If we're requesting a remote document
- // and trying to load JSON or Script with a GET
- if ( s.dataType == "script" && type == "GET" && parts
- && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
-
- var head = document.getElementsByTagName("head")[0];
- var script = document.createElement("script");
- script.src = s.url;
- if (s.scriptCharset)
- script.charset = s.scriptCharset;
-
- // Handle Script loading
- if ( !jsonp ) {
- var done = false;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function(){
- if ( !done && (!this.readyState ||
- this.readyState == "loaded" || this.readyState == "complete") ) {
- done = true;
- success();
- complete();
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
- head.removeChild( script );
- }
- };
- }
-
- head.appendChild(script);
-
- // We handle everything using the script element injection
- return undefined;
- }
-
- var requestDone = false;
-
- // Create the request object
- var xhr = s.xhr();
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if( s.username )
- xhr.open(type, s.url, s.async, s.username, s.password);
- else
- xhr.open(type, s.url, s.async);
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- // Set the correct header, if data is being sent
- if ( s.data )
- xhr.setRequestHeader("Content-Type", s.contentType);
-
- // Set the If-Modified-Since header, if ifModified mode.
- if ( s.ifModified )
- xhr.setRequestHeader("If-Modified-Since",
- jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
- // Set header so the called script knows that it's an XMLHttpRequest
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
- // Set the Accepts header for the server, depending on the dataType
- xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
- s.accepts[ s.dataType ] + ", */*" :
- s.accepts._default );
- } catch(e){}
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
- // close opended socket
- xhr.abort();
- return false;
- }
-
- if ( s.global )
- jQuery.event.trigger("ajaxSend", [xhr, s]);
-
- // Wait for a response to come back
- var onreadystatechange = function(isTimeout){
- // The request was aborted, clear the interval and decrement jQuery.active
- if (xhr.readyState == 0) {
- if (ival) {
- // clear poll interval
- clearInterval(ival);
- ival = null;
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
- }
- // The transfer is complete and the data is available, or the request timed out
- } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
- requestDone = true;
-
- // clear poll interval
- if (ival) {
- clearInterval(ival);
- ival = null;
- }
-
- status = isTimeout == "timeout" ? "timeout" :
- !jQuery.httpSuccess( xhr ) ? "error" :
- s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
- "success";
-
- if ( status == "success" ) {
- // Watch for, and catch, XML document parse errors
- try {
- // process the data (runs the xml through httpData regardless of callback)
- data = jQuery.httpData( xhr, s.dataType, s );
- } catch(e) {
- status = "parsererror";
- }
- }
-
- // Make sure that the request was successful or notmodified
- if ( status == "success" ) {
- // Cache Last-Modified header, if ifModified mode.
- var modRes;
- try {
- modRes = xhr.getResponseHeader("Last-Modified");
- } catch(e) {} // swallow exception thrown by FF if header is not available
-
- if ( s.ifModified && modRes )
- jQuery.lastModified[s.url] = modRes;
-
- // JSONP handles its own success callback
- if ( !jsonp )
- success();
- } else
- jQuery.handleError(s, xhr, status);
-
- // Fire the complete handlers
- complete();
-
- if ( isTimeout )
- xhr.abort();
-
- // Stop memory leaks
- if ( s.async )
- xhr = null;
- }
- };
-
- if ( s.async ) {
- // don't attach the handler to the request, just poll it instead
- var ival = setInterval(onreadystatechange, 13);
-
- // Timeout checker
- if ( s.timeout > 0 )
- setTimeout(function(){
- // Check to see if the request is still happening
- if ( xhr && !requestDone )
- onreadystatechange( "timeout" );
- }, s.timeout);
- }
-
- // Send the data
- try {
- xhr.send(s.data);
- } catch(e) {
- jQuery.handleError(s, xhr, null, e);
- }
-
- // firefox 1.5 doesn't fire statechange for sync requests
- if ( !s.async )
- onreadystatechange();
-
- function success(){
- // If a local callback was specified, fire it and pass it the data
- if ( s.success )
- s.success( data, status );
-
- // Fire the global callback
- if ( s.global )
- jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
- }
-
- function complete(){
- // Process result
- if ( s.complete )
- s.complete(xhr, status);
-
- // The request was completed
- if ( s.global )
- jQuery.event.trigger( "ajaxComplete", [xhr, s] );
-
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
- }
-
- // return XMLHttpRequest to allow aborting the request etc.
- return xhr;
- },
-
- handleError: function( s, xhr, status, e ) {
- // If a local callback was specified, fire it
- if ( s.error ) s.error( xhr, status, e );
-
- // Fire the global callback
- if ( s.global )
- jQuery.event.trigger( "ajaxError", [xhr, s, e] );
- },
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Determines if an XMLHttpRequest was successful or not
- httpSuccess: function( xhr ) {
- try {
- // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
- return !xhr.status && location.protocol == "file:" ||
- ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
- } catch(e){}
- return false;
- },
-
- // Determines if an XMLHttpRequest returns NotModified
- httpNotModified: function( xhr, url ) {
- try {
- var xhrRes = xhr.getResponseHeader("Last-Modified");
-
- // Firefox always returns 200. check Last-Modified date
- return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
- } catch(e){}
- return false;
- },
-
- httpData: function( xhr, type, s ) {
- var ct = xhr.getResponseHeader("content-type"),
- xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
- data = xml ? xhr.responseXML : xhr.responseText;
-
- if ( xml && data.documentElement.tagName == "parsererror" )
- throw "parsererror";
-
- // Allow a pre-filtering function to sanitize the response
- // s != null is checked to keep backwards compatibility
- if( s && s.dataFilter )
- data = s.dataFilter( data, type );
-
- // The filter can actually parse the response
- if( typeof data === "string" ){
-
- // If the type is "script", eval it in global context
- if ( type == "script" )
- jQuery.globalEval( data );
-
- // Get the JavaScript object, if JSON is used.
- if ( type == "json" )
- data = window["eval"]("(" + data + ")");
- }
-
- return data;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a ) {
- var s = [ ];
-
- function add( key, value ){
- s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
- };
-
- // If an array was passed in, assume that it is an array
- // of form elements
- if ( jQuery.isArray(a) || a.jquery )
- // Serialize the form elements
- jQuery.each( a, function(){
- add( this.name, this.value );
- });
-
- // Otherwise, assume that it's an object of key/value pairs
- else
- // Serialize the key/values
- for ( var j in a )
- // If the value is an array then the key names need to be repeated
- if ( jQuery.isArray(a[j]) )
- jQuery.each( a[j], function(){
- add( j, this );
- });
- else
- add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
-
- // Return the resulting serialization
- return s.join("&").replace(/%20/g, "+");
- }
-
-});
-var elemdisplay = {},
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ];
-
-function genFx( type, num ){
- var obj = {};
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
- obj[ this ] = type;
- });
- return obj;
-}
-
-jQuery.fn.extend({
- show: function(speed,callback){
- if ( speed ) {
- return this.animate( genFx("show", 3), speed, callback);
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ){
- var old = jQuery.data(this[i], "olddisplay");
-
- this[i].style.display = old || "";
-
- if ( jQuery.css(this[i], "display") === "none" ) {
- var tagName = this[i].tagName, display;
-
- if ( elemdisplay[ tagName ] ) {
- display = elemdisplay[ tagName ];
- } else {
- var elem = jQuery("<" + tagName + " />").appendTo("body");
-
- display = elem.css("display");
- if ( display === "none" )
- display = "block";
-
- elem.remove();
-
- elemdisplay[ tagName ] = display;
- }
-
- jQuery.data(this[i], "olddisplay", display);
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var i = 0, l = this.length; i < l; i++ ){
- this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
- }
-
- return this;
- }
- },
-
- hide: function(speed,callback){
- if ( speed ) {
- return this.animate( genFx("hide", 3), speed, callback);
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ){
- var old = jQuery.data(this[i], "olddisplay");
- if ( !old && old !== "none" )
- jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var i = 0, l = this.length; i < l; i++ ){
- this[i].style.display = "none";
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2 ){
- var bool = typeof fn === "boolean";
-
- return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
- this._toggle.apply( this, arguments ) :
- fn == null || bool ?
- this.each(function(){
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- }) :
- this.animate(genFx("toggle", 3), fn, fn2);
- },
-
- fadeTo: function(speed,to,callback){
- return this.animate({opacity: to}, speed, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed(speed, easing, callback);
-
- return this[ optall.queue === false ? "each" : "queue" ](function(){
-
- var opt = jQuery.extend({}, optall), p,
- hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
- self = this;
-
- for ( p in prop ) {
- if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
- return opt.complete.call(this);
-
- if ( ( p == "height" || p == "width" ) && this.style ) {
- // Store display property
- opt.display = jQuery.css(this, "display");
-
- // Make sure that nothing sneaks out
- opt.overflow = this.style.overflow;
- }
- }
-
- if ( opt.overflow != null )
- this.style.overflow = "hidden";
-
- opt.curAnim = jQuery.extend({}, prop);
-
- jQuery.each( prop, function(name, val){
- var e = new jQuery.fx( self, opt, name );
-
- if ( /toggle|show|hide/.test(val) )
- e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
- else {
- var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
- start = e.cur(true) || 0;
-
- if ( parts ) {
- var end = parseFloat(parts[2]),
- unit = parts[3] || "px";
-
- // We need to compute starting value
- if ( unit != "px" ) {
- self.style[ name ] = (end || 1) + unit;
- start = ((end || 1) / e.cur(true)) * start;
- self.style[ name ] = start + unit;
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] )
- end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
- e.custom( start, end, unit );
- } else
- e.custom( start, val, "" );
- }
- });
-
- // For JS strict compliance
- return true;
- });
- },
-
- stop: function(clearQueue, gotoEnd){
- var timers = jQuery.timers;
-
- if (clearQueue)
- this.queue([]);
-
- this.each(function(){
- // go in reverse order so anything added to the queue during the loop is ignored
- for ( var i = timers.length - 1; i >= 0; i-- )
- if ( timers[i].elem == this ) {
- if (gotoEnd)
- // force the next step to be the last
- timers[i](true);
- timers.splice(i, 1);
- }
- });
-
- // start the next in the queue if the last step wasn't forced
- if (!gotoEnd)
- this.dequeue();
-
- return this;
- }
-
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show", 1),
- slideUp: genFx("hide", 1),
- slideToggle: genFx("toggle", 1),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" }
-}, function( name, props ){
- jQuery.fn[ name ] = function( speed, callback ){
- return this.animate( props, speed, callback );
- };
-});
-
-jQuery.extend({
-
- speed: function(speed, easing, fn) {
- var opt = typeof speed === "object" ? speed : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
-
- // Queueing
- opt.old = opt.complete;
- opt.complete = function(){
- if ( opt.queue !== false )
- jQuery(this).dequeue();
- if ( jQuery.isFunction( opt.old ) )
- opt.old.call( this );
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p, n, firstNum, diff ) {
- return firstNum + diff * p;
- },
- swing: function( p, n, firstNum, diff ) {
- return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ){
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- if ( !options.orig )
- options.orig = {};
- }
-
-});
-
-jQuery.fx.prototype = {
-
- // Simple function for setting a style value
- update: function(){
- if ( this.options.step )
- this.options.step.call( this.elem, this.now, this );
-
- (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
- // Set display property to block for height/width animations
- if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
- this.elem.style.display = "block";
- },
-
- // Get the current size
- cur: function(force){
- if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
- return this.elem[ this.prop ];
-
- var r = parseFloat(jQuery.css(this.elem, this.prop, force));
- return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
- },
-
- // Start an animation from one number to another
- custom: function(from, to, unit){
- this.startTime = now();
- this.start = from;
- this.end = to;
- this.unit = unit || this.unit || "px";
- this.now = this.start;
- this.pos = this.state = 0;
-
- var self = this;
- function t(gotoEnd){
- return self.step(gotoEnd);
- }
-
- t.elem = this.elem;
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval(function(){
- var timers = jQuery.timers;
-
- for ( var i = 0; i < timers.length; i++ )
- if ( !timers[i]() )
- timers.splice(i--, 1);
-
- if ( !timers.length ) {
- clearInterval( timerId );
- timerId = undefined;
- }
- }, 13);
- }
- },
-
- // Simple 'show' function
- show: function(){
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any
- // flash of content
- this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
-
- // Start by showing the element
- jQuery(this.elem).show();
- },
-
- // Simple 'hide' function
- hide: function(){
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom(this.cur(), 0);
- },
-
- // Each step of an animation
- step: function(gotoEnd){
- var t = now();
-
- if ( gotoEnd || t >= this.options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- this.options.curAnim[ this.prop ] = true;
-
- var done = true;
- for ( var i in this.options.curAnim )
- if ( this.options.curAnim[i] !== true )
- done = false;
-
- if ( done ) {
- if ( this.options.display != null ) {
- // Reset the overflow
- this.elem.style.overflow = this.options.overflow;
-
- // Reset the display
- this.elem.style.display = this.options.display;
- if ( jQuery.css(this.elem, "display") == "none" )
- this.elem.style.display = "block";
- }
-
- // Hide the element if the "hide" operation was done
- if ( this.options.hide )
- jQuery(this.elem).hide();
-
- // Reset the properties, if the item has been hidden or shown
- if ( this.options.hide || this.options.show )
- for ( var p in this.options.curAnim )
- jQuery.attr(this.elem.style, p, this.options.orig[p]);
-
- // Execute the complete function
- this.options.complete.call( this.elem );
- }
-
- return false;
- } else {
- var n = t - this.startTime;
- this.state = n / this.options.duration;
-
- // Perform the easing function, defaults to swing
- this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
- this.now = this.start + ((this.end - this.start) * this.pos);
-
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-
-};
-
-jQuery.extend( jQuery.fx, {
- speeds:{
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
- step: {
-
- opacity: function(fx){
- jQuery.attr(fx.elem.style, "opacity", fx.now);
- },
-
- _default: function(fx){
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
- else
- fx.elem[ fx.prop ] = fx.now;
- }
- }
-});
-if ( document.documentElement["getBoundingClientRect"] )
- jQuery.fn.offset = function() {
- if ( !this[0] ) return { top: 0, left: 0 };
- if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
- var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
- clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
- top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
- left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
- return { top: top, left: left };
- };
-else
- jQuery.fn.offset = function() {
- if ( !this[0] ) return { top: 0, left: 0 };
- if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
- jQuery.offset.initialized || jQuery.offset.initialize();
-
- var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
- doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
- body = doc.body, defaultView = doc.defaultView,
- prevComputedStyle = defaultView.getComputedStyle(elem, null),
- top = elem.offsetTop, left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- computedStyle = defaultView.getComputedStyle(elem, null);
- top -= elem.scrollTop, left -= elem.scrollLeft;
- if ( elem === offsetParent ) {
- top += elem.offsetTop, left += elem.offsetLeft;
- if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
- top += parseInt( computedStyle.borderTopWidth, 10) || 0,
- left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
- prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
- }
- if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
- top += parseInt( computedStyle.borderTopWidth, 10) || 0,
- left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
- top += body.offsetTop,
- left += body.offsetLeft;
-
- if ( prevComputedStyle.position === "fixed" )
- top += Math.max(docElem.scrollTop, body.scrollTop),
- left += Math.max(docElem.scrollLeft, body.scrollLeft);
-
- return { top: top, left: left };
- };
-
-jQuery.offset = {
- initialize: function() {
- if ( this.initialized ) return;
- var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
- html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
-
- rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
- for ( prop in rules ) container.style[prop] = rules[prop];
-
- container.innerHTML = html;
- body.insertBefore(container, body.firstChild);
- innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
-
- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
- innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
- body.style.marginTop = '1px';
- this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
- body.style.marginTop = bodyMarginTop;
-
- body.removeChild(container);
- this.initialized = true;
- },
-
- bodyOffset: function(body) {
- jQuery.offset.initialized || jQuery.offset.initialize();
- var top = body.offsetTop, left = body.offsetLeft;
- if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
- top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0,
- left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
- return { top: top, left: left };
- }
-};
-
-
-jQuery.fn.extend({
- position: function() {
- var left = 0, top = 0, results;
-
- if ( this[0] ) {
- // Get *real* offsetParent
- var offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= num( this, 'marginTop' );
- offset.left -= num( this, 'marginLeft' );
-
- // Add offsetParent borders
- parentOffset.top += num( offsetParent, 'borderTopWidth' );
- parentOffset.left += num( offsetParent, 'borderLeftWidth' );
-
- // Subtract the two offsets
- results = {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- }
-
- return results;
- },
-
- offsetParent: function() {
- var offsetParent = this[0].offsetParent || document.body;
- while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
- offsetParent = offsetParent.offsetParent;
- return jQuery(offsetParent);
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( ['Left', 'Top'], function(i, name) {
- var method = 'scroll' + name;
-
- jQuery.fn[ method ] = function(val) {
- if (!this[0]) return null;
-
- return val !== undefined ?
-
- // Set the scroll offset
- this.each(function() {
- this == window || this == document ?
- window.scrollTo(
- !i ? val : jQuery(window).scrollLeft(),
- i ? val : jQuery(window).scrollTop()
- ) :
- this[ method ] = val;
- }) :
-
- // Return the scroll offset
- this[0] == window || this[0] == document ?
- self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
- jQuery.boxModel && document.documentElement[ method ] ||
- document.body[ method ] :
- this[0][ method ];
- };
-});
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function(i, name){
-
- var tl = i ? "Left" : "Top", // top or left
- br = i ? "Right" : "Bottom", // bottom or right
- lower = name.toLowerCase();
-
- // innerHeight and innerWidth
- jQuery.fn["inner" + name] = function(){
- return this[0] ?
- jQuery.css( this[0], lower, false, "padding" ) :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn["outer" + name] = function(margin) {
- return this[0] ?
- jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) :
- null;
- };
-
- var type = name.toLowerCase();
-
- jQuery.fn[ type ] = function( size ) {
- // Get window width or height
- return this[0] == window ?
- // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
- document.body[ "client" + name ] :
-
- // Get document width or height
- this[0] == document ?
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- Math.max(
- document.documentElement["client" + name],
- document.body["scroll" + name], document.documentElement["scroll" + name],
- document.body["offset" + name], document.documentElement["offset" + name]
- ) :
-
- // Get or set width or height on the element
- size === undefined ?
- // Get width or height on the element
- (this.length ? jQuery.css( this[0], type ) : null) :
-
- // Set the width or height on the element (default to pixels if value is unitless)
- this.css( type, typeof size === "string" ? size : size + "px" );
- };
-
-});
-})();
diff --git a/content/js/jquery-ui-1.js b/content/js/jquery-ui-1.js
deleted file mode 100755
index cf19f30..0000000
--- a/content/js/jquery-ui-1.js
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
- * jQuery UI Draggable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/*
- * jQuery UI Droppable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- */
-(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/*
- * jQuery UI Resizable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/*
- * jQuery UI Selectable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.2",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);;/*
- * jQuery UI Sortable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/*
- * jQuery UI Accordion 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/*
- * jQuery UI Dialog 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||"&nbsp;",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||"&nbsp;");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/*
- * jQuery UI Slider 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/*
- * jQuery UI Tabs 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/*
- * jQuery UI Datepicker 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * ui.core.js
- */
-(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?"&#xa0;":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/*
- * jQuery UI Progressbar 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Progressbar
- *
- * Depends:
- * ui.core.js
- */
-(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/*
- * jQuery UI Effects 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/
- */
-jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/*
- * jQuery UI Effects Blind 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/*
- * jQuery UI Effects Bounce 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Clip 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Drop 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Explode 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"),10)||0;l.left-=parseInt(h.css("marginLeft"),10)||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/*
- * jQuery UI Effects Fold 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/*
- * jQuery UI Effects Highlight 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Pulsate 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Scale 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Shake 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Slide 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Transfer 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * effects.core.js
- */
-(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file
diff --git a/content/js/jquery-ui.all.js b/content/js/jquery-ui.all.js
deleted file mode 100755
index 7ef2f75..0000000
--- a/content/js/jquery-ui.all.js
+++ /dev/null
@@ -1,7531 +0,0 @@
-/*
- * jQuery UI 1.5.1
- *
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;(function($) {
-
-$.ui = {
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
- cssCache: {},
- css: function(name) {
- if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
- var tmp = $('<div class="ui-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
-
- //if (!$.browser.safari)
- //tmp.appendTo('body');
-
- //Opera and Safari set width and height to 0px instead of auto
- //Safari returns rgba(0,0,0,0) when bgcolor is not set
- $.ui.cssCache[name] = !!(
- (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
- !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
- );
- try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){}
- return $.ui.cssCache[name];
- },
- disableSelection: function(e) {
- e.unselectable = "on";
- e.onselectstart = function() { return false; };
- if (e.style) { e.style.MozUserSelect = "none"; }
- },
- enableSelection: function(e) {
- e.unselectable = "off";
- e.onselectstart = function() { return true; };
- if (e.style) { e.style.MozUserSelect = ""; }
- },
- hasScroll: function(e, a) {
- var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
- if (e[scroll] > 0) return true; e[scroll] = 1;
- has = e[scroll] > 0 ? true : false; e[scroll] = 0;
- return has;
- }
-};
-
-
-/** jQuery core modifications and additions **/
-
-var _remove = $.fn.remove;
-$.fn.remove = function() {
- $("*", this).add(this).trigger("remove");
- return _remove.apply(this, arguments );
-};
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-// created by Scott González and Jörn Zaefferer
-function getter(namespace, plugin, method) {
- var methods = $[namespace][plugin].getter || [];
- methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- if (isMethodCall && getter(namespace, name, options)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- return this.each(function() {
- var instance = $.data(this, name);
- if (isMethodCall && instance && $.isFunction(instance[options])) {
- instance[options].apply(instance, args);
- } else if (!isMethodCall) {
- $.data(this, name, new $[namespace][name](this, options));
- }
- });
- };
-
- // create widget constructor
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.widgetName = name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
- this.element = $(element)
- .bind('setData.' + name, function(e, key, value) {
- return self.setData(key, value);
- })
- .bind('getData.' + name, function(e, key) {
- return self.getData(key);
- })
- .bind('remove', function() {
- return self.destroy();
- });
- this.init();
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-};
-
-$.widget.prototype = {
- init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName);
- },
-
- getData: function(key) {
- return this.options[key];
- },
- setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element[value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled');
- }
- },
-
- enable: function() {
- this.setData('disabled', false);
- },
- disable: function() {
- this.setData('disabled', true);
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- mouseInit: function() {
- var self = this;
-
- this.element.bind('mousedown.'+this.widgetName, function(e) {
- return self.mouseDown(e);
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- mouseDown: function(e) {
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this.mouseUp(e));
-
- this._mouseDownEvent = e;
-
- var self = this,
- btnIsLeft = (e.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
- if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
- return true;
- }
-
- this._mouseDelayMet = !this.options.delay;
- if (!this._mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self._mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
- this._mouseStarted = (this.mouseStart(e) !== false);
- if (!this._mouseStarted) {
- e.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(e) {
- return self.mouseMove(e);
- };
- this._mouseUpDelegate = function(e) {
- return self.mouseUp(e);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- return false;
- },
-
- mouseMove: function(e) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !e.button) {
- return this.mouseUp(e);
- }
-
- if (this._mouseStarted) {
- this.mouseDrag(e);
- return false;
- }
-
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
- this._mouseStarted =
- (this.mouseStart(this._mouseDownEvent, e) !== false);
- (this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e));
- }
-
- return !this._mouseStarted;
- },
-
- mouseUp: function(e) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this.mouseStop(e);
- }
-
- return false;
- },
-
- mouseDistanceMet: function(e) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - e.pageX),
- Math.abs(this._mouseDownEvent.pageY - e.pageY)
- ) >= this.options.distance
- );
- },
-
- mouseDelayMet: function(e) {
- return this._mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- mouseStart: function(e) {},
- mouseDrag: function(e) {},
- mouseStop: function(e) {},
- mouseCapture: function(e) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
-/*
- * jQuery UI Draggable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.draggable", $.extend($.ui.mouse, {
- init: function() {
-
- //Initialize needed constants
- var o = this.options;
-
- //Position the node
- if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
- this.element.css('position', 'relative');
-
- this.element.addClass('ui-draggable');
- (o.disabled && this.element.addClass('ui-draggable-disabled'));
-
- this.mouseInit();
-
- },
- mouseStart: function(e) {
- var o = this.options;
-
- if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false;
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
-
-
- $(this.options.handle, this.element).find("*").andSelf().each(function() {
- if(this == e.target) handle = true;
- });
- if (!handle) return false;
-
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
-
- //Create and append the visible helper
- this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element);
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
- if(this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) this.helper.css("position", "absolute");
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- this.margins = { //Cache the margins
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
-
- this.cssPosition = this.helper.css("position"); //Store the helper's css position
- this.offset = this.element.offset(); //The element's absolute position on the page
- this.offset = { //Substract the margins from the element's absolute offset
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- this.offset.click = { //Where the click happened, relative to the element
- left: e.pageX - this.offset.left,
- top: e.pageY - this.offset.top
- };
-
- this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position
- if(this.offsetParent[0] == document.body && $.browser.mozilla) po = { top: 0, left: 0 }; //Ugly FF3 fix
- this.offset.parent = { //Store its position plus border
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- var p = this.element.position(); //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helpers
- this.offset.relative = this.cssPosition == "relative" ? {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.offsetParent[0].scrollTop,
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.offsetParent[0].scrollLeft
- } : { top: 0, left: 0 };
-
- this.originalPosition = this.generatePosition(e); //Generate the original position
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
-
- if(o.cursorAt) {
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left + this.margins.left;
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right + this.margins.left;
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top + this.margins.top;
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom + this.margins.top;
- }
-
-
- /*
- * - Position constraining -
- * Here we prepare position constraining like grid and containment.
- */
-
- if(o.containment) {
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top,
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
- }
- }
-
- //Call plugins and callbacks
- this.propagate("start", e);
-
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
-
- this.helper.addClass("ui-draggable-dragging");
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
- convertPositionTo: function(d, pos) {
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- return {
- top: (
- pos.top // the calculated relative position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed
- + (this.cssPosition == "fixed" ? $(document).scrollTop() : 0) * mod
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
- ),
- left: (
- pos.left // the calculated relative position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed
- + (this.cssPosition == "fixed" ? $(document).scrollLeft() : 0) * mod
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
- )
- };
- },
- generatePosition: function(e) {
-
- var o = this.options;
- var position = {
- top: (
- e.pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
- - (this.cssPosition == "fixed" ? $(document).scrollTop() : 0)
- ),
- left: (
- e.pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
- - (this.cssPosition == "fixed" ? $(document).scrollLeft() : 0)
- )
- };
-
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- if(this.containment) {
- if(position.left < this.containment[0]) position.left = this.containment[0];
- if(position.top < this.containment[1]) position.top = this.containment[1];
- if(position.left > this.containment[2]) position.left = this.containment[2];
- if(position.top > this.containment[3]) position.top = this.containment[3];
- }
-
- if(o.grid) {
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- return position;
- },
- mouseDrag: function(e) {
-
- //Compute the helpers position
- this.position = this.generatePosition(e);
- this.positionAbs = this.convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- this.position = this.propagate("drag", e) || this.position;
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
-
- return false;
- },
- mouseStop: function(e) {
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, e);
-
- if(this.options.revert) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() {
- self.propagate("stop", e);
- self.clear();
- });
- } else {
- this.propagate("stop", e);
- this.clear();
- }
-
- return false;
- },
- clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
- plugins: {},
- uiHash: function(e) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs,
- options: this.options
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.uiHash()]);
- return this.element.triggerHandler(n == "drag" ? n : "drag"+n, [e, this.uiHash()], this.options[n]);
- },
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable');
- this.mouseDestroy();
- }
-}));
-
-$.extend($.ui.draggable, {
- defaults: {
- appendTo: "parent",
- axis: false,
- cancel: ":input",
- delay: 0,
- distance: 1,
- helper: "original"
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(e, ui) {
- var t = $('body');
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
- t.css("cursor", ui.options.cursor);
- },
- stop: function(e, ui) {
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(e, ui) {
- var t = $(ui.helper);
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
- t.css('zIndex', ui.options.zIndex);
- },
- stop: function(e, ui) {
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(e, ui) {
- var t = $(ui.helper);
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
- t.css('opacity', ui.options.opacity);
- },
- stop: function(e, ui) {
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(e, ui) {
- $(ui.options.iframeFix === true ? "iframe" : ui.options.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(e, ui) {
- $("div.DragDropIframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(e, ui) {
- var o = ui.options;
- var i = $(this).data("draggable");
- o.scrollSensitivity = o.scrollSensitivity || 20;
- o.scrollSpeed = o.scrollSpeed || 20;
-
- i.overflowY = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(this);
- i.overflowX = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(this);
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
-
- },
- drag: function(e, ui) {
-
- var o = ui.options;
- var i = $(this).data("draggable");
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
-
- } else {
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
- } else {
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(e, ui) {
-
- var inst = $(this).data("draggable");
- inst.snapElements = [];
- $(ui.options.snap === true ? '.ui-draggable' : ui.options.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != inst.element[0]) inst.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(e, ui) {
-
- var inst = $(this).data("draggable");
- var d = ui.options.snapTolerance || 20;
- var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) continue;
-
- if(ui.options.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= 20;
- var bs = Math.abs(b - y1) <= 20;
- var ls = Math.abs(l - x2) <= 20;
- var rs = Math.abs(r - x1) <= 20;
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b, left: 0 }).top;
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r }).left;
- }
-
- if(ui.options.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= 20;
- var bs = Math.abs(b - y2) <= 20;
- var ls = Math.abs(l - x1) <= 20;
- var rs = Math.abs(r - x2) <= 20;
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t, left: 0 }).top;
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l }).left;
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
- }
-
- };
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(e,ui) {
-
- var inst = $(this).data("draggable");
- inst.sortables = [];
- $(ui.options.connectToSortable).each(function() {
- if($.data(this, 'sortable')) {
- var sortable = $.data(this, 'sortable');
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable.refreshItems(); //Do a one-time refresh at start to refresh the containerCache
- sortable.propagate("activate", e, inst);
- }
- });
-
- },
- stop: function(e,ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable");
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
- this.instance.isOver = 0;
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
- if(this.shouldRevert) this.instance.options.revert = true; //revert here
- this.instance.mouseStop(e);
-
- //Also propagate receive event, since the sortable is actually receiving a element
- this.instance.element.triggerHandler("sortreceive", [e, $.extend(this.instance.ui(), { sender: inst.element })], this.instance.options["receive"]);
-
- this.instance.options.helper = this.instance.options._helper;
- } else {
- this.instance.propagate("deactivate", e, inst);
- }
-
- });
-
- },
- drag: function(e,ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
-
- var l = o.left, r = l + o.width,
- t = o.top, b = t + o.height;
-
- return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r
- && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b);
- };
-
- $.each(inst.sortables, function(i) {
-
- if(checkPos.call(inst, this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
- this.instance.isOver = 1;
-
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- e.target = this.instance.currentItem[0];
- this.instance.mouseCapture(e, true);
- this.instance.mouseStart(e, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst.propagate("toSortable", e);
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance.mouseDrag(e);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
- this.instance.options.revert = false; //No revert here
- this.instance.mouseStop(e, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst.propagate("fromSortable", e);
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(e,ui) {
- var group = $.makeArray($(ui.options.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || ui.options.stack.min) - (parseInt($(b).css("zIndex"),10) || ui.options.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = ui.options.stack.min + i;
- });
-
- this[0].style.zIndex = ui.options.stack.min + group.length;
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Droppable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- */
-(function($) {
-
-$.widget("ui.droppable", {
- init: function() {
-
- this.element.addClass("ui-droppable");
- this.isover = 0; this.isout = 1;
-
- //Prepare the passed options
- var o = this.options, accept = o.accept;
- o = $.extend(o, {
- accept: o.accept && o.accept.constructor == Function ? o.accept : function(d) {
- return $(d).is(accept);
- }
- });
-
- //Store the droppable's proportions
- this.proportions = { width: this.element.outerWidth(), height: this.element.outerHeight() };
-
- // Add the reference and positions to the manager
- $.ui.ddmanager.droppables.push(this);
-
- },
- plugins: {},
- ui: function(c) {
- return {
- draggable: (c.currentItem || c.element),
- helper: c.helper,
- position: c.position,
- absolutePosition: c.positionAbs,
- options: this.options,
- element: this.element
- };
- },
- destroy: function() {
- var drop = $.ui.ddmanager.droppables;
- for ( var i = 0; i < drop.length; i++ )
- if ( drop[i] == this )
- drop.splice(i, 1);
-
- this.element
- .removeClass("ui-droppable ui-droppable-disabled")
- .removeData("droppable")
- .unbind(".droppable");
- },
- over: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'over', [e, this.ui(draggable)]);
- this.element.triggerHandler("dropover", [e, this.ui(draggable)], this.options.over);
- }
-
- },
- out: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'out', [e, this.ui(draggable)]);
- this.element.triggerHandler("dropout", [e, this.ui(draggable)], this.options.out);
- }
-
- },
- drop: function(e,custom) {
-
- var draggable = custom || $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
-
- var childrenIntersection = false;
- this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function() {
- var inst = $.data(this, 'droppable');
- if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
- childrenIntersection = true; return false;
- }
- });
- if(childrenIntersection) return false;
-
- if(this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]);
- this.element.triggerHandler("drop", [e, this.ui(draggable)], this.options.drop);
- return true;
- }
-
- return false;
-
- },
- activate: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- $.ui.plugin.call(this, 'activate', [e, this.ui(draggable)]);
- if(draggable) this.element.triggerHandler("dropactivate", [e, this.ui(draggable)], this.options.activate);
-
- },
- deactivate: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- $.ui.plugin.call(this, 'deactivate', [e, this.ui(draggable)]);
- if(draggable) this.element.triggerHandler("dropdeactivate", [e, this.ui(draggable)], this.options.deactivate);
-
- }
-});
-
-$.extend($.ui.droppable, {
- defaults: {
- disabled: false,
- tolerance: 'intersect'
- }
-});
-
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
-
- if (!droppable.offset) return false;
-
- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
- var l = droppable.offset.left, r = l + droppable.proportions.width,
- t = droppable.offset.top, b = t + droppable.proportions.height;
-
- switch (toleranceMode) {
- case 'fit':
- return (l < x1 && x2 < r
- && t < y1 && y2 < b);
- break;
- case 'intersect':
- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
- && x2 - (draggable.helperProportions.width / 2) < r // Left Half
- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
- break;
- case 'pointer':
- return (l < ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) && ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) < r
- && t < ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) && ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) < b);
- break;
- case 'touch':
- return (
- (y1 >= t && y1 <= b) || // Top edge touching
- (y2 >= t && y2 <= b) || // Bottom edge touching
- (y1 < t && y2 > b) // Surrounded vertically
- ) && (
- (x1 >= l && x1 <= r) || // Left edge touching
- (x2 >= l && x2 <= r) || // Right edge touching
- (x1 < l && x2 > r) // Surrounded horizontally
- );
- break;
- default:
- return false;
- break;
- }
-
-};
-
-/*
- This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
- current: null,
- droppables: [],
- prepareOffsets: function(t, e) {
-
- var m = $.ui.ddmanager.droppables;
- var type = e ? e.type : null; // workaround for #2317
- for (var i = 0; i < m.length; i++) {
-
- if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element,(t.currentItem || t.element)))) continue;
- m[i].visible = m[i].element.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue
- m[i].offset = m[i].element.offset();
- m[i].proportions = { width: m[i].element.outerWidth(), height: m[i].element.outerHeight() };
-
- if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables
- }
-
- },
- drop: function(draggable, e) {
-
- var dropped = false;
- $.each($.ui.ddmanager.droppables, function() {
-
- if(!this.options) return;
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
- dropped = this.drop.call(this, e);
-
- if (!this.options.disabled && this.visible && this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- this.isout = 1; this.isover = 0;
- this.deactivate.call(this, e);
- }
-
- });
- return dropped;
-
- },
- drag: function(draggable, e) {
-
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, e);
-
- //Run through all droppables and check their positions based on specific tolerance options
- $.each($.ui.ddmanager.droppables, function() {
-
- if(this.options.disabled || this.greedyChild || !this.visible) return;
- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
-
- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
- if(!c) return;
-
- var parentInstance;
- if (this.options.greedy) {
- var parent = this.element.parents('.ui-droppable:eq(0)');
- if (parent.length) {
- parentInstance = $.data(parent[0], 'droppable');
- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
- }
- }
-
- // we just moved into a greedy child
- if (parentInstance && c == 'isover') {
- parentInstance['isover'] = 0;
- parentInstance['isout'] = 1;
- parentInstance.out.call(parentInstance, e);
- }
-
- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
- this[c == "isover" ? "over" : "out"].call(this, e);
-
- // we just moved out of a greedy child
- if (parentInstance && c == 'isout') {
- parentInstance['isout'] = 0;
- parentInstance['isover'] = 1;
- parentInstance.over.call(parentInstance, e);
- }
- });
-
- }
-};
-
-/*
- * Droppable Extensions
- */
-
-$.ui.plugin.add("droppable", "activeClass", {
- activate: function(e, ui) {
- $(this).addClass(ui.options.activeClass);
- },
- deactivate: function(e, ui) {
- $(this).removeClass(ui.options.activeClass);
- },
- drop: function(e, ui) {
- $(this).removeClass(ui.options.activeClass);
- }
-});
-
-$.ui.plugin.add("droppable", "hoverClass", {
- over: function(e, ui) {
- $(this).addClass(ui.options.hoverClass);
- },
- out: function(e, ui) {
- $(this).removeClass(ui.options.hoverClass);
- },
- drop: function(e, ui) {
- $(this).removeClass(ui.options.hoverClass);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Resizable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.resizable", $.extend($.ui.mouse, {
- init: function() {
-
- var self = this, o = this.options;
-
- var elpos = this.element.css('position');
-
- this.originalElement = this.element;
-
- // simulate .ui-resizable { position: relative; }
- this.element.addClass("ui-resizable").css({ position: /static/.test(elpos) ? 'relative' : elpos });
-
- $.extend(o, {
- _aspectRatio: !!(o.aspectRatio),
- helper: o.helper || o.ghost || o.animate ? o.helper || 'proxy' : null,
- knobHandles: o.knobHandles === true ? 'ui-resizable-knob-handle' : o.knobHandles
- });
-
- //Default Theme
- var aBorder = '1px solid #DEDEDE';
-
- o.defaultTheme = {
- 'ui-resizable': { display: 'block' },
- 'ui-resizable-handle': { position: 'absolute', background: '#F2F2F2', fontSize: '0.1px' },
- 'ui-resizable-n': { cursor: 'n-resize', height: '4px', left: '0px', right: '0px', borderTop: aBorder },
- 'ui-resizable-s': { cursor: 's-resize', height: '4px', left: '0px', right: '0px', borderBottom: aBorder },
- 'ui-resizable-e': { cursor: 'e-resize', width: '4px', top: '0px', bottom: '0px', borderRight: aBorder },
- 'ui-resizable-w': { cursor: 'w-resize', width: '4px', top: '0px', bottom: '0px', borderLeft: aBorder },
- 'ui-resizable-se': { cursor: 'se-resize', width: '4px', height: '4px', borderRight: aBorder, borderBottom: aBorder },
- 'ui-resizable-sw': { cursor: 'sw-resize', width: '4px', height: '4px', borderBottom: aBorder, borderLeft: aBorder },
- 'ui-resizable-ne': { cursor: 'ne-resize', width: '4px', height: '4px', borderRight: aBorder, borderTop: aBorder },
- 'ui-resizable-nw': { cursor: 'nw-resize', width: '4px', height: '4px', borderLeft: aBorder, borderTop: aBorder }
- };
-
- o.knobTheme = {
- 'ui-resizable-handle': { background: '#F2F2F2', border: '1px solid #808080', height: '8px', width: '8px' },
- 'ui-resizable-n': { cursor: 'n-resize', top: '0px', left: '45%' },
- 'ui-resizable-s': { cursor: 's-resize', bottom: '0px', left: '45%' },
- 'ui-resizable-e': { cursor: 'e-resize', right: '0px', top: '45%' },
- 'ui-resizable-w': { cursor: 'w-resize', left: '0px', top: '45%' },
- 'ui-resizable-se': { cursor: 'se-resize', right: '0px', bottom: '0px' },
- 'ui-resizable-sw': { cursor: 'sw-resize', left: '0px', bottom: '0px' },
- 'ui-resizable-nw': { cursor: 'nw-resize', left: '0px', top: '0px' },
- 'ui-resizable-ne': { cursor: 'ne-resize', right: '0px', top: '0px' }
- };
-
- o._nodeName = this.element[0].nodeName;
-
- //Wrap the element if it cannot hold child nodes
- if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)) {
- var el = this.element;
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera)
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- el.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css( {
- position: el.css('position'),
- width: el.outerWidth(),
- height: el.outerHeight(),
- top: el.css('top'),
- left: el.css('left')
- })
- );
-
- var oel = this.element; this.element = this.element.parent();
-
- // store instance on wrapper
- this.element.data('resizable', this);
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: oel.css("marginLeft"), marginTop: oel.css("marginTop"),
- marginRight: oel.css("marginRight"), marginBottom: oel.css("marginBottom")
- });
-
- oel.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- if ($.browser.safari && o.preventDefault) oel.css('resize', 'none');
-
- o.proportionallyResize = oel.css({ position: 'static', zoom: 1, display: 'block' });
-
- // avoid IE jump
- this.element.css({ margin: oel.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
- }
-
- if(!o.handles) o.handles = !$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' };
- if(o.handles.constructor == String) {
-
- o.zIndex = o.zIndex || 1000;
-
- if(o.handles == 'all') o.handles = 'n,e,s,w,se,sw,ne,nw';
-
- var n = o.handles.split(","); o.handles = {};
-
- // insertions are applied when don't have theme loaded
- var insertionsDefault = {
- handle: 'position: absolute; display: none; overflow:hidden;',
- n: 'top: 0pt; width:100%;',
- e: 'right: 0pt; height:100%;',
- s: 'bottom: 0pt; width:100%;',
- w: 'left: 0pt; height:100%;',
- se: 'bottom: 0pt; right: 0px;',
- sw: 'bottom: 0pt; left: 0px;',
- ne: 'top: 0pt; right: 0px;',
- nw: 'top: 0pt; left: 0px;'
- };
-
- for(var i = 0; i < n.length; i++) {
- var handle = $.trim(n[i]), dt = o.defaultTheme, hname = 'ui-resizable-'+handle, loadDefault = !$.ui.css(hname) && !o.knobHandles, userKnobClass = $.ui.css('ui-resizable-knob-handle'),
- allDefTheme = $.extend(dt[hname], dt['ui-resizable-handle']), allKnobTheme = $.extend(o.knobTheme[hname], !userKnobClass ? o.knobTheme['ui-resizable-handle'] : {});
-
- // increase zIndex of sw, se, ne, nw axis
- var applyZIndex = /sw|se|ne|nw/.test(handle) ? { zIndex: ++o.zIndex } : {};
-
- var defCss = (loadDefault ? insertionsDefault[handle] : ''),
- axis = $(['<div class="ui-resizable-handle ', hname, '" style="', defCss, insertionsDefault.handle, '"></div>'].join('')).css( applyZIndex );
- o.handles[handle] = '.ui-resizable-'+handle;
-
- this.element.append(
- //Theme detection, if not loaded, load o.defaultTheme
- axis.css( loadDefault ? allDefTheme : {} )
- // Load the knobHandle css, fix width, height, top, left...
- .css( o.knobHandles ? allKnobTheme : {} ).addClass(o.knobHandles ? 'ui-resizable-knob-handle' : '').addClass(o.knobHandles)
- );
- }
-
- if (o.knobHandles) this.element.addClass('ui-resizable-knob').css( !$.ui.css('ui-resizable-knob') ? { /*border: '1px #fff dashed'*/ } : {} );
- }
-
- this._renderAxis = function(target) {
- target = target || this.element;
-
- for(var i in o.handles) {
- if(o.handles[i].constructor == String)
- o.handles[i] = $(o.handles[i], this.element).show();
-
- if (o.transparent)
- o.handles[i].css({opacity:0});
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.element.is('.ui-wrapper') &&
- o._nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(o.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- if (!o.transparent)
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
- }
- if(!$(o.handles[i]).length) continue;
- }
- };
-
- this._renderAxis(this.element);
- o._handles = $('.ui-resizable-handle', self.element);
-
- if (o.disableSelection)
- o._handles.each(function(i, e) { $.ui.disableSelection(e); });
-
- //Matching axis name
- o._handles.mouseover(function() {
- if (!o.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = o.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- o._handles.hide();
- $(self.element).addClass("ui-resizable-autohide").hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- o._handles.show();
- },
- function(){
- if (!o.resizing) {
- $(this).addClass("ui-resizable-autohide");
- o._handles.hide();
- }
- });
- }
-
- this.mouseInit();
- },
- plugins: {},
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- options: this.options,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.ui()]);
- if (n != "resize") this.element.triggerHandler(["resize", n].join(""), [e, this.ui()], this.options[n]);
- },
- destroy: function() {
- var el = this.element, wrapped = el.children(".ui-resizable").get(0);
-
- this.mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- _destroy(el);
-
- if (el.is('.ui-wrapper') && wrapped) {
- el.parent().append(
- $(wrapped).css({
- position: el.css('position'),
- width: el.outerWidth(),
- height: el.outerHeight(),
- top: el.css('top'),
- left: el.css('left')
- })
- ).end().remove();
-
- _destroy(wrapped);
- }
- },
- mouseStart: function(e) {
- if(this.options.disabled) return false;
-
- var handle = false;
- for(var i in this.options.handles) {
- if($(this.options.handles[i])[0] == e.target) handle = true;
- }
- if (!handle) return false;
-
- var o = this.options, iniPos = this.element.position(), el = this.element,
- num = function(v) { return parseInt(v, 10) || 0; }, ie6 = $.browser.msie && $.browser.version < 7;
- o.resizing = true;
- o.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix #1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
-
- // sOffset decides if document scrollOffset will be added to the top/left of the resizable element
- var sOffset = $.browser.msie && !o.containment && (/absolute/).test(el.css('position')) && !(/relative/).test(el.parent().css('position'));
- var dscrollt = sOffset ? o.documentScroll.top : 0, dscrolll = sOffset ? o.documentScroll.left : 0;
-
- el.css({ position: 'absolute', top: (iniPos.top + dscrollt), left: (iniPos.left + dscrolll) });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && /relative/.test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = o.helper || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = o.helper || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: e.pageX, top: e.pageY };
-
- //Aspect Ratio
- o.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.height / this.originalSize.width)||1);
-
- if (o.preserveCursor)
- $('body').css('cursor', this.axis + '-resize');
-
- this.propagate("start", e);
- return true;
- },
- mouseDrag: function(e) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (e.pageX-smp.left)||0, dy = (e.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [e, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (o._aspectRatio || e.shiftKey)
- data = this._updateRatio(data, e);
-
- data = this._respectSize(data, e);
-
- // plugins callbacks need to be called first
- this.propagate("resize", e);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!o.helper && o.proportionallyResize)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this.element.triggerHandler("resize", [e, this.ui()], this.options["resize"]);
-
- return false;
- },
- mouseStop: function(e) {
-
- this.options.resizing = false;
- var o = this.options, num = function(v) { return parseInt(v, 10) || 0; }, self = this;
-
- if(o.helper) {
- var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
- soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- if (o.helper && !o.animate) this._proportionallyResize();
- }
-
- if (o.preserveCursor)
- $('body').css('cursor', 'auto');
-
- this.propagate("stop", e);
-
- if (o.helper) this.helper.remove();
-
- return false;
- },
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (data.left) this.position.left = data.left;
- if (data.top) this.position.top = data.top;
- if (data.height) this.size.height = data.height;
- if (data.width) this.size.width = data.width;
- },
- _updateRatio: function(data, e) {
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height / o.aspectRatio);
- else if (data.width) data.height = (csize.width * o.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
- _respectSize: function(data, e) {
-
- var el = this.helper, o = this.options, pRatio = o._aspectRatio || e.shiftKey, a = this.axis,
- ismaxw = data.width && o.maxWidth && o.maxWidth < data.width, ismaxh = data.height && o.maxHeight && o.maxHeight < data.height,
- isminw = data.width && o.minWidth && o.minWidth > data.width, isminh = data.height && o.minHeight && o.minHeight > data.height;
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
- _proportionallyResize: function() {
- var o = this.options;
- if (!o.proportionallyResize) return;
- var prel = o.proportionallyResize, el = this.helper || this.element;
-
- if (!o.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- o.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
- prel.css({
- height: (el.height() - o.borderDif[0] - o.borderDif[2]) + "px",
- width: (el.width() - o.borderDif[1] - o.borderDif[3]) + "px"
- });
- },
- _renderProxy: function() {
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(o.helper) {
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(o.helper).css({
- width: el.outerWidth() + pxyoffset,
- height: el.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex
- });
-
- this.helper.appendTo("body");
-
- if (o.disableSelection)
- $.ui.disableSelection(this.helper.get(0));
-
- } else {
- this.helper = el;
- }
- },
- _change: {
- e: function(e, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(e, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(e, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(e, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(e, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, dx, dy]));
- },
- sw: function(e, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, dx, dy]));
- },
- ne: function(e, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, dx, dy]));
- },
- nw: function(e, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, dx, dy]));
- }
- }
-}));
-
-$.extend($.ui.resizable, {
- defaults: {
- cancel: ":input",
- distance: 1,
- delay: 0,
- preventDefault: true,
- transparent: false,
- minWidth: 10,
- minHeight: 10,
- aspectRatio: false,
- disableSelection: true,
- preserveCursor: true,
- autoHide: false,
- knobHandles: false
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
-
- // i'm a node, so compute top, left, right, bottom
- else{
- self.containerOffset = $(ce).offset();
- self.containerPosition = $(ce).position();
- self.containerSize = { height: $(ce).innerHeight(), width: $(ce).innerWidth() };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"),
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = o._aspectRatio || e.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && /static/.test(ce.css('position')))
- cop = self.containerPosition;
-
- if (cp.left < (o.helper ? co.left : cop.left)) {
- self.size.width = self.size.width + (o.helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width * o.aspectRatio;
- self.position.left = o.helper ? co.left : cop.left;
- }
-
- if (cp.top < (o.helper ? co.top : 0)) {
- self.size.height = self.size.height + (o.helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height / o.aspectRatio;
- self.position.top = o.helper ? co.top : 0;
- }
-
- var woset = (o.helper ? self.offset.left - co.left : (self.position.left - cop.left)) + self.sizeDiff.width,
- hoset = (o.helper ? self.offset.top - co.top : self.position.top) + self.sizeDiff.height;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width * o.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height / o.aspectRatio;
- }
- },
-
- stop: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.innerWidth(), h = helper.innerHeight();
-
-
- if (o.helper && !o.animate && /relative/.test(ce.css('position')))
- $(this).css({ left: (ho.left - co.left), top: (ho.top - co.top), width: w, height: h });
-
- if (o.helper && !o.animate && /static/.test(ce.css('position')))
- $(this).css({ left: cop.left + (ho.left - co.left), top: cop.top + (ho.top - co.top), width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable");
-
- var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
- soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration || "slow", easing: o.animateEasing || "swing",
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr) pr.css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self.propagate("animate", e);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize, cs = self.size;
-
- if (!pr) self.ghost = self.element.clone();
- else self.ghost = pr.clone();
-
- self.ghost.css(
- { opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }
- )
- .addClass('ui-resizable-ghost').addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;
-
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
-
- },
-
- stop: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"),
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object') {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
- $(this).css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object') {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(e, ui){
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Selectable
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.selectable", $.extend($.ui.mouse, {
- init: function() {
- var self = this;
-
- this.element.addClass("ui-selectable");
-
- this.dragged = false;
-
- // cache selectee children based on filter
- var selectees;
- this.refresh = function() {
- selectees = $(self.options.filter, self.element[0]);
- selectees.each(function() {
- var $this = $(this);
- var pos = $this.offset();
- $.data(this, "selectable-item", {
- element: this,
- $element: $this,
- left: pos.left,
- top: pos.top,
- right: pos.left + $this.width(),
- bottom: pos.top + $this.height(),
- startselected: false,
- selected: $this.hasClass('ui-selected'),
- selecting: $this.hasClass('ui-selecting'),
- unselecting: $this.hasClass('ui-unselecting')
- });
- });
- };
- this.refresh();
-
- this.selectees = selectees.addClass("ui-selectee");
-
- this.mouseInit();
-
- this.helper = $(document.createElement('div')).css({border:'1px dotted black'});
- },
- toggle: function() {
- if(this.options.disabled){
- this.enable();
- } else {
- this.disable();
- }
- },
- destroy: function() {
- this.element
- .removeClass("ui-selectable ui-selectable-disabled")
- .removeData("selectable")
- .unbind(".selectable");
- this.mouseDestroy();
- },
- mouseStart: function(e) {
- var self = this;
-
- this.opos = [e.pageX, e.pageY];
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- this.selectees = $(options.filter, this.element[0]);
-
- // selectable START callback
- this.element.triggerHandler("selectablestart", [e, {
- "selectable": this.element[0],
- "options": options
- }], options.start);
-
- $('body').append(this.helper);
- // position helper (lasso)
- this.helper.css({
- "z-index": 100,
- "position": "absolute",
- "left": e.clientX,
- "top": e.clientY,
- "width": 0,
- "height": 0
- });
-
- if (options.autoRefresh) {
- this.refresh();
- }
-
- this.selectees.filter('.ui-selected').each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.startselected = true;
- if (!e.ctrlKey) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- });
-
- var isSelectee = false;
- $(e.target).parents().andSelf().each(function() {
- if($.data(this, "selectable-item")) isSelectee = true;
- });
- return this.options.keyboard ? !isSelectee : true;
- },
- mouseDrag: function(e) {
- var self = this;
- this.dragged = true;
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- var x1 = this.opos[0], y1 = this.opos[1], x2 = e.pageX, y2 = e.pageY;
- if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
- if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
- this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
-
- this.selectees.each(function() {
- var selectee = $.data(this, "selectable-item");
- //prevent helper from being selected if appendTo: selectable
- if (!selectee || selectee.element == self.element[0])
- return;
- var hit = false;
- if (options.tolerance == 'touch') {
- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
- } else if (options.tolerance == 'fit') {
- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
- }
-
- if (hit) {
- // SELECT
- if (selectee.selected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- }
- if (selectee.unselecting) {
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- }
- if (!selectee.selecting) {
- selectee.$element.addClass('ui-selecting');
- selectee.selecting = true;
- // selectable SELECTING callback
- self.element.triggerHandler("selectableselecting", [e, {
- selectable: self.element[0],
- selecting: selectee.element,
- options: options
- }], options.selecting);
- }
- } else {
- // UNSELECT
- if (selectee.selecting) {
- if (e.ctrlKey && selectee.startselected) {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- selectee.$element.addClass('ui-selected');
- selectee.selected = true;
- } else {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- if (selectee.startselected) {
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- }
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- }
- if (selectee.selected) {
- if (!e.ctrlKey && !selectee.startselected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
-
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- }
- }
- });
-
- return false;
- },
- mouseStop: function(e) {
- var self = this;
-
- this.dragged = false;
-
- var options = this.options;
-
- $('.ui-unselecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- selectee.startselected = false;
- self.element.triggerHandler("selectableunselected", [e, {
- selectable: self.element[0],
- unselected: selectee.element,
- options: options
- }], options.unselected);
- });
- $('.ui-selecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
- selectee.selecting = false;
- selectee.selected = true;
- selectee.startselected = true;
- self.element.triggerHandler("selectableselected", [e, {
- selectable: self.element[0],
- selected: selectee.element,
- options: options
- }], options.selected);
- });
- this.element.triggerHandler("selectablestop", [e, {
- selectable: self.element[0],
- options: this.options
- }], this.options.stop);
-
- this.helper.remove();
-
- return false;
- }
-}));
-
-$.extend($.ui.selectable, {
- defaults: {
- distance: 1,
- delay: 0,
- cancel: ":input",
- appendTo: 'body',
- autoRefresh: true,
- filter: '*',
- tolerance: 'touch'
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Sortable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-function contains(a, b) {
- var safari2 = $.browser.safari && $.browser.version < 522;
- if (a.contains && !safari2) {
- return a.contains(b);
- }
- if (a.compareDocumentPosition)
- return !!(a.compareDocumentPosition(b) & 16);
- while (b = b.parentNode)
- if (b == a) return true;
- return false;
-};
-
-$.widget("ui.sortable", $.extend($.ui.mouse, {
- init: function() {
-
- var o = this.options;
- this.containerCache = {};
- this.element.addClass("ui-sortable");
-
- //Get the items
- this.refresh();
-
- //Let's determine if the items are floating
- this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;
-
- //Let's determine the parent's offset
- if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative');
- this.offset = this.element.offset();
-
- //Initialize mouse events for interaction
- this.mouseInit();
-
- },
- plugins: {},
- ui: function(inst) {
- return {
- helper: (inst || this)["helper"],
- placeholder: (inst || this)["placeholder"] || $([]),
- position: (inst || this)["position"],
- absolutePosition: (inst || this)["positionAbs"],
- options: this.options,
- element: this.element,
- item: (inst || this)["currentItem"],
- sender: inst ? inst.element : null
- };
- },
- propagate: function(n,e,inst, noPropagation) {
- $.ui.plugin.call(this, n, [e, this.ui(inst)]);
- if(!noPropagation) this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]);
- },
- serialize: function(o) {
-
- var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
- var str = []; o = o || {};
-
- items.each(function() {
- var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
- if(res) str.push((o.key || res[1])+'[]='+(o.key && o.expression ? res[1] : res[2]));
- });
-
- return str.join('&');
-
- },
- toArray: function(attr) {
-
- var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
- var ret = [];
-
- items.each(function() { ret.push($(this).attr(attr || 'id')); });
- return ret;
-
- },
- /* Be careful with the following core functions */
- intersectsWith: function(item) {
-
- var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height;
- var l = item.left, r = l + item.width,
- t = item.top, b = t + item.height;
-
- if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])) {
- return (y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r);
- } else {
-
- return (l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b ); // Top Half
-
- }
-
- },
- intersectsWithEdge: function(item) {
- var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height;
- var l = item.left, r = l + item.width,
- t = item.top, b = t + item.height;
-
- if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])) {
-
- if(!(y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r)) return false;
-
- if(this.floating) {
- if(x1 + this.offset.click.left > l && x1 + this.offset.click.left < l + item.width/2) return 2;
- if(x1 + this.offset.click.left > l+item.width/2 && x1 + this.offset.click.left < r) return 1;
- } else {
- if(y1 + this.offset.click.top > t && y1 + this.offset.click.top < t + item.height/2) return 2;
- if(y1 + this.offset.click.top > t+item.height/2 && y1 + this.offset.click.top < b) return 1;
- }
-
- } else {
-
- if (!(l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half
-
- if(this.floating) {
- if(x2 > l && x1 < l) return 2; //Crosses left edge
- if(x1 < r && x2 > r) return 1; //Crosses right edge
- } else {
- if(y2 > t && y1 < t) return 1; //Crosses top edge
- if(y1 < b && y2 > b) return 2; //Crosses bottom edge
- }
-
- }
-
- return false;
-
- },
- refresh: function() {
- this.refreshItems();
- this.refreshPositions();
- },
- refreshItems: function() {
-
- this.items = [];
- this.containers = [this];
- var items = this.items;
- var self = this;
- var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element), this]];
-
- if(this.options.connectWith) {
- for (var i = this.options.connectWith.length - 1; i >= 0; i--){
- var cur = $(this.options.connectWith[i]);
- for (var j = cur.length - 1; j >= 0; j--){
- var inst = $.data(cur[j], 'sortable');
- if(inst && !inst.options.disabled) {
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element), inst]);
- this.containers.push(inst);
- }
- };
- };
- }
-
- for (var i = queries.length - 1; i >= 0; i--){
- queries[i][0].each(function() {
- $.data(this, 'sortable-item', queries[i][1]); // Data for target checking (mouse manager)
- items.push({
- item: $(this),
- instance: queries[i][1],
- width: 0, height: 0,
- left: 0, top: 0
- });
- });
- };
-
- },
- refreshPositions: function(fast) {
-
- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
- if(this.offsetParent) {
- var po = this.offsetParent.offset();
- this.offset.parent = { top: po.top + this.offsetParentBorders.top, left: po.left + this.offsetParentBorders.left };
- }
-
- for (var i = this.items.length - 1; i >= 0; i--){
-
- //We ignore calculating positions of all connected containers when we're not over them
- if(this.items[i].instance != this.currentContainer && this.currentContainer && this.items[i].item[0] != this.currentItem[0])
- continue;
-
- var t = this.options.toleranceElement ? $(this.options.toleranceElement, this.items[i].item) : this.items[i].item;
-
- if(!fast) {
- this.items[i].width = t.outerWidth();
- this.items[i].height = t.outerHeight();
- }
-
- var p = t.offset();
- this.items[i].left = p.left;
- this.items[i].top = p.top;
-
- };
-
- for (var i = this.containers.length - 1; i >= 0; i--){
- var p =this.containers[i].element.offset();
- this.containers[i].containerCache.left = p.left;
- this.containers[i].containerCache.top = p.top;
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
- };
-
- },
- destroy: function() {
- this.element
- .removeClass("ui-sortable ui-sortable-disabled")
- .removeData("sortable")
- .unbind(".sortable");
- this.mouseDestroy();
-
- for ( var i = this.items.length - 1; i >= 0; i-- )
- this.items[i].item.removeData("sortable-item");
- },
- createPlaceholder: function(that) {
-
- var self = that || this, o = self.options;
-
- if(o.placeholder.constructor == String) {
- var className = o.placeholder;
- o.placeholder = {
- element: function() {
- return $('<div></div>').addClass(className)[0];
- },
- update: function(i, p) {
- p.css(i.offset()).css({ width: i.outerWidth(), height: i.outerHeight() });
- }
- };
- }
-
- self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)).appendTo('body').css({ position: 'absolute' });
- o.placeholder.update.call(self.element, self.currentItem, self.placeholder);
- },
- contactContainers: function(e) {
- for (var i = this.containers.length - 1; i >= 0; i--){
-
- if(this.intersectsWith(this.containers[i].containerCache)) {
- if(!this.containers[i].containerCache.over) {
-
-
- if(this.currentContainer != this.containers[i]) {
-
- //When entering a new container, we will find the item with the least distance and append our item near it
- var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top'];
- for (var j = this.items.length - 1; j >= 0; j--) {
- if(!contains(this.containers[i].element[0], this.items[j].item[0])) continue;
- var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
- if(Math.abs(cur - base) < dist) {
- dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
- }
- }
-
- if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
- continue;
-
- //We also need to exchange the placeholder
- if(this.placeholder) this.placeholder.remove();
- if(this.containers[i].options.placeholder) {
- this.containers[i].createPlaceholder(this);
- } else {
- this.placeholder = null;;
- }
-
- this.currentContainer = this.containers[i];
- itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance, null, true) : this.rearrange(e, null, this.containers[i].element, true);
- this.propagate("change", e); //Call plugins and callbacks
- this.containers[i].propagate("change", e, this); //Call plugins and callbacks
-
- }
-
- this.containers[i].propagate("over", e, this);
- this.containers[i].containerCache.over = 1;
- }
- } else {
- if(this.containers[i].containerCache.over) {
- this.containers[i].propagate("out", e, this);
- this.containers[i].containerCache.over = 0;
- }
- }
-
- };
- },
- mouseCapture: function(e, overrideHandle) {
-
- if(this.options.disabled || this.options.type == 'static') return false;
-
- //We have to refresh the items data once first
- this.refreshItems();
-
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
- var currentItem = null, self = this, nodes = $(e.target).parents().each(function() {
- if($.data(this, 'sortable-item') == self) {
- currentItem = $(this);
- return false;
- }
- });
- if($.data(e.target, 'sortable-item') == self) currentItem = $(e.target);
-
- if(!currentItem) return false;
- if(this.options.handle && !overrideHandle) {
- var validHandle = false;
-
- $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == e.target) validHandle = true; });
- if(!validHandle) return false;
- }
-
- this.currentItem = currentItem;
- return true;
-
- },
- mouseStart: function(e, overrideHandle, noActivation) {
-
- var o = this.options;
- this.currentContainer = this;
-
- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
- this.refreshPositions();
-
- //Create and append the visible helper
- this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone();
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)); //Add the helper to the DOM if that didn't happen already
- this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- this.margins = { //Cache the margins
- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
- };
-
- this.offset = this.currentItem.offset(); //The element's absolute position on the page
- this.offset = { //Substract the margins from the element's absolute offset
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- this.offset.click = { //Where the click happened, relative to the element
- left: e.pageX - this.offset.left,
- top: e.pageY - this.offset.top
- };
-
- this.offsetParent = this.helper.offsetParent(); //Get the offsetParent and cache its position
- var po = this.offsetParent.offset();
-
- this.offsetParentBorders = {
- top: (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
- this.offset.parent = { //Store its position plus border
- top: po.top + this.offsetParentBorders.top,
- left: po.left + this.offsetParentBorders.left
- };
-
- this.originalPosition = this.generatePosition(e); //Generate the original position
- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; //Cache the former DOM position
-
- //If o.placeholder is used, create a new element at the given position with the class
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
- if(o.placeholder) this.createPlaceholder();
-
- //Call plugins and callbacks
- this.propagate("start", e);
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
-
- if(o.cursorAt) {
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left;
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right;
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top;
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom;
- }
-
- /*
- * - Position constraining -
- * Here we prepare position constraining like grid and containment.
- */
-
- if(o.containment) {
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.parent.left,
- 0 - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top,
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0),
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0)
- ];
- }
- }
-
- //Set the original element visibility to hidden to still fill out the white space
- if(this.options.placeholder != 'clone')
- this.currentItem.css('visibility', 'hidden');
-
- //Post 'activate' events to possible containers
- if(!noActivation) {
- for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); }
- }
-
- //Prepare possible droppables
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
-
- this.dragging = true;
-
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
-
-
- },
- convertPositionTo: function(d, pos) {
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- return {
- top: (
- pos.top // the calculated relative position
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
- ),
- left: (
- pos.left // the calculated relative position
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
- )
- };
- },
- generatePosition: function(e) {
-
- var o = this.options;
- var position = {
- top: (
- e.pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
- ),
- left: (
- e.pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
- )
- };
-
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- if(this.containment) {
- if(position.left < this.containment[0]) position.left = this.containment[0];
- if(position.top < this.containment[1]) position.top = this.containment[1];
- if(position.left > this.containment[2]) position.left = this.containment[2];
- if(position.top > this.containment[3]) position.top = this.containment[3];
- }
-
- if(o.grid) {
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- return position;
- },
- mouseDrag: function(e) {
-
-
- //Compute the helpers position
- this.position = this.generatePosition(e);
- this.positionAbs = this.convertPositionTo("absolute");
-
- //Rearrange
- for (var i = this.items.length - 1; i >= 0; i--) {
- var intersection = this.intersectsWithEdge(this.items[i]);
- if(!intersection) continue;
-
- if(this.items[i].item[0] != this.currentItem[0] //cannot intersect with itself
- && this.currentItem[intersection == 1 ? "next" : "prev"]()[0] != this.items[i].item[0] //no useless actions that have been done before
- && !contains(this.currentItem[0], this.items[i].item[0]) //no action if the item moved is the parent of the item checked
- && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true)
- ) {
-
- this.direction = intersection == 1 ? "down" : "up";
- this.rearrange(e, this.items[i]);
- this.propagate("change", e); //Call plugins and callbacks
- break;
- }
- }
-
- //Post events to containers
- this.contactContainers(e);
-
- //Call plugins and callbacks
- this.propagate("sort", e);
-
- if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px';
-
- //Interconnect with droppables
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
-
- return false;
-
- },
- rearrange: function(e, i, a, hardRefresh) {
- a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem);
-
- //Various things done here to improve the performance:
- // 1. we create a setTimeout, that calls refreshPositions
- // 2. on the instance, we have a counter variable, that get's higher after every append
- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
- // 4. this lets only the last addition to the timeout stack through
- this.counter = this.counter ? ++this.counter : 1;
- var self = this, counter = this.counter;
-
- window.setTimeout(function() {
- if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
- },0);
-
- if(this.options.placeholder)
- this.options.placeholder.update.call(this.element, this.currentItem, this.placeholder);
- },
- mouseStop: function(e, noPropagation) {
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, e);
-
- if(this.options.revert) {
- var self = this;
- var cur = self.currentItem.offset();
-
- //Also animate the placeholder if we have one
- if(self.placeholder) self.placeholder.animate({ opacity: 'hide' }, (parseInt(this.options.revert, 10) || 500)-50);
-
- $(this.helper).animate({
- left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
- top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
- }, parseInt(this.options.revert, 10) || 500, function() {
- self.clear(e);
- });
- } else {
- this.clear(e, noPropagation);
- }
-
- return false;
-
- },
- clear: function(e, noPropagation) {
-
- if(this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback if the DOM position has changed
- if(!contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
- this.propagate("remove", e, null, noPropagation);
- for (var i = this.containers.length - 1; i >= 0; i--){
- if(contains(this.containers[i].element[0], this.currentItem[0])) {
- this.containers[i].propagate("update", e, this, noPropagation);
- this.containers[i].propagate("receive", e, this, noPropagation);
- }
- };
- };
-
- //Post events to containers
- for (var i = this.containers.length - 1; i >= 0; i--){
- this.containers[i].propagate("deactivate", e, this, noPropagation);
- if(this.containers[i].containerCache.over) {
- this.containers[i].propagate("out", e, this);
- this.containers[i].containerCache.over = 0;
- }
- }
-
- this.dragging = false;
- if(this.cancelHelperRemoval) {
- this.propagate("stop", e, null, noPropagation);
- return false;
- }
-
- $(this.currentItem).css('visibility', '');
- if(this.placeholder) this.placeholder.remove();
- this.helper.remove(); this.helper = null;
- this.propagate("stop", e, null, noPropagation);
-
- return true;
-
- }
-}));
-
-$.extend($.ui.sortable, {
- getter: "serialize toArray",
- defaults: {
- helper: "clone",
- tolerance: "guess",
- distance: 1,
- delay: 0,
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- cancel: ":input",
- items: '> *',
- zIndex: 1000,
- dropOnEmpty: true,
- appendTo: "parent"
- }
-});
-
-/*
- * Sortable Extensions
- */
-
-$.ui.plugin.add("sortable", "cursor", {
- start: function(e, ui) {
- var t = $('body');
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
- t.css("cursor", ui.options.cursor);
- },
- stop: function(e, ui) {
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
- }
-});
-
-$.ui.plugin.add("sortable", "zIndex", {
- start: function(e, ui) {
- var t = ui.helper;
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
- t.css('zIndex', ui.options.zIndex);
- },
- stop: function(e, ui) {
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
- }
-});
-
-$.ui.plugin.add("sortable", "opacity", {
- start: function(e, ui) {
- var t = ui.helper;
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
- t.css('opacity', ui.options.opacity);
- },
- stop: function(e, ui) {
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
- }
-});
-
-$.ui.plugin.add("sortable", "scroll", {
- start: function(e, ui) {
- var o = ui.options;
- var i = $(this).data("sortable");
-
- i.overflowY = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(i.currentItem);
- i.overflowX = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(i.currentItem);
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
-
- },
- sort: function(e, ui) {
-
- var o = ui.options;
- var i = $(this).data("sortable");
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
- } else {
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
- } else {
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Effects 1.5.1
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/
- */
-;(function($) {
-
-$.effects = $.effects || {}; //Add the 'effects' scope
-
-$.extend($.effects, {
- save: function(el, set) {
- for(var i=0;i<set.length;i++) {
- if(set[i] !== null) $.data(el[0], "ec.storage."+set[i], el[0].style[set[i]]);
- }
- },
- restore: function(el, set) {
- for(var i=0;i<set.length;i++) {
- if(set[i] !== null) el.css(set[i], $.data(el[0], "ec.storage."+set[i]));
- }
- },
- setMode: function(el, mode) {
- if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
- return mode;
- },
- getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
- // this should be a little more flexible in the future to handle a string & hash
- var y, x;
- switch (origin[0]) {
- case 'top': y = 0; break;
- case 'middle': y = 0.5; break;
- case 'bottom': y = 1; break;
- default: y = origin[0] / original.height;
- };
- switch (origin[1]) {
- case 'left': x = 0; break;
- case 'center': x = 0.5; break;
- case 'right': x = 1; break;
- default: x = origin[1] / original.width;
- };
- return {x: x, y: y};
- },
- createWrapper: function(el) {
- if (el.parent().attr('id') == 'fxWrapper')
- return el;
- var props = {width: el.outerWidth({margin:true}), height: el.outerHeight({margin:true}), 'float': el.css('float')};
- el.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
- var wrapper = el.parent();
- if (el.css('position') == 'static'){
- wrapper.css({position: 'relative'});
- el.css({position: 'relative'});
- } else {
- var top = parseInt(el.css('top'), 10); if(isNaN(top)) top = 'auto';
- var left = parseInt(el.css('left'), 10); if(isNaN(left)) left = 'auto';
- wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show();
- el.css({position: 'relative', top:0, left:0});
- }
- wrapper.css(props);
- return wrapper;
- },
- removeWrapper: function(el) {
- if (el.parent().attr('id') == 'fxWrapper')
- return el.parent().replaceWith(el);
- return el;
- },
- setTransition: function(el, list, factor, val) {
- val = val || {};
- $.each(list,function(i, x){
- unit = el.cssUnit(x);
- if (unit[0] > 0) val[x] = unit[0] * factor + unit[1];
- });
- return val;
- },
- animateClass: function(value, duration, easing, callback) {
-
- var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
- var ea = (typeof easing == "object" ? easing : null);
-
- return this.each(function() {
-
- var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
- if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
- if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
-
- //Let's get a style offset
- var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
- if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
- var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
- if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
-
- // The main function to form the object for animation
- for(var n in newStyle) {
- if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
- && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
- && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
- && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
- && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
- ) offset[n] = newStyle[n];
- }
-
- that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
- // Change style attribute back to original. For stupid IE, we need to clear the damn object.
- if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
- if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
- if(cb) cb.apply(this, arguments);
- });
-
- });
- }
-});
-
-//Extend the methods of jQuery
-$.fn.extend({
- //Save old methods
- _show: $.fn.show,
- _hide: $.fn.hide,
- __toggle: $.fn.toggle,
- _addClass: $.fn.addClass,
- _removeClass: $.fn.removeClass,
- _toggleClass: $.fn.toggleClass,
- // New ec methods
- effect: function(fx,o,speed,callback) {
- return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: o || {}, duration: speed, callback: callback }) : null;
- },
- show: function() {
- if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
- return this._show.apply(this, arguments);
- else {
- var o = arguments[1] || {}; o['mode'] = 'show';
- return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
- }
- },
- hide: function() {
- if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
- return this._hide.apply(this, arguments);
- else {
- var o = arguments[1] || {}; o['mode'] = 'hide';
- return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
- }
- },
- toggle: function(){
- if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function))
- return this.__toggle.apply(this, arguments);
- else {
- var o = arguments[1] || {}; o['mode'] = 'toggle';
- return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
- }
- },
- addClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
- },
- removeClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
- },
- toggleClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames);
- },
- morph: function(remove,add,speed,easing,callback) {
- return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
- },
- switchClass: function() {
- return this.morph.apply(this, arguments);
- },
- // helper functions
- cssUnit: function(key) {
- var style = this.css(key), val = [];
- $.each( ['em','px','%','pt'], function(i, unit){
- if(style.indexOf(unit) > 0)
- val = [parseFloat(style), unit];
- });
- return val;
- }
-});
-
-/*
- * jQuery Color Animations
- * Copyright 2007 John Resig
- * Released under the MIT and GPL licenses.
- */
-
-// We override the animation for all of these color styles
-jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
- jQuery.fx.step[attr] = function(fx){
- if ( fx.state == 0 ) {
- fx.start = getColor( fx.elem, attr );
- fx.end = getRGB( fx.end );
- }
-
- fx.elem.style[attr] = "rgb(" + [
- Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
- Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
- Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
- ].join(",") + ")";
- }
-});
-
-// Color Conversion functions from highlightFade
-// By Blair Mitchelmore
-// http://jquery.offput.ca/highlightFade/
-
-// Parse strings looking for color tuples [255,255,255]
-function getRGB(color) {
- var result;
-
- // Check if we're already dealing with an array of colors
- if ( color && color.constructor == Array && color.length == 3 )
- return color;
-
- // Look for rgb(num,num,num)
- if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
- return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
-
- // Look for rgb(num%,num%,num%)
- if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
- return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
-
- // Look for #a0b1c2
- if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
- return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
-
- // Look for #fff
- if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
- return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
-
- // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
- if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
- return colors['transparent']
-
- // Otherwise, we're most likely dealing with a named color
- return colors[jQuery.trim(color).toLowerCase()];
-}
-
-function getColor(elem, attr) {
- var color;
-
- do {
- color = jQuery.curCSS(elem, attr);
-
- // Keep going until we find an element that has color, or we hit the body
- if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
- break;
-
- attr = "backgroundColor";
- } while ( elem = elem.parentNode );
-
- return getRGB(color);
-};
-
-// Some named colors to work with
-// From Interface by Stefan Petre
-// http://interface.eyecon.ro/
-
-var colors = {
- aqua:[0,255,255],
- azure:[240,255,255],
- beige:[245,245,220],
- black:[0,0,0],
- blue:[0,0,255],
- brown:[165,42,42],
- cyan:[0,255,255],
- darkblue:[0,0,139],
- darkcyan:[0,139,139],
- darkgrey:[169,169,169],
- darkgreen:[0,100,0],
- darkkhaki:[189,183,107],
- darkmagenta:[139,0,139],
- darkolivegreen:[85,107,47],
- darkorange:[255,140,0],
- darkorchid:[153,50,204],
- darkred:[139,0,0],
- darksalmon:[233,150,122],
- darkviolet:[148,0,211],
- fuchsia:[255,0,255],
- gold:[255,215,0],
- green:[0,128,0],
- indigo:[75,0,130],
- khaki:[240,230,140],
- lightblue:[173,216,230],
- lightcyan:[224,255,255],
- lightgreen:[144,238,144],
- lightgrey:[211,211,211],
- lightpink:[255,182,193],
- lightyellow:[255,255,224],
- lime:[0,255,0],
- magenta:[255,0,255],
- maroon:[128,0,0],
- navy:[0,0,128],
- olive:[128,128,0],
- orange:[255,165,0],
- pink:[255,192,203],
- purple:[128,0,128],
- violet:[128,0,128],
- red:[255,0,0],
- silver:[192,192,192],
- white:[255,255,255],
- yellow:[255,255,0],
- transparent: [255,255,255]
-};
-
-/*
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
- *
- * Uses the built in easing capabilities added In jQuery 1.1
- * to offer multiple easing options
- *
- * TERMS OF USE - jQuery Easing
- *
- * Open source under the BSD License.
- *
- * Copyright © 2008 George McGinley Smith
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
-*/
-
-// t: current time, b: begInnIng value, c: change In value, d: duration
-jQuery.easing['jswing'] = jQuery.easing['swing'];
-
-jQuery.extend( jQuery.easing,
-{
- def: 'easeOutQuad',
- swing: function (x, t, b, c, d) {
- //alert(jQuery.easing.default);
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
- },
- easeInQuad: function (x, t, b, c, d) {
- return c*(t/=d)*t + b;
- },
- easeOutQuad: function (x, t, b, c, d) {
- return -c *(t/=d)*(t-2) + b;
- },
- easeInOutQuad: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t + b;
- return -c/2 * ((--t)*(t-2) - 1) + b;
- },
- easeInCubic: function (x, t, b, c, d) {
- return c*(t/=d)*t*t + b;
- },
- easeOutCubic: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t + 1) + b;
- },
- easeInOutCubic: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
- },
- easeInQuart: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t + b;
- },
- easeOutQuart: function (x, t, b, c, d) {
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
- },
- easeInOutQuart: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
- },
- easeInQuint: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t*t + b;
- },
- easeOutQuint: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
- },
- easeInOutQuint: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
- return c/2*((t-=2)*t*t*t*t + 2) + b;
- },
- easeInSine: function (x, t, b, c, d) {
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
- },
- easeOutSine: function (x, t, b, c, d) {
- return c * Math.sin(t/d * (Math.PI/2)) + b;
- },
- easeInOutSine: function (x, t, b, c, d) {
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
- },
- easeInExpo: function (x, t, b, c, d) {
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
- },
- easeOutExpo: function (x, t, b, c, d) {
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
- },
- easeInOutExpo: function (x, t, b, c, d) {
- if (t==0) return b;
- if (t==d) return b+c;
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
- },
- easeInCirc: function (x, t, b, c, d) {
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
- },
- easeOutCirc: function (x, t, b, c, d) {
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
- },
- easeInOutCirc: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
- },
- easeInElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- },
- easeOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
- },
- easeInOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
- },
- easeInBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*(t/=d)*t*((s+1)*t - s) + b;
- },
- easeOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
- },
- easeInOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
- },
- easeInBounce: function (x, t, b, c, d) {
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
- },
- easeOutBounce: function (x, t, b, c, d) {
- if ((t/=d) < (1/2.75)) {
- return c*(7.5625*t*t) + b;
- } else if (t < (2/2.75)) {
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
- } else if (t < (2.5/2.75)) {
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
- } else {
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
- }
- },
- easeInOutBounce: function (x, t, b, c, d) {
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
- }
-});
-
-/*
- *
- * TERMS OF USE - EASING EQUATIONS
- *
- * Open source under the BSD License.
- *
- * Copyright © 2001 Robert Penner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-})(jQuery);
-/*
- * jQuery UI Effects Blind
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.blind = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'vertical') ? 'height' : 'width';
- var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
- if(mode == 'show') wrapper.css(ref, 0); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = mode == 'show' ? distance : 0;
-
- // Animate
- wrapper.animate(animation, o.duration, o.options.easing, function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Bounce
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.bounce = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'up'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 5; // Default # of times
- var speed = o.duration || 250; // Default speed per bounce
- if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
- if (mode == 'hide') distance = distance / (times * 2);
- if (mode != 'hide') times--;
-
- // Animate
- if (mode == 'show') { // Show Bounce
- var animation = {opacity: 1};
- animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation, speed / 2, o.options.easing);
- distance = distance / 2;
- times--;
- };
- for (var i = 0; i < times; i++) { // Bounces
- var animation1 = {}, animation2 = {};
- animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
- distance = (mode == 'hide') ? distance * 2 : distance / 2;
- };
- if (mode == 'hide') { // Last Bounce
- var animation = {opacity: 0};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- el.animate(animation, speed / 2, o.options.easing, function(){
- el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- } else {
- var animation1 = {}, animation2 = {};
- animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- };
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Clip
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.clip = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','height','width'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var animate = el[0].tagName == 'IMG' ? wrapper : el;
- var ref = {
- size: (direction == 'vertical') ? 'height' : 'width',
- position: (direction == 'vertical') ? 'top' : 'left'
- };
- var distance = (direction == 'vertical') ? animate.height() : animate.width();
- if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
-
- // Animation
- var animation = {};
- animation[ref.size] = mode == 'show' ? distance : 0;
- animation[ref.position] = mode == 'show' ? 0 : distance / 2;
-
- // Animate
- animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Drop
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.drop = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {opacity: mode == 'show' ? 1 : 0};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Explode
- *
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.explode = function(o) {
-
- return this.queue(function() {
-
- var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
- var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
-
- o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
- var el = $(this).show().css('visibility', 'hidden');
- var offset = el.offset();
-
- //Substract the margins - not fixing the problem yet.
- offset.top -= parseInt(el.css("marginTop")) || 0;
- offset.left -= parseInt(el.css("marginLeft")) || 0;
-
- var width = el.outerWidth(true);
- var height = el.outerHeight(true);
-
- for(var i=0;i<rows;i++) { // =
- for(var j=0;j<cells;j++) { // ||
- el
- .clone()
- .appendTo('body')
- .wrap('<div></div>')
- .css({
- position: 'absolute',
- visibility: 'visible',
- left: -j*(width/cells),
- top: -i*(height/rows)
- })
- .parent()
- .addClass('effects-explode')
- .css({
- position: 'absolute',
- overflow: 'hidden',
- width: width/cells,
- height: height/rows,
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
- opacity: o.options.mode == 'show' ? 0 : 1
- }).animate({
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
- opacity: o.options.mode == 'show' ? 1 : 0
- }, o.duration || 500);
- }
- }
-
- // Set a timeout, to call the callback approx. when the other animations have finished
- setTimeout(function() {
-
- o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
- if(o.callback) o.callback.apply(el[0]); // Callback
- el.dequeue();
-
- $('.effects-explode').remove();
-
- }, o.duration || 500);
-
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Fold
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.fold = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var size = o.options.size || 15; // Default fold size
- var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var widthFirst = ((mode == 'show') != horizFirst);
- var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
- var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
- var percent = /([0-9]+)%/.exec(size);
- if(percent) size = parseInt(percent[1]) / 100 * distance[mode == 'hide' ? 0 : 1];
- if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
-
- // Animation
- var animation1 = {}, animation2 = {};
- animation1[ref[0]] = mode == 'show' ? distance[0] : size;
- animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
-
- // Animate
- wrapper.animate(animation1, o.duration / 2, o.options.easing)
- .animate(animation2, o.duration / 2, o.options.easing, function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Highlight
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * effects.core.js
- */
-;(function($) {
-
-$.effects.highlight = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var color = o.options.color || "#ffff99"; // Default highlight color
- var oldColor = el.css("backgroundColor");
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
-
- // Animation
- var animation = {backgroundColor: oldColor };
- if (mode == "hide") animation['opacity'] = 0;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == "hide") el.hide();
- $.effects.restore(el, props);
- if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter');
- if(o.callback) o.callback.apply(this, arguments);
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Pulsate
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.pulsate = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var times = o.options.times || 5; // Default # of times
-
- // Adjust
- if (mode == 'hide') times--;
- if (el.is(':hidden')) { // Show fadeIn
- el.css('opacity', 0);
- el.show(); // Show
- el.animate({opacity: 1}, o.duration / 2, o.options.easing);
- times = times-2;
- }
-
- // Animate
- for (var i = 0; i < times; i++) { // Pulsate
- el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing);
- };
- if (mode == 'hide') { // Last Pulse
- el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){
- el.hide(); // Hide
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- } else {
- el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing, function(){
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- };
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Scale
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.puff = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var options = $.extend(true, {}, o.options);
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var percent = parseInt(o.options.percent) || 150; // Set default puff percent
- options.fade = true; // It's not a puff if it doesn't fade! :)
- var original = {height: el.height(), width: el.width()}; // Save original
-
- // Adjust
- var factor = percent / 100;
- el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor};
-
- // Animation
- options.from = el.from;
- options.percent = (mode == 'hide') ? percent : 100;
- options.mode = mode;
-
- // Animate
- el.effect('scale', options, o.duration, o.callback);
- el.dequeue();
- });
-
-};
-
-$.effects.scale = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var options = $.extend(true, {}, o.options);
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
- var direction = o.options.direction || 'both'; // Set default axis
- var origin = o.options.origin; // The origin of the scaling
- if (mode != 'effect') { // Set default origin and restore for show/hide
- options.origin = origin || ['middle','center'];
- options.restore = true;
- }
- var original = {height: el.height(), width: el.width()}; // Save original
- el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
-
- // Adjust
- var factor = { // Set scaling factor
- y: direction != 'horizontal' ? (percent / 100) : 1,
- x: direction != 'vertical' ? (percent / 100) : 1
- };
- el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
-
- if (o.options.fade) { // Fade option to support puff
- if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
- if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
- };
-
- // Animation
- options.from = el.from; options.to = el.to; options.mode = mode;
-
- // Animate
- el.effect('size', options, o.duration, o.callback);
- el.dequeue();
- });
-
-};
-
-$.effects.size = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','width','height','overflow','opacity'];
- var props1 = ['position','top','left','overflow','opacity']; // Always restore
- var props2 = ['width','height','overflow']; // Copy for children
- var cProps = ['fontSize'];
- var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
- var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var restore = o.options.restore || false; // Default restore
- var scale = o.options.scale || 'both'; // Default scale mode
- var origin = o.options.origin; // The origin of the sizing
- var original = {height: el.height(), width: el.width()}; // Save original
- el.from = o.options.from || original; // Default from state
- el.to = o.options.to || original; // Default to state
- // Adjust
- if (origin) { // Calculate baseline shifts
- var baseline = $.effects.getBaseline(origin, original);
- el.from.top = (original.height - el.from.height) * baseline.y;
- el.from.left = (original.width - el.from.width) * baseline.x;
- el.to.top = (original.height - el.to.height) * baseline.y;
- el.to.left = (original.width - el.to.width) * baseline.x;
- };
- var factor = { // Set scaling factor
- from: {y: el.from.height / original.height, x: el.from.width / original.width},
- to: {y: el.to.height / original.height, x: el.to.width / original.width}
- };
- if (scale == 'box' || scale == 'both') { // Scale the css box
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- props = props.concat(vProps);
- el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
- el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
- };
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
- props = props.concat(hProps);
- el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
- el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
- };
- };
- if (scale == 'content' || scale == 'both') { // Scale the content
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- props = props.concat(cProps);
- el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
- el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
- };
- };
- $.effects.save(el, restore ? props : props1); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- el.css('overflow','hidden').css(el.from); // Shift
-
- // Animate
- if (scale == 'content' || scale == 'both') { // Scale the children
- vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
- hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
- props2 = props.concat(vProps).concat(hProps); // Concat
- el.find("*[width]").each(function(){
- child = $(this);
- if (restore) $.effects.save(child, props2);
- var c_original = {height: child.height(), width: child.width()}; // Save original
- child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
- child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
- child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
- };
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
- child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
- child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
- };
- child.css(child.from); // Shift children
- child.animate(child.to, o.duration, o.options.easing, function(){
- if (restore) $.effects.restore(child, props2); // Restore children
- }); // Animate children
- });
- };
-
- // Animate
- el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Shake
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.shake = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'left'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 3; // Default # of times
- var speed = o.duration || o.options.duration || 140; // Default speed per shake
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
-
- // Animation
- var animation = {}, animation1 = {}, animation2 = {};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
- animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
-
- // Animate
- el.animate(animation, speed, o.options.easing);
- for (var i = 1; i < times; i++) { // Shakes
- el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
- };
- el.animate(animation1, speed, o.options.easing).
- animate(animation, speed / 2, o.options.easing, function(){ // Last shake
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Slide
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.slide = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
- if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Transfer
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.transfer = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var target = $(o.options.to); // Find Target
- var position = el.offset();
- var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body);
- if(o.options.className) transfer.addClass(o.options.className);
-
- // Set target css
- transfer.addClass(o.options.className);
- transfer.css({
- top: position.top,
- left: position.left,
- height: el.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
- width: el.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')),
- position: 'absolute'
- });
-
- // Animation
- position = target.offset();
- animation = {
- top: position.top,
- left: position.left,
- height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
- width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth'))
- };
-
- // Animate
- transfer.animate(animation, o.duration, o.options.easing, function() {
- transfer.remove(); // Remove div
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Accordion
- *
- * Copyright (c) 2007, 2008 Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.accordion", {
- init: function() {
- var options = this.options;
-
- if ( options.navigation ) {
- var current = this.element.find("a").filter(options.navigationFilter);
- if ( current.length ) {
- if ( current.filter(options.header).length ) {
- options.active = current;
- } else {
- options.active = current.parent().parent().prev();
- current.addClass("current");
- }
- }
- }
-
- // calculate active if not specified, using the first header
- options.headers = this.element.find(options.header);
- options.active = findActive(options.headers, options.active);
-
- // IE7-/Win - Extra vertical space in Lists fixed
- if ($.browser.msie) {
- this.element.find('a').css('zoom', '1');
- }
-
- if (!this.element.hasClass("ui-accordion")) {
- this.element.addClass("ui-accordion");
- $("<span class='ui-accordion-left'/>").insertBefore(options.headers);
- $("<span class='ui-accordion-right'/>").appendTo(options.headers);
- options.headers.addClass("ui-accordion-header").attr("tabindex", "0");
- }
-
- var maxHeight;
- if ( options.fillSpace ) {
- maxHeight = this.element.parent().height();
- options.headers.each(function() {
- maxHeight -= $(this).outerHeight();
- });
- var maxPadding = 0;
- options.headers.next().each(function() {
- maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
- }).height(maxHeight - maxPadding);
- } else if ( options.autoHeight ) {
- maxHeight = 0;
- options.headers.next().each(function() {
- maxHeight = Math.max(maxHeight, $(this).outerHeight());
- }).height(maxHeight);
- }
-
- options.headers
- .not(options.active || "")
- .next()
- .hide();
- options.active.parent().andSelf().addClass(options.selectedClass);
-
- if (options.event) {
- this.element.bind((options.event) + ".accordion", clickHandler);
- }
- },
- activate: function(index) {
- // call clickHandler with custom event
- clickHandler.call(this.element[0], {
- target: findActive( this.options.headers, index )[0]
- });
- },
- destroy: function() {
- this.options.headers.next().css("display", "");
- if ( this.options.fillSpace || this.options.autoHeight ) {
- this.options.headers.next().css("height", "");
- }
- $.removeData(this.element[0], "accordion");
- this.element.removeClass("ui-accordion").unbind(".accordion");
- }
-});
-
-function scopeCallback(callback, scope) {
- return function() {
- return callback.apply(scope, arguments);
- };
-};
-
-function completed(cancel) {
- // if removed while animated data can be empty
- if (!$.data(this, "accordion")) {
- return;
- }
-
- var instance = $.data(this, "accordion");
- var options = instance.options;
- options.running = cancel ? 0 : --options.running;
- if ( options.running ) {
- return;
- }
- if ( options.clearStyle ) {
- options.toShow.add(options.toHide).css({
- height: "",
- overflow: ""
- });
- }
- $(this).triggerHandler("accordionchange", [null, options.data], options.change);
-}
-
-function toggle(toShow, toHide, data, clickedActive, down) {
- var options = $.data(this, "accordion").options;
- options.toShow = toShow;
- options.toHide = toHide;
- options.data = data;
- var complete = scopeCallback(completed, this);
-
- // count elements to animate
- options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
-
- if ( options.animated ) {
- if ( !options.alwaysOpen && clickedActive ) {
- $.ui.accordion.animations[options.animated]({
- toShow: jQuery([]),
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight
- });
- } else {
- $.ui.accordion.animations[options.animated]({
- toShow: toShow,
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight
- });
- }
- } else {
- if ( !options.alwaysOpen && clickedActive ) {
- toShow.toggle();
- } else {
- toHide.hide();
- toShow.show();
- }
- complete(true);
- }
-}
-
-function clickHandler(event) {
- var options = $.data(this, "accordion").options;
- if (options.disabled) {
- return false;
- }
-
- // called only when using activate(false) to close all parts programmatically
- if ( !event.target && !options.alwaysOpen ) {
- options.active.parent().andSelf().toggleClass(options.selectedClass);
- var toHide = options.active.next(),
- data = {
- options: options,
- newHeader: jQuery([]),
- oldHeader: options.active,
- newContent: jQuery([]),
- oldContent: toHide
- },
- toShow = (options.active = $([]));
- toggle.call(this, toShow, toHide, data );
- return false;
- }
- // get the click target
- var clicked = $(event.target);
-
- // due to the event delegation model, we have to check if one
- // of the parent elements is our actual header, and find that
- // otherwise stick with the initial target
- clicked = $( clicked.parents(options.header)[0] || clicked );
-
- var clickedActive = clicked[0] == options.active[0];
-
- // if animations are still active, or the active header is the target, ignore click
- if (options.running || (options.alwaysOpen && clickedActive)) {
- return false;
- }
- if (!clicked.is(options.header)) {
- return;
- }
-
- // switch classes
- options.active.parent().andSelf().toggleClass(options.selectedClass);
- if ( !clickedActive ) {
- clicked.parent().andSelf().addClass(options.selectedClass);
- }
-
- // find elements to show and hide
- var toShow = clicked.next(),
- toHide = options.active.next(),
- //data = [clicked, options.active, toShow, toHide],
- data = {
- options: options,
- newHeader: clicked,
- oldHeader: options.active,
- newContent: toShow,
- oldContent: toHide
- },
- down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );
-
- options.active = clickedActive ? $([]) : clicked;
- toggle.call(this, toShow, toHide, data, clickedActive, down );
-
- return false;
-};
-
-function findActive(headers, selector) {
- return selector != undefined
- ? typeof selector == "number"
- ? headers.filter(":eq(" + selector + ")")
- : headers.not(headers.not(selector))
- : selector === false
- ? $([])
- : headers.filter(":eq(0)");
-}
-
-$.extend($.ui.accordion, {
- defaults: {
- selectedClass: "selected",
- alwaysOpen: true,
- animated: 'slide',
- event: "click",
- header: "a",
- autoHeight: true,
- running: 0,
- navigationFilter: function() {
- return this.href.toLowerCase() == location.href.toLowerCase();
- }
- },
- animations: {
- slide: function(options, additions) {
- options = $.extend({
- easing: "swing",
- duration: 300
- }, options, additions);
- if ( !options.toHide.size() ) {
- options.toShow.animate({height: "show"}, options);
- return;
- }
- var hideHeight = options.toHide.height(),
- showHeight = options.toShow.height(),
- difference = showHeight / hideHeight;
- options.toShow.css({ height: 0, overflow: 'hidden' }).show();
- options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
- step: function(now) {
- var current = (hideHeight - now) * difference;
- if ($.browser.msie || $.browser.opera) {
- current = Math.ceil(current);
- }
- options.toShow.height( current );
- },
- duration: options.duration,
- easing: options.easing,
- complete: function() {
- if ( !options.autoHeight ) {
- options.toShow.css("height", "auto");
- }
- options.complete();
- }
- });
- },
- bounceslide: function(options) {
- this.slide(options, {
- easing: options.down ? "bounceout" : "swing",
- duration: options.down ? 1000 : 200
- });
- },
- easeslide: function(options) {
- this.slide(options, {
- easing: "easeinout",
- duration: 700
- });
- }
- }
-});
-
-// deprecated, use accordion("activate", index) instead
-$.fn.activate = function(index) {
- return this.accordion("activate", index);
-};
-
-})(jQuery);
-/*
- * jQuery UI Datepicker
- *
- * Copyright (c) 2006, 2007, 2008 Marc Grabanski
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * ui.core.js
- *
- * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au).
- */
-
-(function($) { // hide the namespace
-
-/* Date picker manager.
- Use the singleton instance of this class, $.datepicker, to interact with the date picker.
- Settings for (groups of) date pickers are maintained in an instance object
- (DatepickerInstance), allowing multiple different settings on the same page. */
-
-function Datepicker() {
- this.debug = false; // Change this to true to start debugging
- this._nextId = 0; // Next ID for a date picker instance
- this._inst = []; // List of instances indexed by ID
- this._curInst = null; // The current instance in use
- this._disabledInputs = []; // List of date picker inputs that have been disabled
- this._datepickerShowing = false; // True if the popup picker is showing , false if not
- this._inDialog = false; // True if showing within a "dialog", false if not
- this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
- this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
- this._wrapClass = 'ui-datepicker-wrap'; // The name of the wrapper marker class
- this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
- this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
- this._promptClass = 'ui-datepicker-prompt'; // The name of the dialog prompt marker class
- this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
- this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
- this.regional = []; // Available regional settings, indexed by language code
- this.regional[''] = { // Default regional settings
- clearText: 'Clear', // Display text for clear link
- clearStatus: 'Erase the current date', // Status text for clear link
- closeText: 'Close', // Display text for close link
- closeStatus: 'Close without change', // Status text for close link
- prevText: '&#x3c;Prev', // Display text for previous month link
- prevStatus: 'Show the previous month', // Status text for previous month link
- nextText: 'Next&#x3e;', // Display text for next month link
- nextStatus: 'Show the next month', // Status text for next month link
- currentText: 'Today', // Display text for current month link
- currentStatus: 'Show the current month', // Status text for current month link
- monthNames: ['January','February','March','April','May','June',
- 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
- monthStatus: 'Show a different month', // Status text for selecting a month
- yearStatus: 'Show a different year', // Status text for selecting a year
- weekHeader: 'Wk', // Header for the week of the year column
- weekStatus: 'Week of the year', // Status text for the week of the year column
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
- dayStatus: 'Set DD as first week day', // Status text for the day of the week selection
- dateStatus: 'Select DD, M d', // Status text for the date selection
- dateFormat: 'mm/dd/yy', // See format options on parseDate
- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
- initStatus: 'Select a date', // Initial Status text on opening
- isRTL: false // True if right-to-left language, false if left-to-right
- };
- this._defaults = { // Global defaults for all the date picker instances
- showOn: 'focus', // 'focus' for popup on focus,
- // 'button' for trigger button, or 'both' for either
- showAnim: 'show', // Name of jQuery animation for popup
- defaultDate: null, // Used when field is blank: actual date,
- // +/-number for offset from today, null for today
- appendText: '', // Display text following the input box, e.g. showing the format
- buttonText: '...', // Text for trigger button
- buttonImage: '', // URL for trigger button image
- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
- closeAtTop: true, // True to have the clear/close at the top,
- // false to have them at the bottom
- mandatory: false, // True to hide the Clear link, false to include it
- hideIfNoPrevNext: false, // True to hide next/previous month links
- // if not applicable, false to just disable them
- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
- changeMonth: true, // True if month can be selected directly, false if only prev/next
- changeYear: true, // True if year can be selected directly, false if only prev/next
- yearRange: '-10:+10', // Range of years to display in drop-down,
- // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
- changeFirstDay: true, // True to click on day name to change, false to remain as set
- highlightWeek: false, // True to highlight the selected week
- showOtherMonths: false, // True to show dates in other months, false to leave blank
- showWeeks: false, // True to show week of the year, false to omit
- calculateWeek: this.iso8601Week, // How to calculate the week of the year,
- // takes a Date and returns the number of the week for it
- shortYearCutoff: '+10', // Short year values < this are in the current century,
- // > this are in the previous century,
- // string value starting with '+' for current year + value
- showStatus: false, // True to show status bar at bottom, false to not show it
- statusForDate: this.dateStatus, // Function to provide status text for a date -
- // takes date and instance as parameters, returns display text
- minDate: null, // The earliest selectable date, or null for no limit
- maxDate: null, // The latest selectable date, or null for no limit
- speed: 'normal', // Speed of display/closure
- beforeShowDay: null, // Function that takes a date and returns an array with
- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
- // [2] = cell title (optional), e.g. $.datepicker.noWeekends
- beforeShow: null, // Function that takes an input field and
- // returns a set of custom settings for the date picker
- onSelect: null, // Define a callback function when a date is selected
- onChangeMonthYear: null, // Define a callback function when the month or year is changed
- onClose: null, // Define a callback function when the datepicker is closed
- numberOfMonths: 1, // Number of months to show at a time
- stepMonths: 1, // Number of months to step back/forward
- rangeSelect: false, // Allows for selecting a date range on one date picker
- rangeSeparator: ' - ', // Text between two dates in a range
- altField: '', // Selector for an alternate field to store selected dates into
- altFormat: '' // The date format to use for the alternate field
- };
- $.extend(this._defaults, this.regional['']);
- this._datepickerDiv = $('<div id="' + this._mainDivId + '"></div>');
-}
-
-$.extend(Datepicker.prototype, {
- /* Class name added to elements to indicate already configured with a date picker. */
- markerClassName: 'hasDatepicker',
-
- /* Debug logging (if enabled). */
- log: function () {
- if (this.debug)
- console.log.apply('', arguments);
- },
-
- /* Register a new date picker instance - with custom settings. */
- _register: function(inst) {
- var id = this._nextId++;
- this._inst[id] = inst;
- return id;
- },
-
- /* Retrieve a particular date picker instance based on its ID. */
- _getInst: function(id) {
- return this._inst[id] || id;
- },
-
- /* Override the default settings for all instances of the date picker.
- @param settings object - the new settings to use as defaults (anonymous object)
- @return the manager object */
- setDefaults: function(settings) {
- extendRemove(this._defaults, settings || {});
- return this;
- },
-
- /* Attach the date picker to a jQuery selection.
- @param target element - the target input field or division or span
- @param settings object - the new settings to use for this date picker instance (anonymous) */
- _attachDatepicker: function(target, settings) {
- // check for settings on the control itself - in namespace 'date:'
- var inlineSettings = null;
- for (attrName in this._defaults) {
- var attrValue = target.getAttribute('date:' + attrName);
- if (attrValue) {
- inlineSettings = inlineSettings || {};
- try {
- inlineSettings[attrName] = eval(attrValue);
- } catch (err) {
- inlineSettings[attrName] = attrValue;
- }
- }
- }
- var nodeName = target.nodeName.toLowerCase();
- var instSettings = (inlineSettings ?
- $.extend(settings || {}, inlineSettings) : settings);
- if (nodeName == 'input') {
- var inst = (inst && !inlineSettings ? inst :
- new DatepickerInstance(instSettings, false));
- this._connectDatepicker(target, inst);
- } else if (nodeName == 'div' || nodeName == 'span') {
- var inst = new DatepickerInstance(instSettings, true);
- this._inlineDatepicker(target, inst);
- }
- },
-
- /* Detach a datepicker from its control.
- @param target element - the target input field or division or span */
- _destroyDatepicker: function(target) {
- var nodeName = target.nodeName.toLowerCase();
- var calId = target._calId;
- var $target = $(target);
- $target.removeAttr('_calId');
- if (nodeName == 'input') {
- $target.siblings('.' + this._appendClass).replaceWith('').end()
- .siblings('.' + this._triggerClass).replaceWith('').end()
- .removeClass(this.markerClassName)
- .unbind('focus', this._showDatepicker)
- .unbind('keydown', this._doKeyDown)
- .unbind('keypress', this._doKeyPress);
- var wrapper = $target.parents('.' + this._wrapClass);
- if (wrapper)
- wrapper.siblings('.' + this._appendClass).replaceWith('').end()
- .replaceWith(wrapper.html());
- } else if (nodeName == 'div' || nodeName == 'span')
- $target.removeClass(this.markerClassName).empty();
- if ($('input[_calId=' + calId + ']').length == 0)
- // clean up if last for this ID
- this._inst[calId] = null;
- },
-
- /* Enable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _enableDatepicker: function(target) {
- target.disabled = false;
- $(target).siblings('button.' + this._triggerClass).each(function() { this.disabled = false; }).end()
- .siblings('img.' + this._triggerClass).css({opacity: '1.0', cursor: ''});
- this._disabledInputs = $.map(this._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- },
-
- /* Disable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _disableDatepicker: function(target) {
- target.disabled = true;
- $(target).siblings('button.' + this._triggerClass).each(function() { this.disabled = true; }).end()
- .siblings('img.' + this._triggerClass).css({opacity: '0.5', cursor: 'default'});
- this._disabledInputs = $.map($.datepicker._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- this._disabledInputs[$.datepicker._disabledInputs.length] = target;
- },
-
- /* Is the first field in a jQuery collection disabled as a datepicker?
- @param target element - the target input field or division or span
- @return boolean - true if disabled, false if enabled */
- _isDisabledDatepicker: function(target) {
- if (!target)
- return false;
- for (var i = 0; i < this._disabledInputs.length; i++) {
- if (this._disabledInputs[i] == target)
- return true;
- }
- return false;
- },
-
- /* Update the settings for a date picker attached to an input field or division.
- @param target element - the target input field or division or span
- @param name string - the name of the setting to change or
- object - the new settings to update
- @param value any - the new value for the setting (omit if above is an object) */
- _changeDatepicker: function(target, name, value) {
- var settings = name || {};
- if (typeof name == 'string') {
- settings = {};
- settings[name] = value;
- }
- if (inst = this._getInst(target._calId)) {
- extendRemove(inst._settings, settings);
- this._updateDatepicker(inst);
- }
- },
-
- /* Set the dates for a jQuery selection.
- @param target element - the target input field or division or span
- @param date Date - the new date
- @param endDate Date - the new end date for a range (optional) */
- _setDateDatepicker: function(target, date, endDate) {
- if (inst = this._getInst(target._calId)) {
- inst._setDate(date, endDate);
- this._updateDatepicker(inst);
- }
- },
-
- /* Get the date(s) for the first entry in a jQuery selection.
- @param target element - the target input field or division or span
- @return Date - the current date or
- Date[2] - the current dates for a range */
- _getDateDatepicker: function(target) {
- var inst = this._getInst(target._calId);
- if (inst)
- inst._setDateFromField($(target));
- return (inst ? inst._getDate() : null);
- },
-
- /* Handle keystrokes. */
- _doKeyDown: function(e) {
- var inst = $.datepicker._getInst(this._calId);
- if ($.datepicker._datepickerShowing)
- switch (e.keyCode) {
- case 9: $.datepicker._hideDatepicker(null, '');
- break; // hide on tab out
- case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear,
- $('td.ui-datepicker-days-cell-over', inst._datepickerDiv)[0]);
- return false; // don't submit the form
- break; // select the value on enter
- case 27: $.datepicker._hideDatepicker(null, inst._get('speed'));
- break; // hide on escape
- case 33: $.datepicker._adjustDate(inst,
- (e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
- break; // previous month/year on page up/+ ctrl
- case 34: $.datepicker._adjustDate(inst,
- (e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
- break; // next month/year on page down/+ ctrl
- case 35: if (e.ctrlKey) $.datepicker._clearDate(inst);
- break; // clear on ctrl+end
- case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst);
- break; // current on ctrl+home
- case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D');
- break; // -1 day on ctrl+left
- case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D');
- break; // -1 week on ctrl+up
- case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D');
- break; // +1 day on ctrl+right
- case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D');
- break; // +1 week on ctrl+down
- }
- else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home
- $.datepicker._showDatepicker(this);
- },
-
- /* Filter entered characters - based on date format. */
- _doKeyPress: function(e) {
- var inst = $.datepicker._getInst(this._calId);
- var chars = $.datepicker._possibleChars(inst._get('dateFormat'));
- var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode);
- return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
- },
-
- /* Attach the date picker to an input field. */
- _connectDatepicker: function(target, inst) {
- var input = $(target);
- if (input.hasClass(this.markerClassName))
- return;
- var appendText = inst._get('appendText');
- var isRTL = inst._get('isRTL');
- if (appendText)
- input[isRTL ? 'before' : 'after']('<span class="' + this._appendClass + '">' + appendText + '</span>');
- var showOn = inst._get('showOn');
- if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
- input.focus(this._showDatepicker);
- if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
- input.wrap('<span class="' + this._wrapClass + '"></span>');
- var buttonText = inst._get('buttonText');
- var buttonImage = inst._get('buttonImage');
- var trigger = $(inst._get('buttonImageOnly') ?
- $('<img/>').addClass(this._triggerClass).attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
- $('<button></button>').addClass(this._triggerClass).html(buttonImage != '' ?
- $('<img/>').attr({ src:buttonImage, alt:buttonText, title:buttonText }) : buttonText));
- input[isRTL ? 'before' : 'after'](trigger);
- trigger.click(function() {
- if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
- $.datepicker._hideDatepicker();
- else
- $.datepicker._showDatepicker(target);
- });
- }
- input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress)
- .bind("setData.datepicker", function(event, key, value) {
- inst._settings[key] = value;
- }).bind("getData.datepicker", function(event, key) {
- return inst._get(key);
- });
- input[0]._calId = inst._id;
- },
-
- /* Attach an inline date picker to a div. */
- _inlineDatepicker: function(target, inst) {
- var input = $(target);
- if (input.hasClass(this.markerClassName))
- return;
- input.addClass(this.markerClassName).append(inst._datepickerDiv)
- .bind("setData.datepicker", function(event, key, value){
- inst._settings[key] = value;
- }).bind("getData.datepicker", function(event, key){
- return inst._get(key);
- });
- input[0]._calId = inst._id;
- this._updateDatepicker(inst);
- },
-
- /* Tidy up after displaying the date picker. */
- _inlineShow: function(inst) {
- var numMonths = inst._getNumberOfMonths(); // fix width for dynamic number of date pickers
- inst._datepickerDiv.width(numMonths[1] * $('.ui-datepicker', inst._datepickerDiv[0]).width());
- },
-
- /* Pop-up the date picker in a "dialog" box.
- @param input element - ignored
- @param dateText string - the initial date to display (in the current format)
- @param onSelect function - the function(dateText) to call when a date is selected
- @param settings object - update the dialog date picker instance's settings (anonymous object)
- @param pos int[2] - coordinates for the dialog's position within the screen or
- event - with x/y coordinates or
- leave empty for default (screen centre)
- @return the manager object */
- _dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
- var inst = this._dialogInst; // internal instance
- if (!inst) {
- inst = this._dialogInst = new DatepickerInstance({}, false);
- this._dialogInput = $('<input type="text" size="1" style="position: absolute; top: -100px;"/>');
- this._dialogInput.keydown(this._doKeyDown);
- $('body').append(this._dialogInput);
- this._dialogInput[0]._calId = inst._id;
- }
- extendRemove(inst._settings, settings || {});
- this._dialogInput.val(dateText);
-
- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
- if (!this._pos) {
- var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
- var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- this._pos = // should use actual width/height below
- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
- }
-
- // move input on screen for focus, but hidden behind dialog
- this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
- inst._settings.onSelect = onSelect;
- this._inDialog = true;
- this._datepickerDiv.addClass(this._dialogClass);
- this._showDatepicker(this._dialogInput[0]);
- if ($.blockUI)
- $.blockUI(this._datepickerDiv);
- return this;
- },
-
- /* Pop-up the date picker for a given input field.
- @param input element - the input field attached to the date picker or
- event - if triggered by focus */
- _showDatepicker: function(input) {
- input = input.target || input;
- if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
- input = $('input', input.parentNode)[0];
- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
- return;
- var inst = $.datepicker._getInst(input._calId);
- var beforeShow = inst._get('beforeShow');
- extendRemove(inst._settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
- $.datepicker._hideDatepicker(null, '');
- $.datepicker._lastInput = input;
- inst._setDateFromField(input);
- if ($.datepicker._inDialog) // hide cursor
- input.value = '';
- if (!$.datepicker._pos) { // position below input
- $.datepicker._pos = $.datepicker._findPos(input);
- $.datepicker._pos[1] += input.offsetHeight; // add the height
- }
- var isFixed = false;
- $(input).parents().each(function() {
- isFixed |= $(this).css('position') == 'fixed';
- return !isFixed;
- });
- if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
- $.datepicker._pos[0] -= document.documentElement.scrollLeft;
- $.datepicker._pos[1] -= document.documentElement.scrollTop;
- }
- var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
- $.datepicker._pos = null;
- inst._rangeStart = null;
- // determine sizing offscreen
- inst._datepickerDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
- $.datepicker._updateDatepicker(inst);
- // fix width for dynamic number of date pickers
- inst._datepickerDiv.width(inst._getNumberOfMonths()[1] *
- $('.ui-datepicker', inst._datepickerDiv[0])[0].offsetWidth);
- // and adjust position before showing
- offset = $.datepicker._checkOffset(inst, offset, isFixed);
- inst._datepickerDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
- 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
- left: offset.left + 'px', top: offset.top + 'px'});
- if (!inst._inline) {
- var showAnim = inst._get('showAnim') || 'show';
- var speed = inst._get('speed');
- var postProcess = function() {
- $.datepicker._datepickerShowing = true;
- if ($.browser.msie && parseInt($.browser.version) < 7) // fix IE < 7 select problems
- $('iframe.ui-datepicker-cover').css({width: inst._datepickerDiv.width() + 4,
- height: inst._datepickerDiv.height() + 4});
- };
- inst._datepickerDiv[showAnim](speed, postProcess);
- if (speed == '')
- postProcess();
- if (inst._input[0].type != 'hidden')
- inst._input[0].focus();
- $.datepicker._curInst = inst;
- }
- },
-
- /* Generate the date picker content. */
- _updateDatepicker: function(inst) {
- var dims = {width: inst._datepickerDiv.width() + 4,
- height: inst._datepickerDiv.height() + 4};
- inst._datepickerDiv.empty().append(inst._generateDatepicker()).
- find('iframe.ui-datepicker-cover').
- css({width: dims.width, height: dims.height});
- var numMonths = inst._getNumberOfMonths();
- if (numMonths[0] != 1 || numMonths[1] != 1)
- inst._datepickerDiv.addClass('ui-datepicker-multi');
- else
- inst._datepickerDiv.removeClass('ui-datepicker-multi');
-
- if (inst._get('isRTL'))
- inst._datepickerDiv.addClass('ui-datepicker-rtl');
- else
- inst._datepickerDiv.removeClass('ui-datepicker-rtl');
-
- if (inst._input && inst._input[0].type != 'hidden')
- $(inst._input[0]).focus();
- },
-
- /* Check positioning to remain on screen. */
- _checkOffset: function(inst, offset, isFixed) {
- var pos = inst._input ? $.datepicker._findPos(inst._input[0]) : null;
- var browserWidth = window.innerWidth || document.documentElement.clientWidth;
- var browserHeight = window.innerHeight || document.documentElement.clientHeight;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- // reposition date picker horizontally if outside the browser window
- if ((offset.left + inst._datepickerDiv.width() - scrollX) > browserWidth)
- offset.left = Math.max((isFixed ? 0 : scrollX),
- pos[0] + (inst._input ? inst._input.width() : 0) - (isFixed ? scrollX : 0) - inst._datepickerDiv.width() -
- (isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0));
- else
- offset.left -= (isFixed ? scrollX : 0);
- // reposition date picker vertically if outside the browser window
- if ((offset.top + inst._datepickerDiv.height() - scrollY) > browserHeight)
- offset.top = Math.max((isFixed ? 0 : scrollY),
- pos[1] - (isFixed ? scrollY : 0) - (this._inDialog ? 0 : inst._datepickerDiv.height()) -
- (isFixed && $.browser.opera ? document.documentElement.scrollTop : 0));
- else
- offset.top -= (isFixed ? scrollY : 0);
- return offset;
- },
-
- /* Find an object's position on the screen. */
- _findPos: function(obj) {
- while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
- obj = obj.nextSibling;
- }
- var position = $(obj).offset();
- return [position.left, position.top];
- },
-
- /* Hide the date picker from view.
- @param input element - the input field attached to the date picker
- @param speed string - the speed at which to close the date picker */
- _hideDatepicker: function(input, speed) {
- var inst = this._curInst;
- if (!inst)
- return;
- var rangeSelect = inst._get('rangeSelect');
- if (rangeSelect && this._stayOpen)
- this._selectDate(inst, inst._formatDate(
- inst._currentDay, inst._currentMonth, inst._currentYear));
- this._stayOpen = false;
- if (this._datepickerShowing) {
- speed = (speed != null ? speed : inst._get('speed'));
- var showAnim = inst._get('showAnim');
- inst._datepickerDiv[(showAnim == 'slideDown' ? 'slideUp' :
- (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))](speed, function() {
- $.datepicker._tidyDialog(inst);
- });
- if (speed == '')
- this._tidyDialog(inst);
- var onClose = inst._get('onClose');
- if (onClose)
- onClose.apply((inst._input ? inst._input[0] : null),
- [inst._getDate(), inst]); // trigger custom callback
- this._datepickerShowing = false;
- this._lastInput = null;
- inst._settings.prompt = null;
- if (this._inDialog) {
- this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
- if ($.blockUI) {
- $.unblockUI();
- $('body').append(this._datepickerDiv);
- }
- }
- this._inDialog = false;
- }
- this._curInst = null;
- },
-
- /* Tidy up after a dialog display. */
- _tidyDialog: function(inst) {
- inst._datepickerDiv.removeClass(this._dialogClass).unbind('.ui-datepicker');
- $('.' + this._promptClass, inst._datepickerDiv).remove();
- },
-
- /* Close date picker if clicked elsewhere. */
- _checkExternalClick: function(event) {
- if (!$.datepicker._curInst)
- return;
- var $target = $(event.target);
- if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
- !$target.hasClass($.datepicker.markerClassName) &&
- !$target.hasClass($.datepicker._triggerClass) &&
- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
- $.datepicker._hideDatepicker(null, '');
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(id, offset, period) {
- var inst = this._getInst(id);
- inst._adjustDate(offset, period);
- this._updateDatepicker(inst);
- },
-
- /* Action for current link. */
- _gotoToday: function(id) {
- var date = new Date();
- var inst = this._getInst(id);
- inst._selectedDay = date.getDate();
- inst._drawMonth = inst._selectedMonth = date.getMonth();
- inst._drawYear = inst._selectedYear = date.getFullYear();
- this._adjustDate(inst);
- inst._notifyChange();
- },
-
- /* Action for selecting a new month/year. */
- _selectMonthYear: function(id, select, period) {
- var inst = this._getInst(id);
- inst._selectingMonthYear = false;
- inst[period == 'M' ? '_drawMonth' : '_drawYear'] =
- select.options[select.selectedIndex].value - 0;
- this._adjustDate(inst);
- inst._notifyChange();
- },
-
- /* Restore input focus after not changing month/year. */
- _clickMonthYear: function(id) {
- var inst = this._getInst(id);
- if (inst._input && inst._selectingMonthYear && !$.browser.msie)
- inst._input[0].focus();
- inst._selectingMonthYear = !inst._selectingMonthYear;
- },
-
- /* Action for changing the first week day. */
- _changeFirstDay: function(id, day) {
- var inst = this._getInst(id);
- inst._settings.firstDay = day;
- this._updateDatepicker(inst);
- },
-
- /* Action for selecting a day. */
- _selectDay: function(id, month, year, td) {
- if ($(td).hasClass(this._unselectableClass))
- return;
- var inst = this._getInst(id);
- var rangeSelect = inst._get('rangeSelect');
- if (rangeSelect) {
- this._stayOpen = !this._stayOpen;
- if (this._stayOpen) {
- $('.ui-datepicker td').removeClass(this._currentClass);
- $(td).addClass(this._currentClass);
- }
- }
- inst._selectedDay = inst._currentDay = $('a', td).html();
- inst._selectedMonth = inst._currentMonth = month;
- inst._selectedYear = inst._currentYear = year;
- if (this._stayOpen) {
- inst._endDay = inst._endMonth = inst._endYear = null;
- }
- else if (rangeSelect) {
- inst._endDay = inst._currentDay;
- inst._endMonth = inst._currentMonth;
- inst._endYear = inst._currentYear;
- }
- this._selectDate(id, inst._formatDate(
- inst._currentDay, inst._currentMonth, inst._currentYear));
- if (this._stayOpen) {
- inst._rangeStart = new Date(inst._currentYear, inst._currentMonth, inst._currentDay);
- this._updateDatepicker(inst);
- }
- else if (rangeSelect) {
- inst._selectedDay = inst._currentDay = inst._rangeStart.getDate();
- inst._selectedMonth = inst._currentMonth = inst._rangeStart.getMonth();
- inst._selectedYear = inst._currentYear = inst._rangeStart.getFullYear();
- inst._rangeStart = null;
- if (inst._inline)
- this._updateDatepicker(inst);
- }
- },
-
- /* Erase the input field and hide the date picker. */
- _clearDate: function(id) {
- var inst = this._getInst(id);
- if (inst._get('mandatory'))
- return;
- this._stayOpen = false;
- inst._endDay = inst._endMonth = inst._endYear = inst._rangeStart = null;
- this._selectDate(inst, '');
- },
-
- /* Update the input field with the selected date. */
- _selectDate: function(id, dateStr) {
- var inst = this._getInst(id);
- dateStr = (dateStr != null ? dateStr : inst._formatDate());
- if (inst._get('rangeSelect') && dateStr)
- dateStr = (inst._rangeStart ? inst._formatDate(inst._rangeStart) :
- dateStr) + inst._get('rangeSeparator') + dateStr;
- if (inst._input)
- inst._input.val(dateStr);
- this._updateAlternate(inst);
- var onSelect = inst._get('onSelect');
- if (onSelect)
- onSelect.apply((inst._input ? inst._input[0] : null), [dateStr, inst]); // trigger custom callback
- else if (inst._input)
- inst._input.trigger('change'); // fire the change event
- if (inst._inline)
- this._updateDatepicker(inst);
- else if (!this._stayOpen) {
- this._hideDatepicker(null, inst._get('speed'));
- this._lastInput = inst._input[0];
- if (typeof(inst._input[0]) != 'object')
- inst._input[0].focus(); // restore focus
- this._lastInput = null;
- }
- },
-
- /* Update any alternate field to synchronise with the main field. */
- _updateAlternate: function(inst) {
- var altField = inst._get('altField');
- if (altField) { // update alternate field too
- var altFormat = inst._get('altFormat');
- var date = inst._getDate();
- dateStr = (isArray(date) ? (!date[0] && !date[1] ? '' :
- $.datepicker.formatDate(altFormat, date[0], inst._getFormatConfig()) +
- inst._get('rangeSeparator') + $.datepicker.formatDate(
- altFormat, date[1] || date[0], inst._getFormatConfig())) :
- $.datepicker.formatDate(altFormat, date, inst._getFormatConfig()));
- $(altField).each(function() { $(this).val(dateStr); });
- }
- },
-
- /* Set as beforeShowDay function to prevent selection of weekends.
- @param date Date - the date to customise
- @return [boolean, string] - is this date selectable?, what is its CSS class? */
- noWeekends: function(date) {
- var day = date.getDay();
- return [(day > 0 && day < 6), ''];
- },
-
- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
- @param date Date - the date to get the week for
- @return number - the number of the week within the year that contains this date */
- iso8601Week: function(date) {
- var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), (date.getTimezoneOffset() / -60));
- var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
- var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
- firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
- if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
- checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
- return $.datepicker.iso8601Week(checkDate);
- } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
- firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
- if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
- checkDate.setDate(checkDate.getDate() + 3); // Generate for next year
- return $.datepicker.iso8601Week(checkDate);
- }
- }
- return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
- },
-
- /* Provide status text for a particular date.
- @param date the date to get the status for
- @param inst the current datepicker instance
- @return the status display text for this date */
- dateStatus: function(date, inst) {
- return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig());
- },
-
- /* Parse a string value into a date object.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- '...' - literal text
- '' - single quote
-
- @param format String - the expected format of the date
- @param value String - the date in the above format
- @param settings Object - attributes include:
- shortYearCutoff Number - the cutoff year for determining the century (optional)
- dayNamesShort String[7] - abbreviated names of the days from Sunday (optional)
- dayNames String[7] - names of the days from Sunday (optional)
- monthNamesShort String[12] - abbreviated names of the months (optional)
- monthNames String[12] - names of the months (optional)
- @return Date - the extracted date value or null if value is blank */
- parseDate: function (format, value, settings) {
- if (format == null || value == null)
- throw 'Invalid arguments';
- value = (typeof value == 'object' ? value.toString() : value + '');
- if (value == '')
- return null;
- var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- var year = -1;
- var month = -1;
- var day = -1;
- var literal = false;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Extract a number from the string value
- var getNumber = function(match) {
- lookAhead(match);
- var size = (match == 'y' ? 4 : 2);
- var num = 0;
- while (size > 0 && iValue < value.length &&
- value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
- num = num * 10 + (value.charAt(iValue++) - 0);
- size--;
- }
- if (size == (match == 'y' ? 4 : 2))
- throw 'Missing number at position ' + iValue;
- return num;
- };
- // Extract a name from the string value and convert to an index
- var getName = function(match, shortNames, longNames) {
- var names = (lookAhead(match) ? longNames : shortNames);
- var size = 0;
- for (var j = 0; j < names.length; j++)
- size = Math.max(size, names[j].length);
- var name = '';
- var iInit = iValue;
- while (size > 0 && iValue < value.length) {
- name += value.charAt(iValue++);
- for (var i = 0; i < names.length; i++)
- if (name == names[i])
- return i + 1;
- size--;
- }
- throw 'Unknown name at position ' + iInit;
- };
- // Confirm that a literal character matches the string value
- var checkLiteral = function() {
- if (value.charAt(iValue) != format.charAt(iFormat))
- throw 'Unexpected literal at position ' + iValue;
- iValue++;
- };
- var iValue = 0;
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- checkLiteral();
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- day = getNumber('d');
- break;
- case 'D':
- getName('D', dayNamesShort, dayNames);
- break;
- case 'm':
- month = getNumber('m');
- break;
- case 'M':
- month = getName('M', monthNamesShort, monthNames);
- break;
- case 'y':
- year = getNumber('y');
- break;
- case "'":
- if (lookAhead("'"))
- checkLiteral();
- else
- literal = true;
- break;
- default:
- checkLiteral();
- }
- }
- if (year < 100)
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
- (year <= shortYearCutoff ? 0 : -100);
- var date = new Date(year, month - 1, day);
- if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
- throw 'Invalid date'; // E.g. 31/02/*
- return date;
- },
-
- /* Format a date object into a string value.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- '...' - literal text
- '' - single quote
-
- @param format String - the desired format of the date
- @param date Date - the date value to format
- @param settings Object - attributes include:
- dayNamesShort String[7] - abbreviated names of the days from Sunday (optional)
- dayNames String[7] - names of the days from Sunday (optional)
- monthNamesShort String[12] - abbreviated names of the months (optional)
- monthNames String[12] - names of the months (optional)
- @return String - the date in the above format */
- formatDate: function (format, date, settings) {
- if (!date)
- return '';
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Format a number, with leading zero if necessary
- var formatNumber = function(match, value) {
- return (lookAhead(match) && value < 10 ? '0' : '') + value;
- };
- // Format a name, short or long as requested
- var formatName = function(match, value, shortNames, longNames) {
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
- };
- var output = '';
- var literal = false;
- if (date)
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- output += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- output += formatNumber('d', date.getDate());
- break;
- case 'D':
- output += formatName('D', date.getDay(), dayNamesShort, dayNames);
- break;
- case 'm':
- output += formatNumber('m', date.getMonth() + 1);
- break;
- case 'M':
- output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
- break;
- case 'y':
- output += (lookAhead('y') ? date.getFullYear() :
- (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
- break;
- case "'":
- if (lookAhead("'"))
- output += "'";
- else
- literal = true;
- break;
- default:
- output += format.charAt(iFormat);
- }
- }
- return output;
- },
-
- /* Extract all possible characters from the date format. */
- _possibleChars: function (format) {
- var chars = '';
- var literal = false;
- for (var iFormat = 0; iFormat < format.length; iFormat++)
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- chars += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd': case 'm': case 'y':
- chars += '0123456789';
- break;
- case 'D': case 'M':
- return null; // Accept anything
- case "'":
- if (lookAhead("'"))
- chars += "'";
- else
- literal = true;
- break;
- default:
- chars += format.charAt(iFormat);
- }
- return chars;
- }
-});
-
-/* Individualised settings for date picker functionality applied to one or more related inputs.
- Instances are managed and manipulated through the Datepicker manager. */
-function DatepickerInstance(settings, inline) {
- this._id = $.datepicker._register(this);
- this._selectedDay = 0; // Current date for selection
- this._selectedMonth = 0; // 0-11
- this._selectedYear = 0; // 4-digit year
- this._drawMonth = 0; // Current month at start of datepicker
- this._drawYear = 0;
- this._input = null; // The attached input field
- this._inline = inline; // True if showing inline, false if used in a popup
- this._datepickerDiv = (!inline ? $.datepicker._datepickerDiv :
- $('<div id="' + $.datepicker._mainDivId + '-' + this._id + '" class="ui-datepicker-inline">'));
- // customise the date picker object - uses manager defaults if not overridden
- this._settings = extendRemove(settings || {}); // clone
- if (inline)
- this._setDate(this._getDefaultDate());
-}
-
-$.extend(DatepickerInstance.prototype, {
- /* Get a setting value, defaulting if necessary. */
- _get: function(name) {
- return this._settings[name] !== undefined ? this._settings[name] : $.datepicker._defaults[name];
- },
-
- /* Parse existing date and initialise date picker. */
- _setDateFromField: function(input) {
- this._input = $(input);
- var dateFormat = this._get('dateFormat');
- var dates = this._input ? this._input.val().split(this._get('rangeSeparator')) : null;
- this._endDay = this._endMonth = this._endYear = null;
- var date = defaultDate = this._getDefaultDate();
- if (dates.length > 0) {
- var settings = this._getFormatConfig();
- if (dates.length > 1) {
- date = $.datepicker.parseDate(dateFormat, dates[1], settings) || defaultDate;
- this._endDay = date.getDate();
- this._endMonth = date.getMonth();
- this._endYear = date.getFullYear();
- }
- try {
- date = $.datepicker.parseDate(dateFormat, dates[0], settings) || defaultDate;
- } catch (e) {
- $.datepicker.log(e);
- date = defaultDate;
- }
- }
- this._selectedDay = date.getDate();
- this._drawMonth = this._selectedMonth = date.getMonth();
- this._drawYear = this._selectedYear = date.getFullYear();
- this._currentDay = (dates[0] ? date.getDate() : 0);
- this._currentMonth = (dates[0] ? date.getMonth() : 0);
- this._currentYear = (dates[0] ? date.getFullYear() : 0);
- this._adjustDate();
- },
-
- /* Retrieve the default date shown on opening. */
- _getDefaultDate: function() {
- var date = this._determineDate('defaultDate', new Date());
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- date = (minDate && date < minDate ? minDate : date);
- date = (maxDate && date > maxDate ? maxDate : date);
- return date;
- },
-
- /* A date may be specified as an exact value or a relative one. */
- _determineDate: function(name, defaultDate) {
- var offsetNumeric = function(offset) {
- var date = new Date();
- date.setDate(date.getDate() + offset);
- return date;
- };
- var offsetString = function(offset, getDaysInMonth) {
- var date = new Date();
- var year = date.getFullYear();
- var month = date.getMonth();
- var day = date.getDate();
- var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
- var matches = pattern.exec(offset);
- while (matches) {
- switch (matches[2] || 'd') {
- case 'd' : case 'D' :
- day += (matches[1] - 0); break;
- case 'w' : case 'W' :
- day += (matches[1] * 7); break;
- case 'm' : case 'M' :
- month += (matches[1] - 0);
- day = Math.min(day, getDaysInMonth(year, month));
- break;
- case 'y': case 'Y' :
- year += (matches[1] - 0);
- day = Math.min(day, getDaysInMonth(year, month));
- break;
- }
- matches = pattern.exec(offset);
- }
- return new Date(year, month, day);
- };
- var date = this._get(name);
- return (date == null ? defaultDate :
- (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
- (typeof date == 'number' ? offsetNumeric(date) : date)));
- },
-
- /* Set the date(s) directly. */
- _setDate: function(date, endDate) {
- this._selectedDay = this._currentDay = date.getDate();
- this._drawMonth = this._selectedMonth = this._currentMonth = date.getMonth();
- this._drawYear = this._selectedYear = this._currentYear = date.getFullYear();
- if (this._get('rangeSelect')) {
- if (endDate) {
- this._endDay = endDate.getDate();
- this._endMonth = endDate.getMonth();
- this._endYear = endDate.getFullYear();
- } else {
- this._endDay = this._currentDay;
- this._endMonth = this._currentMonth;
- this._endYear = this._currentYear;
- }
- }
- this._adjustDate();
- },
-
- /* Retrieve the date(s) directly. */
- _getDate: function() {
- var startDate = (!this._currentYear || (this._input && this._input.val() == '') ? null :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- if (this._get('rangeSelect')) {
- return [this._rangeStart || startDate, (!this._endYear ? null :
- new Date(this._endYear, this._endMonth, this._endDay))];
- } else
- return startDate;
- },
-
- /* Generate the HTML for the current state of the date picker. */
- _generateDatepicker: function() {
- var today = new Date();
- today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // clear time
- var showStatus = this._get('showStatus');
- var isRTL = this._get('isRTL');
- // build the date picker HTML
- var clear = (this._get('mandatory') ? '' :
- '<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('clearStatus') || '&#xa0;') : '') + '>' +
- this._get('clearText') + '</a></div>');
- var controls = '<div class="ui-datepicker-control">' + (isRTL ? '' : clear) +
- '<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"' +
- (showStatus ? this._addStatus(this._get('closeStatus') || '&#xa0;') : '') + '>' +
- this._get('closeText') + '</a></div>' + (isRTL ? clear : '') + '</div>';
- var prompt = this._get('prompt');
- var closeAtTop = this._get('closeAtTop');
- var hideIfNoPrevNext = this._get('hideIfNoPrevNext');
- var navigationAsDateFormat = this._get('navigationAsDateFormat');
- var numMonths = this._getNumberOfMonths();
- var stepMonths = this._get('stepMonths');
- var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- var drawMonth = this._drawMonth;
- var drawYear = this._drawYear;
- if (maxDate) {
- var maxDraw = new Date(maxDate.getFullYear(),
- maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate());
- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
- while (new Date(drawYear, drawMonth, 1) > maxDraw) {
- drawMonth--;
- if (drawMonth < 0) {
- drawMonth = 11;
- drawYear--;
- }
- }
- }
- // controls and links
- var prevText = this._get('prevText');
- prevText = (!navigationAsDateFormat ? prevText : $.datepicker.formatDate(
- prevText, new Date(drawYear, drawMonth - stepMonths, 1), this._getFormatConfig()));
- var prev = '<div class="ui-datepicker-prev">' + (this._canAdjustMonth(-1, drawYear, drawMonth) ?
- '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', -' + stepMonths + ', \'M\');"' +
- (showStatus ? this._addStatus(this._get('prevStatus') || '&#xa0;') : '') + '>' + prevText + '</a>' :
- (hideIfNoPrevNext ? '' : '<label>' + prevText + '</label>')) + '</div>';
- var nextText = this._get('nextText');
- nextText = (!navigationAsDateFormat ? nextText : $.datepicker.formatDate(
- nextText, new Date(drawYear, drawMonth + stepMonths, 1), this._getFormatConfig()));
- var next = '<div class="ui-datepicker-next">' + (this._canAdjustMonth(+1, drawYear, drawMonth) ?
- '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', +' + stepMonths + ', \'M\');"' +
- (showStatus ? this._addStatus(this._get('nextStatus') || '&#xa0;') : '') + '>' + nextText + '</a>' :
- (hideIfNoPrevNext ? '' : '<label>' + nextText + '</label>')) + '</div>';
- var currentText = this._get('currentText');
- currentText = (!navigationAsDateFormat ? currentText: $.datepicker.formatDate(
- currentText, today, this._getFormatConfig()));
- var html = (prompt ? '<div class="' + $.datepicker._promptClass + '">' + prompt + '</div>' : '') +
- (closeAtTop && !this._inline ? controls : '') +
- '<div class="ui-datepicker-links">' + (isRTL ? next : prev) +
- (this._isInRange(today) ? '<div class="ui-datepicker-current">' +
- '<a onclick="jQuery.datepicker._gotoToday(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('currentStatus') || '&#xa0;') : '') + '>' +
- currentText + '</a></div>' : '') + (isRTL ? prev : next) + '</div>';
- var showWeeks = this._get('showWeeks');
- for (var row = 0; row < numMonths[0]; row++)
- for (var col = 0; col < numMonths[1]; col++) {
- var selectedDate = new Date(drawYear, drawMonth, this._selectedDay);
- html += '<div class="ui-datepicker-one-month' + (col == 0 ? ' ui-datepicker-new-row' : '') + '">' +
- this._generateMonthYearHeader(drawMonth, drawYear, minDate, maxDate,
- selectedDate, row > 0 || col > 0) + // draw month headers
- '<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead>' +
- '<tr class="ui-datepicker-title-row">' +
- (showWeeks ? '<td>' + this._get('weekHeader') + '</td>' : '');
- var firstDay = this._get('firstDay');
- var changeFirstDay = this._get('changeFirstDay');
- var dayNames = this._get('dayNames');
- var dayNamesShort = this._get('dayNamesShort');
- var dayNamesMin = this._get('dayNamesMin');
- for (var dow = 0; dow < 7; dow++) { // days of the week
- var day = (dow + firstDay) % 7;
- var status = this._get('dayStatus') || '&#xa0;';
- status = (status.indexOf('DD') > -1 ? status.replace(/DD/, dayNames[day]) :
- status.replace(/D/, dayNamesShort[day]));
- html += '<td' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end-cell"' : '') + '>' +
- (!changeFirstDay ? '<span' :
- '<a onclick="jQuery.datepicker._changeFirstDay(' + this._id + ', ' + day + ');"') +
- (showStatus ? this._addStatus(status) : '') + ' title="' + dayNames[day] + '">' +
- dayNamesMin[day] + (changeFirstDay ? '</a>' : '</span>') + '</td>';
- }
- html += '</tr></thead><tbody>';
- var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
- if (drawYear == this._selectedYear && drawMonth == this._selectedMonth)
- this._selectedDay = Math.min(this._selectedDay, daysInMonth);
- var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
- var currentDate = (!this._currentDay ? new Date(9999, 9, 9) :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- var endDate = this._endDay ? new Date(this._endYear, this._endMonth, this._endDay) : currentDate;
- var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
- var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
- var beforeShowDay = this._get('beforeShowDay');
- var highlightWeek = this._get('highlightWeek');
- var showOtherMonths = this._get('showOtherMonths');
- var calculateWeek = this._get('calculateWeek') || $.datepicker.iso8601Week;
- var dateStatus = this._get('statusForDate') || $.datepicker.dateStatus;
- for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
- html += '<tr class="ui-datepicker-days-row">' +
- (showWeeks ? '<td class="ui-datepicker-week-col">' + calculateWeek(printDate) + '</td>' : '');
- for (var dow = 0; dow < 7; dow++) { // create date picker days
- var daySettings = (beforeShowDay ?
- beforeShowDay.apply((this._input ? this._input[0] : null), [printDate]) : [true, '']);
- var otherMonth = (printDate.getMonth() != drawMonth);
- var unselectable = otherMonth || !daySettings[0] ||
- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
- html += '<td class="ui-datepicker-days-cell' +
- ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end-cell' : '') + // highlight weekends
- (otherMonth ? ' ui-datepicker-otherMonth' : '') + // highlight days from other months
- (printDate.getTime() == selectedDate.getTime() && drawMonth == this._selectedMonth ?
- ' ui-datepicker-days-cell-over' : '') + // highlight selected day
- (unselectable ? ' ' + $.datepicker._unselectableClass : '') + // highlight unselectable days
- (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
- (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
- ' ' + $.datepicker._currentClass : '') + // highlight selected day
- (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
- ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
- (unselectable ? (highlightWeek ? ' onmouseover="jQuery(this).parent().addClass(\'ui-datepicker-week-over\');"' + // highlight selection week
- ' onmouseout="jQuery(this).parent().removeClass(\'ui-datepicker-week-over\');"' : '') : // unhighlight selection week
- ' onmouseover="jQuery(this).addClass(\'ui-datepicker-days-cell-over\')' + // highlight selection
- (highlightWeek ? '.parent().addClass(\'ui-datepicker-week-over\')' : '') + ';' + // highlight selection week
- (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
- this._id + '\').html(\'' + (dateStatus.apply((this._input ? this._input[0] : null),
- [printDate, this]) || '&#xa0;') +'\');') + '"' +
- ' onmouseout="jQuery(this).removeClass(\'ui-datepicker-days-cell-over\')' + // unhighlight selection
- (highlightWeek ? '.parent().removeClass(\'ui-datepicker-week-over\')' : '') + ';' + // unhighlight selection week
- (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
- this._id + '\').html(\'&#xa0;\');') + '" onclick="jQuery.datepicker._selectDay(' +
- this._id + ',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions
- (otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
- (unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
- printDate.setDate(printDate.getDate() + 1);
- }
- html += '</tr>';
- }
- drawMonth++;
- if (drawMonth > 11) {
- drawMonth = 0;
- drawYear++;
- }
- html += '</tbody></table></div>';
- }
- html += (showStatus ? '<div style="clear: both;"></div><div id="ui-datepicker-status-' + this._id +
- '" class="ui-datepicker-status">' + (this._get('initStatus') || '&#xa0;') + '</div>' : '') +
- (!closeAtTop && !this._inline ? controls : '') +
- '<div style="clear: both;"></div>' +
- ($.browser.msie && parseInt($.browser.version) < 7 && !this._inline ?
- '<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>' : '');
- return html;
- },
-
- /* Generate the month and year header. */
- _generateMonthYearHeader: function(drawMonth, drawYear, minDate, maxDate, selectedDate, secondary) {
- minDate = (this._rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
- var showStatus = this._get('showStatus');
- var html = '<div class="ui-datepicker-header">';
- // month selection
- var monthNames = this._get('monthNames');
- if (secondary || !this._get('changeMonth'))
- html += monthNames[drawMonth] + '&#xa0;';
- else {
- var inMinYear = (minDate && minDate.getFullYear() == drawYear);
- var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
- html += '<select class="ui-datepicker-new-month" ' +
- 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'M\');" ' +
- 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('monthStatus') || '&#xa0;') : '') + '>';
- for (var month = 0; month < 12; month++) {
- if ((!inMinYear || month >= minDate.getMonth()) &&
- (!inMaxYear || month <= maxDate.getMonth()))
- html += '<option value="' + month + '"' +
- (month == drawMonth ? ' selected="selected"' : '') +
- '>' + monthNames[month] + '</option>';
- }
- html += '</select>';
- }
- // year selection
- if (secondary || !this._get('changeYear'))
- html += drawYear;
- else {
- // determine range of years to display
- var years = this._get('yearRange').split(':');
- var year = 0;
- var endYear = 0;
- if (years.length != 2) {
- year = drawYear - 10;
- endYear = drawYear + 10;
- } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
- year = endYear = new Date().getFullYear();
- year += parseInt(years[0], 10);
- endYear += parseInt(years[1], 10);
- } else {
- year = parseInt(years[0], 10);
- endYear = parseInt(years[1], 10);
- }
- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
- html += '<select class="ui-datepicker-new-year" ' +
- 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'Y\');" ' +
- 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('yearStatus') || '&#xa0;') : '') + '>';
- for (; year <= endYear; year++) {
- html += '<option value="' + year + '"' +
- (year == drawYear ? ' selected="selected"' : '') +
- '>' + year + '</option>';
- }
- html += '</select>';
- }
- html += '</div>'; // Close datepicker_header
- return html;
- },
-
- /* Provide code to set and clear the status panel. */
- _addStatus: function(text) {
- return ' onmouseover="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\'' + text + '\');" ' +
- 'onmouseout="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\'&#xa0;\');"';
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(offset, period) {
- var year = this._drawYear + (period == 'Y' ? offset : 0);
- var month = this._drawMonth + (period == 'M' ? offset : 0);
- var day = Math.min(this._selectedDay, this._getDaysInMonth(year, month)) +
- (period == 'D' ? offset : 0);
- var date = new Date(year, month, day);
- // ensure it is within the bounds set
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- date = (minDate && date < minDate ? minDate : date);
- date = (maxDate && date > maxDate ? maxDate : date);
- this._selectedDay = date.getDate();
- this._drawMonth = this._selectedMonth = date.getMonth();
- this._drawYear = this._selectedYear = date.getFullYear();
- if (period == 'M' || period == 'Y')
- this._notifyChange();
- },
-
- /* Notify change of month/year. */
- _notifyChange: function() {
- var onChange = this._get('onChangeMonthYear');
- if (onChange)
- onChange.apply((this._input ? this._input[0] : null),
- [new Date(this._selectedYear, this._selectedMonth, 1), this]);
- },
-
- /* Determine the number of months to show. */
- _getNumberOfMonths: function() {
- var numMonths = this._get('numberOfMonths');
- return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
- },
-
- /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
- _getMinMaxDate: function(minMax, checkRange) {
- var date = this._determineDate(minMax + 'Date', null);
- if (date) {
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- date.setMilliseconds(0);
- }
- return (!checkRange || !this._rangeStart ? date :
- (!date || this._rangeStart > date ? this._rangeStart : date));
- },
-
- /* Find the number of days in a given month. */
- _getDaysInMonth: function(year, month) {
- return 32 - new Date(year, month, 32).getDate();
- },
-
- /* Find the day of the week of the first of a month. */
- _getFirstDayOfMonth: function(year, month) {
- return new Date(year, month, 1).getDay();
- },
-
- /* Determines if we should allow a "next/prev" month display change. */
- _canAdjustMonth: function(offset, curYear, curMonth) {
- var numMonths = this._getNumberOfMonths();
- var date = new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1);
- if (offset < 0)
- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
- return this._isInRange(date);
- },
-
- /* Is the given date in the accepted range? */
- _isInRange: function(date) {
- // during range selection, use minimum of selected date and range start
- var newMinDate = (!this._rangeStart ? null :
- new Date(this._selectedYear, this._selectedMonth, this._selectedDay));
- newMinDate = (newMinDate && this._rangeStart < newMinDate ? this._rangeStart : newMinDate);
- var minDate = newMinDate || this._getMinMaxDate('min');
- var maxDate = this._getMinMaxDate('max');
- return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
- },
-
- /* Provide the configuration settings for formatting/parsing. */
- _getFormatConfig: function() {
- var shortYearCutoff = this._get('shortYearCutoff');
- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
- return {shortYearCutoff: shortYearCutoff,
- dayNamesShort: this._get('dayNamesShort'), dayNames: this._get('dayNames'),
- monthNamesShort: this._get('monthNamesShort'), monthNames: this._get('monthNames')};
- },
-
- /* Format the given date for display. */
- _formatDate: function(day, month, year) {
- if (!day) {
- this._currentDay = this._selectedDay;
- this._currentMonth = this._selectedMonth;
- this._currentYear = this._selectedYear;
- }
- var date = (day ? (typeof day == 'object' ? day : new Date(year, month, day)) :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- return $.datepicker.formatDate(this._get('dateFormat'), date, this._getFormatConfig());
- }
-});
-
-/* jQuery extend now ignores nulls! */
-function extendRemove(target, props) {
- $.extend(target, props);
- for (var name in props)
- if (props[name] == null || props[name] == undefined)
- target[name] = props[name];
- return target;
-};
-
-/* Determine whether an object is an array. */
-function isArray(a) {
- return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
- (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
-};
-
-/* Invoke the datepicker functionality.
- @param options String - a command, optionally followed by additional parameters or
- Object - settings for attaching new datepicker functionality
- @return jQuery object */
-$.fn.datepicker = function(options){
- var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
- return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs));
- return this.each(function() {
- typeof options == 'string' ?
- $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this].concat(otherArgs)) :
- $.datepicker._attachDatepicker(this, options);
- });
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-
-/* Initialise the date picker. */
-$(document).ready(function() {
- $(document.body).append($.datepicker._datepickerDiv).
- mousedown($.datepicker._checkExternalClick);
-});
-
-})(jQuery);
-/*
- * jQuery UI Dialog
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
-};
-
-$.widget("ui.dialog", {
- init: function() {
- var self = this,
- options = this.options,
- resizeHandles = typeof options.resizable == 'string'
- ? options.resizable
- : 'n,e,s,w,se,sw,ne,nw',
-
- uiDialogContent = this.element
- .addClass('ui-dialog-content')
- .wrap('<div/>')
- .wrap('<div/>'),
-
- uiDialogContainer = (this.uiDialogContainer = uiDialogContent.parent()
- .addClass('ui-dialog-container')
- .css({position: 'relative', width: '100%', height: '100%'})),
-
- title = options.title || uiDialogContent.attr('title') || '',
- uiDialogTitlebar = (this.uiDialogTitlebar =
- $('<div class="ui-dialog-titlebar"/>'))
- .append('<span class="ui-dialog-title">' + title + '</span>')
- .append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>')
- .prependTo(uiDialogContainer),
-
- uiDialog = (this.uiDialog = uiDialogContainer.parent())
- .appendTo(document.body)
- .hide()
- .addClass('ui-dialog')
- .addClass(options.dialogClass)
- // add content classes to dialog
- // to inherit theme at top level of element
- .addClass(uiDialogContent.attr('className'))
- .removeClass('ui-dialog-content')
- .css({
- position: 'absolute',
- width: options.width,
- height: options.height,
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
- if (options.closeOnEscape) {
- var ESC = 27;
- (ev.keyCode && ev.keyCode == ESC && self.close());
- }
- })
- .mousedown(function() {
- self.moveToTop();
- }),
-
- uiDialogButtonPane = (this.uiDialogButtonPane = $('<div/>'))
- .addClass('ui-dialog-buttonpane')
- .appendTo(uiDialog);
-
- this.uiDialogTitlebarClose = $('.ui-dialog-titlebar-close', uiDialogTitlebar)
- .hover(
- function() {
- $(this).addClass('ui-dialog-titlebar-close-hover');
- },
- function() {
- $(this).removeClass('ui-dialog-titlebar-close-hover');
- }
- )
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function() {
- self.close();
- return false;
- });
-
- if ($.fn.draggable) {
- uiDialog.draggable({
- helper: options.dragHelper,
- handle: '.ui-dialog-titlebar',
- start: function(e, ui) {
- self.moveToTop();
- (options.dragStart && options.dragStart.apply(self.element[0], arguments));
- },
- drag: function(e, ui) {
- (options.drag && options.drag.apply(self.element[0], arguments));
- },
- stop: function(e, ui) {
- (options.dragStop && options.dragStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- (options.draggable || uiDialog.draggable('disable'));
- }
-
- if ($.fn.resizable) {
- uiDialog.resizable({
- proxy: options.resizeHelper,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: function() {
- (options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
- },
- resize: function(e, ui) {
- (options.autoResize && self.size.apply(self));
- (options.resize && options.resize.apply(self.element[0], arguments));
- },
- handles: resizeHandles,
- stop: function(e, ui) {
- (options.autoResize && self.size.apply(self));
- (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- (options.resizable || uiDialog.resizable('disable'));
- }
-
- this.createButtons(options.buttons);
- this.isOpen = false;
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
- },
-
- setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "buttons":
- this.createButtons(value);
- break;
- case "draggable":
- this.uiDialog.draggable(value ? 'enable' : 'disable');
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this.position(value);
- break;
- case "resizable":
- (typeof value == 'string' && this.uiDialog.data('handles.resizable', value));
- this.uiDialog.resizable(value ? 'enable' : 'disable');
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).text(value);
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
-
- $.widget.prototype.setData.apply(this, arguments);
- },
-
- position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += wnd.width() - this.uiDialog.width();
- break;
- default:
- case 'center':
- pLeft += (wnd.width() - this.uiDialog.width()) / 2;
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += wnd.height() - this.uiDialog.height();
- break;
- default:
- case 'middle':
- pTop += (wnd.height() - this.uiDialog.height()) / 2;
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- size: function() {
- var container = this.uiDialogContainer,
- titlebar = this.uiDialogTitlebar,
- content = this.element,
- tbMargin = parseInt(content.css('margin-top')) + parseInt(content.css('margin-bottom')),
- lrMargin = parseInt(content.css('margin-left')) + parseInt(content.css('margin-right'));
- content.height(container.height() - titlebar.outerHeight() - tbMargin);
- content.width(container.width() - lrMargin);
- },
-
- open: function() {
- if (this.isOpen) { return; }
-
- this.overlay = this.options.modal ? new $.ui.dialog.overlay(this) : null;
- this.uiDialog.appendTo('body');
- this.position(this.options.position);
- this.uiDialog.show(this.options.show);
- this.options.autoResize && this.size();
- this.moveToTop(true);
-
- // CALLBACK: open
- var openEV = null;
- var openUI = {
- options: this.options
- };
- this.uiDialogTitlebarClose.focus();
- this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open);
-
- this.isOpen = true;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force) {
- if ((this.options.modal && !force)
- || (!this.options.stack && !this.options.modal)) { return; }
-
- var maxZ = this.options.zIndex, options = this.options;
- $('.ui-dialog:visible').each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
- });
- (this.overlay && this.overlay.$el.css('z-index', ++maxZ));
- this.uiDialog.css('z-index', ++maxZ);
- },
-
- close: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide(this.options.hide);
-
- // CALLBACK: close
- var closeEV = null;
- var closeUI = {
- options: this.options
- };
- this.element.triggerHandler("dialogclose", [closeEV, closeUI], this.options.close);
- $.ui.dialog.overlay.resize();
-
- this.isOpen = false;
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
- },
-
- createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = this.uiDialogButtonPane;
-
- // remove any existing buttons
- uiDialogButtonPane.empty().hide();
-
- $.each(buttons, function() { return !(hasButtons = true); });
- if (hasButtons) {
- uiDialogButtonPane.show();
- $.each(buttons, function(name, fn) {
- $('<button/>')
- .text(name)
- .click(function() { fn.apply(self.element[0], arguments); })
- .appendTo(uiDialogButtonPane);
- });
- }
- }
-});
-
-$.extend($.ui.dialog, {
- defaults: {
- autoOpen: true,
- autoResize: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- draggable: true,
- height: 200,
- minHeight: 100,
- minWidth: 150,
- modal: false,
- overlay: {},
- position: 'center',
- resizable: true,
- stack: true,
- width: 300,
- zIndex: 1000
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(e) { return e + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- $('a, :input').bind($.ui.dialog.overlay.events, function() {
- // allow use of the element if inside a dialog and
- // - there are no modal dialogs
- // - there are modal dialogs, but we are in front of the topmost modal
- var allow = false;
- var $dialog = $(this).parents('.ui-dialog');
- if ($dialog.length) {
- var $overlays = $('.ui-dialog-overlay');
- if ($overlays.length) {
- var maxZ = parseInt($overlays.css('z-index'), 10);
- $overlays.each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10));
- });
- allow = parseInt($dialog.css('z-index'), 10) > maxZ;
- } else {
- allow = true;
- }
- }
- return allow;
- });
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(e) {
- var ESC = 27;
- (e.keyCode && e.keyCode == ESC && dialog.close());
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div/>').appendTo(document.body)
- .addClass('ui-dialog-overlay').css($.extend({
- borderWidth: 0, margin: 0, padding: 0,
- position: 'absolute', top: 0, left: 0,
- width: this.width(),
- height: this.height()
- }, dialog.options.overlay));
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $('a, :input').add([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
- },
-
- height: function() {
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Slider
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.fn.unwrap = $.fn.unwrap || function(expr) {
- return this.each(function(){
- $(this).parents(expr).eq(0).after(this).remove();
- });
-};
-
-$.widget("ui.slider", {
- plugins: {},
- ui: function(e) {
- return {
- options: this.options,
- handle: this.currentHandle,
- value: this.options.axis != "both" || !this.options.axis ? Math.round(this.value(null,this.options.axis == "vertical" ? "y" : "x")) : {
- x: Math.round(this.value(null,"x")),
- y: Math.round(this.value(null,"y"))
- },
- range: this.getRange()
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.ui()]);
- this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]);
- },
- destroy: function() {
-
- this.element
- .removeClass("ui-slider ui-slider-disabled")
- .removeData("slider")
- .unbind(".slider");
-
- if(this.handle && this.handle.length) {
- this.handle
- .unwrap("a");
- this.handle.each(function() {
- $(this).data("mouse").mouseDestroy();
- });
- }
-
- this.generated && this.generated.remove();
-
- },
- setData: function(key, value) {
- $.widget.prototype.setData.apply(this, arguments);
- if (/min|max|steps/.test(key)) {
- this.initBoundaries();
- }
-
- if(key == "range") {
- value ? this.handle.length == 2 && this.createRange() : this.removeRange();
- }
-
- },
-
- init: function() {
-
- var self = this;
- this.element.addClass("ui-slider");
- this.initBoundaries();
-
- // Initialize mouse and key events for interaction
- this.handle = $(this.options.handle, this.element);
- if (!this.handle.length) {
- self.handle = self.generated = $(self.options.handles || [0]).map(function() {
- var handle = $("<div/>").addClass("ui-slider-handle").appendTo(self.element);
- if (this.id)
- handle.attr("id", this.id);
- return handle[0];
- });
- }
-
-
- var handleclass = function(el) {
- this.element = $(el);
- this.element.data("mouse", this);
- this.options = self.options;
-
- this.element.bind("mousedown", function() {
- if(self.currentHandle) this.blur(self.currentHandle);
- self.focus(this,1);
- });
-
- this.mouseInit();
- };
-
- $.extend(handleclass.prototype, $.ui.mouse, {
- mouseStart: function(e) { return self.start.call(self, e, this.element[0]); },
- mouseStop: function(e) { return self.stop.call(self, e, this.element[0]); },
- mouseDrag: function(e) { return self.drag.call(self, e, this.element[0]); },
- mouseCapture: function() { return true; },
- trigger: function(e) { this.mouseDown(e); }
- });
-
-
- $(this.handle)
- .each(function() {
- new handleclass(this);
- })
- .wrap('<a href="javascript:void(0)" style="cursor:default;"></a>')
- .parent()
- .bind('focus', function(e) { self.focus(this.firstChild); })
- .bind('blur', function(e) { self.blur(this.firstChild); })
- .bind('keydown', function(e) { if(!self.options.noKeyboard) self.keydown(e.keyCode, this.firstChild); })
- ;
-
- // Bind the click to the slider itself
- this.element.bind('mousedown.slider', function(e) {
- self.click.apply(self, [e]);
- self.currentHandle.data("mouse").trigger(e);
- self.firstValue = self.firstValue + 1; //This is for always triggering the change event
- });
-
- // Move the first handle to the startValue
- $.each(this.options.handles || [], function(index, handle) {
- self.moveTo(handle.start, index, true);
- });
- if (!isNaN(this.options.startValue))
- this.moveTo(this.options.startValue, 0, true);
-
- this.previousHandle = $(this.handle[0]); //set the previous handle to the first to allow clicking before selecting the handle
- if(this.handle.length == 2 && this.options.range) this.createRange();
- },
- initBoundaries: function() {
-
- var element = this.element[0], o = this.options;
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- $.extend(o, {
- axis: o.axis || (element.offsetWidth < element.offsetHeight ? 'vertical' : 'horizontal'),
- max: !isNaN(parseInt(o.max,10)) ? { x: parseInt(o.max, 10), y: parseInt(o.max, 10) } : ({ x: o.max && o.max.x || 100, y: o.max && o.max.y || 100 }),
- min: !isNaN(parseInt(o.min,10)) ? { x: parseInt(o.min, 10), y: parseInt(o.min, 10) } : ({ x: o.min && o.min.x || 0, y: o.min && o.min.y || 0 })
- });
- //Prepare the real maxValue
- o.realMax = {
- x: o.max.x - o.min.x,
- y: o.max.y - o.min.y
- };
- //Calculate stepping based on steps
- o.stepping = {
- x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps ? o.realMax.x/(o.steps.x || parseInt(o.steps, 10) || o.realMax.x) : 0),
- y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps ? o.realMax.y/(o.steps.y || parseInt(o.steps, 10) || o.realMax.y) : 0)
- };
- },
-
-
- keydown: function(keyCode, handle) {
- if(/(37|38|39|40)/.test(keyCode)) {
- this.moveTo({
- x: /(37|39)/.test(keyCode) ? (keyCode == 37 ? '-' : '+') + '=' + this.oneStep("x") : 0,
- y: /(38|40)/.test(keyCode) ? (keyCode == 38 ? '-' : '+') + '=' + this.oneStep("y") : 0
- }, handle);
- }
- },
- focus: function(handle,hard) {
- this.currentHandle = $(handle).addClass('ui-slider-handle-active');
- if (hard)
- this.currentHandle.parent()[0].focus();
- },
- blur: function(handle) {
- $(handle).removeClass('ui-slider-handle-active');
- if(this.currentHandle && this.currentHandle[0] == handle) { this.previousHandle = this.currentHandle; this.currentHandle = null; };
- },
- click: function(e) {
- // This method is only used if:
- // - The user didn't click a handle
- // - The Slider is not disabled
- // - There is a current, or previous selected handle (otherwise we wouldn't know which one to move)
-
- var pointer = [e.pageX,e.pageY];
-
- var clickedHandle = false;
- this.handle.each(function() {
- if(this == e.target)
- clickedHandle = true;
- });
- if (clickedHandle || this.options.disabled || !(this.currentHandle || this.previousHandle))
- return;
-
- // If a previous handle was focussed, focus it again
- if (!this.currentHandle && this.previousHandle)
- this.focus(this.previousHandle, true);
-
- // propagate only for distance > 0, otherwise propagation is done my drag
- this.offset = this.element.offset();
-
- this.moveTo({
- y: this.convertValue(e.pageY - this.offset.top - this.currentHandle[0].offsetHeight/2, "y"),
- x: this.convertValue(e.pageX - this.offset.left - this.currentHandle[0].offsetWidth/2, "x")
- }, null, !this.options.distance);
- },
-
-
-
- createRange: function() {
- if(this.rangeElement) return;
- this.rangeElement = $('<div></div>')
- .addClass('ui-slider-range')
- .css({ position: 'absolute' })
- .appendTo(this.element);
- this.updateRange();
- },
- removeRange: function() {
- this.rangeElement.remove();
- this.rangeElement = null;
- },
- updateRange: function() {
- var prop = this.options.axis == "vertical" ? "top" : "left";
- var size = this.options.axis == "vertical" ? "height" : "width";
- this.rangeElement.css(prop, (parseInt($(this.handle[0]).css(prop),10) || 0) + this.handleSize(0, this.options.axis == "vertical" ? "y" : "x")/2);
- this.rangeElement.css(size, (parseInt($(this.handle[1]).css(prop),10) || 0) - (parseInt($(this.handle[0]).css(prop),10) || 0));
- },
- getRange: function() {
- return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.options.axis == "vertical" ? "height" : "width"),10), this.options.axis == "vertical" ? "y" : "x") : null;
- },
-
- handleIndex: function() {
- return this.handle.index(this.currentHandle[0]);
- },
- value: function(handle, axis) {
- if(this.handle.length == 1) this.currentHandle = this.handle;
- if(!axis) axis = this.options.axis == "vertical" ? "y" : "x";
-
- var curHandle = $(handle != undefined && handle !== null ? this.handle[handle] || handle : this.currentHandle);
-
- if(curHandle.data("mouse").sliderValue) {
- return parseInt(curHandle.data("mouse").sliderValue[axis],10);
- } else {
- return parseInt(((parseInt(curHandle.css(axis == "x" ? "left" : "top"),10) / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(handle,axis))) * this.options.realMax[axis]) + this.options.min[axis],10);
- }
-
- },
- convertValue: function(value,axis) {
- return this.options.min[axis] + (value / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))) * this.options.realMax[axis];
- },
-
- translateValue: function(value,axis) {
- return ((value - this.options.min[axis]) / this.options.realMax[axis]) * (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis));
- },
- translateRange: function(value,axis) {
- if (this.rangeElement) {
- if (this.currentHandle[0] == this.handle[0] && value >= this.translateValue(this.value(1),axis))
- value = this.translateValue(this.value(1,axis) - this.oneStep(axis), axis);
- if (this.currentHandle[0] == this.handle[1] && value <= this.translateValue(this.value(0),axis))
- value = this.translateValue(this.value(0,axis) + this.oneStep(axis), axis);
- }
- if (this.options.handles) {
- var handle = this.options.handles[this.handleIndex()];
- if (value < this.translateValue(handle.min,axis)) {
- value = this.translateValue(handle.min,axis);
- } else if (value > this.translateValue(handle.max,axis)) {
- value = this.translateValue(handle.max,axis);
- }
- }
- return value;
- },
- translateLimits: function(value,axis) {
- if (value >= this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))
- value = this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis);
- if (value <= 0)
- value = 0;
- return value;
- },
- handleSize: function(handle,axis) {
- return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[0]["offset"+(axis == "x" ? "Width" : "Height")];
- },
- oneStep: function(axis) {
- return this.options.stepping[axis] || 1;
- },
-
-
- start: function(e, handle) {
-
- var o = this.options;
- if(o.disabled) return false;
-
- // Prepare the outer size
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- // This is a especially ugly fix for strange blur events happening on mousemove events
- if (!this.currentHandle)
- this.focus(this.previousHandle, true);
-
- this.offset = this.element.offset();
-
- this.handleOffset = this.currentHandle.offset();
- this.clickOffset = { top: e.pageY - this.handleOffset.top, left: e.pageX - this.handleOffset.left };
-
- this.firstValue = this.value();
-
- this.propagate('start', e);
- this.drag(e, handle);
- return true;
-
- },
- stop: function(e) {
- this.propagate('stop', e);
- if (this.firstValue != this.value())
- this.propagate('change', e);
- // This is a especially ugly fix for strange blur events happening on mousemove events
- this.focus(this.currentHandle, true);
- return false;
- },
- drag: function(e, handle) {
-
- var o = this.options;
- var position = { top: e.pageY - this.offset.top - this.clickOffset.top, left: e.pageX - this.offset.left - this.clickOffset.left};
- if(!this.currentHandle) this.focus(this.previousHandle, true); //This is a especially ugly fix for strange blur events happening on mousemove events
-
- position.left = this.translateLimits(position.left, "x");
- position.top = this.translateLimits(position.top, "y");
-
- if (o.stepping.x) {
- var value = this.convertValue(position.left, "x");
- value = Math.round(value / o.stepping.x) * o.stepping.x;
- position.left = this.translateValue(value, "x");
- }
- if (o.stepping.y) {
- var value = this.convertValue(position.top, "y");
- value = Math.round(value / o.stepping.y) * o.stepping.y;
- position.top = this.translateValue(value, "y");
- }
-
- position.left = this.translateRange(position.left, "x");
- position.top = this.translateRange(position.top, "y");
-
- if(o.axis != "vertical") this.currentHandle.css({ left: position.left });
- if(o.axis != "horizontal") this.currentHandle.css({ top: position.top });
-
- //Store the slider's value
- this.currentHandle.data("mouse").sliderValue = {
- x: Math.round(this.convertValue(position.left, "x")) || 0,
- y: Math.round(this.convertValue(position.top, "y")) || 0
- };
-
- if (this.rangeElement)
- this.updateRange();
- this.propagate('slide', e);
- return false;
- },
-
- moveTo: function(value, handle, noPropagation) {
-
- var o = this.options;
-
- // Prepare the outer size
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- //If no handle has been passed, no current handle is available and we have multiple handles, return false
- if (handle == undefined && !this.currentHandle && this.handle.length != 1)
- return false;
-
- //If only one handle is available, use it
- if (handle == undefined && !this.currentHandle)
- handle = 0;
-
- if (handle != undefined)
- this.currentHandle = this.previousHandle = $(this.handle[handle] || handle);
-
-
- if(value.x !== undefined && value.y !== undefined) {
- var x = value.x, y = value.y;
- } else {
- var x = value, y = value;
- }
-
- if(x !== undefined && x.constructor != Number) {
- var me = /^\-\=/.test(x), pe = /^\+\=/.test(x);
- if(me || pe) {
- x = this.value(null, "x") + parseInt(x.replace(me ? '=' : '+=', ''), 10);
- } else {
- x = isNaN(parseInt(x, 10)) ? undefined : parseInt(x, 10);
- }
- }
-
- if(y !== undefined && y.constructor != Number) {
- var me = /^\-\=/.test(y), pe = /^\+\=/.test(y);
- if(me || pe) {
- y = this.value(null, "y") + parseInt(y.replace(me ? '=' : '+=', ''), 10);
- } else {
- y = isNaN(parseInt(y, 10)) ? undefined : parseInt(y, 10);
- }
- }
-
- if(o.axis != "vertical" && x !== undefined) {
- if(o.stepping.x) x = Math.round(x / o.stepping.x) * o.stepping.x;
- x = this.translateValue(x, "x");
- x = this.translateLimits(x, "x");
- x = this.translateRange(x, "x");
- this.currentHandle.css({ left: x });
- }
-
- if(o.axis != "horizontal" && y !== undefined) {
- if(o.stepping.y) y = Math.round(y / o.stepping.y) * o.stepping.y;
- y = this.translateValue(y, "y");
- y = this.translateLimits(y, "y");
- y = this.translateRange(y, "y");
- this.currentHandle.css({ top: y });
- }
-
- if (this.rangeElement)
- this.updateRange();
-
- //Store the slider's value
- this.currentHandle.data("mouse").sliderValue = {
- x: Math.round(this.convertValue(x, "x")) || 0,
- y: Math.round(this.convertValue(y, "y")) || 0
- };
-
- if (!noPropagation) {
- this.propagate('start', null);
- this.propagate('stop', null);
- this.propagate('change', null);
- this.propagate("slide", null);
- }
- }
-});
-
-$.ui.slider.getter = "value";
-
-$.ui.slider.defaults = {
- handle: ".ui-slider-handle",
- distance: 1
-};
-
-})(jQuery);
-/*
- * jQuery UI Tabs
- *
- * Copyright (c) 2007, 2008 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.tabs", {
- init: function() {
- this.options.event += '.tabs'; // namespace event
-
- // create tabs
- this.tabify(true);
- },
- setData: function(key, value) {
- if ((/^selected/).test(key))
- this.select(value);
- else {
- this.options[key] = value;
- this.tabify();
- }
- },
- length: function() {
- return this.$tabs.length;
- },
- tabId: function(a) {
- return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '')
- || this.options.idPrefix + $.data(a);
- },
- ui: function(tab, panel) {
- return {
- options: this.options,
- tab: tab,
- panel: panel
- };
- },
- tabify: function(init) {
-
- this.$lis = $('li:has(a[href])', this.element);
- this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
- this.$panels = $([]);
-
- var self = this, o = this.options;
-
- this.$tabs.each(function(i, a) {
- // inline tab
- if (a.hash && a.hash.replace('#', '')) // Safari 2 reports '#' for an empty hash
- self.$panels = self.$panels.add(a.hash);
- // remote tab
- else if ($(a).attr('href') != '#') { // prevent loading the page itself if href is just "#"
- $.data(a, 'href.tabs', a.href); // required for restore on destroy
- $.data(a, 'load.tabs', a.href); // mutable
- var id = self.tabId(a);
- a.href = '#' + id;
- var $panel = $('#' + id);
- if (!$panel.length) {
- $panel = $(o.panelTemplate).attr('id', id).addClass(o.panelClass)
- .insertAfter( self.$panels[i - 1] || self.element );
- $panel.data('destroy.tabs', true);
- }
- self.$panels = self.$panels.add( $panel );
- }
- // invalid tab href
- else
- o.disabled.push(i + 1);
- });
-
- if (init) {
-
- // attach necessary classes for styling if not present
- this.element.addClass(o.navClass);
- this.$panels.each(function() {
- var $this = $(this);
- $this.addClass(o.panelClass);
- });
-
- // Selected tab
- // use "selected" option or try to retrieve:
- // 1. from fragment identifier in url
- // 2. from cookie
- // 3. from selected class attribute on <li>
- if (o.selected === undefined) {
- if (location.hash) {
- this.$tabs.each(function(i, a) {
- if (a.hash == location.hash) {
- o.selected = i;
- // prevent page scroll to fragment
- if ($.browser.msie || $.browser.opera) { // && !o.remote
- var $toShow = $(location.hash), toShowId = $toShow.attr('id');
- $toShow.attr('id', '');
- setTimeout(function() {
- $toShow.attr('id', toShowId); // restore id
- }, 500);
- }
- scrollTo(0, 0);
- return false; // break
- }
- });
- }
- else if (o.cookie) {
- var index = parseInt($.cookie('ui-tabs' + $.data(self.element)),10);
- if (index && self.$tabs[index])
- o.selected = index;
- }
- else if (self.$lis.filter('.' + o.selectedClass).length)
- o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] );
- }
- o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; // first tab selected by default
-
- // Take disabling tabs via class attribute from HTML
- // into account and update option properly.
- // A selected tab cannot become disabled.
- o.disabled = $.unique(o.disabled.concat(
- $.map(this.$lis.filter('.' + o.disabledClass),
- function(n, i) { return self.$lis.index(n); } )
- )).sort();
- if ($.inArray(o.selected, o.disabled) != -1)
- o.disabled.splice($.inArray(o.selected, o.disabled), 1);
-
- // highlight selected tab
- this.$panels.addClass(o.hideClass);
- this.$lis.removeClass(o.selectedClass);
- if (o.selected !== null) {
- this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
- this.$lis.eq(o.selected).addClass(o.selectedClass);
-
- // seems to be expected behavior that the show callback is fired
- var onShow = function() {
- $(self.element).triggerHandler('tabsshow',
- [null, self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show);
- };
-
- // load if remote tab
- if ($.data(this.$tabs[o.selected], 'load.tabs'))
- this.load(o.selected, onShow);
- // just trigger show event
- else
- onShow();
-
- }
-
- // clean up to avoid memory leaks in certain versions of IE 6
- $(window).bind('unload', function() {
- self.$tabs.unbind('.tabs');
- self.$lis = self.$tabs = self.$panels = null;
- });
-
- }
-
- // disable tabs
- for (var i = 0, li; li = this.$lis[i]; i++)
- $(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass(o.selectedClass) ? 'addClass' : 'removeClass'](o.disabledClass);
-
- // reset cache if switching from cached to not cached
- if (o.cache === false)
- this.$tabs.removeData('cache.tabs');
-
- // set up animations
- var hideFx, showFx, baseFx = { 'min-width': 0, duration: 1 }, baseDuration = 'normal';
- if (o.fx && o.fx.constructor == Array)
- hideFx = o.fx[0] || baseFx, showFx = o.fx[1] || baseFx;
- else
- hideFx = showFx = o.fx || baseFx;
-
- // reset some styles to maintain print style sheets etc.
- var resetCSS = { display: '', overflow: '', height: '' };
- if (!$.browser.msie) // not in IE to prevent ClearType font issue
- resetCSS.opacity = '';
-
- // Hide a tab, animation prevents browser scrolling to fragment,
- // $show is optional.
- function hideTab(clicked, $hide, $show) {
- $hide.animate(hideFx, hideFx.duration || baseDuration, function() { //
- $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && hideFx.opacity)
- $hide[0].style.filter = '';
- if ($show)
- showTab(clicked, $show, $hide);
- });
- }
-
- // Show a tab, animation prevents browser scrolling to fragment,
- // $hide is optional.
- function showTab(clicked, $show, $hide) {
- if (showFx === baseFx)
- $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels
- $show.animate(showFx, showFx.duration || baseDuration, function() {
- $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && showFx.opacity)
- $show[0].style.filter = '';
-
- // callback
- $(self.element).triggerHandler('tabsshow',
- [null, self.ui(clicked, $show[0])], o.show);
-
- });
- }
-
- // switch a tab
- function switchTab(clicked, $li, $hide, $show) {
- /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
- $.ajaxHistory.update(clicked.hash);
- }*/
- $li.addClass(o.selectedClass)
- .siblings().removeClass(o.selectedClass);
- hideTab(clicked, $hide, $show);
- }
-
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
- this.$tabs.unbind('.tabs').bind(o.event, function() {
-
- //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
- var $li = $(this).parents('li:eq(0)'),
- $hide = self.$panels.filter(':visible'),
- $show = $(this.hash);
-
- // If tab is already selected and not unselectable or tab disabled or
- // or is already loading or click callback returns false stop here.
- // Check if click handler returns false last so that it is not executed
- // for a disabled or loading tab!
- if (($li.hasClass(o.selectedClass) && !o.unselect)
- || $li.hasClass(o.disabledClass)
- || $(this).hasClass(o.loadingClass)
- || $(self.element).triggerHandler('tabsselect', [null, self.ui(this, $show[0])], o.select) === false
- ) {
- this.blur();
- return false;
- }
-
- self.options.selected = self.$tabs.index(this);
-
- // if tab may be closed
- if (o.unselect) {
- if ($li.hasClass(o.selectedClass)) {
- self.options.selected = null;
- $li.removeClass(o.selectedClass);
- self.$panels.stop();
- hideTab(this, $hide);
- this.blur();
- return false;
- } else if (!$hide.length) {
- self.$panels.stop();
- var a = this;
- self.load(self.$tabs.index(this), function() {
- $li.addClass(o.selectedClass).addClass(o.unselectClass);
- showTab(a, $show);
- });
- this.blur();
- return false;
- }
- }
-
- if (o.cookie)
- $.cookie('ui-tabs' + $.data(self.element), self.options.selected, o.cookie);
-
- // stop possibly running animations
- self.$panels.stop();
-
- // show new tab
- if ($show.length) {
-
- // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
- /*if ($.browser.msie && o.bookmarkable) {
- var showId = this.hash.replace('#', '');
- $show.attr('id', '');
- setTimeout(function() {
- $show.attr('id', showId); // restore id
- }, 0);
- }*/
-
- var a = this;
- self.load(self.$tabs.index(this), $hide.length ?
- function() {
- switchTab(a, $li, $hide, $show);
- } :
- function() {
- $li.addClass(o.selectedClass);
- showTab(a, $show);
- }
- );
-
- // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
- /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
- var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
- setTimeout(function() {
- scrollTo(scrollX, scrollY);
- }, 0);*/
-
- } else
- throw 'jQuery UI Tabs: Mismatching fragment identifier.';
-
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled in modern
- // browsers via CSS, also blur removes focus from address bar in Firefox
- // which can become a usability and annoying problem with tabsRotate.
- if ($.browser.msie)
- this.blur();
-
- //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
- return false;
-
- });
-
- // disable click if event is configured to something else
- if (!(/^click/).test(o.event))
- this.$tabs.bind('click.tabs', function() { return false; });
-
- },
- add: function(url, label, index) {
- if (index == undefined)
- index = this.$tabs.length; // append by default
-
- var o = this.options;
- var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label));
- $li.data('destroy.tabs', true);
-
- var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] );
-
- // try to find an existing element before creating a new one
- var $panel = $('#' + id);
- if (!$panel.length) {
- $panel = $(o.panelTemplate).attr('id', id)
- .addClass(o.hideClass)
- .data('destroy.tabs', true);
- }
- $panel.addClass(o.panelClass);
- if (index >= this.$lis.length) {
- $li.appendTo(this.element);
- $panel.appendTo(this.element[0].parentNode);
- } else {
- $li.insertBefore(this.$lis[index]);
- $panel.insertBefore(this.$panels[index]);
- }
-
- o.disabled = $.map(o.disabled,
- function(n, i) { return n >= index ? ++n : n });
-
- this.tabify();
-
- if (this.$tabs.length == 1) {
- $li.addClass(o.selectedClass);
- $panel.removeClass(o.hideClass);
- var href = $.data(this.$tabs[0], 'load.tabs');
- if (href)
- this.load(index, href);
- }
-
- // callback
- this.element.triggerHandler('tabsadd',
- [null, this.ui(this.$tabs[index], this.$panels[index])], o.add
- );
- },
- remove: function(index) {
- var o = this.options, $li = this.$lis.eq(index).remove(),
- $panel = this.$panels.eq(index).remove();
-
- // If selected tab was removed focus tab to the right or
- // in case the last tab was removed the tab to the left.
- if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1)
- this.select(index + (index + 1 < this.$tabs.length ? 1 : -1));
-
- o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
- function(n, i) { return n >= index ? --n : n });
-
- this.tabify();
-
- // callback
- this.element.triggerHandler('tabsremove',
- [null, this.ui($li.find('a')[0], $panel[0])], o.remove
- );
- },
- enable: function(index) {
- var o = this.options;
- if ($.inArray(index, o.disabled) == -1)
- return;
-
- var $li = this.$lis.eq(index).removeClass(o.disabledClass);
- if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2...
- $li.css('display', 'inline-block');
- setTimeout(function() {
- $li.css('display', 'block');
- }, 0);
- }
-
- o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });
-
- // callback
- this.element.triggerHandler('tabsenable',
- [null, this.ui(this.$tabs[index], this.$panels[index])], o.enable
- );
-
- },
- disable: function(index) {
- var self = this, o = this.options;
- if (index != o.selected) { // cannot disable already selected tab
- this.$lis.eq(index).addClass(o.disabledClass);
-
- o.disabled.push(index);
- o.disabled.sort();
-
- // callback
- this.element.triggerHandler('tabsdisable',
- [null, this.ui(this.$tabs[index], this.$panels[index])], o.disable
- );
- }
- },
- select: function(index) {
- if (typeof index == 'string')
- index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] );
- this.$tabs.eq(index).trigger(this.options.event);
- },
- load: function(index, callback) { // callback is for internal usage only
-
- var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0],
- bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs');
-
- callback = callback || function() {};
-
- // no remote or from cache - just finish with callback
- if (!url || !bypassCache && $.data(a, 'cache.tabs')) {
- callback();
- return;
- }
-
- // load remote from here on
-
- var inner = function(parent) {
- var $parent = $(parent), $inner = $parent.find('*:last');
- return $inner.length && $inner || $parent;
- };
- var cleanup = function() {
- self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass)
- .each(function() {
- if (o.spinner)
- inner(this).parent().html(inner(this).data('label.tabs'));
- });
- self.xhr = null;
- };
-
- if (o.spinner) {
- var label = inner(a).html();
- inner(a).wrapInner('<em></em>')
- .find('em').data('label.tabs', label).html(o.spinner);
- }
-
- var ajaxOptions = $.extend({}, o.ajaxOptions, {
- url: url,
- success: function(r, s) {
- $(a.hash).html(r);
- cleanup();
-
- if (o.cache)
- $.data(a, 'cache.tabs', true); // if loaded once do not load them again
-
- // callbacks
- $(self.element).triggerHandler('tabsload',
- [null, self.ui(self.$tabs[index], self.$panels[index])], o.load
- );
- o.ajaxOptions.success && o.ajaxOptions.success(r, s);
-
- // This callback is required because the switch has to take
- // place after loading has completed. Call last in order to
- // fire load before show callback...
- callback();
- }
- });
- if (this.xhr) {
- // terminate pending requests from other tabs and restore tab label
- this.xhr.abort();
- cleanup();
- }
- $a.addClass(o.loadingClass);
- setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
- self.xhr = $.ajax(ajaxOptions);
- }, 0);
-
- },
- url: function(index, url) {
- this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url);
- },
- destroy: function() {
- var o = this.options;
- this.element.unbind('.tabs')
- .removeClass(o.navClass).removeData('tabs');
- this.$tabs.each(function() {
- var href = $.data(this, 'href.tabs');
- if (href)
- this.href = href;
- var $this = $(this).unbind('.tabs');
- $.each(['href', 'load', 'cache'], function(i, prefix) {
- $this.removeData(prefix + '.tabs');
- });
- });
- this.$lis.add(this.$panels).each(function() {
- if ($.data(this, 'destroy.tabs'))
- $(this).remove();
- else
- $(this).removeClass([o.selectedClass, o.unselectClass,
- o.disabledClass, o.panelClass, o.hideClass].join(' '));
- });
- }
-});
-
-$.ui.tabs.defaults = {
- // basic setup
- unselect: false,
- event: 'click',
- disabled: [],
- cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
- // TODO history: false,
-
- // Ajax
- spinner: 'Loading&#8230;',
- cache: false,
- idPrefix: 'ui-tabs-',
- ajaxOptions: {},
-
- // animations
- fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
-
- // templates
- tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>',
- panelTemplate: '<div></div>',
-
- // CSS classes
- navClass: 'ui-tabs-nav',
- selectedClass: 'ui-tabs-selected',
- unselectClass: 'ui-tabs-unselect',
- disabledClass: 'ui-tabs-disabled',
- panelClass: 'ui-tabs-panel',
- hideClass: 'ui-tabs-hide',
- loadingClass: 'ui-tabs-loading'
-};
-
-$.ui.tabs.getter = "length";
-
-/*
- * Tabs Extensions
- */
-
-/*
- * Rotate
- */
-$.extend($.ui.tabs.prototype, {
- rotation: null,
- rotate: function(ms, continuing) {
-
- continuing = continuing || false;
-
- var self = this, t = this.options.selected;
-
- function start() {
- self.rotation = setInterval(function() {
- t = ++t < self.$tabs.length ? t : 0;
- self.select(t);
- }, ms);
- }
-
- function stop(e) {
- if (!e || e.clientX) { // only in case of a true click
- clearInterval(self.rotation);
- }
- }
-
- // start interval
- if (ms) {
- start();
- if (!continuing)
- this.$tabs.bind(this.options.event, stop);
- else
- this.$tabs.bind(this.options.event, function() {
- stop();
- t = self.options.selected;
- start();
- });
- }
- // stop interval
- else {
- stop();
- this.$tabs.unbind(this.options.event, stop);
- }
- }
-});
-
-})(jQuery);
diff --git a/content/js/jquery.es.json b/content/js/jquery.es.json
deleted file mode 100755
index 699dc93..0000000
--- a/content/js/jquery.es.json
+++ /dev/null
@@ -1 +0,0 @@
-$.i18n.es = {}; \ No newline at end of file
diff --git a/content/js/jquery.i18n.js b/content/js/jquery.i18n.js
deleted file mode 100755
index 4eb303f..0000000
--- a/content/js/jquery.i18n.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright Bryan W Berry, 2009,
- * under the MIT license http://www.opensource.org/licenses/mit-license.php
- *
- * this library is heavily influenced by the GNU LIBC library
- * http://www.gnu.org/software/libc/manual/html_node/Locales.html
- */
-
-(function($){
- // PG: Maybe put everything in namespace i18n and rename the following function $.i18n.gettext?
-
- $.i18n = function(string, locale){
- var lang = locale || $.i18n.lang;
- if (!$.i18n[lang] || !$.i18n[lang].strings){
- return string;
- }
- return this.i18n[lang].strings['default'][string]||string;
- };
-
- $.i18n.cgettext = function(context, string, locale){
- var lang = locale || $.i18n.lang;
- if (!this.i18n[lang] || !this.i18n[lang].strings){
- return string;
- }
- return this.i18n[lang].strings[context][string]||string;
- };
-
- // You can override this in messages.<lang>.json.
- $.i18n.choose_pluralized_msg = function (choices, n) {
- return n == 1 ? choices[0] : choices[1];
- };
-
- $.i18n.ngettext = function (msgid1, msgid2, n) {
- var lang = $.i18n.lang;
- if (!$.i18n[lang] || !$.i18n[lang].strings) {
- return $.i18n.choose_pluralized_msg([msgid1, msgid2], n);
- }
- // Is using msgid1 as the key ok?
- return $.i18n.choose_pluralized_msg($.i18n[lang].strings[msgid1]
- || [msgid1, msgid2],
- n);
- };
-
- $._ = $.i18n;
- $._c = $.i18n.cgettext;
-
- $.i18n.setLocale = function (locale){
- $.i18n.lang = locale;
- };
-
- $.i18n.getLocale = function (){
- return $.i18n.lang;
- };
-
-
- /**
- * Converts a number to numerals in the specified locale. Currently only
- * supports devanagari numerals for Indic languages like Nepali and Hindi
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
- $.i18n._n = function(num, locale){
-
- locale = locale || $.i18n.lang;
-
- if (!this.i18n[locale] || !this.i18n[locale].numeralBase ){
- return num;
- }
-
-
- //48 is the base for western numerals
- var numBase = $.i18n[$.i18n.lang].numeralBase || 48;
- var prefix = $.i18n[$.i18n.lang].numeralPrefix || "u00";
-
- var convertDigit = function(digit){
- return '\\' + prefix +
- (numBase + parseInt(digit)).toString(16);
- };
-
- var charArray = num.toString().split("").map(convertDigit);
- return eval('"' + charArray.join('') + '"');
- };
-
- $._n = $.i18n._n;
-
- /* ToDo
- * implement sprintf
- * conversion functions for monetary and numeric
- * sorting functions (collation) for different locales
- */
-
- })(jQuery);
-
-
diff --git a/content/js/jquery.jgrowl_minimized.js b/content/js/jquery.jgrowl_minimized.js
deleted file mode 100755
index 09ddc88..0000000
--- a/content/js/jquery.jgrowl_minimized.js
+++ /dev/null
@@ -1,4 +0,0 @@
-
-(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)$('<div id="jGrowl"></div>').addClass($.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',new $.fn.jGrowl());$(this).data('jGrowl.instance').startup(this);}
-if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'&times;',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);this.notifications[this.notifications.length]={message:message,options:o};o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification'+((o.group!=undefined&&o.group!='')?' '+o.group:'')+'"><div class="close">'+o.closeTemplate+'</div><div class="header">'+o.header+'</div><div class="message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();(o.glue=='after')?$('div.jGrowl-notification:last',this.element).after(notification):$('div.jGrowl-notification:first',this.element).before(notification);$(notification).bind("mouseover.jGrowl",function(){$(this).data("jGrowl").pause=true;}).bind("mouseout.jGrowl",function(){$(this).data("jGrowl").pause=false;}).bind('jGrowl.beforeOpen',function(){o.beforeOpen.apply(self.element,[self.element,message,o]);}).bind('jGrowl.open',function(){o.open.apply(self.element,[self.element,message,o]);}).bind('jGrowl.beforeClose',function(){o.beforeClose.apply(self.element,[self.element,message,o]);}).bind('jGrowl.close',function(){$(this).trigger('jGrowl.beforeClose').animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();o.close.apply(self.element,[self.element,message,o]);});}).trigger('jGrowl.beforeOpen').animate(o.animateOpen,o.speed,o.easing,function(){$(this).data("jGrowl").created=new Date();}).trigger('jGrowl.open');if($.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',this.element).size()>1&&$('div.jGrowl-closer',this.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer').addClass(this.defaults.theme).appendTo(this.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer))self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){$(this).trigger('jGrowl.close');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool)){this.render(this.notifications.shift());}
-if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});};},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){jQuery(e).data('jGrowl.instance').update();},this.defaults.check);if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"])$(this.element).addClass('ie6');},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file
diff --git a/content/js/jquery.ne.json b/content/js/jquery.ne.json
deleted file mode 100755
index fe5e97b..0000000
--- a/content/js/jquery.ne.json
+++ /dev/null
@@ -1,13 +0,0 @@
-$.i18n.ne = {
- numeralBase : 2406,
- numeralPrefix:"u0"
- /*
- * additional values that could be added
- *
- * monetary format
- * non-monetary numeric format
- * date format
- * time format
- * yes, no for yes, no questions
- */
-}; \ No newline at end of file
diff --git a/content/js/jquery.svg.js b/content/js/jquery.svg.js
deleted file mode 100755
index 3d13d94..0000000
--- a/content/js/jquery.svg.js
+++ /dev/null
@@ -1,1325 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-
-(function($) { // Hide scope, no $ conflict
-
-/* SVG manager.
- Use the singleton instance of this class, $.svg,
- to interact with the SVG functionality. */
-function SVGManager() {
- this._settings = []; // Settings to be remembered per SVG object
- this._extensions = []; // List of SVG extensions added to SVGWrapper
- // for each entry [0] is extension name, [1] is extension class (function)
- // the function takes one parameter - the SVGWrapper instance
- this.regional = []; // Localisations, indexed by language, '' for default (English)
- this.regional[''] = {errorLoadingText: 'Error loading',
- notSupportedText: 'This browser does not support SVG'};
- this.local = this.regional['']; // Current localisation
- this._uuid = new Date().getTime();
- this._renesis = detectActiveX('RenesisX.RenesisCtrl');
-}
-
-/* Determine whether a given ActiveX control is available.
- @param classId (string) the ID for the ActiveX control
- @return (boolean) true if found, false if not */
-function detectActiveX(classId) {
- try {
- return !!(window.ActiveXObject && new ActiveXObject(classId));
- }
- catch (e) {
- return false;
- }
-}
-
-var PROP_NAME = 'svgwrapper';
-
-$.extend(SVGManager.prototype, {
- /* Class name added to elements to indicate already configured with SVG. */
- markerClassName: 'hasSVG',
-
- /* SVG namespace. */
- svgNS: 'http://www.w3.org/2000/svg',
- /* XLink namespace. */
- xlinkNS: 'http://www.w3.org/1999/xlink',
-
- /* SVG wrapper class. */
- _wrapperClass: SVGWrapper,
-
- /* Camel-case versions of attribute names containing dashes or are reserved words. */
- _attrNames: {class_: 'class', in_: 'in',
- alignmentBaseline: 'alignment-baseline', baselineShift: 'baseline-shift',
- clipPath: 'clip-path', clipRule: 'clip-rule',
- colorInterpolation: 'color-interpolation',
- colorInterpolationFilters: 'color-interpolation-filters',
- colorRendering: 'color-rendering', dominantBaseline: 'dominant-baseline',
- enableBackground: 'enable-background', fillOpacity: 'fill-opacity',
- fillRule: 'fill-rule', floodColor: 'flood-color',
- floodOpacity: 'flood-opacity', fontFamily: 'font-family',
- fontSize: 'font-size', fontSizeAdjust: 'font-size-adjust',
- fontStretch: 'font-stretch', fontStyle: 'font-style',
- fontVariant: 'font-variant', fontWeight: 'font-weight',
- glyphOrientationHorizontal: 'glyph-orientation-horizontal',
- glyphOrientationVertical: 'glyph-orientation-vertical',
- horizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x',
- imageRendering: 'image-rendering', letterSpacing: 'letter-spacing',
- lightingColor: 'lighting-color', markerEnd: 'marker-end',
- markerMid: 'marker-mid', markerStart: 'marker-start',
- stopColor: 'stop-color', stopOpacity: 'stop-opacity',
- strikethroughPosition: 'strikethrough-position',
- strikethroughThickness: 'strikethrough-thickness',
- strokeDashArray: 'stroke-dasharray', strokeDashOffset: 'stroke-dashoffset',
- strokeLineCap: 'stroke-linecap', strokeLineJoin: 'stroke-linejoin',
- strokeMiterLimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity',
- strokeWidth: 'stroke-width', textAnchor: 'text-anchor',
- textDecoration: 'text-decoration', textRendering: 'text-rendering',
- underlinePosition: 'underline-position', underlineThickness: 'underline-thickness',
- vertAdvY: 'vert-adv-y', vertOriginY: 'vert-origin-y',
- wordSpacing: 'word-spacing', writingMode: 'writing-mode'},
-
- /* Add the SVG object to its container. */
- _attachSVG: function(container, settings) {
- if ($(container).hasClass(this.markerClassName)) {
- return;
- }
- if (typeof settings == 'string') {
- settings = {loadURL: settings};
- }
- else if (typeof settings == 'function') {
- settings = {onLoad: settings};
- }
- $(container).addClass(this.markerClassName);
- try {
- var svg = document.createElementNS(this.svgNS, 'svg');
- svg.setAttribute('version', '1.1');
- svg.setAttribute('width', container.clientWidth);
- svg.setAttribute('height', container.clientHeight);
- container.appendChild(svg);
- this._afterLoad(container, svg, settings);
- }
- catch (e) {
- if ($.browser.msie) {
- if (!container.id) {
- container.id = 'svg' + (this._uuid++);
- }
- this._settings[container.id] = settings;
- container.innerHTML = '<embed type="image/svg+xml" width="100%" ' +
- 'height="100%" src="' + (settings.initPath || '') + 'blank.svg"/>';
- }
- else {
- container.innerHTML = '<p class="svg_error">' +
- this.local.notSupportedText + '</p>';
- }
- }
- },
-
- /* SVG callback after loading - register SVG root. */
- _registerSVG: function() {
- for (var i = 0; i < document.embeds.length; i++) { // Check all
- var container = document.embeds[i].parentNode;
- if (!$(container).hasClass($.svg.markerClassName) || // Not SVG
- $.data(container, PROP_NAME)) { // Already done
- continue;
- }
- var svg = null;
- try {
- svg = document.embeds[i].getSVGDocument();
- }
- catch(e) {
- setTimeout($.svg._registerSVG, 250); // Renesis takes longer to load
- return;
- }
- svg = (svg ? svg.documentElement : null);
- if (svg) {
- $.svg._afterLoad(container, svg);
- }
- }
- },
-
- /* Post-processing once loaded. */
- _afterLoad: function(container, svg, settings) {
- var settings = settings || this._settings[container.id];
- this._settings[container.id] = null;
- var wrapper = new this._wrapperClass(svg, container);
- $.data(container, PROP_NAME, wrapper);
- try {
- if (settings.loadURL) { // Load URL
- wrapper.load(settings.loadURL, settings);
- }
- if (settings.settings) { // Additional settings
- wrapper.configure(settings.settings);
- }
- if (settings.onLoad && !settings.loadURL) { // Onload callback
- settings.onLoad.apply(container, [wrapper]);
- }
- }
- catch (e) {
- alert(e);
- }
- },
-
- /* Return the SVG wrapper created for a given container.
- @param container (string) selector for the container or
- (element) the container for the SVG object or
- jQuery collection - first entry is the container
- @return (SVGWrapper) the corresponding SVG wrapper element, or null if not attached */
- _getSVG: function(container) {
- container = (typeof container == 'string' ? $(container)[0] :
- (container.jquery ? container[0] : container));
- return $.data(container, PROP_NAME);
- },
-
- /* Remove the SVG functionality from a div.
- @param container (element) the container for the SVG object */
- _destroySVG: function(container) {
- var $container = $(container);
- if (!$container.hasClass(this.markerClassName)) {
- return;
- }
- $container.removeClass(this.markerClassName).empty();
- $.removeData(container, PROP_NAME);
- },
-
- /* Extend the SVGWrapper object with an embedded class.
- The constructor function must take a single parameter that is
- a reference to the owning SVG root object. This allows the
- extension to access the basic SVG functionality.
- @param name (string) the name of the SVGWrapper attribute to access the new class
- @param extClass (function) the extension class constructor */
- addExtension: function(name, extClass) {
- this._extensions.push([name, extClass]);
- }
-});
-
-/* The main SVG interface, which encapsulates the SVG element.
- Obtain a reference from $().svg('get') */
-function SVGWrapper(svg, container) {
- this._svg = svg; // The SVG root node
- this._container = container; // The containing div
- for (var i = 0; i < $.svg._extensions.length; i++) {
- var extension = $.svg._extensions[i];
- this[extension[0]] = new extension[1](this);
- }
-}
-
-$.extend(SVGWrapper.prototype, {
-
- /* Retrieve the width of the SVG object. */
- _width: function() {
- return this._container.clientWidth;
- },
-
- /* Retrieve the height of the SVG object. */
- _height: function() {
- return this._container.clientHeight;
- },
-
- /* Retrieve the root SVG element.
- @return the top-level SVG element */
- root: function() {
- return this._svg;
- },
-
- /* Configure the SVG root.
- @param settings (object) additional settings for the root
- @param clear (boolean) true to remove existing attributes first,
- false to add to what is already there (optional)
- @return (SVGWrapper) this root */
- configure: function(settings, clear) {
- if (clear) {
- for (var i = this._svg.attributes.length - 1; i >= 0; i--) {
- var attr = this._svg.attributes.item(i);
- if (!(attr.nodeName == 'onload' || attr.nodeName == 'version' ||
- attr.nodeName.substring(0, 5) == 'xmlns')) {
- this._svg.attributes.removeNamedItem(attr.nodeName);
- }
- }
- }
- for (var attrName in settings) {
- this._svg.setAttribute(attrName, settings[attrName]);
- }
- return this;
- },
-
- /* Locate a specific element in the SVG document.
- @param id (string) the element's identifier
- @return (element) the element reference, or null if not found */
- getElementById: function(id) {
- return this._svg.ownerDocument.getElementById(id);
- },
-
- /* Change the attributes for a SVG node.
- @param element (SVG element) the node to change
- @param settings (object) the new settings
- @return (SVGWrapper) this root */
- change: function(element, settings) {
- if (element) {
- for (var name in settings) {
- if (settings[name] == null) {
- element.removeAttribute(name);
- }
- else {
- element.setAttribute(name, settings[name]);
- }
- }
- }
- return this;
- },
-
- /* Check for parent being absent and adjust arguments accordingly. */
- _args: function(values, names, optSettings) {
- names.splice(0, 0, 'parent');
- names.splice(names.length, 0, 'settings');
- var args = {};
- var offset = 0;
- if (values[0] != null && (typeof values[0] != 'object' || !values[0].nodeName)) {
- args['parent'] = null;
- offset = 1;
- }
- for (var i = 0; i < values.length; i++) {
- args[names[i + offset]] = values[i];
- }
- if (optSettings) {
- $.each(optSettings, function(i, value) {
- if (typeof args[value] == 'object') {
- args.settings = args[value];
- args[value] = null;
- }
- });
- }
- return args;
- },
-
- /* Add a title.
- @param parent (element) the parent node for the new title (optional)
- @param text (string) the text of the title
- @param settings (object) additional settings for the title (optional)
- @return (element) the new title node */
- title: function(parent, text, settings) {
- var args = this._args(arguments, ['text']);
- var node = this._makeNode(args.parent, 'title', args.settings || {});
- node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
- return node;
- },
-
- /* Add a description.
- @param parent (element) the parent node for the new description (optional)
- @param text (string) the text of the description
- @param settings (object) additional settings for the description (optional)
- @return (element) the new description node */
- describe: function(parent, text, settings) {
- var args = this._args(arguments, ['text']);
- var node = this._makeNode(args.parent, 'desc', args.settings || {});
- node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
- return node;
- },
-
- /* Add a definitions node.
- @param parent (element) the parent node for the new definitions (optional)
- @param id (string) the ID of this definitions (optional)
- @param settings (object) additional settings for the definitions (optional)
- @return (element) the new definitions node */
- defs: function(parent, id, settings) {
- var args = this._args(arguments, ['id'], ['id']);
- return this._makeNode(args.parent, 'defs', $.extend(
- (args.id ? {id: args.id} : {}), args.settings || {}));
- },
-
- /* Add a symbol definition.
- @param parent (element) the parent node for the new symbol (optional)
- @param id (string) the ID of this symbol
- @param x1 (number) the left coordinate for this symbol
- @param y1 (number) the top coordinate for this symbol
- @param x2 (number) the right coordinate for this symbol
- @param y2 (number) the bottom coordinate for this symbol
- @param settings (object) additional settings for the symbol (optional)
- @return (element) the new symbol node */
- symbol: function(parent, id, x1, y1, x2, y2, settings) {
- var args = this._args(arguments, ['id', 'x1', 'y1', 'x2', 'y2']);
- return this._makeNode(args.parent, 'symbol', $.extend(
- {id: args.id, viewBox: args.x1 + ' ' + args.y1 + ' ' + args.x2 + ' ' + args.y2},
- args.settings || {}));
- },
-
- /* Add a marker definition.
- @param parent (element) the parent node for the new marker (optional)
- @param id (string) the ID of this marker
- @param refX (number) the x-coordinate for the reference point
- @param refY (number) the y-coordinate for the reference point
- @param mWidth (number) the marker viewport width
- @param mHeight (number) the marker viewport height
- @param orient (string or int) 'auto' or angle (degrees) (optional)
- @param settings (object) additional settings for the marker (optional)
- @return (element) the new marker node */
- marker: function(parent, id, refX, refY, mWidth, mHeight, orient, settings) {
- var args = this._args(arguments, ['id', 'refX', 'refY',
- 'mWidth', 'mHeight', 'orient'], ['orient']);
- return this._makeNode(args.parent, 'marker', $.extend(
- {id: args.id, refX: args.refX, refY: args.refY, markerWidth: args.mWidth,
- markerHeight: args.mHeight, orient: args.orient || 'auto'}, args.settings || {}));
- },
-
- /* Add a style node.
- @param parent (element) the parent node for the new node (optional)
- @param styles (string) the CSS styles
- @param settings (object) additional settings for the node (optional)
- @return (element) the new style node */
- style: function(parent, styles, settings) {
- var args = this._args(arguments, ['styles']);
- var node = this._makeNode(args.parent, 'style', $.extend(
- {type: 'text/css'}, args.settings || {}));
- node.appendChild(this._svg.ownerDocument.createTextNode(args.styles));
- if ($.browser.opera) {
- $('head').append('<style type="text/css">' + args.styles + '</style>');
- }
- return node;
- },
-
- /* Add a script node.
- @param parent (element) the parent node for the new node (optional)
- @param script (string) the JavaScript code
- @param type (string) the MIME type for the code (optional, default 'text/javascript')
- @param settings (object) additional settings for the node (optional)
- @return (element) the new script node */
- script: function(parent, script, type, settings) {
- var args = this._args(arguments, ['script', 'type'], ['type']);
- var node = this._makeNode(args.parent, 'script', $.extend(
- {type: args.type || 'text/javascript'}, args.settings || {}));
- node.appendChild(this._svg.ownerDocument.createTextNode(this._escapeXML(args.script)));
- if (!$.browser.mozilla) {
- $.globalEval(args.script);
- }
- return node;
- },
-
- /* Add a linear gradient definition.
- Specify all of x1, y1, x2, y2 or none of them.
- @param parent (element) the parent node for the new gradient (optional)
- @param id (string) the ID for this gradient
- @param stops (string[][]) the gradient stops, each entry is
- [0] is offset (0.0-1.0 or 0%-100%), [1] is colour,
- [2] is opacity (optional)
- @param x1 (number) the x-coordinate of the gradient start (optional)
- @param y1 (number) the y-coordinate of the gradient start (optional)
- @param x2 (number) the x-coordinate of the gradient end (optional)
- @param y2 (number) the y-coordinate of the gradient end (optional)
- @param settings (object) additional settings for the gradient (optional)
- @return (element) the new gradient node */
- linearGradient: function(parent, id, stops, x1, y1, x2, y2, settings) {
- var args = this._args(arguments,
- ['id', 'stops', 'x1', 'y1', 'x2', 'y2'], ['x1']);
- var sets = $.extend({id: args.id},
- (args.x1 != null ? {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2} : {}));
- return this._gradient(args.parent, 'linearGradient',
- $.extend(sets, args.settings || {}), args.stops);
- },
-
- /* Add a radial gradient definition.
- Specify all of cx, cy, r, fx, fy or none of them.
- @param parent (element) the parent node for the new gradient (optional)
- @param id (string) the ID for this gradient
- @param stops (string[][]) the gradient stops, each entry
- [0] is offset, [1] is colour, [2] is opacity (optional)
- @param cx (number) the x-coordinate of the largest circle centre (optional)
- @param cy (number) the y-coordinate of the largest circle centre (optional)
- @param r (number) the radius of the largest circle (optional)
- @param fx (number) the x-coordinate of the gradient focus (optional)
- @param fy (number) the y-coordinate of the gradient focus (optional)
- @param settings (object) additional settings for the gradient (optional)
- @return (element) the new gradient node */
- radialGradient: function(parent, id, stops, cx, cy, r, fx, fy, settings) {
- var args = this._args(arguments,
- ['id', 'stops', 'cx', 'cy', 'r', 'fx', 'fy'], ['cx']);
- var sets = $.extend({id: args.id}, (args.cx != null ?
- {cx: args.cx, cy: args.cy, r: args.r, fx: args.fx, fy: args.fy} : {}));
- return this._gradient(args.parent, 'radialGradient',
- $.extend(sets, args.settings || {}), args.stops);
- },
-
- /* Add a gradient node. */
- _gradient: function(parent, name, settings, stops) {
- var node = this._makeNode(parent, name, settings);
- for (var i = 0; i < stops.length; i++) {
- var stop = stops[i];
- this._makeNode(node, 'stop', $.extend(
- {offset: stop[0], stopColor: stop[1]},
- (stop[2] != null ? {stopOpacity: stop[2]} : {})));
- }
- return node;
- },
-
- /* Add a pattern definition.
- Specify all of vx, vy, xwidth, vheight or none of them.
- @param parent (element) the parent node for the new pattern (optional)
- @param id (string) the ID for this pattern
- @param x (number) the x-coordinate for the left edge of the pattern
- @param y (number) the y-coordinate for the top edge of the pattern
- @param width (number) the width of the pattern
- @param height (number) the height of the pattern
- @param vx (number) the minimum x-coordinate for view box (optional)
- @param vy (number) the minimum y-coordinate for the view box (optional)
- @param vwidth (number) the width of the view box (optional)
- @param vheight (number) the height of the view box (optional)
- @param settings (object) additional settings for the pattern (optional)
- @return (element) the new pattern node */
- pattern: function(parent, id, x, y, width, height, vx, vy, vwidth, vheight, settings) {
- var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height',
- 'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
- var sets = $.extend({id: args.id, x: args.x, y: args.y,
- width: args.width, height: args.height}, (args.vx != null ?
- {viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' ' + args.vheight} : {}));
- return this._makeNode(args.parent, 'pattern', $.extend(sets, args.settings || {}));
- },
-
- /* Add a mask definition.
- @param parent (element) the parent node for the new mask (optional)
- @param id (string) the ID for this mask
- @param x (number) the x-coordinate for the left edge of the mask
- @param y (number) the y-coordinate for the top edge of the mask
- @param width (number) the width of the mask
- @param height (number) the height of the mask
- @param settings (object) additional settings for the mask (optional)
- @return (element) the new mask node */
- mask: function(parent, id, x, y, width, height, settings) {
- var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height']);
- return this._makeNode(args.parent, 'mask', $.extend(
- {id: args.id, x: args.x, y: args.y, width: args.width, height: args.height},
- args.settings || {}));
- },
-
- /* Create a new path object.
- @return (SVGPath) a new path object */
- createPath: function() {
- return new SVGPath();
- },
-
- /* Create a new text object.
- @return (SVGText) a new text object */
- createText: function() {
- return new SVGText();
- },
-
- /* Add an embedded SVG element.
- Specify all of vx, vy, vwidth, vheight or none of them.
- @param parent (element) the parent node for the new node (optional)
- @param x (number) the x-coordinate for the left edge of the node
- @param y (number) the y-coordinate for the top edge of the node
- @param width (number) the width of the node
- @param height (number) the height of the node
- @param vx (number) the minimum x-coordinate for view box (optional)
- @param vy (number) the minimum y-coordinate for the view box (optional)
- @param vwidth (number) the width of the view box (optional)
- @param vheight (number) the height of the view box (optional)
- @param settings (object) additional settings for the node (optional)
- @return (element) the new node */
- svg: function(parent, x, y, width, height, vx, vy, vwidth, vheight, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height',
- 'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
- var sets = $.extend({x: args.x, y: args.y, width: args.width, height: args.height},
- (args.vx != null ? {viewBox: args.vx + ' ' + args.vy + ' ' +
- args.vwidth + ' ' + args.vheight} : {}));
- return this._makeNode(args.parent, 'svg', $.extend(sets, args.settings || {}));
- },
-
- /* Create a group.
- @param parent (element) the parent node for the new group (optional)
- @param id (string) the ID of this group (optional)
- @param settings (object) additional settings for the group (optional)
- @return (element) the new group node */
- group: function(parent, id, settings) {
- var args = this._args(arguments, ['id'], ['id']);
- return this._makeNode(args.parent, 'g', $.extend({id: args.id}, args.settings || {}));
- },
-
- /* Add a usage reference.
- Specify all of x, y, width, height or none of them.
- @param parent (element) the parent node for the new node (optional)
- @param x (number) the x-coordinate for the left edge of the node (optional)
- @param y (number) the y-coordinate for the top edge of the node (optional)
- @param width (number) the width of the node (optional)
- @param height (number) the height of the node (optional)
- @param ref (string) the ID of the definition node
- @param settings (object) additional settings for the node (optional)
- @return (element) the new node */
- use: function(parent, x, y, width, height, ref, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
- if (typeof args.x == 'string') {
- args.ref = args.x;
- args.settings = args.y;
- args.x = args.y = args.width = args.height = null;
- }
- var node = this._makeNode(args.parent, 'use', $.extend(
- {x: args.x, y: args.y, width: args.width, height: args.height},
- args.settings || {}));
- node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
- return node;
- },
-
- /* Add a link, which applies to all child elements.
- @param parent (element) the parent node for the new link (optional)
- @param ref (string) the target URL
- @param settings (object) additional settings for the link (optional)
- @return (element) the new link node */
- link: function(parent, ref, settings) {
- var args = this._args(arguments, ['ref']);
- var node = this._makeNode(args.parent, 'a', args.settings);
- node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
- return node;
- },
-
- /* Add an image.
- @param parent (element) the parent node for the new image (optional)
- @param x (number) the x-coordinate for the left edge of the image
- @param y (number) the y-coordinate for the top edge of the image
- @param width (number) the width of the image
- @param height (number) the height of the image
- @param ref (string) the path to the image
- @param settings (object) additional settings for the image (optional)
- @return (element) the new image node */
- image: function(parent, x, y, width, height, ref, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
- var node = this._makeNode(args.parent, 'image', $.extend(
- {x: args.x, y: args.y, width: args.width, height: args.height},
- args.settings || {}));
- node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
- return node;
- },
-
- /* Draw a path.
- @param parent (element) the parent node for the new shape (optional)
- @param path (string or SVGPath) the path to draw
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- path: function(parent, path, settings) {
- var args = this._args(arguments, ['path']);
- return this._makeNode(args.parent, 'path', $.extend(
- {d: (args.path.path ? args.path.path() : args.path)}, args.settings || {}));
- },
-
- /* Draw a rectangle.
- Specify both of rx and ry or neither.
- @param parent (element) the parent node for the new shape (optional)
- @param x (number) the x-coordinate for the left edge of the rectangle
- @param y (number) the y-coordinate for the top edge of the rectangle
- @param width (number) the width of the rectangle
- @param height (number) the height of the rectangle
- @param rx (number) the x-radius of the ellipse for the rounded corners (optional)
- @param ry (number) the y-radius of the ellipse for the rounded corners (optional)
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- rect: function(parent, x, y, width, height, rx, ry, settings) {
- var args = this._args(arguments, ['x', 'y', 'width', 'height', 'rx', 'ry'], ['rx']);
- return this._makeNode(args.parent, 'rect', $.extend(
- {x: args.x, y: args.y, width: args.width, height: args.height},
- (args.rx ? {rx: args.rx, ry: args.ry} : {}), args.settings || {}));
- },
-
- /* Draw a circle.
- @param parent (element) the parent node for the new shape (optional)
- @param cx (number) the x-coordinate for the centre of the circle
- @param cy (number) the y-coordinate for the centre of the circle
- @param r (number) the radius of the circle
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- circle: function(parent, cx, cy, r, settings) {
- var args = this._args(arguments, ['cx', 'cy', 'r']);
- return this._makeNode(args.parent, 'circle', $.extend(
- {cx: args.cx, cy: args.cy, r: args.r}, args.settings || {}));
- },
-
- /* Draw an ellipse.
- @param parent (element) the parent node for the new shape (optional)
- @param cx (number) the x-coordinate for the centre of the ellipse
- @param cy (number) the y-coordinate for the centre of the ellipse
- @param rx (number) the x-radius of the ellipse
- @param ry (number) the y-radius of the ellipse
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- ellipse: function(parent, cx, cy, rx, ry, settings) {
- var args = this._args(arguments, ['cx', 'cy', 'rx', 'ry']);
- return this._makeNode(args.parent, 'ellipse', $.extend(
- {cx: args.cx, cy: args.cy, rx: args.rx, ry: args.ry}, args.settings || {}));
- },
-
- /* Draw a line.
- @param parent (element) the parent node for the new shape (optional)
- @param x1 (number) the x-coordinate for the start of the line
- @param y1 (number) the y-coordinate for the start of the line
- @param x2 (number) the x-coordinate for the end of the line
- @param y2 (number) the y-coordinate for the end of the line
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- line: function(parent, x1, y1, x2, y2, settings) {
- var args = this._args(arguments, ['x1', 'y1', 'x2', 'y2']);
- return this._makeNode(args.parent, 'line', $.extend(
- {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2}, args.settings || {}));
- },
-
- /* Draw a polygonal line.
- @param parent (element) the parent node for the new shape (optional)
- @param points (number[][]) the x-/y-coordinates for the points on the line
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- polyline: function(parent, points, settings) {
- var args = this._args(arguments, ['points']);
- return this._poly(args.parent, 'polyline', args.points, args.settings);
- },
-
- /* Draw a polygonal shape.
- @param parent (element) the parent node for the new shape (optional)
- @param points (number[][]) the x-/y-coordinates for the points on the shape
- @param settings (object) additional settings for the shape (optional)
- @return (element) the new shape node */
- polygon: function(parent, points, settings) {
- var args = this._args(arguments, ['points']);
- return this._poly(args.parent, 'polygon', args.points, args.settings);
- },
-
- /* Draw a polygonal line or shape. */
- _poly: function(parent, name, points, settings) {
- var ps = '';
- for (var i = 0; i < points.length; i++) {
- ps += points[i].join() + ' ';
- }
- return this._makeNode(parent, name, $.extend(
- {points: $.trim(ps)}, settings || {}));
- },
-
- /* Draw text.
- Specify both of x and y or neither of them.
- @param parent (element) the parent node for the text (optional)
- @param x (number or number[]) the x-coordinate(s) for the text (optional)
- @param y (number or number[]) the y-coordinate(s) for the text (optional)
- @param value (string) the text content or
- (SVGText) text with spans and references
- @param settings (object) additional settings for the text (optional)
- @return (element) the new text node */
- text: function(parent, x, y, value, settings) {
- var args = this._args(arguments, ['x', 'y', 'value']);
- if (typeof args.x == 'string' && arguments.length < 4) {
- args.value = args.x;
- args.settings = args.y;
- args.x = args.y = null;
- }
- return this._text(args.parent, 'text', args.value, $.extend(
- {x: (args.x && isArray(args.x) ? args.x.join(' ') : args.x),
- y: (args.y && isArray(args.y) ? args.y.join(' ') : args.y)},
- args.settings || {}));
- },
-
- /* Draw text along a path.
- @param parent (element) the parent node for the text (optional)
- @param path (string) the ID of the path
- @param value (string) the text content or
- (SVGText) text with spans and references
- @param settings (object) additional settings for the text (optional)
- @return (element) the new text node */
- textpath: function(parent, path, value, settings) {
- var args = this._args(arguments, ['path', 'value']);
- var node = this._text(args.parent, 'textPath', args.value, args.settings || {});
- node.setAttributeNS($.svg.xlinkNS, 'href', args.path);
- return node;
- },
-
- /* Draw text. */
- _text: function(parent, name, value, settings) {
- var node = this._makeNode(parent, name, settings);
- if (typeof value == 'string') {
- node.appendChild(node.ownerDocument.createTextNode(value));
- }
- else {
- for (var i = 0; i < value._parts.length; i++) {
- var part = value._parts[i];
- if (part[0] == 'tspan') {
- var child = this._makeNode(node, part[0], part[2]);
- child.appendChild(node.ownerDocument.createTextNode(part[1]));
- node.appendChild(child);
- }
- else if (part[0] == 'tref') {
- var child = this._makeNode(node, part[0], part[2]);
- child.setAttributeNS($.svg.xlinkNS, 'href', part[1]);
- node.appendChild(child);
- }
- else if (part[0] == 'textpath') {
- var set = $.extend({}, part[2]);
- set.href = null;
- var child = this._makeNode(node, part[0], set);
- child.setAttributeNS($.svg.xlinkNS, 'href', part[2].href);
- child.appendChild(node.ownerDocument.createTextNode(part[1]));
- node.appendChild(child);
- }
- else { // straight text
- node.appendChild(node.ownerDocument.createTextNode(part[1]));
- }
- }
- }
- return node;
- },
-
- /* Add a custom SVG element.
- @param parent (element) the parent node for the new element (optional)
- @param name (string) the name of the element
- @param settings (object) additional settings for the element (optional)
- @return (element) the new title node */
- other: function(parent, name, settings) {
- var args = this._args(arguments, ['name']);
- return this._makeNode(args.parent, args.name, args.settings || {});
- },
-
- /* Create a shape node with the given settings. */
- _makeNode: function(parent, name, settings) {
- parent = parent || this._svg;
- var node = this._svg.ownerDocument.createElementNS($.svg.svgNS, name);
- for (var name in settings) {
- var value = settings[name];
- if (value != null && value != null &&
- (typeof value != 'string' || value != '')) {
- node.setAttribute($.svg._attrNames[name] || name, value);
- }
- }
- parent.appendChild(node);
- return node;
- },
-
- /* Add an existing SVG node to the diagram.
- @param parent (element) the parent node for the new node (optional)
- @param node (element) the new node to add or
- (string) the jQuery selector for the node or
- (jQuery collection) set of nodes to add
- @return (SVGWrapper) this wrapper */
- add: function(parent, node) {
- var args = this._args(arguments, ['node']);
- var svg = this;
- args.parent = args.parent || this._svg;
- try {
- if ($.svg._renesis) {
- throw 'Force traversal';
- }
- args.parent.appendChild(args.node.cloneNode(true));
- }
- catch (e) {
- args.node = (args.node.jquery ? args.node : $(args.node));
- args.node.each(function() {
- var child = svg._cloneAsSVG(this);
- if (child) {
- args.parent.appendChild(child);
- }
- });
- }
- return this;
- },
-
- /* SVG nodes must belong to the SVG namespace, so clone and ensure this is so. */
- _cloneAsSVG: function(node) {
- var newNode = null;
- if (node.nodeType == 1) { // element
- newNode = this._svg.ownerDocument.createElementNS(
- $.svg.svgNS, this._checkName(node.nodeName));
- for (var i = 0; i < node.attributes.length; i++) {
- var attr = node.attributes.item(i);
- if (attr.nodeName != 'xmlns' && attr.nodeValue) {
- if (attr.prefix == 'xlink') {
- newNode.setAttributeNS($.svg.xlinkNS, attr.localName, attr.nodeValue);
- }
- else {
- newNode.setAttribute(this._checkName(attr.nodeName), attr.nodeValue);
- }
- }
- }
- for (var i = 0; i < node.childNodes.length; i++) {
- var child = this._cloneAsSVG(node.childNodes[i]);
- if (child) {
- newNode.appendChild(child);
- }
- }
- }
- else if (node.nodeType == 3) { // text
- if ($.trim(node.nodeValue)) {
- newNode = this._svg.ownerDocument.createTextNode(node.nodeValue);
- }
- }
- else if (node.nodeType == 4) { // CDATA
- if ($.trim(node.nodeValue)) {
- try {
- newNode = this._svg.ownerDocument.createCDATASection(node.nodeValue);
- }
- catch (e) {
- newNode = this._svg.ownerDocument.createTextNode(
- node.nodeValue.replace(/&/g, '&amp;').
- replace(/</g, '&lt;').replace(/>/g, '&gt;'));
- }
- }
- }
- return newNode;
- },
-
- /* Node names must be lower case and without SVG namespace prefix. */
- _checkName: function(name) {
- name = (name.substring(0, 1) >= 'A' && name.substring(0, 1) <= 'Z' ?
- name.toLowerCase() : name);
- return (name.substring(0, 4) == 'svg:' ? name.substring(4) : name);
- },
-
- /* Load an external SVG document.
- @param url (string) the location of the SVG document or
- the actual SVG content
- @param settings (boolean) see addTo below or
- (function) see onLoad below or
- (object) additional settings for the load with attributes below:
- addTo (boolean) true to add to what's already there,
- or false to clear the canvas first
- changeSize (boolean) true to allow the canvas size to change,
- or false to retain the original
- onLoad (function) callback after the document has loaded,
- 'this' is the container, receives SVG object and
- optional error message as a parameter
- @return (SVGWrapper) this root */
- load: function(url, settings) {
- settings = (typeof settings == 'boolean'? {addTo: settings} :
- (typeof settings == 'function'? {onLoad: settings} : settings || {}));
- if (!settings.addTo) {
- this.clear(false);
- }
- var size = [this._svg.getAttribute('width'), this._svg.getAttribute('height')];
- var wrapper = this;
- // Report a problem with the load
- var reportError = function(message) {
- message = $.svg.local.errorLoadingText + ': ' + message;
- if (settings.onLoad) {
- settings.onLoad.apply(wrapper._container, [wrapper, message]);
- }
- else {
- wrapper.text(null, 10, 20, message);
- }
- };
- // Create a DOM from SVG content
- var loadXML4IE = function(data) {
- var xml = new ActiveXObject('Microsoft.XMLDOM');
- xml.validateOnParse = false;
- xml.resolveExternals = false;
- xml.async = false;
- xml.loadXML(data);
- if (xml.parseError.errorCode != 0) {
- reportError(xml.parseError.reason);
- return null;
- }
- return xml;
- };
- // Load the SVG DOM
- var loadSVG = function(data) {
- if (!data) {
- return;
- }
- if (data.documentElement.nodeName != 'svg') {
- var errors = data.getElementsByTagName('parsererror');
- var messages = (errors.length ? errors[0].getElementsByTagName('div') : []); // Safari
- reportError(!errors.length ? '???' :
- (messages.length ? messages[0] : errors[0]).firstChild.nodeValue);
- return;
- }
- var attrs = {};
- for (var i = 0; i < data.documentElement.attributes.length; i++) {
- var attr = data.documentElement.attributes.item(i);
- if (!(attr.nodeName == 'version' || attr.nodeName.substring(0, 5) == 'xmlns')) {
- attrs[attr.nodeName] = attr.nodeValue;
- }
- }
- wrapper.configure(attrs, true);
- var nodes = data.documentElement.childNodes;
- for (var i = 0; i < nodes.length; i++) {
- try {
- if ($.svg._renesis) {
- throw 'Force traversal';
- }
- wrapper._svg.appendChild(nodes[i].cloneNode(true));
- }
- catch (e) {
- wrapper.add(null, nodes[i]);
- }
- }
- if (!settings.changeSize) {
- wrapper.configure({width: size[0], height: size[1]});
- }
- if (settings.onLoad) {
- settings.onLoad.apply(wrapper._container, [wrapper]);
- }
- };
- if (url.match('<svg')) { // Inline SVG
- loadSVG($.browser.msie ? loadXML4IE(url) :
- new DOMParser().parseFromString(url, 'text/xml'));
- }
- else { // Remote SVG
- $.ajax({url: url, dataType: ($.browser.msie ? 'text' : 'xml'),
- success: function(xml) {
- loadSVG($.browser.msie ? loadXML4IE(xml) : xml);
- }, error: function(http, message, exc) {
- reportError(message + (exc ? ' ' + exc.message : ''));
- }});
- }
- return this;
- },
-
- /* Delete a specified node.
- @param node (element) the drawing node to remove
- @return (SVGWrapper) this root */
- remove: function(node) {
- node.parentNode.removeChild(node);
- return this;
- },
-
- /* Delete everything in the current document.
- @param attrsToo (boolean) true to clear any root attributes as well,
- false to leave them (optional)
- @return (SVGWrapper) this root */
- clear: function(attrsToo) {
- if (attrsToo) {
- this.configure({}, true);
- }
- while (this._svg.firstChild) {
- this._svg.removeChild(this._svg.firstChild);
- }
- return this;
- },
-
- /* Serialise the current diagram into an SVG text document.
- @param node (SVG element) the starting node (optional)
- @return (string) the SVG as text */
- toSVG: function(node) {
- node = node || this._svg;
- return (typeof XMLSerializer == 'undefined' ? this._toSVG(node) :
- new XMLSerializer().serializeToString(node));
- },
-
- /* Serialise one node in the SVG hierarchy. */
- _toSVG: function(node) {
- var svgDoc = '';
- if (!node) {
- return svgDoc;
- }
- if (node.nodeType == 3) { // Text
- svgDoc = node.nodeValue;
- }
- else if (node.nodeType == 4) { // CDATA
- svgDoc = '<![CDATA[' + node.nodeValue + ']]>';
- }
- else { // Element
- svgDoc = '<' + node.nodeName;
- if (node.attributes) {
- for (var i = 0; i < node.attributes.length; i++) {
- var attr = node.attributes.item(i);
- if (!($.trim(attr.nodeValue) == '' || attr.nodeValue.match(/^\[object/) ||
- attr.nodeValue.match(/^function/))) {
- svgDoc += ' ' + (attr.namespaceURI == $.svg.xlinkNS ? 'xlink:' : '') +
- attr.nodeName + '="' + attr.nodeValue + '"';
- }
- }
- }
- if (node.firstChild) {
- svgDoc += '>';
- var child = node.firstChild;
- while (child) {
- svgDoc += this._toSVG(child);
- child = child.nextSibling;
- }
- svgDoc += '</' + node.nodeName + '>';
- }
- else {
- svgDoc += '/>';
- }
- }
- return svgDoc;
- },
-
- /* Escape reserved characters in XML. */
- _escapeXML: function(text) {
- text = text.replace(/&/g, '&amp;');
- text = text.replace(/</g, '&lt;');
- text = text.replace(/>/g, '&gt;');
- return text;
- }
-});
-
-/* Helper to generate an SVG path.
- Obtain an instance from the SVGWrapper object.
- String calls together to generate the path and use its value:
- var path = root.createPath();
- root.path(null, path.move(100, 100).line(300, 100).line(200, 300).close(), {fill: 'red'});
- or
- root.path(null, path.move(100, 100).line([[300, 100], [200, 300]]).close(), {fill: 'red'}); */
-function SVGPath() {
- this._path = '';
-}
-
-$.extend(SVGPath.prototype, {
- /* Prepare to create a new path.
- @return (SVGPath) this path */
- reset: function() {
- this._path = '';
- return this;
- },
-
- /* Move the pointer to a position.
- @param x (number) x-coordinate to move to or
- (number[][]) x-/y-coordinates to move to
- @param y (number) y-coordinate to move to (omitted if x is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- move: function(x, y, relative) {
- relative = (isArray(x) ? y : relative);
- return this._coords((relative ? 'm' : 'M'), x, y);
- },
-
- /* Draw a line to a position.
- @param x (number) x-coordinate to move to or
- (number[][]) x-/y-coordinates to move to
- @param y (number) y-coordinate to move to (omitted if x is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- line: function(x, y, relative) {
- relative = (isArray(x) ? y : relative);
- return this._coords((relative ? 'l' : 'L'), x, y);
- },
-
- /* Draw a horizontal line to a position.
- @param x (number) x-coordinate to draw to or
- (number[]) x-coordinates to draw to
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- horiz: function(x, relative) {
- this._path += (relative ? 'h' : 'H') + (isArray(x) ? x.join(' ') : x);
- return this;
- },
-
- /* Draw a vertical line to a position.
- @param y (number) y-coordinate to draw to or
- (number[]) y-coordinates to draw to
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- vert: function(y, relative) {
- this._path += (relative ? 'v' : 'V') + (isArray(y) ? y.join(' ') : y);
- return this;
- },
-
- /* Draw a cubic Bézier curve.
- @param x1 (number) x-coordinate of beginning control point or
- (number[][]) x-/y-coordinates of control and end points to draw to
- @param y1 (number) y-coordinate of beginning control point (omitted if x1 is array)
- @param x2 (number) x-coordinate of ending control point (omitted if x1 is array)
- @param y2 (number) y-coordinate of ending control point (omitted if x1 is array)
- @param x (number) x-coordinate of curve end (omitted if x1 is array)
- @param y (number) y-coordinate of curve end (omitted if x1 is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- curveC: function(x1, y1, x2, y2, x, y, relative) {
- relative = (isArray(x1) ? y1 : relative);
- return this._coords((relative ? 'c' : 'C'), x1, y1, x2, y2, x, y);
- },
-
- /* Continue a cubic Bézier curve.
- Starting control point is the reflection of the previous end control point.
- @param x2 (number) x-coordinate of ending control point or
- (number[][]) x-/y-coordinates of control and end points to draw to
- @param y2 (number) y-coordinate of ending control point (omitted if x2 is array)
- @param x (number) x-coordinate of curve end (omitted if x2 is array)
- @param y (number) y-coordinate of curve end (omitted if x2 is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- smoothC: function(x2, y2, x, y, relative) {
- relative = (isArray(x2) ? y2 : relative);
- return this._coords((relative ? 's' : 'S'), x2, y2, x, y);
- },
-
- /* Draw a quadratic Bézier curve.
- @param x1 (number) x-coordinate of control point or
- (number[][]) x-/y-coordinates of control and end points to draw to
- @param y1 (number) y-coordinate of control point (omitted if x1 is array)
- @param x (number) x-coordinate of curve end (omitted if x1 is array)
- @param y (number) y-coordinate of curve end (omitted if x1 is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- curveQ: function(x1, y1, x, y, relative) {
- relative = (isArray(x1) ? y1 : relative);
- return this._coords((relative ? 'q' : 'Q'), x1, y1, x, y);
- },
-
- /* Continue a quadratic Bézier curve.
- Control point is the reflection of the previous control point.
- @param x (number) x-coordinate of curve end or
- (number[][]) x-/y-coordinates of points to draw to
- @param y (number) y-coordinate of curve end (omitted if x is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- smoothQ: function(x, y, relative) {
- relative = (isArray(x) ? y : relative);
- return this._coords((relative ? 't' : 'T'), x, y);
- },
-
- /* Generate a path command with (a list of) coordinates. */
- _coords: function(cmd, x1, y1, x2, y2, x3, y3) {
- if (isArray(x1)) {
- for (var i = 0; i < x1.length; i++) {
- var cs = x1[i];
- this._path += (i == 0 ? cmd : ' ') + cs[0] + ',' + cs[1] +
- (cs.length < 4 ? '' : ' ' + cs[2] + ',' + cs[3] +
- (cs.length < 6 ? '': ' ' + cs[4] + ',' + cs[5]));
- }
- }
- else {
- this._path += cmd + x1 + ',' + y1 +
- (x2 == null ? '' : ' ' + x2 + ',' + y2 +
- (x3 == null ? '' : ' ' + x3 + ',' + y3));
- }
- return this;
- },
-
- /* Draw an arc to a position.
- @param rx (number) x-radius of arc or
- (number/boolean[][]) x-/y-coordinates and flags for points to draw to
- @param ry (number) y-radius of arc (omitted if rx is array)
- @param xRotate (number) x-axis rotation (degrees, clockwise) (omitted if rx is array)
- @param large (boolean) true to draw the large part of the arc,
- false to draw the small part (omitted if rx is array)
- @param clockwise (boolean) true to draw the clockwise arc,
- false to draw the anti-clockwise arc (omitted if rx is array)
- @param x (number) x-coordinate of arc end (omitted if rx is array)
- @param y (number) y-coordinate of arc end (omitted if rx is array)
- @param relative (boolean) true for coordinates relative to the current point,
- false for coordinates being absolute
- @return (SVGPath) this path */
- arc: function(rx, ry, xRotate, large, clockwise, x, y, relative) {
- relative = (isArray(rx) ? ry : relative);
- this._path += (relative ? 'a' : 'A');
- if (isArray(rx)) {
- for (var i = 0; i < rx.length; i++) {
- var cs = rx[i];
- this._path += (i == 0 ? '' : ' ') + cs[0] + ',' + cs[1] + ' ' +
- cs[2] + ' ' + (cs[3] ? '1' : '0') + ',' +
- (cs[4] ? '1' : '0') + ' ' + cs[5] + ',' + cs[6];
- }
- }
- else {
- this._path += rx + ',' + ry + ' ' + xRotate + ' ' +
- (large ? '1' : '0') + ',' + (clockwise ? '1' : '0') + ' ' + x + ',' + y;
- }
- return this;
- },
-
- /* Close the current path.
- @return (SVGPath) this path */
- close: function() {
- this._path += 'z';
- return this;
- },
-
- /* Return the string rendering of the specified path.
- @return (string) stringified path */
- path: function() {
- return this._path;
- }
-});
-
-SVGPath.prototype.moveTo = SVGPath.prototype.move;
-SVGPath.prototype.lineTo = SVGPath.prototype.line;
-SVGPath.prototype.horizTo = SVGPath.prototype.horiz;
-SVGPath.prototype.vertTo = SVGPath.prototype.vert;
-SVGPath.prototype.curveCTo = SVGPath.prototype.curveC;
-SVGPath.prototype.smoothCTo = SVGPath.prototype.smoothC;
-SVGPath.prototype.curveQTo = SVGPath.prototype.curveQ;
-SVGPath.prototype.smoothQTo = SVGPath.prototype.smoothQ;
-SVGPath.prototype.arcTo = SVGPath.prototype.arc;
-
-/* Helper to generate an SVG text object.
- Obtain an instance from the SVGWrapper object.
- String calls together to generate the text and use its value:
- var text = root.createText();
- root.text(null, x, y, text.string('This is ').
- span('red', {fill: 'red'}).string('!'), {fill: 'blue'}); */
-function SVGText() {
- this._parts = []; // The components of the text object
-}
-
-$.extend(SVGText.prototype, {
- /* Prepare to create a new text object.
- @return (SVGText) this text */
- reset: function() {
- this._parts = [];
- return this;
- },
-
- /* Add a straight string value.
- @param value (string) the actual text
- @return (SVGText) this text object */
- string: function(value) {
- this._parts[this._parts.length] = ['text', value];
- return this;
- },
-
- /* Add a separate text span that has its own settings.
- @param value (string) the actual text
- @param settings (object) the settings for this text
- @return (SVGText) this text object */
- span: function(value, settings) {
- this._parts[this._parts.length] = ['tspan', value, settings];
- return this;
- },
-
- /* Add a reference to a previously defined text string.
- @param id (string) the ID of the actual text
- @param settings (object) the settings for this text
- @return (SVGText) this text object */
- ref: function(id, settings) {
- this._parts[this._parts.length] = ['tref', id, settings];
- return this;
- },
-
- /* Add text drawn along a path.
- @param id (string) the ID of the path
- @param value (string) the actual text
- @param settings (object) the settings for this text
- @return (SVGText) this text object */
- path: function(id, value, settings) {
- this._parts[this._parts.length] = ['textpath', value,
- $.extend({href: id}, settings || {})];
- return this;
- }
-});
-
-/* Attach the SVG functionality to a jQuery selection.
- @param command (string) the command to run (optional, default 'attach')
- @param options (object) the new settings to use for these SVG instances
- @return jQuery (object) for chaining further calls */
-$.fn.svg = function(options) {
- var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (typeof options == 'string' && options == 'get') {
- return $.svg['_' + options + 'SVG'].apply($.svg, [this[0]].concat(otherArgs));
- }
- return this.each(function() {
- if (typeof options == 'string') {
- $.svg['_' + options + 'SVG'].apply($.svg, [this].concat(otherArgs));
- }
- else {
- $.svg._attachSVG(this, options || {});
- }
- });
-};
-
-/* Determine whether an object is an array. */
-function isArray(a) {
- return (a && a.constructor == Array);
-}
-
-// Singleton primary SVG interface
-$.svg = new SVGManager();
-
-})(jQuery);
diff --git a/content/js/jquery.svg.min.js b/content/js/jquery.svg.min.js
deleted file mode 100755
index d6ad13c..0000000
--- a/content/js/jquery.svg.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-(function($){function SVGManager(){this._settings=[];this._extensions=[];this.regional=[];this.regional['']={errorLoadingText:'Error loading',notSupportedText:'This browser does not support SVG'};this.local=this.regional[''];this._uuid=new Date().getTime();this._renesis=detectActiveX('RenesisX.RenesisCtrl')}function detectActiveX(a){try{return!!(window.ActiveXObject&&new ActiveXObject(a))}catch(e){return false}}var p='svgwrapper';$.extend(SVGManager.prototype,{markerClassName:'hasSVG',svgNS:'http://www.w3.org/2000/svg',xlinkNS:'http://www.w3.org/1999/xlink',_wrapperClass:SVGWrapper,_attrNames:{class_:'class',in_:'in',alignmentBaseline:'alignment-baseline',baselineShift:'baseline-shift',clipPath:'clip-path',clipRule:'clip-rule',colorInterpolation:'color-interpolation',colorInterpolationFilters:'color-interpolation-filters',colorRendering:'color-rendering',dominantBaseline:'dominant-baseline',enableBackground:'enable-background',fillOpacity:'fill-opacity',fillRule:'fill-rule',floodColor:'flood-color',floodOpacity:'flood-opacity',fontFamily:'font-family',fontSize:'font-size',fontSizeAdjust:'font-size-adjust',fontStretch:'font-stretch',fontStyle:'font-style',fontVariant:'font-variant',fontWeight:'font-weight',glyphOrientationHorizontal:'glyph-orientation-horizontal',glyphOrientationVertical:'glyph-orientation-vertical',horizAdvX:'horiz-adv-x',horizOriginX:'horiz-origin-x',imageRendering:'image-rendering',letterSpacing:'letter-spacing',lightingColor:'lighting-color',markerEnd:'marker-end',markerMid:'marker-mid',markerStart:'marker-start',stopColor:'stop-color',stopOpacity:'stop-opacity',strikethroughPosition:'strikethrough-position',strikethroughThickness:'strikethrough-thickness',strokeDashArray:'stroke-dasharray',strokeDashOffset:'stroke-dashoffset',strokeLineCap:'stroke-linecap',strokeLineJoin:'stroke-linejoin',strokeMiterLimit:'stroke-miterlimit',strokeOpacity:'stroke-opacity',strokeWidth:'stroke-width',textAnchor:'text-anchor',textDecoration:'text-decoration',textRendering:'text-rendering',underlinePosition:'underline-position',underlineThickness:'underline-thickness',vertAdvY:'vert-adv-y',vertOriginY:'vert-origin-y',wordSpacing:'word-spacing',writingMode:'writing-mode'},_attachSVG:function(a,b){if($(a).hasClass(this.markerClassName)){return}if(typeof b=='string'){b={loadURL:b}}else if(typeof b=='function'){b={onLoad:b}}$(a).addClass(this.markerClassName);try{var c=document.createElementNS(this.svgNS,'svg');c.setAttribute('version','1.1');c.setAttribute('width',a.clientWidth);c.setAttribute('height',a.clientHeight);a.appendChild(c);this._afterLoad(a,c,b)}catch(e){if($.browser.msie){if(!a.id){a.id='svg'+(this._uuid++)}this._settings[a.id]=b;a.innerHTML='<embed type="image/svg+xml" width="100%" '+'height="100%" src="'+(b.initPath||'')+'blank.svg"/>'}else{a.innerHTML='<p class="svg_error">'+this.local.notSupportedText+'</p>'}}},_registerSVG:function(){for(var i=0;i<document.embeds.length;i++){var a=document.embeds[i].parentNode;if(!$(a).hasClass($.svg.markerClassName)||$.data(a,p)){continue}var b=null;try{b=document.embeds[i].getSVGDocument()}catch(e){setTimeout($.svg._registerSVG,250);return}b=(b?b.documentElement:null);if(b){$.svg._afterLoad(a,b)}}},_afterLoad:function(a,b,c){var c=c||this._settings[a.id];this._settings[a.id]=null;var d=new this._wrapperClass(b,a);$.data(a,p,d);try{if(c.loadURL){d.load(c.loadURL,c)}if(c.settings){d.configure(c.settings)}if(c.onLoad&&!c.loadURL){c.onLoad.apply(a,[d])}}catch(e){alert(e)}},_getSVG:function(a){a=(typeof a=='string'?$(a)[0]:(a.jquery?a[0]:a));return $.data(a,p)},_destroySVG:function(a){var b=$(a);if(!b.hasClass(this.markerClassName)){return}b.removeClass(this.markerClassName).empty();$.removeData(a,p)},addExtension:function(a,b){this._extensions.push([a,b])}});function SVGWrapper(a,b){this._svg=a;this._container=b;for(var i=0;i<$.svg._extensions.length;i++){var c=$.svg._extensions[i];this[c[0]]=new c[1](this)}}$.extend(SVGWrapper.prototype,{_width:function(){return this._container.clientWidth},_height:function(){return this._container.clientHeight},root:function(){return this._svg},configure:function(a,b){if(b){for(var i=this._svg.attributes.length-1;i>=0;i--){var c=this._svg.attributes.item(i);if(!(c.nodeName=='onload'||c.nodeName=='version'||c.nodeName.substring(0,5)=='xmlns')){this._svg.attributes.removeNamedItem(c.nodeName)}}}for(var d in a){this._svg.setAttribute(d,a[d])}return this},getElementById:function(a){return this._svg.ownerDocument.getElementById(a)},change:function(a,b){if(a){for(var c in b){if(b[c]==null){a.removeAttribute(c)}else{a.setAttribute(c,b[c])}}}return this},_args:function(b,c,d){c.splice(0,0,'parent');c.splice(c.length,0,'settings');var e={};var f=0;if(b[0]!=null&&(typeof b[0]!='object'||!b[0].nodeName)){e['parent']=null;f=1}for(var i=0;i<b.length;i++){e[c[i+f]]=b[i]}if(d){$.each(d,function(i,a){if(typeof e[a]=='object'){e.settings=e[a];e[a]=null}})}return e},title:function(a,b,c){var d=this._args(arguments,['text']);var e=this._makeNode(d.parent,'title',d.settings||{});e.appendChild(this._svg.ownerDocument.createTextNode(d.text));return e},describe:function(a,b,c){var d=this._args(arguments,['text']);var e=this._makeNode(d.parent,'desc',d.settings||{});e.appendChild(this._svg.ownerDocument.createTextNode(d.text));return e},defs:function(a,b,c){var d=this._args(arguments,['id'],['id']);return this._makeNode(d.parent,'defs',$.extend((d.id?{id:d.id}:{}),d.settings||{}))},symbol:function(a,b,c,d,e,f,g){var h=this._args(arguments,['id','x1','y1','x2','y2']);return this._makeNode(h.parent,'symbol',$.extend({id:h.id,viewBox:h.x1+' '+h.y1+' '+h.x2+' '+h.y2},h.settings||{}))},marker:function(a,b,c,d,e,f,g,h){var i=this._args(arguments,['id','refX','refY','mWidth','mHeight','orient'],['orient']);return this._makeNode(i.parent,'marker',$.extend({id:i.id,refX:i.refX,refY:i.refY,markerWidth:i.mWidth,markerHeight:i.mHeight,orient:i.orient||'auto'},i.settings||{}))},style:function(a,b,c){var d=this._args(arguments,['styles']);var e=this._makeNode(d.parent,'style',$.extend({type:'text/css'},d.settings||{}));e.appendChild(this._svg.ownerDocument.createTextNode(d.styles));if($.browser.opera){$('head').append('<style type="text/css">'+d.styles+'</style>')}return e},script:function(a,b,c,d){var e=this._args(arguments,['script','type'],['type']);var f=this._makeNode(e.parent,'script',$.extend({type:e.type||'text/javascript'},e.settings||{}));f.appendChild(this._svg.ownerDocument.createTextNode(this._escapeXML(e.script)));if(!$.browser.mozilla){$.globalEval(e.script)}return f},linearGradient:function(a,b,c,d,e,f,g,h){var i=this._args(arguments,['id','stops','x1','y1','x2','y2'],['x1']);var j=$.extend({id:i.id},(i.x1!=null?{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2}:{}));return this._gradient(i.parent,'linearGradient',$.extend(j,i.settings||{}),i.stops)},radialGradient:function(a,b,c,d,e,r,f,g,h){var i=this._args(arguments,['id','stops','cx','cy','r','fx','fy'],['cx']);var j=$.extend({id:i.id},(i.cx!=null?{cx:i.cx,cy:i.cy,r:i.r,fx:i.fx,fy:i.fy}:{}));return this._gradient(i.parent,'radialGradient',$.extend(j,i.settings||{}),i.stops)},_gradient:function(a,b,c,d){var e=this._makeNode(a,b,c);for(var i=0;i<d.length;i++){var f=d[i];this._makeNode(e,'stop',$.extend({offset:f[0],stopColor:f[1]},(f[2]!=null?{stopOpacity:f[2]}:{})))}return e},pattern:function(a,b,x,y,c,d,e,f,g,h,i){var j=this._args(arguments,['id','x','y','width','height','vx','vy','vwidth','vheight'],['vx']);var k=$.extend({id:j.id,x:j.x,y:j.y,width:j.width,height:j.height},(j.vx!=null?{viewBox:j.vx+' '+j.vy+' '+j.vwidth+' '+j.vheight}:{}));return this._makeNode(j.parent,'pattern',$.extend(k,j.settings||{}))},mask:function(a,b,x,y,c,d,e){var f=this._args(arguments,['id','x','y','width','height']);return this._makeNode(f.parent,'mask',$.extend({id:f.id,x:f.x,y:f.y,width:f.width,height:f.height},f.settings||{}))},createPath:function(){return new SVGPath()},createText:function(){return new SVGText()},svg:function(a,x,y,b,c,d,e,f,g,h){var i=this._args(arguments,['x','y','width','height','vx','vy','vwidth','vheight'],['vx']);var j=$.extend({x:i.x,y:i.y,width:i.width,height:i.height},(i.vx!=null?{viewBox:i.vx+' '+i.vy+' '+i.vwidth+' '+i.vheight}:{}));return this._makeNode(i.parent,'svg',$.extend(j,i.settings||{}))},group:function(a,b,c){var d=this._args(arguments,['id'],['id']);return this._makeNode(d.parent,'g',$.extend({id:d.id},d.settings||{}))},use:function(a,x,y,b,c,d,e){var f=this._args(arguments,['x','y','width','height','ref']);if(typeof f.x=='string'){f.ref=f.x;f.settings=f.y;f.x=f.y=f.width=f.height=null}var g=this._makeNode(f.parent,'use',$.extend({x:f.x,y:f.y,width:f.width,height:f.height},f.settings||{}));g.setAttributeNS($.svg.xlinkNS,'href',f.ref);return g},link:function(a,b,c){var d=this._args(arguments,['ref']);var e=this._makeNode(d.parent,'a',d.settings);e.setAttributeNS($.svg.xlinkNS,'href',d.ref);return e},image:function(a,x,y,b,c,d,e){var f=this._args(arguments,['x','y','width','height','ref']);var g=this._makeNode(f.parent,'image',$.extend({x:f.x,y:f.y,width:f.width,height:f.height},f.settings||{}));g.setAttributeNS($.svg.xlinkNS,'href',f.ref);return g},path:function(a,b,c){var d=this._args(arguments,['path']);return this._makeNode(d.parent,'path',$.extend({d:(d.path.path?d.path.path():d.path)},d.settings||{}))},rect:function(a,x,y,b,c,d,e,f){var g=this._args(arguments,['x','y','width','height','rx','ry'],['rx']);return this._makeNode(g.parent,'rect',$.extend({x:g.x,y:g.y,width:g.width,height:g.height},(g.rx?{rx:g.rx,ry:g.ry}:{}),g.settings||{}))},circle:function(a,b,c,r,d){var e=this._args(arguments,['cx','cy','r']);return this._makeNode(e.parent,'circle',$.extend({cx:e.cx,cy:e.cy,r:e.r},e.settings||{}))},ellipse:function(a,b,c,d,e,f){var g=this._args(arguments,['cx','cy','rx','ry']);return this._makeNode(g.parent,'ellipse',$.extend({cx:g.cx,cy:g.cy,rx:g.rx,ry:g.ry},g.settings||{}))},line:function(a,b,c,d,e,f){var g=this._args(arguments,['x1','y1','x2','y2']);return this._makeNode(g.parent,'line',$.extend({x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2},g.settings||{}))},polyline:function(a,b,c){var d=this._args(arguments,['points']);return this._poly(d.parent,'polyline',d.points,d.settings)},polygon:function(a,b,c){var d=this._args(arguments,['points']);return this._poly(d.parent,'polygon',d.points,d.settings)},_poly:function(a,b,c,d){var e='';for(var i=0;i<c.length;i++){e+=c[i].join()+' '}return this._makeNode(a,b,$.extend({points:$.trim(e)},d||{}))},text:function(a,x,y,b,c){var d=this._args(arguments,['x','y','value']);if(typeof d.x=='string'&&arguments.length<4){d.value=d.x;d.settings=d.y;d.x=d.y=null}return this._text(d.parent,'text',d.value,$.extend({x:(d.x&&isArray(d.x)?d.x.join(' '):d.x),y:(d.y&&isArray(d.y)?d.y.join(' '):d.y)},d.settings||{}))},textpath:function(a,b,c,d){var e=this._args(arguments,['path','value']);var f=this._text(e.parent,'textPath',e.value,e.settings||{});f.setAttributeNS($.svg.xlinkNS,'href',e.path);return f},_text:function(a,b,c,d){var e=this._makeNode(a,b,d);if(typeof c=='string'){e.appendChild(e.ownerDocument.createTextNode(c))}else{for(var i=0;i<c._parts.length;i++){var f=c._parts[i];if(f[0]=='tspan'){var g=this._makeNode(e,f[0],f[2]);g.appendChild(e.ownerDocument.createTextNode(f[1]));e.appendChild(g)}else if(f[0]=='tref'){var g=this._makeNode(e,f[0],f[2]);g.setAttributeNS($.svg.xlinkNS,'href',f[1]);e.appendChild(g)}else if(f[0]=='textpath'){var h=$.extend({},f[2]);h.href=null;var g=this._makeNode(e,f[0],h);g.setAttributeNS($.svg.xlinkNS,'href',f[2].href);g.appendChild(e.ownerDocument.createTextNode(f[1]));e.appendChild(g)}else{e.appendChild(e.ownerDocument.createTextNode(f[1]))}}}return e},other:function(a,b,c){var d=this._args(arguments,['name']);return this._makeNode(d.parent,d.name,d.settings||{})},_makeNode:function(a,b,c){a=a||this._svg;var d=this._svg.ownerDocument.createElementNS($.svg.svgNS,b);for(var b in c){var e=c[b];if(e!=null&&e!=null&&(typeof e!='string'||e!='')){d.setAttribute($.svg._attrNames[b]||b,e)}}a.appendChild(d);return d},add:function(b,c){var d=this._args(arguments,['node']);var f=this;d.parent=d.parent||this._svg;try{if($.svg._renesis){throw'Force traversal';}d.parent.appendChild(d.node.cloneNode(true))}catch(e){d.node=(d.node.jquery?d.node:$(d.node));d.node.each(function(){var a=f._cloneAsSVG(this);if(a){d.parent.appendChild(a)}})}return this},_cloneAsSVG:function(a){var b=null;if(a.nodeType==1){b=this._svg.ownerDocument.createElementNS($.svg.svgNS,this._checkName(a.nodeName));for(var i=0;i<a.attributes.length;i++){var c=a.attributes.item(i);if(c.nodeName!='xmlns'&&c.nodeValue){if(c.prefix=='xlink'){b.setAttributeNS($.svg.xlinkNS,c.localName,c.nodeValue)}else{b.setAttribute(this._checkName(c.nodeName),c.nodeValue)}}}for(var i=0;i<a.childNodes.length;i++){var d=this._cloneAsSVG(a.childNodes[i]);if(d){b.appendChild(d)}}}else if(a.nodeType==3){if($.trim(a.nodeValue)){b=this._svg.ownerDocument.createTextNode(a.nodeValue)}}else if(a.nodeType==4){if($.trim(a.nodeValue)){try{b=this._svg.ownerDocument.createCDATASection(a.nodeValue)}catch(e){b=this._svg.ownerDocument.createTextNode(a.nodeValue.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'))}}}return b},_checkName:function(a){a=(a.substring(0,1)>='A'&&a.substring(0,1)<='Z'?a.toLowerCase():a);return(a.substring(0,4)=='svg:'?a.substring(4):a)},load:function(h,j){j=(typeof j=='boolean'?{addTo:j}:(typeof j=='function'?{onLoad:j}:j||{}));if(!j.addTo){this.clear(false)}var k=[this._svg.getAttribute('width'),this._svg.getAttribute('height')];var l=this;var m=function(a){a=$.svg.local.errorLoadingText+': '+a;if(j.onLoad){j.onLoad.apply(l._container,[l,a])}else{l.text(null,10,20,a)}};var n=function(a){var b=new ActiveXObject('Microsoft.XMLDOM');b.validateOnParse=false;b.resolveExternals=false;b.async=false;b.loadXML(a);if(b.parseError.errorCode!=0){m(b.parseError.reason);return null}return b};var o=function(a){if(!a){return}if(a.documentElement.nodeName!='svg'){var b=a.getElementsByTagName('parsererror');var c=(b.length?b[0].getElementsByTagName('div'):[]);m(!b.length?'???':(c.length?c[0]:b[0]).firstChild.nodeValue);return}var d={};for(var i=0;i<a.documentElement.attributes.length;i++){var f=a.documentElement.attributes.item(i);if(!(f.nodeName=='version'||f.nodeName.substring(0,5)=='xmlns')){d[f.nodeName]=f.nodeValue}}l.configure(d,true);var g=a.documentElement.childNodes;for(var i=0;i<g.length;i++){try{if($.svg._renesis){throw'Force traversal';}l._svg.appendChild(g[i].cloneNode(true))}catch(e){l.add(null,g[i])}}if(!j.changeSize){l.configure({width:k[0],height:k[1]})}if(j.onLoad){j.onLoad.apply(l._container,[l])}};if(h.match('<svg')){o($.browser.msie?n(h):new DOMParser().parseFromString(h,'text/xml'))}else{$.ajax({url:h,dataType:($.browser.msie?'text':'xml'),success:function(a){o($.browser.msie?n(a):a)},error:function(a,b,c){m(b+(c?' '+c.message:''))}})}return this},remove:function(a){a.parentNode.removeChild(a);return this},clear:function(a){if(a){this.configure({},true)}while(this._svg.firstChild){this._svg.removeChild(this._svg.firstChild)}return this},toSVG:function(a){a=a||this._svg;return(typeof XMLSerializer=='undefined'?this._toSVG(a):new XMLSerializer().serializeToString(a))},_toSVG:function(a){var b='';if(!a){return b}if(a.nodeType==3){b=a.nodeValue}else if(a.nodeType==4){b='<![CDATA['+a.nodeValue+']]>'}else{b='<'+a.nodeName;if(a.attributes){for(var i=0;i<a.attributes.length;i++){var c=a.attributes.item(i);if(!($.trim(c.nodeValue)==''||c.nodeValue.match(/^\[object/)||c.nodeValue.match(/^function/))){b+=' '+(c.namespaceURI==$.svg.xlinkNS?'xlink:':'')+c.nodeName+'="'+c.nodeValue+'"'}}}if(a.firstChild){b+='>';var d=a.firstChild;while(d){b+=this._toSVG(d);d=d.nextSibling}b+='</'+a.nodeName+'>'}else{b+='/>'}}return b},_escapeXML:function(a){a=a.replace(/&/g,'&amp;');a=a.replace(/</g,'&lt;');a=a.replace(/>/g,'&gt;');return a}});function SVGPath(){this._path=''}$.extend(SVGPath.prototype,{reset:function(){this._path='';return this},move:function(x,y,a){a=(isArray(x)?y:a);return this._coords((a?'m':'M'),x,y)},line:function(x,y,a){a=(isArray(x)?y:a);return this._coords((a?'l':'L'),x,y)},horiz:function(x,a){this._path+=(a?'h':'H')+(isArray(x)?x.join(' '):x);return this},vert:function(y,a){this._path+=(a?'v':'V')+(isArray(y)?y.join(' '):y);return this},curveC:function(a,b,c,d,x,y,e){e=(isArray(a)?b:e);return this._coords((e?'c':'C'),a,b,c,d,x,y)},smoothC:function(a,b,x,y,c){c=(isArray(a)?b:c);return this._coords((c?'s':'S'),a,b,x,y)},curveQ:function(a,b,x,y,c){c=(isArray(a)?b:c);return this._coords((c?'q':'Q'),a,b,x,y)},smoothQ:function(x,y,a){a=(isArray(x)?y:a);return this._coords((a?'t':'T'),x,y)},_coords:function(a,b,c,d,e,f,g){if(isArray(b)){for(var i=0;i<b.length;i++){var h=b[i];this._path+=(i==0?a:' ')+h[0]+','+h[1]+(h.length<4?'':' '+h[2]+','+h[3]+(h.length<6?'':' '+h[4]+','+h[5]))}}else{this._path+=a+b+','+c+(d==null?'':' '+d+','+e+(f==null?'':' '+f+','+g))}return this},arc:function(a,b,c,d,e,x,y,f){f=(isArray(a)?b:f);this._path+=(f?'a':'A');if(isArray(a)){for(var i=0;i<a.length;i++){var g=a[i];this._path+=(i==0?'':' ')+g[0]+','+g[1]+' '+g[2]+' '+(g[3]?'1':'0')+','+(g[4]?'1':'0')+' '+g[5]+','+g[6]}}else{this._path+=a+','+b+' '+c+' '+(d?'1':'0')+','+(e?'1':'0')+' '+x+','+y}return this},close:function(){this._path+='z';return this},path:function(){return this._path}});SVGPath.prototype.moveTo=SVGPath.prototype.move;SVGPath.prototype.lineTo=SVGPath.prototype.line;SVGPath.prototype.horizTo=SVGPath.prototype.horiz;SVGPath.prototype.vertTo=SVGPath.prototype.vert;SVGPath.prototype.curveCTo=SVGPath.prototype.curveC;SVGPath.prototype.smoothCTo=SVGPath.prototype.smoothC;SVGPath.prototype.curveQTo=SVGPath.prototype.curveQ;SVGPath.prototype.smoothQTo=SVGPath.prototype.smoothQ;SVGPath.prototype.arcTo=SVGPath.prototype.arc;function SVGText(){this._parts=[]}$.extend(SVGText.prototype,{reset:function(){this._parts=[];return this},string:function(a){this._parts[this._parts.length]=['text',a];return this},span:function(a,b){this._parts[this._parts.length]=['tspan',a,b];return this},ref:function(a,b){this._parts[this._parts.length]=['tref',a,b];return this},path:function(a,b,c){this._parts[this._parts.length]=['textpath',b,$.extend({href:a},c||{})];return this}});$.fn.svg=function(a){var b=Array.prototype.slice.call(arguments,1);if(typeof a=='string'&&a=='get'){return $.svg['_'+a+'SVG'].apply($.svg,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){$.svg['_'+a+'SVG'].apply($.svg,[this].concat(b))}else{$.svg._attachSVG(this,a||{})}})};function isArray(a){return(a&&a.constructor==Array)}$.svg=new SVGManager()})(jQuery); \ No newline at end of file
diff --git a/content/js/jquery.svg.pack.js b/content/js/jquery.svg.pack.js
deleted file mode 100755
index 4727218..0000000
--- a/content/js/jquery.svg.pack.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){9 2f(){7.1U=[];7.1V=[];7.2g=[];7.2g[\'\']={2Q:\'4d 4e\',2R:\'4f 1s 4g 4h 4i 2h\'};7.2i=7.2g[\'\'];7.2S=1d 4j().4k();7.2j=2T(\'4l.4m\')}9 2T(a){1t{u!!(4n.2k&&1d 2k(a))}1u(e){u 1H}}8 p=\'4o\';$.G(2f.R,{1C:\'4p\',1W:\'2U://2V.2W.2X/4q/B\',1h:\'2U://2V.2W.2X/4r/2l\',2Y:2m,2Z:{4s:\'30\',4t:\'1X\',4u:\'4v-2n\',4w:\'2n-4x\',4y:\'31-19\',4z:\'31-32\',4A:\'1D-33\',4B:\'1D-33-4C\',4D:\'1D-2o\',4E:\'4F-2n\',4G:\'4H-4I\',4J:\'34-1Y\',4K:\'34-32\',4L:\'35-1D\',4M:\'35-1Y\',4N:\'1v-4O\',4P:\'1v-36\',4Q:\'1v-36-4R\',4S:\'1v-4T\',4U:\'1v-1I\',4V:\'1v-4W\',4X:\'1v-4Y\',4Z:\'37-38-50\',51:\'37-38-52\',53:\'1Z-39-x\',54:\'1Z-3a-x\',55:\'21-2o\',56:\'57-3b\',58:\'59-1D\',5a:\'1J-5b\',5c:\'1J-5d\',5e:\'1J-5f\',3c:\'2p-1D\',3d:\'2p-1Y\',5g:\'3e-3f\',5h:\'3e-3g\',5i:\'1w-5j\',5k:\'1w-5l\',5m:\'1w-5n\',5o:\'1w-5p\',5q:\'1w-5r\',5s:\'1w-1Y\',5t:\'1w-P\',5u:\'13-5v\',5w:\'13-5x\',5y:\'13-2o\',5z:\'3h-3f\',5A:\'3h-3g\',5B:\'22-39-y\',5C:\'22-3a-y\',5D:\'5E-3b\',5F:\'5G-5H\'},3i:9(a,b){w($(a).2q(7.1C)){u}w(16 b==\'1i\'){b={23:b}}Y w(16 b==\'9\'){b={1l:b}}$(a).5I(7.1C);1t{8 c=24.2r(7.1W,\'B\');c.1x(\'2s\',\'1.1\');c.1x(\'P\',a.3j);c.1x(\'U\',a.3k);a.11(c);7.2t(a,c,b)}1u(e){w($.1s.25){w(!a.D){a.D=\'B\'+(7.2S++)}7.1U[a.D]=b;a.3l=\'<5J 1y="21/B+2u" P="3m%" \'+\'U="3m%" 5K="\'+(b.5L||\'\')+\'5M.B"/>\'}Y{a.3l=\'<p 30="5N">\'+7.2i.2R+\'</p>\'}}},3n:9(){12(8 i=0;i<24.2v.N;i++){8 a=24.2v[i].3o;w(!$(a).2q($.B.1C)||$.2w(a,p)){5O}8 b=W;1t{b=24.2v[i].5P()}1u(e){5Q($.B.3n,5R);u}b=(b?b.1K:W);w(b){$.B.2t(a,b)}}},2t:9(a,b,c){8 c=c||7.1U[a.D];7.1U[a.D]=W;8 d=1d 7.2Y(b,a);$.2w(a,p,d);1t{w(c.23){d.3p(c.23,c)}w(c.E){d.1L(c.E)}w(c.1l&&!c.23){c.1l.1M(a,[d])}}1u(e){5S(e)}},5T:9(a){a=(16 a==\'1i\'?$(a)[0]:(a.3q?a[0]:a));u $.2w(a,p)},5U:9(a){8 b=$(a);w(!b.2q(7.1C)){u}b.5V(7.1C).5W();$.5X(a,p)},5Y:9(a,b){7.1V.5Z([a,b])}});9 2m(a,b){7.O=a;7.1N=b;12(8 i=0;i<$.B.1V.N;i++){8 c=$.B.1V[i];7[c[0]]=1d c[1](7)}}$.G(2m.R,{60:9(){u 7.1N.3j},61:9(){u 7.1N.3k},62:9(){u 7.O},1L:9(a,b){w(b){12(8 i=7.O.1e.N-1;i>=0;i--){8 c=7.O.1e.26(i);w(!(c.15==\'63\'||c.15==\'2s\'||c.15.1E(0,5)==\'2x\')){7.O.1e.64(c.15)}}}12(8 d 1X a){7.O.1x(d,a[d])}u 7},3r:9(a){u 7.O.17.3r(a)},65:9(a,b){w(a){12(8 c 1X b){w(b[c]==W){a.66(c)}Y{a.1x(c,b[c])}}}u 7},J:9(b,c,d){c.3s(0,0,\'F\');c.3s(c.N,0,\'E\');8 e={};8 f=0;w(b[0]!=W&&(16 b[0]!=\'2y\'||!b[0].15)){e[\'F\']=W;f=1}12(8 i=0;i<b.N;i++){e[c[i+f]]=b[i]}w(d){$.2z(d,9(i,a){w(16 e[a]==\'2y\'){e.E=e[a];e[a]=W}})}u e},3t:9(a,b,c){8 d=7.J(I,[\'13\']);8 e=7.K(d.F,\'3t\',d.E||{});e.11(7.O.17.1f(d.13));u e},67:9(a,b,c){8 d=7.J(I,[\'13\']);8 e=7.K(d.F,\'68\',d.E||{});e.11(7.O.17.1f(d.13));u e},3u:9(a,b,c){8 d=7.J(I,[\'D\'],[\'D\']);u 7.K(d.F,\'3u\',$.G((d.D?{D:d.D}:{}),d.E||{}))},3v:9(a,b,c,d,e,f,g){8 h=7.J(I,[\'D\',\'1g\',\'1m\',\'1n\',\'1o\']);u 7.K(h.F,\'3v\',$.G({D:h.D,2A:h.1g+\' \'+h.1m+\' \'+h.1n+\' \'+h.1o},h.E||{}))},1J:9(a,b,c,d,e,f,g,h){8 i=7.J(I,[\'D\',\'2B\',\'2C\',\'3w\',\'3x\',\'27\'],[\'27\']);u 7.K(i.F,\'1J\',$.G({D:i.D,2B:i.2B,2C:i.2C,69:i.3w,6a:i.3x,27:i.27||\'6b\'},i.E||{}))},1I:9(a,b,c){8 d=7.J(I,[\'2D\']);8 e=7.K(d.F,\'1I\',$.G({1y:\'13/3y\'},d.E||{}));e.11(7.O.17.1f(d.2D));w($.1s.6c){$(\'6d\').6e(\'<1I 1y="13/3y">\'+d.2D+\'</1I>\')}u e},1O:9(a,b,c,d){8 e=7.J(I,[\'1O\',\'1y\'],[\'1y\']);8 f=7.K(e.F,\'1O\',$.G({1y:e.1y||\'13/6f\'},e.E||{}));f.11(7.O.17.1f(7.3z(e.1O)));w(!$.1s.6g){$.6h(e.1O)}u f},3A:9(a,b,c,d,e,f,g,h){8 i=7.J(I,[\'D\',\'28\',\'1g\',\'1m\',\'1n\',\'1o\'],[\'1g\']);8 j=$.G({D:i.D},(i.1g!=W?{1g:i.1g,1m:i.1m,1n:i.1n,1o:i.1o}:{}));u 7.2E(i.F,\'3A\',$.G(j,i.E||{}),i.28)},3B:9(a,b,c,d,e,r,f,g,h){8 i=7.J(I,[\'D\',\'28\',\'1b\',\'1j\',\'r\',\'2F\',\'2G\'],[\'1b\']);8 j=$.G({D:i.D},(i.1b!=W?{1b:i.1b,1j:i.1j,r:i.r,2F:i.2F,2G:i.2G}:{}));u 7.2E(i.F,\'3B\',$.G(j,i.E||{}),i.28)},2E:9(a,b,c,d){8 e=7.K(a,b,c);12(8 i=0;i<d.N;i++){8 f=d[i];7.K(e,\'2p\',$.G({6i:f[0],3c:f[1]},(f[2]!=W?{3d:f[2]}:{})))}u e},3C:9(a,b,x,y,c,d,e,f,g,h,i){8 j=7.J(I,[\'D\',\'x\',\'y\',\'P\',\'U\',\'1p\',\'29\',\'2a\',\'2b\'],[\'1p\']);8 k=$.G({D:j.D,x:j.x,y:j.y,P:j.P,U:j.U},(j.1p!=W?{2A:j.1p+\' \'+j.29+\' \'+j.2a+\' \'+j.2b}:{}));u 7.K(j.F,\'3C\',$.G(k,j.E||{}))},3D:9(a,b,x,y,c,d,e){8 f=7.J(I,[\'D\',\'x\',\'y\',\'P\',\'U\']);u 7.K(f.F,\'3D\',$.G({D:f.D,x:f.x,y:f.y,P:f.P,U:f.U},f.E||{}))},6j:9(){u 1d X()},6k:9(){u 1d 2H()},B:9(a,x,y,b,c,d,e,f,g,h){8 i=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1p\',\'29\',\'2a\',\'2b\'],[\'1p\']);8 j=$.G({x:i.x,y:i.y,P:i.P,U:i.U},(i.1p!=W?{2A:i.1p+\' \'+i.29+\' \'+i.2a+\' \'+i.2b}:{}));u 7.K(i.F,\'B\',$.G(j,i.E||{}))},6l:9(a,b,c){8 d=7.J(I,[\'D\'],[\'D\']);u 7.K(d.F,\'g\',$.G({D:d.D},d.E||{}))},3E:9(a,x,y,b,c,d,e){8 f=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1q\']);w(16 f.x==\'1i\'){f.1q=f.x;f.E=f.y;f.x=f.y=f.P=f.U=W}8 g=7.K(f.F,\'3E\',$.G({x:f.x,y:f.y,P:f.P,U:f.U},f.E||{}));g.1z($.B.1h,\'1k\',f.1q);u g},6m:9(a,b,c){8 d=7.J(I,[\'1q\']);8 e=7.K(d.F,\'a\',d.E);e.1z($.B.1h,\'1k\',d.1q);u e},21:9(a,x,y,b,c,d,e){8 f=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1q\']);8 g=7.K(f.F,\'21\',$.G({x:f.x,y:f.y,P:f.P,U:f.U},f.E||{}));g.1z($.B.1h,\'1k\',f.1q);u g},19:9(a,b,c){8 d=7.J(I,[\'19\']);u 7.K(d.F,\'19\',$.G({d:(d.19.19?d.19.19():d.19)},d.E||{}))},3F:9(a,x,y,b,c,d,e,f){8 g=7.J(I,[\'x\',\'y\',\'P\',\'U\',\'1r\',\'1F\'],[\'1r\']);u 7.K(g.F,\'3F\',$.G({x:g.x,y:g.y,P:g.P,U:g.U},(g.1r?{1r:g.1r,1F:g.1F}:{}),g.E||{}))},3G:9(a,b,c,r,d){8 e=7.J(I,[\'1b\',\'1j\',\'r\']);u 7.K(e.F,\'3G\',$.G({1b:e.1b,1j:e.1j,r:e.r},e.E||{}))},3H:9(a,b,c,d,e,f){8 g=7.J(I,[\'1b\',\'1j\',\'1r\',\'1F\']);u 7.K(g.F,\'3H\',$.G({1b:g.1b,1j:g.1j,1r:g.1r,1F:g.1F},g.E||{}))},2c:9(a,b,c,d,e,f){8 g=7.J(I,[\'1g\',\'1m\',\'1n\',\'1o\']);u 7.K(g.F,\'2c\',$.G({1g:g.1g,1m:g.1m,1n:g.1n,1o:g.1o},g.E||{}))},3I:9(a,b,c){8 d=7.J(I,[\'1P\']);u 7.2I(d.F,\'3I\',d.1P,d.E)},3J:9(a,b,c){8 d=7.J(I,[\'1P\']);u 7.2I(d.F,\'3J\',d.1P,d.E)},2I:9(a,b,c,d){8 e=\'\';12(8 i=0;i<c.N;i++){e+=c[i].1Q()+\' \'}u 7.K(a,b,$.G({1P:$.2d(e)},d||{}))},13:9(a,x,y,b,c){8 d=7.J(I,[\'x\',\'y\',\'1R\']);w(16 d.x==\'1i\'&&I.N<4){d.1R=d.x;d.E=d.y;d.x=d.y=W}u 7.2J(d.F,\'13\',d.1R,$.G({x:(d.x&&18(d.x)?d.x.1Q(\' \'):d.x),y:(d.y&&18(d.y)?d.y.1Q(\' \'):d.y)},d.E||{}))},2K:9(a,b,c,d){8 e=7.J(I,[\'19\',\'1R\']);8 f=7.2J(e.F,\'6n\',e.1R,e.E||{});f.1z($.B.1h,\'1k\',e.19);u f},2J:9(a,b,c,d){8 e=7.K(a,b,d);w(16 c==\'1i\'){e.11(e.17.1f(c))}Y{12(8 i=0;i<c.1a.N;i++){8 f=c.1a[i];w(f[0]==\'3K\'){8 g=7.K(e,f[0],f[2]);g.11(e.17.1f(f[1]));e.11(g)}Y w(f[0]==\'3L\'){8 g=7.K(e,f[0],f[2]);g.1z($.B.1h,\'1k\',f[1]);e.11(g)}Y w(f[0]==\'2K\'){8 h=$.G({},f[2]);h.1k=W;8 g=7.K(e,f[0],h);g.1z($.B.1h,\'1k\',f[2].1k);g.11(e.17.1f(f[1]));e.11(g)}Y{e.11(e.17.1f(f[1]))}}}u e},6o:9(a,b,c){8 d=7.J(I,[\'3M\']);u 7.K(d.F,d.3M,d.E||{})},K:9(a,b,c){a=a||7.O;8 d=7.O.17.2r($.B.1W,b);12(8 b 1X c){8 e=c[b];w(e!=W&&e!=W&&(16 e!=\'1i\'||e!=\'\')){d.1x($.B.2Z[b]||b,e)}}a.11(d);u d},3N:9(b,c){8 d=7.J(I,[\'1A\']);8 f=7;d.F=d.F||7.O;1t{w($.B.2j){3O\'3P 3Q\';}d.F.11(d.1A.3R(2e))}1u(e){d.1A=(d.1A.3q?d.1A:$(d.1A));d.1A.2z(9(){8 a=f.2L(7);w(a){d.F.11(a)}})}u 7},2L:9(a){8 b=W;w(a.1S==1){b=7.O.17.2r($.B.1W,7.2M(a.15));12(8 i=0;i<a.1e.N;i++){8 c=a.1e.26(i);w(c.15!=\'2x\'&&c.14){w(c.6p==\'2l\'){b.1z($.B.1h,c.6q,c.14)}Y{b.1x(7.2M(c.15),c.14)}}}12(8 i=0;i<a.2N.N;i++){8 d=7.2L(a.2N[i]);w(d){b.11(d)}}}Y w(a.1S==3){w($.2d(a.14)){b=7.O.17.1f(a.14)}}Y w(a.1S==4){w($.2d(a.14)){1t{b=7.O.17.6r(a.14)}1u(e){b=7.O.17.1f(a.14.1G(/&/g,\'&3S;\').1G(/</g,\'&3T;\').1G(/>/g,\'&3U;\'))}}}u b},2M:9(a){a=(a.1E(0,1)>=\'A\'&&a.1E(0,1)<=\'Z\'?a.6s():a);u(a.1E(0,4)==\'B:\'?a.1E(4):a)},3p:9(h,j){j=(16 j==\'6t\'?{3V:j}:(16 j==\'9\'?{1l:j}:j||{}));w(!j.3V){7.3W(1H)}8 k=[7.O.3X(\'P\'),7.O.3X(\'U\')];8 l=7;8 m=9(a){a=$.B.2i.2Q+\': \'+a;w(j.1l){j.1l.1M(l.1N,[l,a])}Y{l.13(W,10,20,a)}};8 n=9(a){8 b=1d 2k(\'6u.6v\');b.6w=1H;b.6x=1H;b.6y=1H;b.6z(a);w(b.3Y.6A!=0){m(b.3Y.6B);u W}u b};8 o=9(a){w(!a){u}w(a.1K.15!=\'B\'){8 b=a.3Z(\'6C\');8 c=(b.N?b[0].3Z(\'6D\'):[]);m(!b.N?\'???\':(c.N?c[0]:b[0]).1T.14);u}8 d={};12(8 i=0;i<a.1K.1e.N;i++){8 f=a.1K.1e.26(i);w(!(f.15==\'2s\'||f.15.1E(0,5)==\'2x\')){d[f.15]=f.14}}l.1L(d,2e);8 g=a.1K.2N;12(8 i=0;i<g.N;i++){1t{w($.B.2j){3O\'3P 3Q\';}l.O.11(g[i].3R(2e))}1u(e){l.3N(W,g[i])}}w(!j.6E){l.1L({P:k[0],U:k[1]})}w(j.1l){j.1l.1M(l.1N,[l])}};w(h.2O(\'<B\')){o($.1s.25?n(h):1d 6F().6G(h,\'13/2u\'))}Y{$.6H({6I:h,6J:($.1s.25?\'13\':\'2u\'),6K:9(a){o($.1s.25?n(a):a)},6L:9(a,b,c){m(b+(c?\' \'+c.6M:\'\'))}})}u 7},6N:9(a){a.3o.40(a);u 7},3W:9(a){w(a){7.1L({},2e)}41(7.O.1T){7.O.40(7.O.1T)}u 7},6O:9(a){a=a||7.O;u(16 42==\'6P\'?7.2P(a):1d 42().6Q(a))},2P:9(a){8 b=\'\';w(!a){u b}w(a.1S==3){b=a.14}Y w(a.1S==4){b=\'<![6R[\'+a.14+\']]>\'}Y{b=\'<\'+a.15;w(a.1e){12(8 i=0;i<a.1e.N;i++){8 c=a.1e.26(i);w(!($.2d(c.14)==\'\'||c.14.2O(/^\\[2y/)||c.14.2O(/^9/))){b+=\' \'+(c.6S==$.B.1h?\'2l:\':\'\')+c.15+\'="\'+c.14+\'"\'}}}w(a.1T){b+=\'>\';8 d=a.1T;41(d){b+=7.2P(d);d=d.6T}b+=\'</\'+a.15+\'>\'}Y{b+=\'/>\'}}u b},3z:9(a){a=a.1G(/&/g,\'&3S;\');a=a.1G(/</g,\'&3T;\');a=a.1G(/>/g,\'&3U;\');u a}});9 X(){7.1c=\'\'}$.G(X.R,{43:9(){7.1c=\'\';u 7},44:9(x,y,a){a=(18(x)?y:a);u 7.1B((a?\'m\':\'M\'),x,y)},2c:9(x,y,a){a=(18(x)?y:a);u 7.1B((a?\'l\':\'L\'),x,y)},1Z:9(x,a){7.1c+=(a?\'h\':\'H\')+(18(x)?x.1Q(\' \'):x);u 7},22:9(y,a){7.1c+=(a?\'v\':\'V\')+(18(y)?y.1Q(\' \'):y);u 7},45:9(a,b,c,d,x,y,e){e=(18(a)?b:e);u 7.1B((e?\'c\':\'C\'),a,b,c,d,x,y)},46:9(a,b,x,y,c){c=(18(a)?b:c);u 7.1B((c?\'s\':\'S\'),a,b,x,y)},47:9(a,b,x,y,c){c=(18(a)?b:c);u 7.1B((c?\'q\':\'Q\'),a,b,x,y)},48:9(x,y,a){a=(18(x)?y:a);u 7.1B((a?\'t\':\'T\'),x,y)},1B:9(a,b,c,d,e,f,g){w(18(b)){12(8 i=0;i<b.N;i++){8 h=b[i];7.1c+=(i==0?a:\' \')+h[0]+\',\'+h[1]+(h.N<4?\'\':\' \'+h[2]+\',\'+h[3]+(h.N<6?\'\':\' \'+h[4]+\',\'+h[5]))}}Y{7.1c+=a+b+\',\'+c+(d==W?\'\':\' \'+d+\',\'+e+(f==W?\'\':\' \'+f+\',\'+g))}u 7},49:9(a,b,c,d,e,x,y,f){f=(18(a)?b:f);7.1c+=(f?\'a\':\'A\');w(18(a)){12(8 i=0;i<a.N;i++){8 g=a[i];7.1c+=(i==0?\'\':\' \')+g[0]+\',\'+g[1]+\' \'+g[2]+\' \'+(g[3]?\'1\':\'0\')+\',\'+(g[4]?\'1\':\'0\')+\' \'+g[5]+\',\'+g[6]}}Y{7.1c+=a+\',\'+b+\' \'+c+\' \'+(d?\'1\':\'0\')+\',\'+(e?\'1\':\'0\')+\' \'+x+\',\'+y}u 7},6U:9(){7.1c+=\'z\';u 7},19:9(){u 7.1c}});X.R.6V=X.R.44;X.R.6W=X.R.2c;X.R.6X=X.R.1Z;X.R.6Y=X.R.22;X.R.6Z=X.R.45;X.R.70=X.R.46;X.R.71=X.R.47;X.R.72=X.R.48;X.R.73=X.R.49;9 2H(){7.1a=[]}$.G(2H.R,{43:9(){7.1a=[];u 7},1i:9(a){7.1a[7.1a.N]=[\'13\',a];u 7},74:9(a,b){7.1a[7.1a.N]=[\'3K\',a,b];u 7},1q:9(a,b){7.1a[7.1a.N]=[\'3L\',a,b];u 7},19:9(a,b,c){7.1a[7.1a.N]=[\'2K\',b,$.G({1k:a},c||{})];u 7}});$.75.B=9(a){8 b=4a.R.76.77(I,1);w(16 a==\'1i\'&&a==\'78\'){u $.B[\'4b\'+a+\'2h\'].1M($.B,[7[0]].4c(b))}u 7.2z(9(){w(16 a==\'1i\'){$.B[\'4b\'+a+\'2h\'].1M($.B,[7].4c(b))}Y{$.B.3i(7,a||{})}})};9 18(a){u(a&&a.79==4a)}$.B=1d 2f()})(7a);',62,445,'|||||||this|var|function|||||||||||||||||||||return||if|||||svg||id|settings|parent|extend||arguments|_args|_makeNode|||length|_svg|width||prototype|||height||null|SVGPath|else|||appendChild|for|text|nodeValue|nodeName|typeof|ownerDocument|isArray|path|_parts|cx|_path|new|attributes|createTextNode|x1|xlinkNS|string|cy|href|onLoad|y1|x2|y2|vx|ref|rx|browser|try|catch|font|stroke|setAttribute|type|setAttributeNS|node|_coords|markerClassName|color|substring|ry|replace|false|style|marker|documentElement|configure|apply|_container|script|points|join|value|nodeType|firstChild|_settings|_extensions|svgNS|in|opacity|horiz||image|vert|loadURL|document|msie|item|orient|stops|vy|vwidth|vheight|line|trim|true|SVGManager|regional|SVG|local|_renesis|ActiveXObject|xlink|SVGWrapper|baseline|rendering|stop|hasClass|createElementNS|version|_afterLoad|xml|embeds|data|xmlns|object|each|viewBox|refX|refY|styles|_gradient|fx|fy|SVGText|_poly|_text|textpath|_cloneAsSVG|_checkName|childNodes|match|_toSVG|errorLoadingText|notSupportedText|_uuid|detectActiveX|http|www|w3|org|_wrapperClass|_attrNames|class|clip|rule|interpolation|fill|flood|size|glyph|orientation|adv|origin|spacing|stopColor|stopOpacity|strikethrough|position|thickness|underline|_attachSVG|clientWidth|clientHeight|innerHTML|100|_registerSVG|parentNode|load|jquery|getElementById|splice|title|defs|symbol|mWidth|mHeight|css|_escapeXML|linearGradient|radialGradient|pattern|mask|use|rect|circle|ellipse|polyline|polygon|tspan|tref|name|add|throw|Force|traversal|cloneNode|amp|lt|gt|addTo|clear|getAttribute|parseError|getElementsByTagName|removeChild|while|XMLSerializer|reset|move|curveC|smoothC|curveQ|smoothQ|arc|Array|_|concat|Error|loading|This|does|not|support|Date|getTime|RenesisX|RenesisCtrl|window|svgwrapper|hasSVG|2000|1999|class_|in_|alignmentBaseline|alignment|baselineShift|shift|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|filters|colorRendering|dominantBaseline|dominant|enableBackground|enable|background|fillOpacity|fillRule|floodColor|floodOpacity|fontFamily|family|fontSize|fontSizeAdjust|adjust|fontStretch|stretch|fontStyle|fontVariant|variant|fontWeight|weight|glyphOrientationHorizontal|horizontal|glyphOrientationVertical|vertical|horizAdvX|horizOriginX|imageRendering|letterSpacing|letter|lightingColor|lighting|markerEnd|end|markerMid|mid|markerStart|start|strikethroughPosition|strikethroughThickness|strokeDashArray|dasharray|strokeDashOffset|dashoffset|strokeLineCap|linecap|strokeLineJoin|linejoin|strokeMiterLimit|miterlimit|strokeOpacity|strokeWidth|textAnchor|anchor|textDecoration|decoration|textRendering|underlinePosition|underlineThickness|vertAdvY|vertOriginY|wordSpacing|word|writingMode|writing|mode|addClass|embed|src|initPath|blank|svg_error|continue|getSVGDocument|setTimeout|250|alert|_getSVG|_destroySVG|removeClass|empty|removeData|addExtension|push|_width|_height|root|onload|removeNamedItem|change|removeAttribute|describe|desc|markerWidth|markerHeight|auto|opera|head|append|javascript|mozilla|globalEval|offset|createPath|createText|group|link|textPath|other|prefix|localName|createCDATASection|toLowerCase|boolean|Microsoft|XMLDOM|validateOnParse|resolveExternals|async|loadXML|errorCode|reason|parsererror|div|changeSize|DOMParser|parseFromString|ajax|url|dataType|success|error|message|remove|toSVG|undefined|serializeToString|CDATA|namespaceURI|nextSibling|close|moveTo|lineTo|horizTo|vertTo|curveCTo|smoothCTo|curveQTo|smoothQTo|arcTo|span|fn|slice|call|get|constructor|jQuery'.split('|'),0,{})) \ No newline at end of file
diff --git a/content/js/jquery.svganim.min.js b/content/js/jquery.svganim.min.js
deleted file mode 100755
index 09c432b..0000000
--- a/content/js/jquery.svganim.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG attribute animations for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) June 2008.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-(function($){$.each(['x','y','width','height','rx','ry','cx','cy','r','x1','y1','x2','y2','stroke-width','strokeWidth','opacity','fill-opacity','fillOpacity','stroke-opacity','strokeOpacity','font-size','fontSize'],function(i,f){var g=f.charAt(0).toUpperCase()+f.substr(1);$.fx.step['svg'+g]=$.fx.step['svg-'+f]=function(a){var b=$.svg._attrNames[f]||f;var c=a.elem.attributes.getNamedItem(b);if(!a.set){a.start=(c?parseFloat(c.nodeValue):0);var d=a.options.curAnim['svg-'+f]||a.options.curAnim['svg'+g];if(/^[+-]=/.exec(d)){a.end=a.start+parseFloat(d.replace(/=/,''))}a.set=true}var e=(a.pos*(a.end-a.start)+a.start)+(a.unit=='%'?'%':'');(c?c.nodeValue=e:a.elem.setAttribute(b,e))}});$.fx.step['svgViewBox']=$.fx.step['svg-viewBox']=function(a){var b=a.elem.attributes.getNamedItem('viewBox');if(!a.set){a.start=parseViewBox(b?b.nodeValue:'');var c=a.options.curAnim['svg-viewBox']||a.options.curAnim['svgViewBox'];a.end=parseViewBox(c);if(/^[+-]=/.exec(c)){c=c.split(' ');while(c.length<4){c.push('0')}for(var i=0;i<4;i++){if(/^[+-]=/.exec(c[i])){a.end[i]=a.start[i]+parseFloat(c[i].replace(/=/,''))}}}a.set=true}var d=$.map(a.start,function(n,i){return(a.pos*(a.end[i]-n)+n)}).join(' ');(b?b.nodeValue=d:a.elem.setAttribute('viewBox',d))};function parseViewBox(a){var b=a.split(' ');for(var i=0;i<b.length;i++){b[i]=parseFloat(b[i]);if(isNaN(b[i])){b[i]=0}}while(b.length<4){b.push(0)}return b}$.fx.step['svgTransform']=$.fx.step['svg-transform']=function(a){var b=a.elem.attributes.getNamedItem('transform');if(!a.set){a.start=parseTransform(b?b.nodeValue:'');a.end=parseTransform(a.end,a.start);a.set=true}var c='';for(var i=0;i<a.end.order.length;i++){switch(a.end.order.charAt(i)){case't':c+=(a.start.translateX!=a.end.translateX||a.start.translateY!=a.end.translateY?' translate('+(a.pos*(a.end.translateX-a.start.translateX)+a.start.translateX)+','+(a.pos*(a.end.translateY-a.start.translateY)+a.start.translateY)+')':'');break;case's':c+=(a.start.scaleX!=a.end.scaleX||a.start.scaleY!=a.end.scaleY?' scale('+(a.pos*(a.end.scaleX-a.start.scaleX)+a.start.scaleX)+','+(a.pos*(a.end.scaleY-a.start.scaleY)+a.start.scaleY)+')':'');break;case'r':c+=(a.start.rotateA!=a.end.rotateA||a.start.rotateX!=a.end.rotateX||a.start.rotateY!=a.end.rotateY?' rotate('+(a.pos*(a.end.rotateA-a.start.rotateA)+a.start.rotateA)+','+(a.pos*(a.end.rotateX-a.start.rotateX)+a.start.rotateX)+','+(a.pos*(a.end.rotateY-a.start.rotateY)+a.start.rotateY)+')':'');break;case'x':c+=(a.start.skewX!=a.end.skewX?' skewX('+(a.pos*(a.end.skewX-a.start.skewX)+a.start.skewX)+')':'');case'y':c+=(a.start.skewY!=a.end.skewY?' skewY('+(a.pos*(a.end.skewY-a.start.skewY)+a.start.skewY)+')':'');break;case'm':var d='';for(var j=0;j<6;j++){d+=','+(a.pos*(a.end.matrix[j]-a.start.matrix[j])+a.start.matrix[j])}c+=' matrix('+d.substr(1)+')';break}}(b?b.nodeValue=c:a.elem.setAttribute('transform',c))};function parseTransform(a,b){a=a||'';if(typeof a=='object'){a=a.nodeValue}var c=$.extend({translateX:0,translateY:0,scaleX:0,scaleY:0,rotateA:0,rotateX:0,rotateY:0,skewX:0,skewY:0,matrix:[0,0,0,0,0,0]},b||{});c.order='';var d=/([a-zA-Z]+)\(\s*([+-]?[\d\.]+)\s*(?:[\s,]\s*([+-]?[\d\.]+)\s*(?:[\s,]\s*([+-]?[\d\.]+)\s*(?:[\s,]\s*([+-]?[\d\.]+)\s*[\s,]\s*([+-]?[\d\.]+)\s*[\s,]\s*([+-]?[\d\.]+)\s*)?)?)?\)/g;var e=d.exec(a);while(e){switch(e[1]){case'translate':c.order+='t';c.translateX=parseFloat(e[2]);c.translateY=(e[3]?parseFloat(e[3]):0);break;case'scale':c.order+='s';c.scaleX=parseFloat(e[2]);c.scaleY=(e[3]?parseFloat(e[3]):c.scaleX);break;case'rotate':c.order+='r';c.rotateA=parseFloat(e[2]);c.rotateX=(e[3]?parseFloat(e[3]):0);c.rotateY=(e[4]?parseFloat(e[4]):0);break;case'skewX':c.order+='x';c.skewX=parseFloat(e[2]);break;case'skewY':c.order+='y';c.skewY=parseFloat(e[2]);break;case'matrix':c.order+='m';c.matrix=[parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),parseFloat(e[7])];break}e=d.exec(a)}return c}$.each(['fill','stroke'],function(i,e){var f=e.charAt(0).toUpperCase()+e.substr(1);$.fx.step['svg'+f]=$.fx.step['svg-'+e]=function(a){if(!a.set){a.start=getColour(a.elem,e);var b=(a.end=='none');a.end=(b?getColour(a.elem.parentNode,e):getRGB(a.end));a.end[3]=b;a.set=true}var c=a.elem.attributes.getNamedItem(e);var d='rgb('+[Math.min(Math.max(parseInt((a.pos*(a.end[0]-a.start[0]))+a.start[0],10),0),255),Math.min(Math.max(parseInt((a.pos*(a.end[1]-a.start[1]))+a.start[1],10),0),255),Math.min(Math.max(parseInt((a.pos*(a.end[2]-a.start[2]))+a.start[2],10),0),255)].join(',')+')';d=(a.end[3]&&a.state==1?'none':d);(c?c.nodeValue=d:a.elem.setAttribute(e,d))}});function getColour(a,b){var c;do{c=(a.attributes&&a.attributes.getNamedItem(b)?a.attributes.getNamedItem(b).nodeValue:'');if((c!=''&&c!='none')||$(a).hasClass('hasSVG')){break}}while(a=a.parentNode);return getRGB(c)}function getRGB(a){var b;if(a&&a.constructor==Array&&(a.length==3||a.length==4)){return a}if(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a)){return[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10)]}if(b=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a)){return[parseFloat(b[1])*2.55,parseFloat(b[2])*2.55,parseFloat(b[3])*2.55]}if(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a)){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}if(b=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a)){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}return h[$.trim(a).toLowerCase()]||h['none']}var h={'':[255,255,255,1],none:[255,255,255,1],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})(jQuery); \ No newline at end of file
diff --git a/content/js/jquery.svgdom.js b/content/js/jquery.svgdom.js
deleted file mode 100755
index be0cf4a..0000000
--- a/content/js/jquery.svgdom.js
+++ /dev/null
@@ -1,355 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG/jQuery DOM compatibility for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-
-(function($) { // Hide scope, no $ conflict
-
-/* Support adding class names to SVG nodes. */
-var origAddClass = $.fn.addClass;
-
-$.fn.addClass = function(classNames) {
- classNames = classNames || '';
- return this.each(function() {
- if (isSVGElem(this)) {
- var node = this;
- $.each(classNames.split(/\s+/), function(i, className) {
- var classes = (node.className ? node.className.baseVal : node.getAttribute('class'));
- if ($.inArray(className, classes.split(/\s+/)) == -1) {
- classes += (classes ? ' ' : '') + className;
- (node.className ? node.className.baseVal = classes :
- node.setAttribute('class', classes));
- }
- });
- }
- else {
- origAddClass.apply($(this), [classNames]);
- }
- });
-};
-
-/* Support removing class names from SVG nodes. */
-var origRemoveClass = $.fn.removeClass;
-
-$.fn.removeClass = function(classNames) {
- classNames = classNames || '';
- return this.each(function() {
- if (isSVGElem(this)) {
- var node = this;
- $.each(classNames.split(/\s+/), function(i, className) {
- var classes = (node.className ? node.className.baseVal : node.getAttribute('class'));
- classes = $.grep(classes.split(/\s+/), function(n, i) { return n != className; }).
- join(' ');
- (node.className ? node.className.baseVal = classes :
- node.setAttribute('class', classes));
- });
- }
- else {
- origRemoveClass.apply($(this), [classNames]);
- }
- });
-};
-
-/* Support toggling class names on SVG nodes. */
-var origToggleClass = $.fn.toggleClass;
-
-$.fn.toggleClass = function(className, state) {
- return this.each(function() {
- if (isSVGElem(this)) {
- if (typeof state !== 'boolean') {
- state = !$(this).hasClass(className);
- }
- $(this)[(state ? 'add' : 'remove') + 'Class'](className);
- }
- else {
- origToggleClass.apply($(this), [className, state]);
- }
- });
-};
-
-/* Support checking class names on SVG nodes. */
-var origHasClass = $.fn.hasClass;
-
-$.fn.hasClass = function(className) {
- className = className || '';
- var found = false;
- this.each(function() {
- if (isSVGElem(this)) {
- var classes = (this.className ? this.className.baseVal :
- this.getAttribute('class')).split(/\s+/);
- found = ($.inArray(className, classes) > -1);
- }
- else {
- found = (origHasClass.apply($(this), [className]));
- }
- return !found;
- });
- return found;
-};
-
-/* Support attributes on SVG nodes. */
-var origAttr = $.fn.attr;
-
-//BWB: is this what i need to do for css?
-$.fn.attr = function(name, value, type) {
- if (typeof name === 'string' && value === undefined) {
- var val = origAttr.apply(this, [name, value, type]);
- return (val && val.baseVal ? val.baseVal.valueAsString : val);
- }
- var options = name;
- if (typeof name === 'string') {
- options = {};
- options[name] = value;
- }
- return this.each(function() {
- if (isSVGElem(this)) {
- for (var n in options) {
- this.setAttribute(n,
- (typeof options[n] == 'function' ? options[n]() : options[n]));
- }
- }
- else {
- origAttr.apply($(this), [name, value, type]);
- }
- });
-};
-
-// BWB attempting to patch css manipulation of SVG
-//support manipulation of css styles
-var origCss = $.fn.css;
-
-$.fn.css = function(name, value, type) {
- var revAttrName = function(name){
- for (var jsName in $.svg._attrNames){
- if ($.svg._attrNames[jsName] === name){
- return jsName;
- }
- }
- return name;
- };
-
- if (typeof name === 'string' && value === undefined) {
- var val = origCss.apply(this, [name, value, type]);
- return (val && val.baseVal ? val.baseVal.valueAsString : val);
- }
- var options = name;
- if (typeof name === 'string') {
- options = {};
- options[name] = value;
- }
- return this.each(function() {
- if (isSVGElem(this)) {
- for (var n in options) {
- //if Firefox
- if (this.style.MozBinding === "") {
- var jsName = revAttrName(n);
- this.style[jsName] = options[n];
- (typeof options[n] === 'function' ? options[n]() : options[n]);
- } else {
- this.style.setProperty(n,
- typeof options[n] == 'function' ? options[n]() : options[n]);
- }
- }
- }
- else {
- origCss.apply($(this), [name, value, type]);
- }
- });
-};
-
-
-/* Support removing attributes on SVG nodes. */
-var origRemoveAttr = $.fn.removeAttr;
-
-$.fn.removeAttr = function(name) {
- return this.each(function() {
- if (isSVGElem(this)) {
- (this[name] && this[name].baseVal ? this[name].baseVal.value = '' :
- this.setAttribute(name, ''));
- }
- else {
- origRemoveAttr.apply($(this), [name]);
- }
- });
-};
-
-/* Update Sizzle selectors. */
-var origRelativeNext = $.expr.relative['+'];
-var origRelativeChild = $.expr.relative['>'];
-var origRelativeDescendant = $.expr.relative[''];
-var origRelativeSiblings = $.expr.relative['~'];
-var origFindId = $.expr.find.ID;
-var origFindTag = $.expr.find.TAG;
-var origPreFilterClass = $.expr.preFilter.CLASS;
-var origFilterClass = $.expr.filter.CLASS;
-var origFilterAttr = $.expr.filter.ATTR;
-
-/* Determine if any nodes are SVG nodes. */
-function anySVG(checkSet) {
- for (var i = 0; i < checkSet.length; i++) {
- if (checkSet[i].nodeType == 1 && checkSet[i].namespaceURI == $.svg.svgNS) {
- return true;
- }
- }
- return false;
-}
-
-$.expr.relative['+'] = function(checkSet, part, isXML) {
- origRelativeNext(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.relative['>'] = function(checkSet, part, isXML) {
- origRelativeChild(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.relative[''] = function(checkSet, part, isXML) {
- origRelativeDescendant(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.relative['~'] = function(checkSet, part, isXML) {
- origRelativeSiblings(checkSet, part, isXML || anySVG(checkSet));
-};
-
-$.expr.find.ID = function(match, context, isXML) {
- return (isSVGElem(context) ?
- [context.ownerDocument.getElementById(match[1])] :
- origFindId(match, context, isXML));
-};
-
-var div = document.createElement('div');
-div.appendChild(document.createComment(''));
-if (div.getElementsByTagName('*').length > 0) { // Make sure no comments are found
- $.expr.find.TAG = function(match, context) {
- var results = context.getElementsByTagName(match[1]);
- if (match[1] === '*') { // Filter out possible comments
- var tmp = [];
- for (var i = 0; results[i] || results.item(i); i++) {
- if ((results[i] || results.item(i)).nodeType === 1) {
- tmp.push(results[i] || results.item(i));
- }
- }
- results = tmp;
- }
- return results;
- };
-}
-
-$.expr.preFilter.CLASS = function(match, curLoop, inplace, result, not, isXML) {
- match = ' ' + match[1].replace(/\\/g, '') + ' ';
- if (isXML) {
- return match;
- }
- for (var i = 0, elem = {}; elem != null; i++) {
- elem = curLoop[i];
- if (!elem) {
- try {
- elem = curLoop.item(i);
- }
- catch (e) {
- // Ignore
- }
- }
- if (elem) {
- var className = (!isSVGElem(elem) ? elem.className :
- (elem.className ? elem.className.baseVal : '') || elem.getAttribute('class'));
- if (not ^ (className && (' ' + className + ' ').indexOf(match) > -1)) {
- if (!inplace)
- result.push(elem);
- }
- else if (inplace) {
- curLoop[i] = false;
- }
- }
- }
- return false;
-};
-
-$.expr.filter.CLASS = function(elem, match) {
- var className = (!isSVGElem(elem) ? elem.className :
- (elem.className ? elem.className.baseVal : elem.getAttribute('class')));
- return (' ' + className + ' ').indexOf(match) > -1;
-};
-
-$.expr.filter.ATTR = function(elem, match) {
- var handler = null;
- if (isSVGElem(elem)) {
- handler = match[1];
- $.expr.attrHandle[handler] = function(elem){
- var attr = elem.getAttribute(handler);
- return attr && attr.baseVal || attr;
- };
- }
- var filter = origFilterAttr(elem, match);
- if (handler) {
- $.expr.attrHandle[handler] = null;
- }
- return filter;
-};
-
-/*
- Change Sizzle initialisation (line 1425) in jQuery v1.3.2 base code...
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
- } else if ( context.nodeType === 1 ) {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
- results.push( set[i] || set.item(i) ); // Here
- }
- }
- } else {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] || set.item(i) ); // Here
- }
- }
- }
- }
-
- Change fallback makeArray (line 2076) implementation in jQuery Sizzle...
-
- if ( typeof array.length === "number" ) {
- for ( var i = 0, l = array.length; i < l; i++ ) {
- ret.push( array[i] || array.item(i) ); // Here
- }
- }
-*/
-
-/*
- Events management requires changes to jQuery v1.3.2 base code...
-
- In $.event.add (line 2437)...
-
- if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
- // Bind the global event handler to the element
- try { // Here
- elem.addEventListener(type, handle, false);
- }
- catch(e) {
- if (elem.attachEvent)
- elem.attachEvent("on" + type, handle);
- }
- }
-
- In $.event.remove (line 2521)...
-
- if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
- try { // Here
- elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
- }
- catch (e) {
- if (elem.detachEvent)
- elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
- }
- }
-*/
-
-/* Does this node belong to SVG? */
-function isSVGElem(node) {
- return (node.nodeType == 1 && node.namespaceURI == $.svg.svgNS);
-}
-
-})(jQuery);
diff --git a/content/js/jquery.svgdom.min.js b/content/js/jquery.svgdom.min.js
deleted file mode 100755
index e3db0c8..0000000
--- a/content/js/jquery.svgdom.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG/jQuery DOM compatibility for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-(function($){var j=$.fn.addClass;$.fn.addClass=function(d){d=d||'';return this.each(function(){if(isSVGElem(this)){var c=this;$.each(d.split(/\s+/),function(i,a){var b=(c.className?c.className.baseVal:c.getAttribute('class'));if($.inArray(a,b.split(/\s+/))==-1){b+=(b?' ':'')+a;(c.className?c.className.baseVal=b:c.setAttribute('class',b))}})}else{j.apply($(this),[d])}})};var k=$.fn.removeClass;$.fn.removeClass=function(d){d=d||'';return this.each(function(){if(isSVGElem(this)){var c=this;$.each(d.split(/\s+/),function(i,a){var b=(c.className?c.className.baseVal:c.getAttribute('class'));b=$.grep(b.split(/\s+/),function(n,i){return n!=a}).join(' ');(c.className?c.className.baseVal=b:c.setAttribute('class',b))})}else{k.apply($(this),[d])}})};var l=$.fn.toggleClass;$.fn.toggleClass=function(a,b){return this.each(function(){if(isSVGElem(this)){if(typeof b!=='boolean'){b=!$(this).hasClass(a)}$(this)[(b?'add':'remove')+'Class'](a)}else{l.apply($(this),[a,b])}})};var m=$.fn.hasClass;$.fn.hasClass=function(b){b=b||'';var c=false;this.each(function(){if(isSVGElem(this)){var a=(this.className?this.className.baseVal:this.getAttribute('class')).split(/\s+/);c=($.inArray(b,a)>-1)}else{c=(m.apply($(this),[b]))}return!c});return c};var o=$.fn.attr;$.fn.attr=function(a,b,c){if(typeof a==='string'&&b===undefined){var d=o.apply(this,[a,b,c]);return(d&&d.baseVal?d.baseVal.valueAsString:d)}var e=a;if(typeof a==='string'){e={};e[a]=b}return this.each(function(){if(isSVGElem(this)){for(var n in e){this.setAttribute(n,(typeof e[n]=='function'?e[n]():e[n]))}}else{o.apply($(this),[a,b,c])}})};var p=$.fn.removeAttr;$.fn.removeAttr=function(a){return this.each(function(){if(isSVGElem(this)){(this[a]&&this[a].baseVal?this[a].baseVal.value='':this.setAttribute(a,''))}else{p.apply($(this),[a])}})};var q=$.expr.relative['+'];var r=$.expr.relative['>'];var s=$.expr.relative[''];var t=$.expr.relative['~'];var u=$.expr.find.ID;var v=$.expr.find.TAG;var w=$.expr.preFilter.CLASS;var x=$.expr.filter.CLASS;var y=$.expr.filter.ATTR;function anySVG(a){for(var i=0;i<a.length;i++){if(a[i].nodeType==1&&a[i].namespaceURI==$.svg.svgNS){return true}}return false}$.expr.relative['+']=function(a,b,c){q(a,b,c||anySVG(a))};$.expr.relative['>']=function(a,b,c){r(a,b,c||anySVG(a))};$.expr.relative['']=function(a,b,c){s(a,b,c||anySVG(a))};$.expr.relative['~']=function(a,b,c){t(a,b,c||anySVG(a))};$.expr.find.ID=function(a,b,c){return(isSVGElem(b)?[b.ownerDocument.getElementById(a[1])]:u(a,b,c))};var z=document.createElement('div');z.appendChild(document.createComment(''));if(z.getElementsByTagName('*').length>0){$.expr.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==='*'){var d=[];for(var i=0;c[i]||c.item(i);i++){if((c[i]||c.item(i)).nodeType===1){d.push(c[i]||c.item(i))}}c=d}return c}}$.expr.preFilter.CLASS=function(a,b,c,d,f,g){a=' '+a[1].replace(/\\/g,'')+' ';if(g){return a}for(var i=0,elem={};elem!=null;i++){elem=b[i];if(!elem){try{elem=b.item(i)}catch(e){}}if(elem){var h=(!isSVGElem(elem)?elem.className:(elem.className?elem.className.baseVal:'')||elem.getAttribute('class'));if(f^(h&&(' '+h+' ').indexOf(a)>-1)){if(!c)d.push(elem)}else if(c){b[i]=false}}}return false};$.expr.filter.CLASS=function(a,b){var c=(!isSVGElem(a)?a.className:(a.className?a.className.baseVal:a.getAttribute('class')));return(' '+c+' ').indexOf(b)>-1};$.expr.filter.ATTR=function(c,d){var e=null;if(isSVGElem(c)){e=d[1];$.expr.attrHandle[e]=function(a){var b=a.getAttribute(e);return b&&b.baseVal||b}}var f=y(c,d);if(e){$.expr.attrHandle[e]=null}return f};function isSVGElem(a){return(a.nodeType==1&&a.namespaceURI==$.svg.svgNS)}})(jQuery); \ No newline at end of file
diff --git a/content/js/jquery.svgdom.pack.js b/content/js/jquery.svgdom.pack.js
deleted file mode 100755
index be88a52..0000000
--- a/content/js/jquery.svgdom.pack.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* http://keith-wood.name/svg.html
- SVG/jQuery DOM compatibility for jQuery v1.4.2.
- Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
- Please attribute the author if you use it. */
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){2 j=$.9.W;$.9.W=4(d){d=d||\'\';7 3.D(4(){5(C(3)){2 c=3;$.D(d.J(/\\s+/),4(i,a){2 b=(c.8?c.8.A:c.I(\'F\'));5($.X(a,b.J(/\\s+/))==-1){b+=(b?\' \':\'\')+a;(c.8?c.8.A=b:c.L(\'F\',b))}})}G{j.H($(3),[d])}})};2 k=$.9.Y;$.9.Y=4(d){d=d||\'\';7 3.D(4(){5(C(3)){2 c=3;$.D(d.J(/\\s+/),4(i,a){2 b=(c.8?c.8.A:c.I(\'F\'));b=$.1g(b.J(/\\s+/),4(n,i){7 n!=a}).1h(\' \');(c.8?c.8.A=b:c.L(\'F\',b))})}G{k.H($(3),[d])}})};2 l=$.9.Z;$.9.Z=4(a,b){7 3.D(4(){5(C(3)){5(M b!==\'1i\'){b=!$(3).T(a)}$(3)[(b?\'1j\':\'1k\')+\'1l\'](a)}G{l.H($(3),[a,b])}})};2 m=$.9.T;$.9.T=4(b){b=b||\'\';2 c=N;3.D(4(){5(C(3)){2 a=(3.8?3.8.A:3.I(\'F\')).J(/\\s+/);c=($.X(b,a)>-1)}G{c=(m.H($(3),[b]))}7!c});7 c};2 o=$.9.10;$.9.10=4(a,b,c){5(M a===\'11\'&&b===1m){2 d=o.H(3,[a,b,c]);7(d&&d.A?d.A.1n:d)}2 e=a;5(M a===\'11\'){e={};e[a]=b}7 3.D(4(){5(C(3)){O(2 n 1o e){3.L(n,(M e[n]==\'4\'?e[n]():e[n]))}}G{o.H($(3),[a,b,c])}})};2 p=$.9.12;$.9.12=4(a){7 3.D(4(){5(C(3)){(3[a]&&3[a].A?3[a].A.1p=\'\':3.L(a,\'\'))}G{p.H($(3),[a])}})};2 q=$.6.E[\'+\'];2 r=$.6.E[\'>\'];2 s=$.6.E[\'\'];2 t=$.6.E[\'~\'];2 u=$.6.P.13;2 v=$.6.P.14;2 w=$.6.15.Q;2 x=$.6.R.Q;2 y=$.6.R.16;4 K(a){O(2 i=0;i<a.17;i++){5(a[i].U==1&&a[i].18==$.19.1a){7 1q}}7 N}$.6.E[\'+\']=4(a,b,c){q(a,b,c||K(a))};$.6.E[\'>\']=4(a,b,c){r(a,b,c||K(a))};$.6.E[\'\']=4(a,b,c){s(a,b,c||K(a))};$.6.E[\'~\']=4(a,b,c){t(a,b,c||K(a))};$.6.P.13=4(a,b,c){7(C(b)?[b.1r.1s(a[1])]:u(a,b,c))};2 z=1b.1t(\'1u\');z.1v(1b.1w(\'\'));5(z.1c(\'*\').17>0){$.6.P.14=4(a,b){2 c=b.1c(a[1]);5(a[1]===\'*\'){2 d=[];O(2 i=0;c[i]||c.S(i);i++){5((c[i]||c.S(i)).U===1){d.1d(c[i]||c.S(i))}}c=d}7 c}}$.6.15.Q=4(a,b,c,d,f,g){a=\' \'+a[1].1x(/\\\\/g,\'\')+\' \';5(g){7 a}O(2 i=0,B={};B!=V;i++){B=b[i];5(!B){1y{B=b.S(i)}1z(e){}}5(B){2 h=(!C(B)?B.8:(B.8?B.8.A:\'\')||B.I(\'F\'));5(f^(h&&(\' \'+h+\' \').1e(a)>-1)){5(!c)d.1d(B)}G 5(c){b[i]=N}}}7 N};$.6.R.Q=4(a,b){2 c=(!C(a)?a.8:(a.8?a.8.A:a.I(\'F\')));7(\' \'+c+\' \').1e(b)>-1};$.6.R.16=4(c,d){2 e=V;5(C(c)){e=d[1];$.6.1f[e]=4(a){2 b=a.I(e);7 b&&b.A||b}}2 f=y(c,d);5(e){$.6.1f[e]=V}7 f};4 C(a){7(a.U==1&&a.18==$.19.1a)}})(1A);',62,99,'||var|this|function|if|expr|return|className|fn|||||||||||||||||||||||||||baseVal|elem|isSVGElem|each|relative|class|else|apply|getAttribute|split|anySVG|setAttribute|typeof|false|for|find|CLASS|filter|item|hasClass|nodeType|null|addClass|inArray|removeClass|toggleClass|attr|string|removeAttr|ID|TAG|preFilter|ATTR|length|namespaceURI|svg|svgNS|document|getElementsByTagName|push|indexOf|attrHandle|grep|join|boolean|add|remove|Class|undefined|valueAsString|in|value|true|ownerDocument|getElementById|createElement|div|appendChild|createComment|replace|try|catch|jQuery'.split('|'),0,{})) \ No newline at end of file
diff --git a/content/js/jquery.ui.all.js b/content/js/jquery.ui.all.js
deleted file mode 100755
index 7ef2f75..0000000
--- a/content/js/jquery.ui.all.js
+++ /dev/null
@@ -1,7531 +0,0 @@
-/*
- * jQuery UI 1.5.1
- *
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;(function($) {
-
-$.ui = {
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
- cssCache: {},
- css: function(name) {
- if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
- var tmp = $('<div class="ui-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
-
- //if (!$.browser.safari)
- //tmp.appendTo('body');
-
- //Opera and Safari set width and height to 0px instead of auto
- //Safari returns rgba(0,0,0,0) when bgcolor is not set
- $.ui.cssCache[name] = !!(
- (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
- !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
- );
- try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){}
- return $.ui.cssCache[name];
- },
- disableSelection: function(e) {
- e.unselectable = "on";
- e.onselectstart = function() { return false; };
- if (e.style) { e.style.MozUserSelect = "none"; }
- },
- enableSelection: function(e) {
- e.unselectable = "off";
- e.onselectstart = function() { return true; };
- if (e.style) { e.style.MozUserSelect = ""; }
- },
- hasScroll: function(e, a) {
- var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
- if (e[scroll] > 0) return true; e[scroll] = 1;
- has = e[scroll] > 0 ? true : false; e[scroll] = 0;
- return has;
- }
-};
-
-
-/** jQuery core modifications and additions **/
-
-var _remove = $.fn.remove;
-$.fn.remove = function() {
- $("*", this).add(this).trigger("remove");
- return _remove.apply(this, arguments );
-};
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-// created by Scott González and Jörn Zaefferer
-function getter(namespace, plugin, method) {
- var methods = $[namespace][plugin].getter || [];
- methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- if (isMethodCall && getter(namespace, name, options)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- return this.each(function() {
- var instance = $.data(this, name);
- if (isMethodCall && instance && $.isFunction(instance[options])) {
- instance[options].apply(instance, args);
- } else if (!isMethodCall) {
- $.data(this, name, new $[namespace][name](this, options));
- }
- });
- };
-
- // create widget constructor
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.widgetName = name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
- this.element = $(element)
- .bind('setData.' + name, function(e, key, value) {
- return self.setData(key, value);
- })
- .bind('getData.' + name, function(e, key) {
- return self.getData(key);
- })
- .bind('remove', function() {
- return self.destroy();
- });
- this.init();
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-};
-
-$.widget.prototype = {
- init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName);
- },
-
- getData: function(key) {
- return this.options[key];
- },
- setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element[value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled');
- }
- },
-
- enable: function() {
- this.setData('disabled', false);
- },
- disable: function() {
- this.setData('disabled', true);
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- mouseInit: function() {
- var self = this;
-
- this.element.bind('mousedown.'+this.widgetName, function(e) {
- return self.mouseDown(e);
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- mouseDown: function(e) {
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this.mouseUp(e));
-
- this._mouseDownEvent = e;
-
- var self = this,
- btnIsLeft = (e.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
- if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
- return true;
- }
-
- this._mouseDelayMet = !this.options.delay;
- if (!this._mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self._mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
- this._mouseStarted = (this.mouseStart(e) !== false);
- if (!this._mouseStarted) {
- e.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(e) {
- return self.mouseMove(e);
- };
- this._mouseUpDelegate = function(e) {
- return self.mouseUp(e);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- return false;
- },
-
- mouseMove: function(e) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !e.button) {
- return this.mouseUp(e);
- }
-
- if (this._mouseStarted) {
- this.mouseDrag(e);
- return false;
- }
-
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
- this._mouseStarted =
- (this.mouseStart(this._mouseDownEvent, e) !== false);
- (this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e));
- }
-
- return !this._mouseStarted;
- },
-
- mouseUp: function(e) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this.mouseStop(e);
- }
-
- return false;
- },
-
- mouseDistanceMet: function(e) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - e.pageX),
- Math.abs(this._mouseDownEvent.pageY - e.pageY)
- ) >= this.options.distance
- );
- },
-
- mouseDelayMet: function(e) {
- return this._mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- mouseStart: function(e) {},
- mouseDrag: function(e) {},
- mouseStop: function(e) {},
- mouseCapture: function(e) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
-/*
- * jQuery UI Draggable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.draggable", $.extend($.ui.mouse, {
- init: function() {
-
- //Initialize needed constants
- var o = this.options;
-
- //Position the node
- if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
- this.element.css('position', 'relative');
-
- this.element.addClass('ui-draggable');
- (o.disabled && this.element.addClass('ui-draggable-disabled'));
-
- this.mouseInit();
-
- },
- mouseStart: function(e) {
- var o = this.options;
-
- if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false;
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
-
-
- $(this.options.handle, this.element).find("*").andSelf().each(function() {
- if(this == e.target) handle = true;
- });
- if (!handle) return false;
-
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
-
- //Create and append the visible helper
- this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element);
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
- if(this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) this.helper.css("position", "absolute");
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- this.margins = { //Cache the margins
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
-
- this.cssPosition = this.helper.css("position"); //Store the helper's css position
- this.offset = this.element.offset(); //The element's absolute position on the page
- this.offset = { //Substract the margins from the element's absolute offset
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- this.offset.click = { //Where the click happened, relative to the element
- left: e.pageX - this.offset.left,
- top: e.pageY - this.offset.top
- };
-
- this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position
- if(this.offsetParent[0] == document.body && $.browser.mozilla) po = { top: 0, left: 0 }; //Ugly FF3 fix
- this.offset.parent = { //Store its position plus border
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- var p = this.element.position(); //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helpers
- this.offset.relative = this.cssPosition == "relative" ? {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.offsetParent[0].scrollTop,
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.offsetParent[0].scrollLeft
- } : { top: 0, left: 0 };
-
- this.originalPosition = this.generatePosition(e); //Generate the original position
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
-
- if(o.cursorAt) {
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left + this.margins.left;
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right + this.margins.left;
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top + this.margins.top;
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom + this.margins.top;
- }
-
-
- /*
- * - Position constraining -
- * Here we prepare position constraining like grid and containment.
- */
-
- if(o.containment) {
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top,
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
- }
- }
-
- //Call plugins and callbacks
- this.propagate("start", e);
-
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
-
- this.helper.addClass("ui-draggable-dragging");
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
- convertPositionTo: function(d, pos) {
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- return {
- top: (
- pos.top // the calculated relative position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed
- + (this.cssPosition == "fixed" ? $(document).scrollTop() : 0) * mod
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
- ),
- left: (
- pos.left // the calculated relative position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed
- + (this.cssPosition == "fixed" ? $(document).scrollLeft() : 0) * mod
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
- )
- };
- },
- generatePosition: function(e) {
-
- var o = this.options;
- var position = {
- top: (
- e.pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
- - (this.cssPosition == "fixed" ? $(document).scrollTop() : 0)
- ),
- left: (
- e.pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
- - (this.cssPosition == "fixed" ? $(document).scrollLeft() : 0)
- )
- };
-
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- if(this.containment) {
- if(position.left < this.containment[0]) position.left = this.containment[0];
- if(position.top < this.containment[1]) position.top = this.containment[1];
- if(position.left > this.containment[2]) position.left = this.containment[2];
- if(position.top > this.containment[3]) position.top = this.containment[3];
- }
-
- if(o.grid) {
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- return position;
- },
- mouseDrag: function(e) {
-
- //Compute the helpers position
- this.position = this.generatePosition(e);
- this.positionAbs = this.convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- this.position = this.propagate("drag", e) || this.position;
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
-
- return false;
- },
- mouseStop: function(e) {
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, e);
-
- if(this.options.revert) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() {
- self.propagate("stop", e);
- self.clear();
- });
- } else {
- this.propagate("stop", e);
- this.clear();
- }
-
- return false;
- },
- clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
- plugins: {},
- uiHash: function(e) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs,
- options: this.options
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.uiHash()]);
- return this.element.triggerHandler(n == "drag" ? n : "drag"+n, [e, this.uiHash()], this.options[n]);
- },
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable');
- this.mouseDestroy();
- }
-}));
-
-$.extend($.ui.draggable, {
- defaults: {
- appendTo: "parent",
- axis: false,
- cancel: ":input",
- delay: 0,
- distance: 1,
- helper: "original"
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(e, ui) {
- var t = $('body');
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
- t.css("cursor", ui.options.cursor);
- },
- stop: function(e, ui) {
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(e, ui) {
- var t = $(ui.helper);
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
- t.css('zIndex', ui.options.zIndex);
- },
- stop: function(e, ui) {
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(e, ui) {
- var t = $(ui.helper);
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
- t.css('opacity', ui.options.opacity);
- },
- stop: function(e, ui) {
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(e, ui) {
- $(ui.options.iframeFix === true ? "iframe" : ui.options.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(e, ui) {
- $("div.DragDropIframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(e, ui) {
- var o = ui.options;
- var i = $(this).data("draggable");
- o.scrollSensitivity = o.scrollSensitivity || 20;
- o.scrollSpeed = o.scrollSpeed || 20;
-
- i.overflowY = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(this);
- i.overflowX = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(this);
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
-
- },
- drag: function(e, ui) {
-
- var o = ui.options;
- var i = $(this).data("draggable");
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
-
- } else {
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
- } else {
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(e, ui) {
-
- var inst = $(this).data("draggable");
- inst.snapElements = [];
- $(ui.options.snap === true ? '.ui-draggable' : ui.options.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != inst.element[0]) inst.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(e, ui) {
-
- var inst = $(this).data("draggable");
- var d = ui.options.snapTolerance || 20;
- var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) continue;
-
- if(ui.options.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= 20;
- var bs = Math.abs(b - y1) <= 20;
- var ls = Math.abs(l - x2) <= 20;
- var rs = Math.abs(r - x1) <= 20;
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b, left: 0 }).top;
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r }).left;
- }
-
- if(ui.options.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= 20;
- var bs = Math.abs(b - y2) <= 20;
- var ls = Math.abs(l - x1) <= 20;
- var rs = Math.abs(r - x2) <= 20;
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t, left: 0 }).top;
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l }).left;
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
- }
-
- };
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(e,ui) {
-
- var inst = $(this).data("draggable");
- inst.sortables = [];
- $(ui.options.connectToSortable).each(function() {
- if($.data(this, 'sortable')) {
- var sortable = $.data(this, 'sortable');
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable.refreshItems(); //Do a one-time refresh at start to refresh the containerCache
- sortable.propagate("activate", e, inst);
- }
- });
-
- },
- stop: function(e,ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable");
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
- this.instance.isOver = 0;
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
- if(this.shouldRevert) this.instance.options.revert = true; //revert here
- this.instance.mouseStop(e);
-
- //Also propagate receive event, since the sortable is actually receiving a element
- this.instance.element.triggerHandler("sortreceive", [e, $.extend(this.instance.ui(), { sender: inst.element })], this.instance.options["receive"]);
-
- this.instance.options.helper = this.instance.options._helper;
- } else {
- this.instance.propagate("deactivate", e, inst);
- }
-
- });
-
- },
- drag: function(e,ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
-
- var l = o.left, r = l + o.width,
- t = o.top, b = t + o.height;
-
- return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r
- && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b);
- };
-
- $.each(inst.sortables, function(i) {
-
- if(checkPos.call(inst, this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
- this.instance.isOver = 1;
-
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- e.target = this.instance.currentItem[0];
- this.instance.mouseCapture(e, true);
- this.instance.mouseStart(e, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst.propagate("toSortable", e);
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance.mouseDrag(e);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
- this.instance.options.revert = false; //No revert here
- this.instance.mouseStop(e, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst.propagate("fromSortable", e);
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(e,ui) {
- var group = $.makeArray($(ui.options.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || ui.options.stack.min) - (parseInt($(b).css("zIndex"),10) || ui.options.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = ui.options.stack.min + i;
- });
-
- this[0].style.zIndex = ui.options.stack.min + group.length;
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Droppable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- */
-(function($) {
-
-$.widget("ui.droppable", {
- init: function() {
-
- this.element.addClass("ui-droppable");
- this.isover = 0; this.isout = 1;
-
- //Prepare the passed options
- var o = this.options, accept = o.accept;
- o = $.extend(o, {
- accept: o.accept && o.accept.constructor == Function ? o.accept : function(d) {
- return $(d).is(accept);
- }
- });
-
- //Store the droppable's proportions
- this.proportions = { width: this.element.outerWidth(), height: this.element.outerHeight() };
-
- // Add the reference and positions to the manager
- $.ui.ddmanager.droppables.push(this);
-
- },
- plugins: {},
- ui: function(c) {
- return {
- draggable: (c.currentItem || c.element),
- helper: c.helper,
- position: c.position,
- absolutePosition: c.positionAbs,
- options: this.options,
- element: this.element
- };
- },
- destroy: function() {
- var drop = $.ui.ddmanager.droppables;
- for ( var i = 0; i < drop.length; i++ )
- if ( drop[i] == this )
- drop.splice(i, 1);
-
- this.element
- .removeClass("ui-droppable ui-droppable-disabled")
- .removeData("droppable")
- .unbind(".droppable");
- },
- over: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'over', [e, this.ui(draggable)]);
- this.element.triggerHandler("dropover", [e, this.ui(draggable)], this.options.over);
- }
-
- },
- out: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'out', [e, this.ui(draggable)]);
- this.element.triggerHandler("dropout", [e, this.ui(draggable)], this.options.out);
- }
-
- },
- drop: function(e,custom) {
-
- var draggable = custom || $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
-
- var childrenIntersection = false;
- this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function() {
- var inst = $.data(this, 'droppable');
- if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
- childrenIntersection = true; return false;
- }
- });
- if(childrenIntersection) return false;
-
- if(this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]);
- this.element.triggerHandler("drop", [e, this.ui(draggable)], this.options.drop);
- return true;
- }
-
- return false;
-
- },
- activate: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- $.ui.plugin.call(this, 'activate', [e, this.ui(draggable)]);
- if(draggable) this.element.triggerHandler("dropactivate", [e, this.ui(draggable)], this.options.activate);
-
- },
- deactivate: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- $.ui.plugin.call(this, 'deactivate', [e, this.ui(draggable)]);
- if(draggable) this.element.triggerHandler("dropdeactivate", [e, this.ui(draggable)], this.options.deactivate);
-
- }
-});
-
-$.extend($.ui.droppable, {
- defaults: {
- disabled: false,
- tolerance: 'intersect'
- }
-});
-
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
-
- if (!droppable.offset) return false;
-
- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
- var l = droppable.offset.left, r = l + droppable.proportions.width,
- t = droppable.offset.top, b = t + droppable.proportions.height;
-
- switch (toleranceMode) {
- case 'fit':
- return (l < x1 && x2 < r
- && t < y1 && y2 < b);
- break;
- case 'intersect':
- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
- && x2 - (draggable.helperProportions.width / 2) < r // Left Half
- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
- break;
- case 'pointer':
- return (l < ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) && ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) < r
- && t < ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) && ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) < b);
- break;
- case 'touch':
- return (
- (y1 >= t && y1 <= b) || // Top edge touching
- (y2 >= t && y2 <= b) || // Bottom edge touching
- (y1 < t && y2 > b) // Surrounded vertically
- ) && (
- (x1 >= l && x1 <= r) || // Left edge touching
- (x2 >= l && x2 <= r) || // Right edge touching
- (x1 < l && x2 > r) // Surrounded horizontally
- );
- break;
- default:
- return false;
- break;
- }
-
-};
-
-/*
- This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
- current: null,
- droppables: [],
- prepareOffsets: function(t, e) {
-
- var m = $.ui.ddmanager.droppables;
- var type = e ? e.type : null; // workaround for #2317
- for (var i = 0; i < m.length; i++) {
-
- if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element,(t.currentItem || t.element)))) continue;
- m[i].visible = m[i].element.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue
- m[i].offset = m[i].element.offset();
- m[i].proportions = { width: m[i].element.outerWidth(), height: m[i].element.outerHeight() };
-
- if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables
- }
-
- },
- drop: function(draggable, e) {
-
- var dropped = false;
- $.each($.ui.ddmanager.droppables, function() {
-
- if(!this.options) return;
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
- dropped = this.drop.call(this, e);
-
- if (!this.options.disabled && this.visible && this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- this.isout = 1; this.isover = 0;
- this.deactivate.call(this, e);
- }
-
- });
- return dropped;
-
- },
- drag: function(draggable, e) {
-
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, e);
-
- //Run through all droppables and check their positions based on specific tolerance options
- $.each($.ui.ddmanager.droppables, function() {
-
- if(this.options.disabled || this.greedyChild || !this.visible) return;
- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
-
- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
- if(!c) return;
-
- var parentInstance;
- if (this.options.greedy) {
- var parent = this.element.parents('.ui-droppable:eq(0)');
- if (parent.length) {
- parentInstance = $.data(parent[0], 'droppable');
- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
- }
- }
-
- // we just moved into a greedy child
- if (parentInstance && c == 'isover') {
- parentInstance['isover'] = 0;
- parentInstance['isout'] = 1;
- parentInstance.out.call(parentInstance, e);
- }
-
- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
- this[c == "isover" ? "over" : "out"].call(this, e);
-
- // we just moved out of a greedy child
- if (parentInstance && c == 'isout') {
- parentInstance['isout'] = 0;
- parentInstance['isover'] = 1;
- parentInstance.over.call(parentInstance, e);
- }
- });
-
- }
-};
-
-/*
- * Droppable Extensions
- */
-
-$.ui.plugin.add("droppable", "activeClass", {
- activate: function(e, ui) {
- $(this).addClass(ui.options.activeClass);
- },
- deactivate: function(e, ui) {
- $(this).removeClass(ui.options.activeClass);
- },
- drop: function(e, ui) {
- $(this).removeClass(ui.options.activeClass);
- }
-});
-
-$.ui.plugin.add("droppable", "hoverClass", {
- over: function(e, ui) {
- $(this).addClass(ui.options.hoverClass);
- },
- out: function(e, ui) {
- $(this).removeClass(ui.options.hoverClass);
- },
- drop: function(e, ui) {
- $(this).removeClass(ui.options.hoverClass);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Resizable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.resizable", $.extend($.ui.mouse, {
- init: function() {
-
- var self = this, o = this.options;
-
- var elpos = this.element.css('position');
-
- this.originalElement = this.element;
-
- // simulate .ui-resizable { position: relative; }
- this.element.addClass("ui-resizable").css({ position: /static/.test(elpos) ? 'relative' : elpos });
-
- $.extend(o, {
- _aspectRatio: !!(o.aspectRatio),
- helper: o.helper || o.ghost || o.animate ? o.helper || 'proxy' : null,
- knobHandles: o.knobHandles === true ? 'ui-resizable-knob-handle' : o.knobHandles
- });
-
- //Default Theme
- var aBorder = '1px solid #DEDEDE';
-
- o.defaultTheme = {
- 'ui-resizable': { display: 'block' },
- 'ui-resizable-handle': { position: 'absolute', background: '#F2F2F2', fontSize: '0.1px' },
- 'ui-resizable-n': { cursor: 'n-resize', height: '4px', left: '0px', right: '0px', borderTop: aBorder },
- 'ui-resizable-s': { cursor: 's-resize', height: '4px', left: '0px', right: '0px', borderBottom: aBorder },
- 'ui-resizable-e': { cursor: 'e-resize', width: '4px', top: '0px', bottom: '0px', borderRight: aBorder },
- 'ui-resizable-w': { cursor: 'w-resize', width: '4px', top: '0px', bottom: '0px', borderLeft: aBorder },
- 'ui-resizable-se': { cursor: 'se-resize', width: '4px', height: '4px', borderRight: aBorder, borderBottom: aBorder },
- 'ui-resizable-sw': { cursor: 'sw-resize', width: '4px', height: '4px', borderBottom: aBorder, borderLeft: aBorder },
- 'ui-resizable-ne': { cursor: 'ne-resize', width: '4px', height: '4px', borderRight: aBorder, borderTop: aBorder },
- 'ui-resizable-nw': { cursor: 'nw-resize', width: '4px', height: '4px', borderLeft: aBorder, borderTop: aBorder }
- };
-
- o.knobTheme = {
- 'ui-resizable-handle': { background: '#F2F2F2', border: '1px solid #808080', height: '8px', width: '8px' },
- 'ui-resizable-n': { cursor: 'n-resize', top: '0px', left: '45%' },
- 'ui-resizable-s': { cursor: 's-resize', bottom: '0px', left: '45%' },
- 'ui-resizable-e': { cursor: 'e-resize', right: '0px', top: '45%' },
- 'ui-resizable-w': { cursor: 'w-resize', left: '0px', top: '45%' },
- 'ui-resizable-se': { cursor: 'se-resize', right: '0px', bottom: '0px' },
- 'ui-resizable-sw': { cursor: 'sw-resize', left: '0px', bottom: '0px' },
- 'ui-resizable-nw': { cursor: 'nw-resize', left: '0px', top: '0px' },
- 'ui-resizable-ne': { cursor: 'ne-resize', right: '0px', top: '0px' }
- };
-
- o._nodeName = this.element[0].nodeName;
-
- //Wrap the element if it cannot hold child nodes
- if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)) {
- var el = this.element;
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera)
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- el.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css( {
- position: el.css('position'),
- width: el.outerWidth(),
- height: el.outerHeight(),
- top: el.css('top'),
- left: el.css('left')
- })
- );
-
- var oel = this.element; this.element = this.element.parent();
-
- // store instance on wrapper
- this.element.data('resizable', this);
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: oel.css("marginLeft"), marginTop: oel.css("marginTop"),
- marginRight: oel.css("marginRight"), marginBottom: oel.css("marginBottom")
- });
-
- oel.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- if ($.browser.safari && o.preventDefault) oel.css('resize', 'none');
-
- o.proportionallyResize = oel.css({ position: 'static', zoom: 1, display: 'block' });
-
- // avoid IE jump
- this.element.css({ margin: oel.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
- }
-
- if(!o.handles) o.handles = !$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' };
- if(o.handles.constructor == String) {
-
- o.zIndex = o.zIndex || 1000;
-
- if(o.handles == 'all') o.handles = 'n,e,s,w,se,sw,ne,nw';
-
- var n = o.handles.split(","); o.handles = {};
-
- // insertions are applied when don't have theme loaded
- var insertionsDefault = {
- handle: 'position: absolute; display: none; overflow:hidden;',
- n: 'top: 0pt; width:100%;',
- e: 'right: 0pt; height:100%;',
- s: 'bottom: 0pt; width:100%;',
- w: 'left: 0pt; height:100%;',
- se: 'bottom: 0pt; right: 0px;',
- sw: 'bottom: 0pt; left: 0px;',
- ne: 'top: 0pt; right: 0px;',
- nw: 'top: 0pt; left: 0px;'
- };
-
- for(var i = 0; i < n.length; i++) {
- var handle = $.trim(n[i]), dt = o.defaultTheme, hname = 'ui-resizable-'+handle, loadDefault = !$.ui.css(hname) && !o.knobHandles, userKnobClass = $.ui.css('ui-resizable-knob-handle'),
- allDefTheme = $.extend(dt[hname], dt['ui-resizable-handle']), allKnobTheme = $.extend(o.knobTheme[hname], !userKnobClass ? o.knobTheme['ui-resizable-handle'] : {});
-
- // increase zIndex of sw, se, ne, nw axis
- var applyZIndex = /sw|se|ne|nw/.test(handle) ? { zIndex: ++o.zIndex } : {};
-
- var defCss = (loadDefault ? insertionsDefault[handle] : ''),
- axis = $(['<div class="ui-resizable-handle ', hname, '" style="', defCss, insertionsDefault.handle, '"></div>'].join('')).css( applyZIndex );
- o.handles[handle] = '.ui-resizable-'+handle;
-
- this.element.append(
- //Theme detection, if not loaded, load o.defaultTheme
- axis.css( loadDefault ? allDefTheme : {} )
- // Load the knobHandle css, fix width, height, top, left...
- .css( o.knobHandles ? allKnobTheme : {} ).addClass(o.knobHandles ? 'ui-resizable-knob-handle' : '').addClass(o.knobHandles)
- );
- }
-
- if (o.knobHandles) this.element.addClass('ui-resizable-knob').css( !$.ui.css('ui-resizable-knob') ? { /*border: '1px #fff dashed'*/ } : {} );
- }
-
- this._renderAxis = function(target) {
- target = target || this.element;
-
- for(var i in o.handles) {
- if(o.handles[i].constructor == String)
- o.handles[i] = $(o.handles[i], this.element).show();
-
- if (o.transparent)
- o.handles[i].css({opacity:0});
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.element.is('.ui-wrapper') &&
- o._nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(o.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- if (!o.transparent)
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
- }
- if(!$(o.handles[i]).length) continue;
- }
- };
-
- this._renderAxis(this.element);
- o._handles = $('.ui-resizable-handle', self.element);
-
- if (o.disableSelection)
- o._handles.each(function(i, e) { $.ui.disableSelection(e); });
-
- //Matching axis name
- o._handles.mouseover(function() {
- if (!o.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = o.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- o._handles.hide();
- $(self.element).addClass("ui-resizable-autohide").hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- o._handles.show();
- },
- function(){
- if (!o.resizing) {
- $(this).addClass("ui-resizable-autohide");
- o._handles.hide();
- }
- });
- }
-
- this.mouseInit();
- },
- plugins: {},
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- options: this.options,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.ui()]);
- if (n != "resize") this.element.triggerHandler(["resize", n].join(""), [e, this.ui()], this.options[n]);
- },
- destroy: function() {
- var el = this.element, wrapped = el.children(".ui-resizable").get(0);
-
- this.mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- _destroy(el);
-
- if (el.is('.ui-wrapper') && wrapped) {
- el.parent().append(
- $(wrapped).css({
- position: el.css('position'),
- width: el.outerWidth(),
- height: el.outerHeight(),
- top: el.css('top'),
- left: el.css('left')
- })
- ).end().remove();
-
- _destroy(wrapped);
- }
- },
- mouseStart: function(e) {
- if(this.options.disabled) return false;
-
- var handle = false;
- for(var i in this.options.handles) {
- if($(this.options.handles[i])[0] == e.target) handle = true;
- }
- if (!handle) return false;
-
- var o = this.options, iniPos = this.element.position(), el = this.element,
- num = function(v) { return parseInt(v, 10) || 0; }, ie6 = $.browser.msie && $.browser.version < 7;
- o.resizing = true;
- o.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix #1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
-
- // sOffset decides if document scrollOffset will be added to the top/left of the resizable element
- var sOffset = $.browser.msie && !o.containment && (/absolute/).test(el.css('position')) && !(/relative/).test(el.parent().css('position'));
- var dscrollt = sOffset ? o.documentScroll.top : 0, dscrolll = sOffset ? o.documentScroll.left : 0;
-
- el.css({ position: 'absolute', top: (iniPos.top + dscrollt), left: (iniPos.left + dscrolll) });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && /relative/.test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = o.helper || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = o.helper || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: e.pageX, top: e.pageY };
-
- //Aspect Ratio
- o.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.height / this.originalSize.width)||1);
-
- if (o.preserveCursor)
- $('body').css('cursor', this.axis + '-resize');
-
- this.propagate("start", e);
- return true;
- },
- mouseDrag: function(e) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (e.pageX-smp.left)||0, dy = (e.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [e, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (o._aspectRatio || e.shiftKey)
- data = this._updateRatio(data, e);
-
- data = this._respectSize(data, e);
-
- // plugins callbacks need to be called first
- this.propagate("resize", e);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!o.helper && o.proportionallyResize)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this.element.triggerHandler("resize", [e, this.ui()], this.options["resize"]);
-
- return false;
- },
- mouseStop: function(e) {
-
- this.options.resizing = false;
- var o = this.options, num = function(v) { return parseInt(v, 10) || 0; }, self = this;
-
- if(o.helper) {
- var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
- soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- if (o.helper && !o.animate) this._proportionallyResize();
- }
-
- if (o.preserveCursor)
- $('body').css('cursor', 'auto');
-
- this.propagate("stop", e);
-
- if (o.helper) this.helper.remove();
-
- return false;
- },
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (data.left) this.position.left = data.left;
- if (data.top) this.position.top = data.top;
- if (data.height) this.size.height = data.height;
- if (data.width) this.size.width = data.width;
- },
- _updateRatio: function(data, e) {
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height / o.aspectRatio);
- else if (data.width) data.height = (csize.width * o.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
- _respectSize: function(data, e) {
-
- var el = this.helper, o = this.options, pRatio = o._aspectRatio || e.shiftKey, a = this.axis,
- ismaxw = data.width && o.maxWidth && o.maxWidth < data.width, ismaxh = data.height && o.maxHeight && o.maxHeight < data.height,
- isminw = data.width && o.minWidth && o.minWidth > data.width, isminh = data.height && o.minHeight && o.minHeight > data.height;
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
- _proportionallyResize: function() {
- var o = this.options;
- if (!o.proportionallyResize) return;
- var prel = o.proportionallyResize, el = this.helper || this.element;
-
- if (!o.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- o.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
- prel.css({
- height: (el.height() - o.borderDif[0] - o.borderDif[2]) + "px",
- width: (el.width() - o.borderDif[1] - o.borderDif[3]) + "px"
- });
- },
- _renderProxy: function() {
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(o.helper) {
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(o.helper).css({
- width: el.outerWidth() + pxyoffset,
- height: el.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex
- });
-
- this.helper.appendTo("body");
-
- if (o.disableSelection)
- $.ui.disableSelection(this.helper.get(0));
-
- } else {
- this.helper = el;
- }
- },
- _change: {
- e: function(e, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(e, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(e, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(e, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(e, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, dx, dy]));
- },
- sw: function(e, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, dx, dy]));
- },
- ne: function(e, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, dx, dy]));
- },
- nw: function(e, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, dx, dy]));
- }
- }
-}));
-
-$.extend($.ui.resizable, {
- defaults: {
- cancel: ":input",
- distance: 1,
- delay: 0,
- preventDefault: true,
- transparent: false,
- minWidth: 10,
- minHeight: 10,
- aspectRatio: false,
- disableSelection: true,
- preserveCursor: true,
- autoHide: false,
- knobHandles: false
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
-
- // i'm a node, so compute top, left, right, bottom
- else{
- self.containerOffset = $(ce).offset();
- self.containerPosition = $(ce).position();
- self.containerSize = { height: $(ce).innerHeight(), width: $(ce).innerWidth() };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"),
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = o._aspectRatio || e.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && /static/.test(ce.css('position')))
- cop = self.containerPosition;
-
- if (cp.left < (o.helper ? co.left : cop.left)) {
- self.size.width = self.size.width + (o.helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width * o.aspectRatio;
- self.position.left = o.helper ? co.left : cop.left;
- }
-
- if (cp.top < (o.helper ? co.top : 0)) {
- self.size.height = self.size.height + (o.helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height / o.aspectRatio;
- self.position.top = o.helper ? co.top : 0;
- }
-
- var woset = (o.helper ? self.offset.left - co.left : (self.position.left - cop.left)) + self.sizeDiff.width,
- hoset = (o.helper ? self.offset.top - co.top : self.position.top) + self.sizeDiff.height;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width * o.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height / o.aspectRatio;
- }
- },
-
- stop: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.innerWidth(), h = helper.innerHeight();
-
-
- if (o.helper && !o.animate && /relative/.test(ce.css('position')))
- $(this).css({ left: (ho.left - co.left), top: (ho.top - co.top), width: w, height: h });
-
- if (o.helper && !o.animate && /static/.test(ce.css('position')))
- $(this).css({ left: cop.left + (ho.left - co.left), top: cop.top + (ho.top - co.top), width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable");
-
- var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
- soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration || "slow", easing: o.animateEasing || "swing",
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr) pr.css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self.propagate("animate", e);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize, cs = self.size;
-
- if (!pr) self.ghost = self.element.clone();
- else self.ghost = pr.clone();
-
- self.ghost.css(
- { opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }
- )
- .addClass('ui-resizable-ghost').addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;
-
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
-
- },
-
- stop: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"),
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object') {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
- $(this).css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object') {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(e, ui){
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Selectable
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.selectable", $.extend($.ui.mouse, {
- init: function() {
- var self = this;
-
- this.element.addClass("ui-selectable");
-
- this.dragged = false;
-
- // cache selectee children based on filter
- var selectees;
- this.refresh = function() {
- selectees = $(self.options.filter, self.element[0]);
- selectees.each(function() {
- var $this = $(this);
- var pos = $this.offset();
- $.data(this, "selectable-item", {
- element: this,
- $element: $this,
- left: pos.left,
- top: pos.top,
- right: pos.left + $this.width(),
- bottom: pos.top + $this.height(),
- startselected: false,
- selected: $this.hasClass('ui-selected'),
- selecting: $this.hasClass('ui-selecting'),
- unselecting: $this.hasClass('ui-unselecting')
- });
- });
- };
- this.refresh();
-
- this.selectees = selectees.addClass("ui-selectee");
-
- this.mouseInit();
-
- this.helper = $(document.createElement('div')).css({border:'1px dotted black'});
- },
- toggle: function() {
- if(this.options.disabled){
- this.enable();
- } else {
- this.disable();
- }
- },
- destroy: function() {
- this.element
- .removeClass("ui-selectable ui-selectable-disabled")
- .removeData("selectable")
- .unbind(".selectable");
- this.mouseDestroy();
- },
- mouseStart: function(e) {
- var self = this;
-
- this.opos = [e.pageX, e.pageY];
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- this.selectees = $(options.filter, this.element[0]);
-
- // selectable START callback
- this.element.triggerHandler("selectablestart", [e, {
- "selectable": this.element[0],
- "options": options
- }], options.start);
-
- $('body').append(this.helper);
- // position helper (lasso)
- this.helper.css({
- "z-index": 100,
- "position": "absolute",
- "left": e.clientX,
- "top": e.clientY,
- "width": 0,
- "height": 0
- });
-
- if (options.autoRefresh) {
- this.refresh();
- }
-
- this.selectees.filter('.ui-selected').each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.startselected = true;
- if (!e.ctrlKey) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- });
-
- var isSelectee = false;
- $(e.target).parents().andSelf().each(function() {
- if($.data(this, "selectable-item")) isSelectee = true;
- });
- return this.options.keyboard ? !isSelectee : true;
- },
- mouseDrag: function(e) {
- var self = this;
- this.dragged = true;
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- var x1 = this.opos[0], y1 = this.opos[1], x2 = e.pageX, y2 = e.pageY;
- if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
- if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
- this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
-
- this.selectees.each(function() {
- var selectee = $.data(this, "selectable-item");
- //prevent helper from being selected if appendTo: selectable
- if (!selectee || selectee.element == self.element[0])
- return;
- var hit = false;
- if (options.tolerance == 'touch') {
- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
- } else if (options.tolerance == 'fit') {
- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
- }
-
- if (hit) {
- // SELECT
- if (selectee.selected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- }
- if (selectee.unselecting) {
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- }
- if (!selectee.selecting) {
- selectee.$element.addClass('ui-selecting');
- selectee.selecting = true;
- // selectable SELECTING callback
- self.element.triggerHandler("selectableselecting", [e, {
- selectable: self.element[0],
- selecting: selectee.element,
- options: options
- }], options.selecting);
- }
- } else {
- // UNSELECT
- if (selectee.selecting) {
- if (e.ctrlKey && selectee.startselected) {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- selectee.$element.addClass('ui-selected');
- selectee.selected = true;
- } else {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- if (selectee.startselected) {
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- }
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- }
- if (selectee.selected) {
- if (!e.ctrlKey && !selectee.startselected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
-
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- }
- }
- });
-
- return false;
- },
- mouseStop: function(e) {
- var self = this;
-
- this.dragged = false;
-
- var options = this.options;
-
- $('.ui-unselecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- selectee.startselected = false;
- self.element.triggerHandler("selectableunselected", [e, {
- selectable: self.element[0],
- unselected: selectee.element,
- options: options
- }], options.unselected);
- });
- $('.ui-selecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
- selectee.selecting = false;
- selectee.selected = true;
- selectee.startselected = true;
- self.element.triggerHandler("selectableselected", [e, {
- selectable: self.element[0],
- selected: selectee.element,
- options: options
- }], options.selected);
- });
- this.element.triggerHandler("selectablestop", [e, {
- selectable: self.element[0],
- options: this.options
- }], this.options.stop);
-
- this.helper.remove();
-
- return false;
- }
-}));
-
-$.extend($.ui.selectable, {
- defaults: {
- distance: 1,
- delay: 0,
- cancel: ":input",
- appendTo: 'body',
- autoRefresh: true,
- filter: '*',
- tolerance: 'touch'
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Sortable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-function contains(a, b) {
- var safari2 = $.browser.safari && $.browser.version < 522;
- if (a.contains && !safari2) {
- return a.contains(b);
- }
- if (a.compareDocumentPosition)
- return !!(a.compareDocumentPosition(b) & 16);
- while (b = b.parentNode)
- if (b == a) return true;
- return false;
-};
-
-$.widget("ui.sortable", $.extend($.ui.mouse, {
- init: function() {
-
- var o = this.options;
- this.containerCache = {};
- this.element.addClass("ui-sortable");
-
- //Get the items
- this.refresh();
-
- //Let's determine if the items are floating
- this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;
-
- //Let's determine the parent's offset
- if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative');
- this.offset = this.element.offset();
-
- //Initialize mouse events for interaction
- this.mouseInit();
-
- },
- plugins: {},
- ui: function(inst) {
- return {
- helper: (inst || this)["helper"],
- placeholder: (inst || this)["placeholder"] || $([]),
- position: (inst || this)["position"],
- absolutePosition: (inst || this)["positionAbs"],
- options: this.options,
- element: this.element,
- item: (inst || this)["currentItem"],
- sender: inst ? inst.element : null
- };
- },
- propagate: function(n,e,inst, noPropagation) {
- $.ui.plugin.call(this, n, [e, this.ui(inst)]);
- if(!noPropagation) this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]);
- },
- serialize: function(o) {
-
- var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
- var str = []; o = o || {};
-
- items.each(function() {
- var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
- if(res) str.push((o.key || res[1])+'[]='+(o.key && o.expression ? res[1] : res[2]));
- });
-
- return str.join('&');
-
- },
- toArray: function(attr) {
-
- var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
- var ret = [];
-
- items.each(function() { ret.push($(this).attr(attr || 'id')); });
- return ret;
-
- },
- /* Be careful with the following core functions */
- intersectsWith: function(item) {
-
- var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height;
- var l = item.left, r = l + item.width,
- t = item.top, b = t + item.height;
-
- if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])) {
- return (y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r);
- } else {
-
- return (l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b ); // Top Half
-
- }
-
- },
- intersectsWithEdge: function(item) {
- var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height;
- var l = item.left, r = l + item.width,
- t = item.top, b = t + item.height;
-
- if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])) {
-
- if(!(y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r)) return false;
-
- if(this.floating) {
- if(x1 + this.offset.click.left > l && x1 + this.offset.click.left < l + item.width/2) return 2;
- if(x1 + this.offset.click.left > l+item.width/2 && x1 + this.offset.click.left < r) return 1;
- } else {
- if(y1 + this.offset.click.top > t && y1 + this.offset.click.top < t + item.height/2) return 2;
- if(y1 + this.offset.click.top > t+item.height/2 && y1 + this.offset.click.top < b) return 1;
- }
-
- } else {
-
- if (!(l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half
-
- if(this.floating) {
- if(x2 > l && x1 < l) return 2; //Crosses left edge
- if(x1 < r && x2 > r) return 1; //Crosses right edge
- } else {
- if(y2 > t && y1 < t) return 1; //Crosses top edge
- if(y1 < b && y2 > b) return 2; //Crosses bottom edge
- }
-
- }
-
- return false;
-
- },
- refresh: function() {
- this.refreshItems();
- this.refreshPositions();
- },
- refreshItems: function() {
-
- this.items = [];
- this.containers = [this];
- var items = this.items;
- var self = this;
- var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element), this]];
-
- if(this.options.connectWith) {
- for (var i = this.options.connectWith.length - 1; i >= 0; i--){
- var cur = $(this.options.connectWith[i]);
- for (var j = cur.length - 1; j >= 0; j--){
- var inst = $.data(cur[j], 'sortable');
- if(inst && !inst.options.disabled) {
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element), inst]);
- this.containers.push(inst);
- }
- };
- };
- }
-
- for (var i = queries.length - 1; i >= 0; i--){
- queries[i][0].each(function() {
- $.data(this, 'sortable-item', queries[i][1]); // Data for target checking (mouse manager)
- items.push({
- item: $(this),
- instance: queries[i][1],
- width: 0, height: 0,
- left: 0, top: 0
- });
- });
- };
-
- },
- refreshPositions: function(fast) {
-
- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
- if(this.offsetParent) {
- var po = this.offsetParent.offset();
- this.offset.parent = { top: po.top + this.offsetParentBorders.top, left: po.left + this.offsetParentBorders.left };
- }
-
- for (var i = this.items.length - 1; i >= 0; i--){
-
- //We ignore calculating positions of all connected containers when we're not over them
- if(this.items[i].instance != this.currentContainer && this.currentContainer && this.items[i].item[0] != this.currentItem[0])
- continue;
-
- var t = this.options.toleranceElement ? $(this.options.toleranceElement, this.items[i].item) : this.items[i].item;
-
- if(!fast) {
- this.items[i].width = t.outerWidth();
- this.items[i].height = t.outerHeight();
- }
-
- var p = t.offset();
- this.items[i].left = p.left;
- this.items[i].top = p.top;
-
- };
-
- for (var i = this.containers.length - 1; i >= 0; i--){
- var p =this.containers[i].element.offset();
- this.containers[i].containerCache.left = p.left;
- this.containers[i].containerCache.top = p.top;
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
- };
-
- },
- destroy: function() {
- this.element
- .removeClass("ui-sortable ui-sortable-disabled")
- .removeData("sortable")
- .unbind(".sortable");
- this.mouseDestroy();
-
- for ( var i = this.items.length - 1; i >= 0; i-- )
- this.items[i].item.removeData("sortable-item");
- },
- createPlaceholder: function(that) {
-
- var self = that || this, o = self.options;
-
- if(o.placeholder.constructor == String) {
- var className = o.placeholder;
- o.placeholder = {
- element: function() {
- return $('<div></div>').addClass(className)[0];
- },
- update: function(i, p) {
- p.css(i.offset()).css({ width: i.outerWidth(), height: i.outerHeight() });
- }
- };
- }
-
- self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)).appendTo('body').css({ position: 'absolute' });
- o.placeholder.update.call(self.element, self.currentItem, self.placeholder);
- },
- contactContainers: function(e) {
- for (var i = this.containers.length - 1; i >= 0; i--){
-
- if(this.intersectsWith(this.containers[i].containerCache)) {
- if(!this.containers[i].containerCache.over) {
-
-
- if(this.currentContainer != this.containers[i]) {
-
- //When entering a new container, we will find the item with the least distance and append our item near it
- var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top'];
- for (var j = this.items.length - 1; j >= 0; j--) {
- if(!contains(this.containers[i].element[0], this.items[j].item[0])) continue;
- var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
- if(Math.abs(cur - base) < dist) {
- dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
- }
- }
-
- if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
- continue;
-
- //We also need to exchange the placeholder
- if(this.placeholder) this.placeholder.remove();
- if(this.containers[i].options.placeholder) {
- this.containers[i].createPlaceholder(this);
- } else {
- this.placeholder = null;;
- }
-
- this.currentContainer = this.containers[i];
- itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance, null, true) : this.rearrange(e, null, this.containers[i].element, true);
- this.propagate("change", e); //Call plugins and callbacks
- this.containers[i].propagate("change", e, this); //Call plugins and callbacks
-
- }
-
- this.containers[i].propagate("over", e, this);
- this.containers[i].containerCache.over = 1;
- }
- } else {
- if(this.containers[i].containerCache.over) {
- this.containers[i].propagate("out", e, this);
- this.containers[i].containerCache.over = 0;
- }
- }
-
- };
- },
- mouseCapture: function(e, overrideHandle) {
-
- if(this.options.disabled || this.options.type == 'static') return false;
-
- //We have to refresh the items data once first
- this.refreshItems();
-
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
- var currentItem = null, self = this, nodes = $(e.target).parents().each(function() {
- if($.data(this, 'sortable-item') == self) {
- currentItem = $(this);
- return false;
- }
- });
- if($.data(e.target, 'sortable-item') == self) currentItem = $(e.target);
-
- if(!currentItem) return false;
- if(this.options.handle && !overrideHandle) {
- var validHandle = false;
-
- $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == e.target) validHandle = true; });
- if(!validHandle) return false;
- }
-
- this.currentItem = currentItem;
- return true;
-
- },
- mouseStart: function(e, overrideHandle, noActivation) {
-
- var o = this.options;
- this.currentContainer = this;
-
- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
- this.refreshPositions();
-
- //Create and append the visible helper
- this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone();
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)); //Add the helper to the DOM if that didn't happen already
- this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- this.margins = { //Cache the margins
- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
- };
-
- this.offset = this.currentItem.offset(); //The element's absolute position on the page
- this.offset = { //Substract the margins from the element's absolute offset
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- this.offset.click = { //Where the click happened, relative to the element
- left: e.pageX - this.offset.left,
- top: e.pageY - this.offset.top
- };
-
- this.offsetParent = this.helper.offsetParent(); //Get the offsetParent and cache its position
- var po = this.offsetParent.offset();
-
- this.offsetParentBorders = {
- top: (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
- this.offset.parent = { //Store its position plus border
- top: po.top + this.offsetParentBorders.top,
- left: po.left + this.offsetParentBorders.left
- };
-
- this.originalPosition = this.generatePosition(e); //Generate the original position
- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; //Cache the former DOM position
-
- //If o.placeholder is used, create a new element at the given position with the class
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
- if(o.placeholder) this.createPlaceholder();
-
- //Call plugins and callbacks
- this.propagate("start", e);
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
-
- if(o.cursorAt) {
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left;
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right;
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top;
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom;
- }
-
- /*
- * - Position constraining -
- * Here we prepare position constraining like grid and containment.
- */
-
- if(o.containment) {
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.parent.left,
- 0 - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top,
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0),
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0)
- ];
- }
- }
-
- //Set the original element visibility to hidden to still fill out the white space
- if(this.options.placeholder != 'clone')
- this.currentItem.css('visibility', 'hidden');
-
- //Post 'activate' events to possible containers
- if(!noActivation) {
- for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); }
- }
-
- //Prepare possible droppables
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
-
- this.dragging = true;
-
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
-
-
- },
- convertPositionTo: function(d, pos) {
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- return {
- top: (
- pos.top // the calculated relative position
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
- ),
- left: (
- pos.left // the calculated relative position
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
- )
- };
- },
- generatePosition: function(e) {
-
- var o = this.options;
- var position = {
- top: (
- e.pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
- ),
- left: (
- e.pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
- )
- };
-
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- if(this.containment) {
- if(position.left < this.containment[0]) position.left = this.containment[0];
- if(position.top < this.containment[1]) position.top = this.containment[1];
- if(position.left > this.containment[2]) position.left = this.containment[2];
- if(position.top > this.containment[3]) position.top = this.containment[3];
- }
-
- if(o.grid) {
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- return position;
- },
- mouseDrag: function(e) {
-
-
- //Compute the helpers position
- this.position = this.generatePosition(e);
- this.positionAbs = this.convertPositionTo("absolute");
-
- //Rearrange
- for (var i = this.items.length - 1; i >= 0; i--) {
- var intersection = this.intersectsWithEdge(this.items[i]);
- if(!intersection) continue;
-
- if(this.items[i].item[0] != this.currentItem[0] //cannot intersect with itself
- && this.currentItem[intersection == 1 ? "next" : "prev"]()[0] != this.items[i].item[0] //no useless actions that have been done before
- && !contains(this.currentItem[0], this.items[i].item[0]) //no action if the item moved is the parent of the item checked
- && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true)
- ) {
-
- this.direction = intersection == 1 ? "down" : "up";
- this.rearrange(e, this.items[i]);
- this.propagate("change", e); //Call plugins and callbacks
- break;
- }
- }
-
- //Post events to containers
- this.contactContainers(e);
-
- //Call plugins and callbacks
- this.propagate("sort", e);
-
- if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px';
-
- //Interconnect with droppables
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
-
- return false;
-
- },
- rearrange: function(e, i, a, hardRefresh) {
- a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem);
-
- //Various things done here to improve the performance:
- // 1. we create a setTimeout, that calls refreshPositions
- // 2. on the instance, we have a counter variable, that get's higher after every append
- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
- // 4. this lets only the last addition to the timeout stack through
- this.counter = this.counter ? ++this.counter : 1;
- var self = this, counter = this.counter;
-
- window.setTimeout(function() {
- if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
- },0);
-
- if(this.options.placeholder)
- this.options.placeholder.update.call(this.element, this.currentItem, this.placeholder);
- },
- mouseStop: function(e, noPropagation) {
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, e);
-
- if(this.options.revert) {
- var self = this;
- var cur = self.currentItem.offset();
-
- //Also animate the placeholder if we have one
- if(self.placeholder) self.placeholder.animate({ opacity: 'hide' }, (parseInt(this.options.revert, 10) || 500)-50);
-
- $(this.helper).animate({
- left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
- top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
- }, parseInt(this.options.revert, 10) || 500, function() {
- self.clear(e);
- });
- } else {
- this.clear(e, noPropagation);
- }
-
- return false;
-
- },
- clear: function(e, noPropagation) {
-
- if(this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback if the DOM position has changed
- if(!contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
- this.propagate("remove", e, null, noPropagation);
- for (var i = this.containers.length - 1; i >= 0; i--){
- if(contains(this.containers[i].element[0], this.currentItem[0])) {
- this.containers[i].propagate("update", e, this, noPropagation);
- this.containers[i].propagate("receive", e, this, noPropagation);
- }
- };
- };
-
- //Post events to containers
- for (var i = this.containers.length - 1; i >= 0; i--){
- this.containers[i].propagate("deactivate", e, this, noPropagation);
- if(this.containers[i].containerCache.over) {
- this.containers[i].propagate("out", e, this);
- this.containers[i].containerCache.over = 0;
- }
- }
-
- this.dragging = false;
- if(this.cancelHelperRemoval) {
- this.propagate("stop", e, null, noPropagation);
- return false;
- }
-
- $(this.currentItem).css('visibility', '');
- if(this.placeholder) this.placeholder.remove();
- this.helper.remove(); this.helper = null;
- this.propagate("stop", e, null, noPropagation);
-
- return true;
-
- }
-}));
-
-$.extend($.ui.sortable, {
- getter: "serialize toArray",
- defaults: {
- helper: "clone",
- tolerance: "guess",
- distance: 1,
- delay: 0,
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- cancel: ":input",
- items: '> *',
- zIndex: 1000,
- dropOnEmpty: true,
- appendTo: "parent"
- }
-});
-
-/*
- * Sortable Extensions
- */
-
-$.ui.plugin.add("sortable", "cursor", {
- start: function(e, ui) {
- var t = $('body');
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
- t.css("cursor", ui.options.cursor);
- },
- stop: function(e, ui) {
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
- }
-});
-
-$.ui.plugin.add("sortable", "zIndex", {
- start: function(e, ui) {
- var t = ui.helper;
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
- t.css('zIndex', ui.options.zIndex);
- },
- stop: function(e, ui) {
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
- }
-});
-
-$.ui.plugin.add("sortable", "opacity", {
- start: function(e, ui) {
- var t = ui.helper;
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
- t.css('opacity', ui.options.opacity);
- },
- stop: function(e, ui) {
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
- }
-});
-
-$.ui.plugin.add("sortable", "scroll", {
- start: function(e, ui) {
- var o = ui.options;
- var i = $(this).data("sortable");
-
- i.overflowY = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(i.currentItem);
- i.overflowX = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(i.currentItem);
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
-
- },
- sort: function(e, ui) {
-
- var o = ui.options;
- var i = $(this).data("sortable");
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
- } else {
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
- } else {
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Effects 1.5.1
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/
- */
-;(function($) {
-
-$.effects = $.effects || {}; //Add the 'effects' scope
-
-$.extend($.effects, {
- save: function(el, set) {
- for(var i=0;i<set.length;i++) {
- if(set[i] !== null) $.data(el[0], "ec.storage."+set[i], el[0].style[set[i]]);
- }
- },
- restore: function(el, set) {
- for(var i=0;i<set.length;i++) {
- if(set[i] !== null) el.css(set[i], $.data(el[0], "ec.storage."+set[i]));
- }
- },
- setMode: function(el, mode) {
- if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
- return mode;
- },
- getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
- // this should be a little more flexible in the future to handle a string & hash
- var y, x;
- switch (origin[0]) {
- case 'top': y = 0; break;
- case 'middle': y = 0.5; break;
- case 'bottom': y = 1; break;
- default: y = origin[0] / original.height;
- };
- switch (origin[1]) {
- case 'left': x = 0; break;
- case 'center': x = 0.5; break;
- case 'right': x = 1; break;
- default: x = origin[1] / original.width;
- };
- return {x: x, y: y};
- },
- createWrapper: function(el) {
- if (el.parent().attr('id') == 'fxWrapper')
- return el;
- var props = {width: el.outerWidth({margin:true}), height: el.outerHeight({margin:true}), 'float': el.css('float')};
- el.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
- var wrapper = el.parent();
- if (el.css('position') == 'static'){
- wrapper.css({position: 'relative'});
- el.css({position: 'relative'});
- } else {
- var top = parseInt(el.css('top'), 10); if(isNaN(top)) top = 'auto';
- var left = parseInt(el.css('left'), 10); if(isNaN(left)) left = 'auto';
- wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show();
- el.css({position: 'relative', top:0, left:0});
- }
- wrapper.css(props);
- return wrapper;
- },
- removeWrapper: function(el) {
- if (el.parent().attr('id') == 'fxWrapper')
- return el.parent().replaceWith(el);
- return el;
- },
- setTransition: function(el, list, factor, val) {
- val = val || {};
- $.each(list,function(i, x){
- unit = el.cssUnit(x);
- if (unit[0] > 0) val[x] = unit[0] * factor + unit[1];
- });
- return val;
- },
- animateClass: function(value, duration, easing, callback) {
-
- var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
- var ea = (typeof easing == "object" ? easing : null);
-
- return this.each(function() {
-
- var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
- if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
- if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
-
- //Let's get a style offset
- var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
- if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
- var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
- if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
-
- // The main function to form the object for animation
- for(var n in newStyle) {
- if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
- && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
- && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
- && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
- && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
- ) offset[n] = newStyle[n];
- }
-
- that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
- // Change style attribute back to original. For stupid IE, we need to clear the damn object.
- if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
- if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
- if(cb) cb.apply(this, arguments);
- });
-
- });
- }
-});
-
-//Extend the methods of jQuery
-$.fn.extend({
- //Save old methods
- _show: $.fn.show,
- _hide: $.fn.hide,
- __toggle: $.fn.toggle,
- _addClass: $.fn.addClass,
- _removeClass: $.fn.removeClass,
- _toggleClass: $.fn.toggleClass,
- // New ec methods
- effect: function(fx,o,speed,callback) {
- return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: o || {}, duration: speed, callback: callback }) : null;
- },
- show: function() {
- if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
- return this._show.apply(this, arguments);
- else {
- var o = arguments[1] || {}; o['mode'] = 'show';
- return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
- }
- },
- hide: function() {
- if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
- return this._hide.apply(this, arguments);
- else {
- var o = arguments[1] || {}; o['mode'] = 'hide';
- return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
- }
- },
- toggle: function(){
- if(!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function))
- return this.__toggle.apply(this, arguments);
- else {
- var o = arguments[1] || {}; o['mode'] = 'toggle';
- return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
- }
- },
- addClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
- },
- removeClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
- },
- toggleClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames);
- },
- morph: function(remove,add,speed,easing,callback) {
- return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
- },
- switchClass: function() {
- return this.morph.apply(this, arguments);
- },
- // helper functions
- cssUnit: function(key) {
- var style = this.css(key), val = [];
- $.each( ['em','px','%','pt'], function(i, unit){
- if(style.indexOf(unit) > 0)
- val = [parseFloat(style), unit];
- });
- return val;
- }
-});
-
-/*
- * jQuery Color Animations
- * Copyright 2007 John Resig
- * Released under the MIT and GPL licenses.
- */
-
-// We override the animation for all of these color styles
-jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
- jQuery.fx.step[attr] = function(fx){
- if ( fx.state == 0 ) {
- fx.start = getColor( fx.elem, attr );
- fx.end = getRGB( fx.end );
- }
-
- fx.elem.style[attr] = "rgb(" + [
- Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
- Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
- Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
- ].join(",") + ")";
- }
-});
-
-// Color Conversion functions from highlightFade
-// By Blair Mitchelmore
-// http://jquery.offput.ca/highlightFade/
-
-// Parse strings looking for color tuples [255,255,255]
-function getRGB(color) {
- var result;
-
- // Check if we're already dealing with an array of colors
- if ( color && color.constructor == Array && color.length == 3 )
- return color;
-
- // Look for rgb(num,num,num)
- if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
- return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
-
- // Look for rgb(num%,num%,num%)
- if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
- return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
-
- // Look for #a0b1c2
- if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
- return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
-
- // Look for #fff
- if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
- return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
-
- // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
- if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
- return colors['transparent']
-
- // Otherwise, we're most likely dealing with a named color
- return colors[jQuery.trim(color).toLowerCase()];
-}
-
-function getColor(elem, attr) {
- var color;
-
- do {
- color = jQuery.curCSS(elem, attr);
-
- // Keep going until we find an element that has color, or we hit the body
- if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
- break;
-
- attr = "backgroundColor";
- } while ( elem = elem.parentNode );
-
- return getRGB(color);
-};
-
-// Some named colors to work with
-// From Interface by Stefan Petre
-// http://interface.eyecon.ro/
-
-var colors = {
- aqua:[0,255,255],
- azure:[240,255,255],
- beige:[245,245,220],
- black:[0,0,0],
- blue:[0,0,255],
- brown:[165,42,42],
- cyan:[0,255,255],
- darkblue:[0,0,139],
- darkcyan:[0,139,139],
- darkgrey:[169,169,169],
- darkgreen:[0,100,0],
- darkkhaki:[189,183,107],
- darkmagenta:[139,0,139],
- darkolivegreen:[85,107,47],
- darkorange:[255,140,0],
- darkorchid:[153,50,204],
- darkred:[139,0,0],
- darksalmon:[233,150,122],
- darkviolet:[148,0,211],
- fuchsia:[255,0,255],
- gold:[255,215,0],
- green:[0,128,0],
- indigo:[75,0,130],
- khaki:[240,230,140],
- lightblue:[173,216,230],
- lightcyan:[224,255,255],
- lightgreen:[144,238,144],
- lightgrey:[211,211,211],
- lightpink:[255,182,193],
- lightyellow:[255,255,224],
- lime:[0,255,0],
- magenta:[255,0,255],
- maroon:[128,0,0],
- navy:[0,0,128],
- olive:[128,128,0],
- orange:[255,165,0],
- pink:[255,192,203],
- purple:[128,0,128],
- violet:[128,0,128],
- red:[255,0,0],
- silver:[192,192,192],
- white:[255,255,255],
- yellow:[255,255,0],
- transparent: [255,255,255]
-};
-
-/*
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
- *
- * Uses the built in easing capabilities added In jQuery 1.1
- * to offer multiple easing options
- *
- * TERMS OF USE - jQuery Easing
- *
- * Open source under the BSD License.
- *
- * Copyright © 2008 George McGinley Smith
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
-*/
-
-// t: current time, b: begInnIng value, c: change In value, d: duration
-jQuery.easing['jswing'] = jQuery.easing['swing'];
-
-jQuery.extend( jQuery.easing,
-{
- def: 'easeOutQuad',
- swing: function (x, t, b, c, d) {
- //alert(jQuery.easing.default);
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
- },
- easeInQuad: function (x, t, b, c, d) {
- return c*(t/=d)*t + b;
- },
- easeOutQuad: function (x, t, b, c, d) {
- return -c *(t/=d)*(t-2) + b;
- },
- easeInOutQuad: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t + b;
- return -c/2 * ((--t)*(t-2) - 1) + b;
- },
- easeInCubic: function (x, t, b, c, d) {
- return c*(t/=d)*t*t + b;
- },
- easeOutCubic: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t + 1) + b;
- },
- easeInOutCubic: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
- },
- easeInQuart: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t + b;
- },
- easeOutQuart: function (x, t, b, c, d) {
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
- },
- easeInOutQuart: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
- },
- easeInQuint: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t*t + b;
- },
- easeOutQuint: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
- },
- easeInOutQuint: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
- return c/2*((t-=2)*t*t*t*t + 2) + b;
- },
- easeInSine: function (x, t, b, c, d) {
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
- },
- easeOutSine: function (x, t, b, c, d) {
- return c * Math.sin(t/d * (Math.PI/2)) + b;
- },
- easeInOutSine: function (x, t, b, c, d) {
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
- },
- easeInExpo: function (x, t, b, c, d) {
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
- },
- easeOutExpo: function (x, t, b, c, d) {
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
- },
- easeInOutExpo: function (x, t, b, c, d) {
- if (t==0) return b;
- if (t==d) return b+c;
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
- },
- easeInCirc: function (x, t, b, c, d) {
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
- },
- easeOutCirc: function (x, t, b, c, d) {
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
- },
- easeInOutCirc: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
- },
- easeInElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- },
- easeOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
- },
- easeInOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
- },
- easeInBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*(t/=d)*t*((s+1)*t - s) + b;
- },
- easeOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
- },
- easeInOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
- },
- easeInBounce: function (x, t, b, c, d) {
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
- },
- easeOutBounce: function (x, t, b, c, d) {
- if ((t/=d) < (1/2.75)) {
- return c*(7.5625*t*t) + b;
- } else if (t < (2/2.75)) {
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
- } else if (t < (2.5/2.75)) {
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
- } else {
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
- }
- },
- easeInOutBounce: function (x, t, b, c, d) {
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
- }
-});
-
-/*
- *
- * TERMS OF USE - EASING EQUATIONS
- *
- * Open source under the BSD License.
- *
- * Copyright © 2001 Robert Penner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-})(jQuery);
-/*
- * jQuery UI Effects Blind
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.blind = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'vertical') ? 'height' : 'width';
- var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
- if(mode == 'show') wrapper.css(ref, 0); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = mode == 'show' ? distance : 0;
-
- // Animate
- wrapper.animate(animation, o.duration, o.options.easing, function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Bounce
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.bounce = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'up'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 5; // Default # of times
- var speed = o.duration || 250; // Default speed per bounce
- if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
- if (mode == 'hide') distance = distance / (times * 2);
- if (mode != 'hide') times--;
-
- // Animate
- if (mode == 'show') { // Show Bounce
- var animation = {opacity: 1};
- animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation, speed / 2, o.options.easing);
- distance = distance / 2;
- times--;
- };
- for (var i = 0; i < times; i++) { // Bounces
- var animation1 = {}, animation2 = {};
- animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
- distance = (mode == 'hide') ? distance * 2 : distance / 2;
- };
- if (mode == 'hide') { // Last Bounce
- var animation = {opacity: 0};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- el.animate(animation, speed / 2, o.options.easing, function(){
- el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- } else {
- var animation1 = {}, animation2 = {};
- animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- };
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Clip
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.clip = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','height','width'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var animate = el[0].tagName == 'IMG' ? wrapper : el;
- var ref = {
- size: (direction == 'vertical') ? 'height' : 'width',
- position: (direction == 'vertical') ? 'top' : 'left'
- };
- var distance = (direction == 'vertical') ? animate.height() : animate.width();
- if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
-
- // Animation
- var animation = {};
- animation[ref.size] = mode == 'show' ? distance : 0;
- animation[ref.position] = mode == 'show' ? 0 : distance / 2;
-
- // Animate
- animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Drop
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.drop = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {opacity: mode == 'show' ? 1 : 0};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Explode
- *
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.explode = function(o) {
-
- return this.queue(function() {
-
- var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
- var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
-
- o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
- var el = $(this).show().css('visibility', 'hidden');
- var offset = el.offset();
-
- //Substract the margins - not fixing the problem yet.
- offset.top -= parseInt(el.css("marginTop")) || 0;
- offset.left -= parseInt(el.css("marginLeft")) || 0;
-
- var width = el.outerWidth(true);
- var height = el.outerHeight(true);
-
- for(var i=0;i<rows;i++) { // =
- for(var j=0;j<cells;j++) { // ||
- el
- .clone()
- .appendTo('body')
- .wrap('<div></div>')
- .css({
- position: 'absolute',
- visibility: 'visible',
- left: -j*(width/cells),
- top: -i*(height/rows)
- })
- .parent()
- .addClass('effects-explode')
- .css({
- position: 'absolute',
- overflow: 'hidden',
- width: width/cells,
- height: height/rows,
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
- opacity: o.options.mode == 'show' ? 0 : 1
- }).animate({
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
- opacity: o.options.mode == 'show' ? 1 : 0
- }, o.duration || 500);
- }
- }
-
- // Set a timeout, to call the callback approx. when the other animations have finished
- setTimeout(function() {
-
- o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
- if(o.callback) o.callback.apply(el[0]); // Callback
- el.dequeue();
-
- $('.effects-explode').remove();
-
- }, o.duration || 500);
-
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Fold
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.fold = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var size = o.options.size || 15; // Default fold size
- var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var widthFirst = ((mode == 'show') != horizFirst);
- var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
- var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
- var percent = /([0-9]+)%/.exec(size);
- if(percent) size = parseInt(percent[1]) / 100 * distance[mode == 'hide' ? 0 : 1];
- if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
-
- // Animation
- var animation1 = {}, animation2 = {};
- animation1[ref[0]] = mode == 'show' ? distance[0] : size;
- animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
-
- // Animate
- wrapper.animate(animation1, o.duration / 2, o.options.easing)
- .animate(animation2, o.duration / 2, o.options.easing, function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Highlight
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * effects.core.js
- */
-;(function($) {
-
-$.effects.highlight = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var color = o.options.color || "#ffff99"; // Default highlight color
- var oldColor = el.css("backgroundColor");
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
-
- // Animation
- var animation = {backgroundColor: oldColor };
- if (mode == "hide") animation['opacity'] = 0;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == "hide") el.hide();
- $.effects.restore(el, props);
- if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter');
- if(o.callback) o.callback.apply(this, arguments);
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Pulsate
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.pulsate = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var times = o.options.times || 5; // Default # of times
-
- // Adjust
- if (mode == 'hide') times--;
- if (el.is(':hidden')) { // Show fadeIn
- el.css('opacity', 0);
- el.show(); // Show
- el.animate({opacity: 1}, o.duration / 2, o.options.easing);
- times = times-2;
- }
-
- // Animate
- for (var i = 0; i < times; i++) { // Pulsate
- el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing);
- };
- if (mode == 'hide') { // Last Pulse
- el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){
- el.hide(); // Hide
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- } else {
- el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing, function(){
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- };
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Scale
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.puff = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var options = $.extend(true, {}, o.options);
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var percent = parseInt(o.options.percent) || 150; // Set default puff percent
- options.fade = true; // It's not a puff if it doesn't fade! :)
- var original = {height: el.height(), width: el.width()}; // Save original
-
- // Adjust
- var factor = percent / 100;
- el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor};
-
- // Animation
- options.from = el.from;
- options.percent = (mode == 'hide') ? percent : 100;
- options.mode = mode;
-
- // Animate
- el.effect('scale', options, o.duration, o.callback);
- el.dequeue();
- });
-
-};
-
-$.effects.scale = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var options = $.extend(true, {}, o.options);
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
- var direction = o.options.direction || 'both'; // Set default axis
- var origin = o.options.origin; // The origin of the scaling
- if (mode != 'effect') { // Set default origin and restore for show/hide
- options.origin = origin || ['middle','center'];
- options.restore = true;
- }
- var original = {height: el.height(), width: el.width()}; // Save original
- el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
-
- // Adjust
- var factor = { // Set scaling factor
- y: direction != 'horizontal' ? (percent / 100) : 1,
- x: direction != 'vertical' ? (percent / 100) : 1
- };
- el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
-
- if (o.options.fade) { // Fade option to support puff
- if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
- if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
- };
-
- // Animation
- options.from = el.from; options.to = el.to; options.mode = mode;
-
- // Animate
- el.effect('size', options, o.duration, o.callback);
- el.dequeue();
- });
-
-};
-
-$.effects.size = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','width','height','overflow','opacity'];
- var props1 = ['position','top','left','overflow','opacity']; // Always restore
- var props2 = ['width','height','overflow']; // Copy for children
- var cProps = ['fontSize'];
- var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
- var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var restore = o.options.restore || false; // Default restore
- var scale = o.options.scale || 'both'; // Default scale mode
- var origin = o.options.origin; // The origin of the sizing
- var original = {height: el.height(), width: el.width()}; // Save original
- el.from = o.options.from || original; // Default from state
- el.to = o.options.to || original; // Default to state
- // Adjust
- if (origin) { // Calculate baseline shifts
- var baseline = $.effects.getBaseline(origin, original);
- el.from.top = (original.height - el.from.height) * baseline.y;
- el.from.left = (original.width - el.from.width) * baseline.x;
- el.to.top = (original.height - el.to.height) * baseline.y;
- el.to.left = (original.width - el.to.width) * baseline.x;
- };
- var factor = { // Set scaling factor
- from: {y: el.from.height / original.height, x: el.from.width / original.width},
- to: {y: el.to.height / original.height, x: el.to.width / original.width}
- };
- if (scale == 'box' || scale == 'both') { // Scale the css box
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- props = props.concat(vProps);
- el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
- el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
- };
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
- props = props.concat(hProps);
- el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
- el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
- };
- };
- if (scale == 'content' || scale == 'both') { // Scale the content
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- props = props.concat(cProps);
- el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
- el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
- };
- };
- $.effects.save(el, restore ? props : props1); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- el.css('overflow','hidden').css(el.from); // Shift
-
- // Animate
- if (scale == 'content' || scale == 'both') { // Scale the children
- vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
- hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
- props2 = props.concat(vProps).concat(hProps); // Concat
- el.find("*[width]").each(function(){
- child = $(this);
- if (restore) $.effects.save(child, props2);
- var c_original = {height: child.height(), width: child.width()}; // Save original
- child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
- child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
- child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
- };
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
- child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
- child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
- };
- child.css(child.from); // Shift children
- child.animate(child.to, o.duration, o.options.easing, function(){
- if (restore) $.effects.restore(child, props2); // Restore children
- }); // Animate children
- });
- };
-
- // Animate
- el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Shake
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.shake = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'left'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 3; // Default # of times
- var speed = o.duration || o.options.duration || 140; // Default speed per shake
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
-
- // Animation
- var animation = {}, animation1 = {}, animation2 = {};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
- animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
-
- // Animate
- el.animate(animation, speed, o.options.easing);
- for (var i = 1; i < times; i++) { // Shakes
- el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
- };
- el.animate(animation1, speed, o.options.easing).
- animate(animation, speed / 2, o.options.easing, function(){ // Last shake
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Slide
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.slide = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
- if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Transfer
- *
- * Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * effects.core.js
- */
-(function($) {
-
-$.effects.transfer = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var target = $(o.options.to); // Find Target
- var position = el.offset();
- var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body);
- if(o.options.className) transfer.addClass(o.options.className);
-
- // Set target css
- transfer.addClass(o.options.className);
- transfer.css({
- top: position.top,
- left: position.left,
- height: el.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
- width: el.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')),
- position: 'absolute'
- });
-
- // Animation
- position = target.offset();
- animation = {
- top: position.top,
- left: position.left,
- height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
- width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth'))
- };
-
- // Animate
- transfer.animate(animation, o.duration, o.options.easing, function() {
- transfer.remove(); // Remove div
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Accordion
- *
- * Copyright (c) 2007, 2008 Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.accordion", {
- init: function() {
- var options = this.options;
-
- if ( options.navigation ) {
- var current = this.element.find("a").filter(options.navigationFilter);
- if ( current.length ) {
- if ( current.filter(options.header).length ) {
- options.active = current;
- } else {
- options.active = current.parent().parent().prev();
- current.addClass("current");
- }
- }
- }
-
- // calculate active if not specified, using the first header
- options.headers = this.element.find(options.header);
- options.active = findActive(options.headers, options.active);
-
- // IE7-/Win - Extra vertical space in Lists fixed
- if ($.browser.msie) {
- this.element.find('a').css('zoom', '1');
- }
-
- if (!this.element.hasClass("ui-accordion")) {
- this.element.addClass("ui-accordion");
- $("<span class='ui-accordion-left'/>").insertBefore(options.headers);
- $("<span class='ui-accordion-right'/>").appendTo(options.headers);
- options.headers.addClass("ui-accordion-header").attr("tabindex", "0");
- }
-
- var maxHeight;
- if ( options.fillSpace ) {
- maxHeight = this.element.parent().height();
- options.headers.each(function() {
- maxHeight -= $(this).outerHeight();
- });
- var maxPadding = 0;
- options.headers.next().each(function() {
- maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
- }).height(maxHeight - maxPadding);
- } else if ( options.autoHeight ) {
- maxHeight = 0;
- options.headers.next().each(function() {
- maxHeight = Math.max(maxHeight, $(this).outerHeight());
- }).height(maxHeight);
- }
-
- options.headers
- .not(options.active || "")
- .next()
- .hide();
- options.active.parent().andSelf().addClass(options.selectedClass);
-
- if (options.event) {
- this.element.bind((options.event) + ".accordion", clickHandler);
- }
- },
- activate: function(index) {
- // call clickHandler with custom event
- clickHandler.call(this.element[0], {
- target: findActive( this.options.headers, index )[0]
- });
- },
- destroy: function() {
- this.options.headers.next().css("display", "");
- if ( this.options.fillSpace || this.options.autoHeight ) {
- this.options.headers.next().css("height", "");
- }
- $.removeData(this.element[0], "accordion");
- this.element.removeClass("ui-accordion").unbind(".accordion");
- }
-});
-
-function scopeCallback(callback, scope) {
- return function() {
- return callback.apply(scope, arguments);
- };
-};
-
-function completed(cancel) {
- // if removed while animated data can be empty
- if (!$.data(this, "accordion")) {
- return;
- }
-
- var instance = $.data(this, "accordion");
- var options = instance.options;
- options.running = cancel ? 0 : --options.running;
- if ( options.running ) {
- return;
- }
- if ( options.clearStyle ) {
- options.toShow.add(options.toHide).css({
- height: "",
- overflow: ""
- });
- }
- $(this).triggerHandler("accordionchange", [null, options.data], options.change);
-}
-
-function toggle(toShow, toHide, data, clickedActive, down) {
- var options = $.data(this, "accordion").options;
- options.toShow = toShow;
- options.toHide = toHide;
- options.data = data;
- var complete = scopeCallback(completed, this);
-
- // count elements to animate
- options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
-
- if ( options.animated ) {
- if ( !options.alwaysOpen && clickedActive ) {
- $.ui.accordion.animations[options.animated]({
- toShow: jQuery([]),
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight
- });
- } else {
- $.ui.accordion.animations[options.animated]({
- toShow: toShow,
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight
- });
- }
- } else {
- if ( !options.alwaysOpen && clickedActive ) {
- toShow.toggle();
- } else {
- toHide.hide();
- toShow.show();
- }
- complete(true);
- }
-}
-
-function clickHandler(event) {
- var options = $.data(this, "accordion").options;
- if (options.disabled) {
- return false;
- }
-
- // called only when using activate(false) to close all parts programmatically
- if ( !event.target && !options.alwaysOpen ) {
- options.active.parent().andSelf().toggleClass(options.selectedClass);
- var toHide = options.active.next(),
- data = {
- options: options,
- newHeader: jQuery([]),
- oldHeader: options.active,
- newContent: jQuery([]),
- oldContent: toHide
- },
- toShow = (options.active = $([]));
- toggle.call(this, toShow, toHide, data );
- return false;
- }
- // get the click target
- var clicked = $(event.target);
-
- // due to the event delegation model, we have to check if one
- // of the parent elements is our actual header, and find that
- // otherwise stick with the initial target
- clicked = $( clicked.parents(options.header)[0] || clicked );
-
- var clickedActive = clicked[0] == options.active[0];
-
- // if animations are still active, or the active header is the target, ignore click
- if (options.running || (options.alwaysOpen && clickedActive)) {
- return false;
- }
- if (!clicked.is(options.header)) {
- return;
- }
-
- // switch classes
- options.active.parent().andSelf().toggleClass(options.selectedClass);
- if ( !clickedActive ) {
- clicked.parent().andSelf().addClass(options.selectedClass);
- }
-
- // find elements to show and hide
- var toShow = clicked.next(),
- toHide = options.active.next(),
- //data = [clicked, options.active, toShow, toHide],
- data = {
- options: options,
- newHeader: clicked,
- oldHeader: options.active,
- newContent: toShow,
- oldContent: toHide
- },
- down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );
-
- options.active = clickedActive ? $([]) : clicked;
- toggle.call(this, toShow, toHide, data, clickedActive, down );
-
- return false;
-};
-
-function findActive(headers, selector) {
- return selector != undefined
- ? typeof selector == "number"
- ? headers.filter(":eq(" + selector + ")")
- : headers.not(headers.not(selector))
- : selector === false
- ? $([])
- : headers.filter(":eq(0)");
-}
-
-$.extend($.ui.accordion, {
- defaults: {
- selectedClass: "selected",
- alwaysOpen: true,
- animated: 'slide',
- event: "click",
- header: "a",
- autoHeight: true,
- running: 0,
- navigationFilter: function() {
- return this.href.toLowerCase() == location.href.toLowerCase();
- }
- },
- animations: {
- slide: function(options, additions) {
- options = $.extend({
- easing: "swing",
- duration: 300
- }, options, additions);
- if ( !options.toHide.size() ) {
- options.toShow.animate({height: "show"}, options);
- return;
- }
- var hideHeight = options.toHide.height(),
- showHeight = options.toShow.height(),
- difference = showHeight / hideHeight;
- options.toShow.css({ height: 0, overflow: 'hidden' }).show();
- options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
- step: function(now) {
- var current = (hideHeight - now) * difference;
- if ($.browser.msie || $.browser.opera) {
- current = Math.ceil(current);
- }
- options.toShow.height( current );
- },
- duration: options.duration,
- easing: options.easing,
- complete: function() {
- if ( !options.autoHeight ) {
- options.toShow.css("height", "auto");
- }
- options.complete();
- }
- });
- },
- bounceslide: function(options) {
- this.slide(options, {
- easing: options.down ? "bounceout" : "swing",
- duration: options.down ? 1000 : 200
- });
- },
- easeslide: function(options) {
- this.slide(options, {
- easing: "easeinout",
- duration: 700
- });
- }
- }
-});
-
-// deprecated, use accordion("activate", index) instead
-$.fn.activate = function(index) {
- return this.accordion("activate", index);
-};
-
-})(jQuery);
-/*
- * jQuery UI Datepicker
- *
- * Copyright (c) 2006, 2007, 2008 Marc Grabanski
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * ui.core.js
- *
- * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au).
- */
-
-(function($) { // hide the namespace
-
-/* Date picker manager.
- Use the singleton instance of this class, $.datepicker, to interact with the date picker.
- Settings for (groups of) date pickers are maintained in an instance object
- (DatepickerInstance), allowing multiple different settings on the same page. */
-
-function Datepicker() {
- this.debug = false; // Change this to true to start debugging
- this._nextId = 0; // Next ID for a date picker instance
- this._inst = []; // List of instances indexed by ID
- this._curInst = null; // The current instance in use
- this._disabledInputs = []; // List of date picker inputs that have been disabled
- this._datepickerShowing = false; // True if the popup picker is showing , false if not
- this._inDialog = false; // True if showing within a "dialog", false if not
- this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
- this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
- this._wrapClass = 'ui-datepicker-wrap'; // The name of the wrapper marker class
- this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
- this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
- this._promptClass = 'ui-datepicker-prompt'; // The name of the dialog prompt marker class
- this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
- this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
- this.regional = []; // Available regional settings, indexed by language code
- this.regional[''] = { // Default regional settings
- clearText: 'Clear', // Display text for clear link
- clearStatus: 'Erase the current date', // Status text for clear link
- closeText: 'Close', // Display text for close link
- closeStatus: 'Close without change', // Status text for close link
- prevText: '&#x3c;Prev', // Display text for previous month link
- prevStatus: 'Show the previous month', // Status text for previous month link
- nextText: 'Next&#x3e;', // Display text for next month link
- nextStatus: 'Show the next month', // Status text for next month link
- currentText: 'Today', // Display text for current month link
- currentStatus: 'Show the current month', // Status text for current month link
- monthNames: ['January','February','March','April','May','June',
- 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
- monthStatus: 'Show a different month', // Status text for selecting a month
- yearStatus: 'Show a different year', // Status text for selecting a year
- weekHeader: 'Wk', // Header for the week of the year column
- weekStatus: 'Week of the year', // Status text for the week of the year column
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
- dayStatus: 'Set DD as first week day', // Status text for the day of the week selection
- dateStatus: 'Select DD, M d', // Status text for the date selection
- dateFormat: 'mm/dd/yy', // See format options on parseDate
- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
- initStatus: 'Select a date', // Initial Status text on opening
- isRTL: false // True if right-to-left language, false if left-to-right
- };
- this._defaults = { // Global defaults for all the date picker instances
- showOn: 'focus', // 'focus' for popup on focus,
- // 'button' for trigger button, or 'both' for either
- showAnim: 'show', // Name of jQuery animation for popup
- defaultDate: null, // Used when field is blank: actual date,
- // +/-number for offset from today, null for today
- appendText: '', // Display text following the input box, e.g. showing the format
- buttonText: '...', // Text for trigger button
- buttonImage: '', // URL for trigger button image
- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
- closeAtTop: true, // True to have the clear/close at the top,
- // false to have them at the bottom
- mandatory: false, // True to hide the Clear link, false to include it
- hideIfNoPrevNext: false, // True to hide next/previous month links
- // if not applicable, false to just disable them
- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
- changeMonth: true, // True if month can be selected directly, false if only prev/next
- changeYear: true, // True if year can be selected directly, false if only prev/next
- yearRange: '-10:+10', // Range of years to display in drop-down,
- // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
- changeFirstDay: true, // True to click on day name to change, false to remain as set
- highlightWeek: false, // True to highlight the selected week
- showOtherMonths: false, // True to show dates in other months, false to leave blank
- showWeeks: false, // True to show week of the year, false to omit
- calculateWeek: this.iso8601Week, // How to calculate the week of the year,
- // takes a Date and returns the number of the week for it
- shortYearCutoff: '+10', // Short year values < this are in the current century,
- // > this are in the previous century,
- // string value starting with '+' for current year + value
- showStatus: false, // True to show status bar at bottom, false to not show it
- statusForDate: this.dateStatus, // Function to provide status text for a date -
- // takes date and instance as parameters, returns display text
- minDate: null, // The earliest selectable date, or null for no limit
- maxDate: null, // The latest selectable date, or null for no limit
- speed: 'normal', // Speed of display/closure
- beforeShowDay: null, // Function that takes a date and returns an array with
- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
- // [2] = cell title (optional), e.g. $.datepicker.noWeekends
- beforeShow: null, // Function that takes an input field and
- // returns a set of custom settings for the date picker
- onSelect: null, // Define a callback function when a date is selected
- onChangeMonthYear: null, // Define a callback function when the month or year is changed
- onClose: null, // Define a callback function when the datepicker is closed
- numberOfMonths: 1, // Number of months to show at a time
- stepMonths: 1, // Number of months to step back/forward
- rangeSelect: false, // Allows for selecting a date range on one date picker
- rangeSeparator: ' - ', // Text between two dates in a range
- altField: '', // Selector for an alternate field to store selected dates into
- altFormat: '' // The date format to use for the alternate field
- };
- $.extend(this._defaults, this.regional['']);
- this._datepickerDiv = $('<div id="' + this._mainDivId + '"></div>');
-}
-
-$.extend(Datepicker.prototype, {
- /* Class name added to elements to indicate already configured with a date picker. */
- markerClassName: 'hasDatepicker',
-
- /* Debug logging (if enabled). */
- log: function () {
- if (this.debug)
- console.log.apply('', arguments);
- },
-
- /* Register a new date picker instance - with custom settings. */
- _register: function(inst) {
- var id = this._nextId++;
- this._inst[id] = inst;
- return id;
- },
-
- /* Retrieve a particular date picker instance based on its ID. */
- _getInst: function(id) {
- return this._inst[id] || id;
- },
-
- /* Override the default settings for all instances of the date picker.
- @param settings object - the new settings to use as defaults (anonymous object)
- @return the manager object */
- setDefaults: function(settings) {
- extendRemove(this._defaults, settings || {});
- return this;
- },
-
- /* Attach the date picker to a jQuery selection.
- @param target element - the target input field or division or span
- @param settings object - the new settings to use for this date picker instance (anonymous) */
- _attachDatepicker: function(target, settings) {
- // check for settings on the control itself - in namespace 'date:'
- var inlineSettings = null;
- for (attrName in this._defaults) {
- var attrValue = target.getAttribute('date:' + attrName);
- if (attrValue) {
- inlineSettings = inlineSettings || {};
- try {
- inlineSettings[attrName] = eval(attrValue);
- } catch (err) {
- inlineSettings[attrName] = attrValue;
- }
- }
- }
- var nodeName = target.nodeName.toLowerCase();
- var instSettings = (inlineSettings ?
- $.extend(settings || {}, inlineSettings) : settings);
- if (nodeName == 'input') {
- var inst = (inst && !inlineSettings ? inst :
- new DatepickerInstance(instSettings, false));
- this._connectDatepicker(target, inst);
- } else if (nodeName == 'div' || nodeName == 'span') {
- var inst = new DatepickerInstance(instSettings, true);
- this._inlineDatepicker(target, inst);
- }
- },
-
- /* Detach a datepicker from its control.
- @param target element - the target input field or division or span */
- _destroyDatepicker: function(target) {
- var nodeName = target.nodeName.toLowerCase();
- var calId = target._calId;
- var $target = $(target);
- $target.removeAttr('_calId');
- if (nodeName == 'input') {
- $target.siblings('.' + this._appendClass).replaceWith('').end()
- .siblings('.' + this._triggerClass).replaceWith('').end()
- .removeClass(this.markerClassName)
- .unbind('focus', this._showDatepicker)
- .unbind('keydown', this._doKeyDown)
- .unbind('keypress', this._doKeyPress);
- var wrapper = $target.parents('.' + this._wrapClass);
- if (wrapper)
- wrapper.siblings('.' + this._appendClass).replaceWith('').end()
- .replaceWith(wrapper.html());
- } else if (nodeName == 'div' || nodeName == 'span')
- $target.removeClass(this.markerClassName).empty();
- if ($('input[_calId=' + calId + ']').length == 0)
- // clean up if last for this ID
- this._inst[calId] = null;
- },
-
- /* Enable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _enableDatepicker: function(target) {
- target.disabled = false;
- $(target).siblings('button.' + this._triggerClass).each(function() { this.disabled = false; }).end()
- .siblings('img.' + this._triggerClass).css({opacity: '1.0', cursor: ''});
- this._disabledInputs = $.map(this._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- },
-
- /* Disable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _disableDatepicker: function(target) {
- target.disabled = true;
- $(target).siblings('button.' + this._triggerClass).each(function() { this.disabled = true; }).end()
- .siblings('img.' + this._triggerClass).css({opacity: '0.5', cursor: 'default'});
- this._disabledInputs = $.map($.datepicker._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- this._disabledInputs[$.datepicker._disabledInputs.length] = target;
- },
-
- /* Is the first field in a jQuery collection disabled as a datepicker?
- @param target element - the target input field or division or span
- @return boolean - true if disabled, false if enabled */
- _isDisabledDatepicker: function(target) {
- if (!target)
- return false;
- for (var i = 0; i < this._disabledInputs.length; i++) {
- if (this._disabledInputs[i] == target)
- return true;
- }
- return false;
- },
-
- /* Update the settings for a date picker attached to an input field or division.
- @param target element - the target input field or division or span
- @param name string - the name of the setting to change or
- object - the new settings to update
- @param value any - the new value for the setting (omit if above is an object) */
- _changeDatepicker: function(target, name, value) {
- var settings = name || {};
- if (typeof name == 'string') {
- settings = {};
- settings[name] = value;
- }
- if (inst = this._getInst(target._calId)) {
- extendRemove(inst._settings, settings);
- this._updateDatepicker(inst);
- }
- },
-
- /* Set the dates for a jQuery selection.
- @param target element - the target input field or division or span
- @param date Date - the new date
- @param endDate Date - the new end date for a range (optional) */
- _setDateDatepicker: function(target, date, endDate) {
- if (inst = this._getInst(target._calId)) {
- inst._setDate(date, endDate);
- this._updateDatepicker(inst);
- }
- },
-
- /* Get the date(s) for the first entry in a jQuery selection.
- @param target element - the target input field or division or span
- @return Date - the current date or
- Date[2] - the current dates for a range */
- _getDateDatepicker: function(target) {
- var inst = this._getInst(target._calId);
- if (inst)
- inst._setDateFromField($(target));
- return (inst ? inst._getDate() : null);
- },
-
- /* Handle keystrokes. */
- _doKeyDown: function(e) {
- var inst = $.datepicker._getInst(this._calId);
- if ($.datepicker._datepickerShowing)
- switch (e.keyCode) {
- case 9: $.datepicker._hideDatepicker(null, '');
- break; // hide on tab out
- case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear,
- $('td.ui-datepicker-days-cell-over', inst._datepickerDiv)[0]);
- return false; // don't submit the form
- break; // select the value on enter
- case 27: $.datepicker._hideDatepicker(null, inst._get('speed'));
- break; // hide on escape
- case 33: $.datepicker._adjustDate(inst,
- (e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
- break; // previous month/year on page up/+ ctrl
- case 34: $.datepicker._adjustDate(inst,
- (e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
- break; // next month/year on page down/+ ctrl
- case 35: if (e.ctrlKey) $.datepicker._clearDate(inst);
- break; // clear on ctrl+end
- case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst);
- break; // current on ctrl+home
- case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D');
- break; // -1 day on ctrl+left
- case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D');
- break; // -1 week on ctrl+up
- case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D');
- break; // +1 day on ctrl+right
- case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D');
- break; // +1 week on ctrl+down
- }
- else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home
- $.datepicker._showDatepicker(this);
- },
-
- /* Filter entered characters - based on date format. */
- _doKeyPress: function(e) {
- var inst = $.datepicker._getInst(this._calId);
- var chars = $.datepicker._possibleChars(inst._get('dateFormat'));
- var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode);
- return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
- },
-
- /* Attach the date picker to an input field. */
- _connectDatepicker: function(target, inst) {
- var input = $(target);
- if (input.hasClass(this.markerClassName))
- return;
- var appendText = inst._get('appendText');
- var isRTL = inst._get('isRTL');
- if (appendText)
- input[isRTL ? 'before' : 'after']('<span class="' + this._appendClass + '">' + appendText + '</span>');
- var showOn = inst._get('showOn');
- if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
- input.focus(this._showDatepicker);
- if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
- input.wrap('<span class="' + this._wrapClass + '"></span>');
- var buttonText = inst._get('buttonText');
- var buttonImage = inst._get('buttonImage');
- var trigger = $(inst._get('buttonImageOnly') ?
- $('<img/>').addClass(this._triggerClass).attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
- $('<button></button>').addClass(this._triggerClass).html(buttonImage != '' ?
- $('<img/>').attr({ src:buttonImage, alt:buttonText, title:buttonText }) : buttonText));
- input[isRTL ? 'before' : 'after'](trigger);
- trigger.click(function() {
- if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
- $.datepicker._hideDatepicker();
- else
- $.datepicker._showDatepicker(target);
- });
- }
- input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress)
- .bind("setData.datepicker", function(event, key, value) {
- inst._settings[key] = value;
- }).bind("getData.datepicker", function(event, key) {
- return inst._get(key);
- });
- input[0]._calId = inst._id;
- },
-
- /* Attach an inline date picker to a div. */
- _inlineDatepicker: function(target, inst) {
- var input = $(target);
- if (input.hasClass(this.markerClassName))
- return;
- input.addClass(this.markerClassName).append(inst._datepickerDiv)
- .bind("setData.datepicker", function(event, key, value){
- inst._settings[key] = value;
- }).bind("getData.datepicker", function(event, key){
- return inst._get(key);
- });
- input[0]._calId = inst._id;
- this._updateDatepicker(inst);
- },
-
- /* Tidy up after displaying the date picker. */
- _inlineShow: function(inst) {
- var numMonths = inst._getNumberOfMonths(); // fix width for dynamic number of date pickers
- inst._datepickerDiv.width(numMonths[1] * $('.ui-datepicker', inst._datepickerDiv[0]).width());
- },
-
- /* Pop-up the date picker in a "dialog" box.
- @param input element - ignored
- @param dateText string - the initial date to display (in the current format)
- @param onSelect function - the function(dateText) to call when a date is selected
- @param settings object - update the dialog date picker instance's settings (anonymous object)
- @param pos int[2] - coordinates for the dialog's position within the screen or
- event - with x/y coordinates or
- leave empty for default (screen centre)
- @return the manager object */
- _dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
- var inst = this._dialogInst; // internal instance
- if (!inst) {
- inst = this._dialogInst = new DatepickerInstance({}, false);
- this._dialogInput = $('<input type="text" size="1" style="position: absolute; top: -100px;"/>');
- this._dialogInput.keydown(this._doKeyDown);
- $('body').append(this._dialogInput);
- this._dialogInput[0]._calId = inst._id;
- }
- extendRemove(inst._settings, settings || {});
- this._dialogInput.val(dateText);
-
- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
- if (!this._pos) {
- var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
- var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- this._pos = // should use actual width/height below
- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
- }
-
- // move input on screen for focus, but hidden behind dialog
- this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
- inst._settings.onSelect = onSelect;
- this._inDialog = true;
- this._datepickerDiv.addClass(this._dialogClass);
- this._showDatepicker(this._dialogInput[0]);
- if ($.blockUI)
- $.blockUI(this._datepickerDiv);
- return this;
- },
-
- /* Pop-up the date picker for a given input field.
- @param input element - the input field attached to the date picker or
- event - if triggered by focus */
- _showDatepicker: function(input) {
- input = input.target || input;
- if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
- input = $('input', input.parentNode)[0];
- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
- return;
- var inst = $.datepicker._getInst(input._calId);
- var beforeShow = inst._get('beforeShow');
- extendRemove(inst._settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
- $.datepicker._hideDatepicker(null, '');
- $.datepicker._lastInput = input;
- inst._setDateFromField(input);
- if ($.datepicker._inDialog) // hide cursor
- input.value = '';
- if (!$.datepicker._pos) { // position below input
- $.datepicker._pos = $.datepicker._findPos(input);
- $.datepicker._pos[1] += input.offsetHeight; // add the height
- }
- var isFixed = false;
- $(input).parents().each(function() {
- isFixed |= $(this).css('position') == 'fixed';
- return !isFixed;
- });
- if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
- $.datepicker._pos[0] -= document.documentElement.scrollLeft;
- $.datepicker._pos[1] -= document.documentElement.scrollTop;
- }
- var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
- $.datepicker._pos = null;
- inst._rangeStart = null;
- // determine sizing offscreen
- inst._datepickerDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
- $.datepicker._updateDatepicker(inst);
- // fix width for dynamic number of date pickers
- inst._datepickerDiv.width(inst._getNumberOfMonths()[1] *
- $('.ui-datepicker', inst._datepickerDiv[0])[0].offsetWidth);
- // and adjust position before showing
- offset = $.datepicker._checkOffset(inst, offset, isFixed);
- inst._datepickerDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
- 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
- left: offset.left + 'px', top: offset.top + 'px'});
- if (!inst._inline) {
- var showAnim = inst._get('showAnim') || 'show';
- var speed = inst._get('speed');
- var postProcess = function() {
- $.datepicker._datepickerShowing = true;
- if ($.browser.msie && parseInt($.browser.version) < 7) // fix IE < 7 select problems
- $('iframe.ui-datepicker-cover').css({width: inst._datepickerDiv.width() + 4,
- height: inst._datepickerDiv.height() + 4});
- };
- inst._datepickerDiv[showAnim](speed, postProcess);
- if (speed == '')
- postProcess();
- if (inst._input[0].type != 'hidden')
- inst._input[0].focus();
- $.datepicker._curInst = inst;
- }
- },
-
- /* Generate the date picker content. */
- _updateDatepicker: function(inst) {
- var dims = {width: inst._datepickerDiv.width() + 4,
- height: inst._datepickerDiv.height() + 4};
- inst._datepickerDiv.empty().append(inst._generateDatepicker()).
- find('iframe.ui-datepicker-cover').
- css({width: dims.width, height: dims.height});
- var numMonths = inst._getNumberOfMonths();
- if (numMonths[0] != 1 || numMonths[1] != 1)
- inst._datepickerDiv.addClass('ui-datepicker-multi');
- else
- inst._datepickerDiv.removeClass('ui-datepicker-multi');
-
- if (inst._get('isRTL'))
- inst._datepickerDiv.addClass('ui-datepicker-rtl');
- else
- inst._datepickerDiv.removeClass('ui-datepicker-rtl');
-
- if (inst._input && inst._input[0].type != 'hidden')
- $(inst._input[0]).focus();
- },
-
- /* Check positioning to remain on screen. */
- _checkOffset: function(inst, offset, isFixed) {
- var pos = inst._input ? $.datepicker._findPos(inst._input[0]) : null;
- var browserWidth = window.innerWidth || document.documentElement.clientWidth;
- var browserHeight = window.innerHeight || document.documentElement.clientHeight;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- // reposition date picker horizontally if outside the browser window
- if ((offset.left + inst._datepickerDiv.width() - scrollX) > browserWidth)
- offset.left = Math.max((isFixed ? 0 : scrollX),
- pos[0] + (inst._input ? inst._input.width() : 0) - (isFixed ? scrollX : 0) - inst._datepickerDiv.width() -
- (isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0));
- else
- offset.left -= (isFixed ? scrollX : 0);
- // reposition date picker vertically if outside the browser window
- if ((offset.top + inst._datepickerDiv.height() - scrollY) > browserHeight)
- offset.top = Math.max((isFixed ? 0 : scrollY),
- pos[1] - (isFixed ? scrollY : 0) - (this._inDialog ? 0 : inst._datepickerDiv.height()) -
- (isFixed && $.browser.opera ? document.documentElement.scrollTop : 0));
- else
- offset.top -= (isFixed ? scrollY : 0);
- return offset;
- },
-
- /* Find an object's position on the screen. */
- _findPos: function(obj) {
- while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
- obj = obj.nextSibling;
- }
- var position = $(obj).offset();
- return [position.left, position.top];
- },
-
- /* Hide the date picker from view.
- @param input element - the input field attached to the date picker
- @param speed string - the speed at which to close the date picker */
- _hideDatepicker: function(input, speed) {
- var inst = this._curInst;
- if (!inst)
- return;
- var rangeSelect = inst._get('rangeSelect');
- if (rangeSelect && this._stayOpen)
- this._selectDate(inst, inst._formatDate(
- inst._currentDay, inst._currentMonth, inst._currentYear));
- this._stayOpen = false;
- if (this._datepickerShowing) {
- speed = (speed != null ? speed : inst._get('speed'));
- var showAnim = inst._get('showAnim');
- inst._datepickerDiv[(showAnim == 'slideDown' ? 'slideUp' :
- (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))](speed, function() {
- $.datepicker._tidyDialog(inst);
- });
- if (speed == '')
- this._tidyDialog(inst);
- var onClose = inst._get('onClose');
- if (onClose)
- onClose.apply((inst._input ? inst._input[0] : null),
- [inst._getDate(), inst]); // trigger custom callback
- this._datepickerShowing = false;
- this._lastInput = null;
- inst._settings.prompt = null;
- if (this._inDialog) {
- this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
- if ($.blockUI) {
- $.unblockUI();
- $('body').append(this._datepickerDiv);
- }
- }
- this._inDialog = false;
- }
- this._curInst = null;
- },
-
- /* Tidy up after a dialog display. */
- _tidyDialog: function(inst) {
- inst._datepickerDiv.removeClass(this._dialogClass).unbind('.ui-datepicker');
- $('.' + this._promptClass, inst._datepickerDiv).remove();
- },
-
- /* Close date picker if clicked elsewhere. */
- _checkExternalClick: function(event) {
- if (!$.datepicker._curInst)
- return;
- var $target = $(event.target);
- if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
- !$target.hasClass($.datepicker.markerClassName) &&
- !$target.hasClass($.datepicker._triggerClass) &&
- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
- $.datepicker._hideDatepicker(null, '');
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(id, offset, period) {
- var inst = this._getInst(id);
- inst._adjustDate(offset, period);
- this._updateDatepicker(inst);
- },
-
- /* Action for current link. */
- _gotoToday: function(id) {
- var date = new Date();
- var inst = this._getInst(id);
- inst._selectedDay = date.getDate();
- inst._drawMonth = inst._selectedMonth = date.getMonth();
- inst._drawYear = inst._selectedYear = date.getFullYear();
- this._adjustDate(inst);
- inst._notifyChange();
- },
-
- /* Action for selecting a new month/year. */
- _selectMonthYear: function(id, select, period) {
- var inst = this._getInst(id);
- inst._selectingMonthYear = false;
- inst[period == 'M' ? '_drawMonth' : '_drawYear'] =
- select.options[select.selectedIndex].value - 0;
- this._adjustDate(inst);
- inst._notifyChange();
- },
-
- /* Restore input focus after not changing month/year. */
- _clickMonthYear: function(id) {
- var inst = this._getInst(id);
- if (inst._input && inst._selectingMonthYear && !$.browser.msie)
- inst._input[0].focus();
- inst._selectingMonthYear = !inst._selectingMonthYear;
- },
-
- /* Action for changing the first week day. */
- _changeFirstDay: function(id, day) {
- var inst = this._getInst(id);
- inst._settings.firstDay = day;
- this._updateDatepicker(inst);
- },
-
- /* Action for selecting a day. */
- _selectDay: function(id, month, year, td) {
- if ($(td).hasClass(this._unselectableClass))
- return;
- var inst = this._getInst(id);
- var rangeSelect = inst._get('rangeSelect');
- if (rangeSelect) {
- this._stayOpen = !this._stayOpen;
- if (this._stayOpen) {
- $('.ui-datepicker td').removeClass(this._currentClass);
- $(td).addClass(this._currentClass);
- }
- }
- inst._selectedDay = inst._currentDay = $('a', td).html();
- inst._selectedMonth = inst._currentMonth = month;
- inst._selectedYear = inst._currentYear = year;
- if (this._stayOpen) {
- inst._endDay = inst._endMonth = inst._endYear = null;
- }
- else if (rangeSelect) {
- inst._endDay = inst._currentDay;
- inst._endMonth = inst._currentMonth;
- inst._endYear = inst._currentYear;
- }
- this._selectDate(id, inst._formatDate(
- inst._currentDay, inst._currentMonth, inst._currentYear));
- if (this._stayOpen) {
- inst._rangeStart = new Date(inst._currentYear, inst._currentMonth, inst._currentDay);
- this._updateDatepicker(inst);
- }
- else if (rangeSelect) {
- inst._selectedDay = inst._currentDay = inst._rangeStart.getDate();
- inst._selectedMonth = inst._currentMonth = inst._rangeStart.getMonth();
- inst._selectedYear = inst._currentYear = inst._rangeStart.getFullYear();
- inst._rangeStart = null;
- if (inst._inline)
- this._updateDatepicker(inst);
- }
- },
-
- /* Erase the input field and hide the date picker. */
- _clearDate: function(id) {
- var inst = this._getInst(id);
- if (inst._get('mandatory'))
- return;
- this._stayOpen = false;
- inst._endDay = inst._endMonth = inst._endYear = inst._rangeStart = null;
- this._selectDate(inst, '');
- },
-
- /* Update the input field with the selected date. */
- _selectDate: function(id, dateStr) {
- var inst = this._getInst(id);
- dateStr = (dateStr != null ? dateStr : inst._formatDate());
- if (inst._get('rangeSelect') && dateStr)
- dateStr = (inst._rangeStart ? inst._formatDate(inst._rangeStart) :
- dateStr) + inst._get('rangeSeparator') + dateStr;
- if (inst._input)
- inst._input.val(dateStr);
- this._updateAlternate(inst);
- var onSelect = inst._get('onSelect');
- if (onSelect)
- onSelect.apply((inst._input ? inst._input[0] : null), [dateStr, inst]); // trigger custom callback
- else if (inst._input)
- inst._input.trigger('change'); // fire the change event
- if (inst._inline)
- this._updateDatepicker(inst);
- else if (!this._stayOpen) {
- this._hideDatepicker(null, inst._get('speed'));
- this._lastInput = inst._input[0];
- if (typeof(inst._input[0]) != 'object')
- inst._input[0].focus(); // restore focus
- this._lastInput = null;
- }
- },
-
- /* Update any alternate field to synchronise with the main field. */
- _updateAlternate: function(inst) {
- var altField = inst._get('altField');
- if (altField) { // update alternate field too
- var altFormat = inst._get('altFormat');
- var date = inst._getDate();
- dateStr = (isArray(date) ? (!date[0] && !date[1] ? '' :
- $.datepicker.formatDate(altFormat, date[0], inst._getFormatConfig()) +
- inst._get('rangeSeparator') + $.datepicker.formatDate(
- altFormat, date[1] || date[0], inst._getFormatConfig())) :
- $.datepicker.formatDate(altFormat, date, inst._getFormatConfig()));
- $(altField).each(function() { $(this).val(dateStr); });
- }
- },
-
- /* Set as beforeShowDay function to prevent selection of weekends.
- @param date Date - the date to customise
- @return [boolean, string] - is this date selectable?, what is its CSS class? */
- noWeekends: function(date) {
- var day = date.getDay();
- return [(day > 0 && day < 6), ''];
- },
-
- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
- @param date Date - the date to get the week for
- @return number - the number of the week within the year that contains this date */
- iso8601Week: function(date) {
- var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), (date.getTimezoneOffset() / -60));
- var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
- var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
- firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
- if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
- checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
- return $.datepicker.iso8601Week(checkDate);
- } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
- firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
- if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
- checkDate.setDate(checkDate.getDate() + 3); // Generate for next year
- return $.datepicker.iso8601Week(checkDate);
- }
- }
- return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
- },
-
- /* Provide status text for a particular date.
- @param date the date to get the status for
- @param inst the current datepicker instance
- @return the status display text for this date */
- dateStatus: function(date, inst) {
- return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig());
- },
-
- /* Parse a string value into a date object.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- '...' - literal text
- '' - single quote
-
- @param format String - the expected format of the date
- @param value String - the date in the above format
- @param settings Object - attributes include:
- shortYearCutoff Number - the cutoff year for determining the century (optional)
- dayNamesShort String[7] - abbreviated names of the days from Sunday (optional)
- dayNames String[7] - names of the days from Sunday (optional)
- monthNamesShort String[12] - abbreviated names of the months (optional)
- monthNames String[12] - names of the months (optional)
- @return Date - the extracted date value or null if value is blank */
- parseDate: function (format, value, settings) {
- if (format == null || value == null)
- throw 'Invalid arguments';
- value = (typeof value == 'object' ? value.toString() : value + '');
- if (value == '')
- return null;
- var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- var year = -1;
- var month = -1;
- var day = -1;
- var literal = false;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Extract a number from the string value
- var getNumber = function(match) {
- lookAhead(match);
- var size = (match == 'y' ? 4 : 2);
- var num = 0;
- while (size > 0 && iValue < value.length &&
- value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
- num = num * 10 + (value.charAt(iValue++) - 0);
- size--;
- }
- if (size == (match == 'y' ? 4 : 2))
- throw 'Missing number at position ' + iValue;
- return num;
- };
- // Extract a name from the string value and convert to an index
- var getName = function(match, shortNames, longNames) {
- var names = (lookAhead(match) ? longNames : shortNames);
- var size = 0;
- for (var j = 0; j < names.length; j++)
- size = Math.max(size, names[j].length);
- var name = '';
- var iInit = iValue;
- while (size > 0 && iValue < value.length) {
- name += value.charAt(iValue++);
- for (var i = 0; i < names.length; i++)
- if (name == names[i])
- return i + 1;
- size--;
- }
- throw 'Unknown name at position ' + iInit;
- };
- // Confirm that a literal character matches the string value
- var checkLiteral = function() {
- if (value.charAt(iValue) != format.charAt(iFormat))
- throw 'Unexpected literal at position ' + iValue;
- iValue++;
- };
- var iValue = 0;
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- checkLiteral();
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- day = getNumber('d');
- break;
- case 'D':
- getName('D', dayNamesShort, dayNames);
- break;
- case 'm':
- month = getNumber('m');
- break;
- case 'M':
- month = getName('M', monthNamesShort, monthNames);
- break;
- case 'y':
- year = getNumber('y');
- break;
- case "'":
- if (lookAhead("'"))
- checkLiteral();
- else
- literal = true;
- break;
- default:
- checkLiteral();
- }
- }
- if (year < 100)
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
- (year <= shortYearCutoff ? 0 : -100);
- var date = new Date(year, month - 1, day);
- if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
- throw 'Invalid date'; // E.g. 31/02/*
- return date;
- },
-
- /* Format a date object into a string value.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- '...' - literal text
- '' - single quote
-
- @param format String - the desired format of the date
- @param date Date - the date value to format
- @param settings Object - attributes include:
- dayNamesShort String[7] - abbreviated names of the days from Sunday (optional)
- dayNames String[7] - names of the days from Sunday (optional)
- monthNamesShort String[12] - abbreviated names of the months (optional)
- monthNames String[12] - names of the months (optional)
- @return String - the date in the above format */
- formatDate: function (format, date, settings) {
- if (!date)
- return '';
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Format a number, with leading zero if necessary
- var formatNumber = function(match, value) {
- return (lookAhead(match) && value < 10 ? '0' : '') + value;
- };
- // Format a name, short or long as requested
- var formatName = function(match, value, shortNames, longNames) {
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
- };
- var output = '';
- var literal = false;
- if (date)
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- output += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- output += formatNumber('d', date.getDate());
- break;
- case 'D':
- output += formatName('D', date.getDay(), dayNamesShort, dayNames);
- break;
- case 'm':
- output += formatNumber('m', date.getMonth() + 1);
- break;
- case 'M':
- output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
- break;
- case 'y':
- output += (lookAhead('y') ? date.getFullYear() :
- (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
- break;
- case "'":
- if (lookAhead("'"))
- output += "'";
- else
- literal = true;
- break;
- default:
- output += format.charAt(iFormat);
- }
- }
- return output;
- },
-
- /* Extract all possible characters from the date format. */
- _possibleChars: function (format) {
- var chars = '';
- var literal = false;
- for (var iFormat = 0; iFormat < format.length; iFormat++)
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- chars += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd': case 'm': case 'y':
- chars += '0123456789';
- break;
- case 'D': case 'M':
- return null; // Accept anything
- case "'":
- if (lookAhead("'"))
- chars += "'";
- else
- literal = true;
- break;
- default:
- chars += format.charAt(iFormat);
- }
- return chars;
- }
-});
-
-/* Individualised settings for date picker functionality applied to one or more related inputs.
- Instances are managed and manipulated through the Datepicker manager. */
-function DatepickerInstance(settings, inline) {
- this._id = $.datepicker._register(this);
- this._selectedDay = 0; // Current date for selection
- this._selectedMonth = 0; // 0-11
- this._selectedYear = 0; // 4-digit year
- this._drawMonth = 0; // Current month at start of datepicker
- this._drawYear = 0;
- this._input = null; // The attached input field
- this._inline = inline; // True if showing inline, false if used in a popup
- this._datepickerDiv = (!inline ? $.datepicker._datepickerDiv :
- $('<div id="' + $.datepicker._mainDivId + '-' + this._id + '" class="ui-datepicker-inline">'));
- // customise the date picker object - uses manager defaults if not overridden
- this._settings = extendRemove(settings || {}); // clone
- if (inline)
- this._setDate(this._getDefaultDate());
-}
-
-$.extend(DatepickerInstance.prototype, {
- /* Get a setting value, defaulting if necessary. */
- _get: function(name) {
- return this._settings[name] !== undefined ? this._settings[name] : $.datepicker._defaults[name];
- },
-
- /* Parse existing date and initialise date picker. */
- _setDateFromField: function(input) {
- this._input = $(input);
- var dateFormat = this._get('dateFormat');
- var dates = this._input ? this._input.val().split(this._get('rangeSeparator')) : null;
- this._endDay = this._endMonth = this._endYear = null;
- var date = defaultDate = this._getDefaultDate();
- if (dates.length > 0) {
- var settings = this._getFormatConfig();
- if (dates.length > 1) {
- date = $.datepicker.parseDate(dateFormat, dates[1], settings) || defaultDate;
- this._endDay = date.getDate();
- this._endMonth = date.getMonth();
- this._endYear = date.getFullYear();
- }
- try {
- date = $.datepicker.parseDate(dateFormat, dates[0], settings) || defaultDate;
- } catch (e) {
- $.datepicker.log(e);
- date = defaultDate;
- }
- }
- this._selectedDay = date.getDate();
- this._drawMonth = this._selectedMonth = date.getMonth();
- this._drawYear = this._selectedYear = date.getFullYear();
- this._currentDay = (dates[0] ? date.getDate() : 0);
- this._currentMonth = (dates[0] ? date.getMonth() : 0);
- this._currentYear = (dates[0] ? date.getFullYear() : 0);
- this._adjustDate();
- },
-
- /* Retrieve the default date shown on opening. */
- _getDefaultDate: function() {
- var date = this._determineDate('defaultDate', new Date());
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- date = (minDate && date < minDate ? minDate : date);
- date = (maxDate && date > maxDate ? maxDate : date);
- return date;
- },
-
- /* A date may be specified as an exact value or a relative one. */
- _determineDate: function(name, defaultDate) {
- var offsetNumeric = function(offset) {
- var date = new Date();
- date.setDate(date.getDate() + offset);
- return date;
- };
- var offsetString = function(offset, getDaysInMonth) {
- var date = new Date();
- var year = date.getFullYear();
- var month = date.getMonth();
- var day = date.getDate();
- var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
- var matches = pattern.exec(offset);
- while (matches) {
- switch (matches[2] || 'd') {
- case 'd' : case 'D' :
- day += (matches[1] - 0); break;
- case 'w' : case 'W' :
- day += (matches[1] * 7); break;
- case 'm' : case 'M' :
- month += (matches[1] - 0);
- day = Math.min(day, getDaysInMonth(year, month));
- break;
- case 'y': case 'Y' :
- year += (matches[1] - 0);
- day = Math.min(day, getDaysInMonth(year, month));
- break;
- }
- matches = pattern.exec(offset);
- }
- return new Date(year, month, day);
- };
- var date = this._get(name);
- return (date == null ? defaultDate :
- (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
- (typeof date == 'number' ? offsetNumeric(date) : date)));
- },
-
- /* Set the date(s) directly. */
- _setDate: function(date, endDate) {
- this._selectedDay = this._currentDay = date.getDate();
- this._drawMonth = this._selectedMonth = this._currentMonth = date.getMonth();
- this._drawYear = this._selectedYear = this._currentYear = date.getFullYear();
- if (this._get('rangeSelect')) {
- if (endDate) {
- this._endDay = endDate.getDate();
- this._endMonth = endDate.getMonth();
- this._endYear = endDate.getFullYear();
- } else {
- this._endDay = this._currentDay;
- this._endMonth = this._currentMonth;
- this._endYear = this._currentYear;
- }
- }
- this._adjustDate();
- },
-
- /* Retrieve the date(s) directly. */
- _getDate: function() {
- var startDate = (!this._currentYear || (this._input && this._input.val() == '') ? null :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- if (this._get('rangeSelect')) {
- return [this._rangeStart || startDate, (!this._endYear ? null :
- new Date(this._endYear, this._endMonth, this._endDay))];
- } else
- return startDate;
- },
-
- /* Generate the HTML for the current state of the date picker. */
- _generateDatepicker: function() {
- var today = new Date();
- today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // clear time
- var showStatus = this._get('showStatus');
- var isRTL = this._get('isRTL');
- // build the date picker HTML
- var clear = (this._get('mandatory') ? '' :
- '<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('clearStatus') || '&#xa0;') : '') + '>' +
- this._get('clearText') + '</a></div>');
- var controls = '<div class="ui-datepicker-control">' + (isRTL ? '' : clear) +
- '<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"' +
- (showStatus ? this._addStatus(this._get('closeStatus') || '&#xa0;') : '') + '>' +
- this._get('closeText') + '</a></div>' + (isRTL ? clear : '') + '</div>';
- var prompt = this._get('prompt');
- var closeAtTop = this._get('closeAtTop');
- var hideIfNoPrevNext = this._get('hideIfNoPrevNext');
- var navigationAsDateFormat = this._get('navigationAsDateFormat');
- var numMonths = this._getNumberOfMonths();
- var stepMonths = this._get('stepMonths');
- var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- var drawMonth = this._drawMonth;
- var drawYear = this._drawYear;
- if (maxDate) {
- var maxDraw = new Date(maxDate.getFullYear(),
- maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate());
- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
- while (new Date(drawYear, drawMonth, 1) > maxDraw) {
- drawMonth--;
- if (drawMonth < 0) {
- drawMonth = 11;
- drawYear--;
- }
- }
- }
- // controls and links
- var prevText = this._get('prevText');
- prevText = (!navigationAsDateFormat ? prevText : $.datepicker.formatDate(
- prevText, new Date(drawYear, drawMonth - stepMonths, 1), this._getFormatConfig()));
- var prev = '<div class="ui-datepicker-prev">' + (this._canAdjustMonth(-1, drawYear, drawMonth) ?
- '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', -' + stepMonths + ', \'M\');"' +
- (showStatus ? this._addStatus(this._get('prevStatus') || '&#xa0;') : '') + '>' + prevText + '</a>' :
- (hideIfNoPrevNext ? '' : '<label>' + prevText + '</label>')) + '</div>';
- var nextText = this._get('nextText');
- nextText = (!navigationAsDateFormat ? nextText : $.datepicker.formatDate(
- nextText, new Date(drawYear, drawMonth + stepMonths, 1), this._getFormatConfig()));
- var next = '<div class="ui-datepicker-next">' + (this._canAdjustMonth(+1, drawYear, drawMonth) ?
- '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', +' + stepMonths + ', \'M\');"' +
- (showStatus ? this._addStatus(this._get('nextStatus') || '&#xa0;') : '') + '>' + nextText + '</a>' :
- (hideIfNoPrevNext ? '' : '<label>' + nextText + '</label>')) + '</div>';
- var currentText = this._get('currentText');
- currentText = (!navigationAsDateFormat ? currentText: $.datepicker.formatDate(
- currentText, today, this._getFormatConfig()));
- var html = (prompt ? '<div class="' + $.datepicker._promptClass + '">' + prompt + '</div>' : '') +
- (closeAtTop && !this._inline ? controls : '') +
- '<div class="ui-datepicker-links">' + (isRTL ? next : prev) +
- (this._isInRange(today) ? '<div class="ui-datepicker-current">' +
- '<a onclick="jQuery.datepicker._gotoToday(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('currentStatus') || '&#xa0;') : '') + '>' +
- currentText + '</a></div>' : '') + (isRTL ? prev : next) + '</div>';
- var showWeeks = this._get('showWeeks');
- for (var row = 0; row < numMonths[0]; row++)
- for (var col = 0; col < numMonths[1]; col++) {
- var selectedDate = new Date(drawYear, drawMonth, this._selectedDay);
- html += '<div class="ui-datepicker-one-month' + (col == 0 ? ' ui-datepicker-new-row' : '') + '">' +
- this._generateMonthYearHeader(drawMonth, drawYear, minDate, maxDate,
- selectedDate, row > 0 || col > 0) + // draw month headers
- '<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead>' +
- '<tr class="ui-datepicker-title-row">' +
- (showWeeks ? '<td>' + this._get('weekHeader') + '</td>' : '');
- var firstDay = this._get('firstDay');
- var changeFirstDay = this._get('changeFirstDay');
- var dayNames = this._get('dayNames');
- var dayNamesShort = this._get('dayNamesShort');
- var dayNamesMin = this._get('dayNamesMin');
- for (var dow = 0; dow < 7; dow++) { // days of the week
- var day = (dow + firstDay) % 7;
- var status = this._get('dayStatus') || '&#xa0;';
- status = (status.indexOf('DD') > -1 ? status.replace(/DD/, dayNames[day]) :
- status.replace(/D/, dayNamesShort[day]));
- html += '<td' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end-cell"' : '') + '>' +
- (!changeFirstDay ? '<span' :
- '<a onclick="jQuery.datepicker._changeFirstDay(' + this._id + ', ' + day + ');"') +
- (showStatus ? this._addStatus(status) : '') + ' title="' + dayNames[day] + '">' +
- dayNamesMin[day] + (changeFirstDay ? '</a>' : '</span>') + '</td>';
- }
- html += '</tr></thead><tbody>';
- var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
- if (drawYear == this._selectedYear && drawMonth == this._selectedMonth)
- this._selectedDay = Math.min(this._selectedDay, daysInMonth);
- var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
- var currentDate = (!this._currentDay ? new Date(9999, 9, 9) :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- var endDate = this._endDay ? new Date(this._endYear, this._endMonth, this._endDay) : currentDate;
- var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
- var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
- var beforeShowDay = this._get('beforeShowDay');
- var highlightWeek = this._get('highlightWeek');
- var showOtherMonths = this._get('showOtherMonths');
- var calculateWeek = this._get('calculateWeek') || $.datepicker.iso8601Week;
- var dateStatus = this._get('statusForDate') || $.datepicker.dateStatus;
- for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
- html += '<tr class="ui-datepicker-days-row">' +
- (showWeeks ? '<td class="ui-datepicker-week-col">' + calculateWeek(printDate) + '</td>' : '');
- for (var dow = 0; dow < 7; dow++) { // create date picker days
- var daySettings = (beforeShowDay ?
- beforeShowDay.apply((this._input ? this._input[0] : null), [printDate]) : [true, '']);
- var otherMonth = (printDate.getMonth() != drawMonth);
- var unselectable = otherMonth || !daySettings[0] ||
- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
- html += '<td class="ui-datepicker-days-cell' +
- ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end-cell' : '') + // highlight weekends
- (otherMonth ? ' ui-datepicker-otherMonth' : '') + // highlight days from other months
- (printDate.getTime() == selectedDate.getTime() && drawMonth == this._selectedMonth ?
- ' ui-datepicker-days-cell-over' : '') + // highlight selected day
- (unselectable ? ' ' + $.datepicker._unselectableClass : '') + // highlight unselectable days
- (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
- (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
- ' ' + $.datepicker._currentClass : '') + // highlight selected day
- (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
- ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
- (unselectable ? (highlightWeek ? ' onmouseover="jQuery(this).parent().addClass(\'ui-datepicker-week-over\');"' + // highlight selection week
- ' onmouseout="jQuery(this).parent().removeClass(\'ui-datepicker-week-over\');"' : '') : // unhighlight selection week
- ' onmouseover="jQuery(this).addClass(\'ui-datepicker-days-cell-over\')' + // highlight selection
- (highlightWeek ? '.parent().addClass(\'ui-datepicker-week-over\')' : '') + ';' + // highlight selection week
- (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
- this._id + '\').html(\'' + (dateStatus.apply((this._input ? this._input[0] : null),
- [printDate, this]) || '&#xa0;') +'\');') + '"' +
- ' onmouseout="jQuery(this).removeClass(\'ui-datepicker-days-cell-over\')' + // unhighlight selection
- (highlightWeek ? '.parent().removeClass(\'ui-datepicker-week-over\')' : '') + ';' + // unhighlight selection week
- (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
- this._id + '\').html(\'&#xa0;\');') + '" onclick="jQuery.datepicker._selectDay(' +
- this._id + ',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions
- (otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
- (unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
- printDate.setDate(printDate.getDate() + 1);
- }
- html += '</tr>';
- }
- drawMonth++;
- if (drawMonth > 11) {
- drawMonth = 0;
- drawYear++;
- }
- html += '</tbody></table></div>';
- }
- html += (showStatus ? '<div style="clear: both;"></div><div id="ui-datepicker-status-' + this._id +
- '" class="ui-datepicker-status">' + (this._get('initStatus') || '&#xa0;') + '</div>' : '') +
- (!closeAtTop && !this._inline ? controls : '') +
- '<div style="clear: both;"></div>' +
- ($.browser.msie && parseInt($.browser.version) < 7 && !this._inline ?
- '<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>' : '');
- return html;
- },
-
- /* Generate the month and year header. */
- _generateMonthYearHeader: function(drawMonth, drawYear, minDate, maxDate, selectedDate, secondary) {
- minDate = (this._rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
- var showStatus = this._get('showStatus');
- var html = '<div class="ui-datepicker-header">';
- // month selection
- var monthNames = this._get('monthNames');
- if (secondary || !this._get('changeMonth'))
- html += monthNames[drawMonth] + '&#xa0;';
- else {
- var inMinYear = (minDate && minDate.getFullYear() == drawYear);
- var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
- html += '<select class="ui-datepicker-new-month" ' +
- 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'M\');" ' +
- 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('monthStatus') || '&#xa0;') : '') + '>';
- for (var month = 0; month < 12; month++) {
- if ((!inMinYear || month >= minDate.getMonth()) &&
- (!inMaxYear || month <= maxDate.getMonth()))
- html += '<option value="' + month + '"' +
- (month == drawMonth ? ' selected="selected"' : '') +
- '>' + monthNames[month] + '</option>';
- }
- html += '</select>';
- }
- // year selection
- if (secondary || !this._get('changeYear'))
- html += drawYear;
- else {
- // determine range of years to display
- var years = this._get('yearRange').split(':');
- var year = 0;
- var endYear = 0;
- if (years.length != 2) {
- year = drawYear - 10;
- endYear = drawYear + 10;
- } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
- year = endYear = new Date().getFullYear();
- year += parseInt(years[0], 10);
- endYear += parseInt(years[1], 10);
- } else {
- year = parseInt(years[0], 10);
- endYear = parseInt(years[1], 10);
- }
- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
- html += '<select class="ui-datepicker-new-year" ' +
- 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'Y\');" ' +
- 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('yearStatus') || '&#xa0;') : '') + '>';
- for (; year <= endYear; year++) {
- html += '<option value="' + year + '"' +
- (year == drawYear ? ' selected="selected"' : '') +
- '>' + year + '</option>';
- }
- html += '</select>';
- }
- html += '</div>'; // Close datepicker_header
- return html;
- },
-
- /* Provide code to set and clear the status panel. */
- _addStatus: function(text) {
- return ' onmouseover="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\'' + text + '\');" ' +
- 'onmouseout="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\'&#xa0;\');"';
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(offset, period) {
- var year = this._drawYear + (period == 'Y' ? offset : 0);
- var month = this._drawMonth + (period == 'M' ? offset : 0);
- var day = Math.min(this._selectedDay, this._getDaysInMonth(year, month)) +
- (period == 'D' ? offset : 0);
- var date = new Date(year, month, day);
- // ensure it is within the bounds set
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- date = (minDate && date < minDate ? minDate : date);
- date = (maxDate && date > maxDate ? maxDate : date);
- this._selectedDay = date.getDate();
- this._drawMonth = this._selectedMonth = date.getMonth();
- this._drawYear = this._selectedYear = date.getFullYear();
- if (period == 'M' || period == 'Y')
- this._notifyChange();
- },
-
- /* Notify change of month/year. */
- _notifyChange: function() {
- var onChange = this._get('onChangeMonthYear');
- if (onChange)
- onChange.apply((this._input ? this._input[0] : null),
- [new Date(this._selectedYear, this._selectedMonth, 1), this]);
- },
-
- /* Determine the number of months to show. */
- _getNumberOfMonths: function() {
- var numMonths = this._get('numberOfMonths');
- return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
- },
-
- /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
- _getMinMaxDate: function(minMax, checkRange) {
- var date = this._determineDate(minMax + 'Date', null);
- if (date) {
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- date.setMilliseconds(0);
- }
- return (!checkRange || !this._rangeStart ? date :
- (!date || this._rangeStart > date ? this._rangeStart : date));
- },
-
- /* Find the number of days in a given month. */
- _getDaysInMonth: function(year, month) {
- return 32 - new Date(year, month, 32).getDate();
- },
-
- /* Find the day of the week of the first of a month. */
- _getFirstDayOfMonth: function(year, month) {
- return new Date(year, month, 1).getDay();
- },
-
- /* Determines if we should allow a "next/prev" month display change. */
- _canAdjustMonth: function(offset, curYear, curMonth) {
- var numMonths = this._getNumberOfMonths();
- var date = new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1);
- if (offset < 0)
- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
- return this._isInRange(date);
- },
-
- /* Is the given date in the accepted range? */
- _isInRange: function(date) {
- // during range selection, use minimum of selected date and range start
- var newMinDate = (!this._rangeStart ? null :
- new Date(this._selectedYear, this._selectedMonth, this._selectedDay));
- newMinDate = (newMinDate && this._rangeStart < newMinDate ? this._rangeStart : newMinDate);
- var minDate = newMinDate || this._getMinMaxDate('min');
- var maxDate = this._getMinMaxDate('max');
- return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
- },
-
- /* Provide the configuration settings for formatting/parsing. */
- _getFormatConfig: function() {
- var shortYearCutoff = this._get('shortYearCutoff');
- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
- return {shortYearCutoff: shortYearCutoff,
- dayNamesShort: this._get('dayNamesShort'), dayNames: this._get('dayNames'),
- monthNamesShort: this._get('monthNamesShort'), monthNames: this._get('monthNames')};
- },
-
- /* Format the given date for display. */
- _formatDate: function(day, month, year) {
- if (!day) {
- this._currentDay = this._selectedDay;
- this._currentMonth = this._selectedMonth;
- this._currentYear = this._selectedYear;
- }
- var date = (day ? (typeof day == 'object' ? day : new Date(year, month, day)) :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- return $.datepicker.formatDate(this._get('dateFormat'), date, this._getFormatConfig());
- }
-});
-
-/* jQuery extend now ignores nulls! */
-function extendRemove(target, props) {
- $.extend(target, props);
- for (var name in props)
- if (props[name] == null || props[name] == undefined)
- target[name] = props[name];
- return target;
-};
-
-/* Determine whether an object is an array. */
-function isArray(a) {
- return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
- (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
-};
-
-/* Invoke the datepicker functionality.
- @param options String - a command, optionally followed by additional parameters or
- Object - settings for attaching new datepicker functionality
- @return jQuery object */
-$.fn.datepicker = function(options){
- var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
- return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs));
- return this.each(function() {
- typeof options == 'string' ?
- $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this].concat(otherArgs)) :
- $.datepicker._attachDatepicker(this, options);
- });
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-
-/* Initialise the date picker. */
-$(document).ready(function() {
- $(document.body).append($.datepicker._datepickerDiv).
- mousedown($.datepicker._checkExternalClick);
-});
-
-})(jQuery);
-/*
- * jQuery UI Dialog
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
-};
-
-$.widget("ui.dialog", {
- init: function() {
- var self = this,
- options = this.options,
- resizeHandles = typeof options.resizable == 'string'
- ? options.resizable
- : 'n,e,s,w,se,sw,ne,nw',
-
- uiDialogContent = this.element
- .addClass('ui-dialog-content')
- .wrap('<div/>')
- .wrap('<div/>'),
-
- uiDialogContainer = (this.uiDialogContainer = uiDialogContent.parent()
- .addClass('ui-dialog-container')
- .css({position: 'relative', width: '100%', height: '100%'})),
-
- title = options.title || uiDialogContent.attr('title') || '',
- uiDialogTitlebar = (this.uiDialogTitlebar =
- $('<div class="ui-dialog-titlebar"/>'))
- .append('<span class="ui-dialog-title">' + title + '</span>')
- .append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>')
- .prependTo(uiDialogContainer),
-
- uiDialog = (this.uiDialog = uiDialogContainer.parent())
- .appendTo(document.body)
- .hide()
- .addClass('ui-dialog')
- .addClass(options.dialogClass)
- // add content classes to dialog
- // to inherit theme at top level of element
- .addClass(uiDialogContent.attr('className'))
- .removeClass('ui-dialog-content')
- .css({
- position: 'absolute',
- width: options.width,
- height: options.height,
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
- if (options.closeOnEscape) {
- var ESC = 27;
- (ev.keyCode && ev.keyCode == ESC && self.close());
- }
- })
- .mousedown(function() {
- self.moveToTop();
- }),
-
- uiDialogButtonPane = (this.uiDialogButtonPane = $('<div/>'))
- .addClass('ui-dialog-buttonpane')
- .appendTo(uiDialog);
-
- this.uiDialogTitlebarClose = $('.ui-dialog-titlebar-close', uiDialogTitlebar)
- .hover(
- function() {
- $(this).addClass('ui-dialog-titlebar-close-hover');
- },
- function() {
- $(this).removeClass('ui-dialog-titlebar-close-hover');
- }
- )
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function() {
- self.close();
- return false;
- });
-
- if ($.fn.draggable) {
- uiDialog.draggable({
- helper: options.dragHelper,
- handle: '.ui-dialog-titlebar',
- start: function(e, ui) {
- self.moveToTop();
- (options.dragStart && options.dragStart.apply(self.element[0], arguments));
- },
- drag: function(e, ui) {
- (options.drag && options.drag.apply(self.element[0], arguments));
- },
- stop: function(e, ui) {
- (options.dragStop && options.dragStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- (options.draggable || uiDialog.draggable('disable'));
- }
-
- if ($.fn.resizable) {
- uiDialog.resizable({
- proxy: options.resizeHelper,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: function() {
- (options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
- },
- resize: function(e, ui) {
- (options.autoResize && self.size.apply(self));
- (options.resize && options.resize.apply(self.element[0], arguments));
- },
- handles: resizeHandles,
- stop: function(e, ui) {
- (options.autoResize && self.size.apply(self));
- (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- (options.resizable || uiDialog.resizable('disable'));
- }
-
- this.createButtons(options.buttons);
- this.isOpen = false;
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
- },
-
- setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "buttons":
- this.createButtons(value);
- break;
- case "draggable":
- this.uiDialog.draggable(value ? 'enable' : 'disable');
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this.position(value);
- break;
- case "resizable":
- (typeof value == 'string' && this.uiDialog.data('handles.resizable', value));
- this.uiDialog.resizable(value ? 'enable' : 'disable');
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).text(value);
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
-
- $.widget.prototype.setData.apply(this, arguments);
- },
-
- position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += wnd.width() - this.uiDialog.width();
- break;
- default:
- case 'center':
- pLeft += (wnd.width() - this.uiDialog.width()) / 2;
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += wnd.height() - this.uiDialog.height();
- break;
- default:
- case 'middle':
- pTop += (wnd.height() - this.uiDialog.height()) / 2;
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- size: function() {
- var container = this.uiDialogContainer,
- titlebar = this.uiDialogTitlebar,
- content = this.element,
- tbMargin = parseInt(content.css('margin-top')) + parseInt(content.css('margin-bottom')),
- lrMargin = parseInt(content.css('margin-left')) + parseInt(content.css('margin-right'));
- content.height(container.height() - titlebar.outerHeight() - tbMargin);
- content.width(container.width() - lrMargin);
- },
-
- open: function() {
- if (this.isOpen) { return; }
-
- this.overlay = this.options.modal ? new $.ui.dialog.overlay(this) : null;
- this.uiDialog.appendTo('body');
- this.position(this.options.position);
- this.uiDialog.show(this.options.show);
- this.options.autoResize && this.size();
- this.moveToTop(true);
-
- // CALLBACK: open
- var openEV = null;
- var openUI = {
- options: this.options
- };
- this.uiDialogTitlebarClose.focus();
- this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open);
-
- this.isOpen = true;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force) {
- if ((this.options.modal && !force)
- || (!this.options.stack && !this.options.modal)) { return; }
-
- var maxZ = this.options.zIndex, options = this.options;
- $('.ui-dialog:visible').each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
- });
- (this.overlay && this.overlay.$el.css('z-index', ++maxZ));
- this.uiDialog.css('z-index', ++maxZ);
- },
-
- close: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide(this.options.hide);
-
- // CALLBACK: close
- var closeEV = null;
- var closeUI = {
- options: this.options
- };
- this.element.triggerHandler("dialogclose", [closeEV, closeUI], this.options.close);
- $.ui.dialog.overlay.resize();
-
- this.isOpen = false;
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
- },
-
- createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = this.uiDialogButtonPane;
-
- // remove any existing buttons
- uiDialogButtonPane.empty().hide();
-
- $.each(buttons, function() { return !(hasButtons = true); });
- if (hasButtons) {
- uiDialogButtonPane.show();
- $.each(buttons, function(name, fn) {
- $('<button/>')
- .text(name)
- .click(function() { fn.apply(self.element[0], arguments); })
- .appendTo(uiDialogButtonPane);
- });
- }
- }
-});
-
-$.extend($.ui.dialog, {
- defaults: {
- autoOpen: true,
- autoResize: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- draggable: true,
- height: 200,
- minHeight: 100,
- minWidth: 150,
- modal: false,
- overlay: {},
- position: 'center',
- resizable: true,
- stack: true,
- width: 300,
- zIndex: 1000
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(e) { return e + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- $('a, :input').bind($.ui.dialog.overlay.events, function() {
- // allow use of the element if inside a dialog and
- // - there are no modal dialogs
- // - there are modal dialogs, but we are in front of the topmost modal
- var allow = false;
- var $dialog = $(this).parents('.ui-dialog');
- if ($dialog.length) {
- var $overlays = $('.ui-dialog-overlay');
- if ($overlays.length) {
- var maxZ = parseInt($overlays.css('z-index'), 10);
- $overlays.each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10));
- });
- allow = parseInt($dialog.css('z-index'), 10) > maxZ;
- } else {
- allow = true;
- }
- }
- return allow;
- });
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(e) {
- var ESC = 27;
- (e.keyCode && e.keyCode == ESC && dialog.close());
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div/>').appendTo(document.body)
- .addClass('ui-dialog-overlay').css($.extend({
- borderWidth: 0, margin: 0, padding: 0,
- position: 'absolute', top: 0, left: 0,
- width: this.width(),
- height: this.height()
- }, dialog.options.overlay));
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $('a, :input').add([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
- },
-
- height: function() {
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Slider
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.fn.unwrap = $.fn.unwrap || function(expr) {
- return this.each(function(){
- $(this).parents(expr).eq(0).after(this).remove();
- });
-};
-
-$.widget("ui.slider", {
- plugins: {},
- ui: function(e) {
- return {
- options: this.options,
- handle: this.currentHandle,
- value: this.options.axis != "both" || !this.options.axis ? Math.round(this.value(null,this.options.axis == "vertical" ? "y" : "x")) : {
- x: Math.round(this.value(null,"x")),
- y: Math.round(this.value(null,"y"))
- },
- range: this.getRange()
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.ui()]);
- this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]);
- },
- destroy: function() {
-
- this.element
- .removeClass("ui-slider ui-slider-disabled")
- .removeData("slider")
- .unbind(".slider");
-
- if(this.handle && this.handle.length) {
- this.handle
- .unwrap("a");
- this.handle.each(function() {
- $(this).data("mouse").mouseDestroy();
- });
- }
-
- this.generated && this.generated.remove();
-
- },
- setData: function(key, value) {
- $.widget.prototype.setData.apply(this, arguments);
- if (/min|max|steps/.test(key)) {
- this.initBoundaries();
- }
-
- if(key == "range") {
- value ? this.handle.length == 2 && this.createRange() : this.removeRange();
- }
-
- },
-
- init: function() {
-
- var self = this;
- this.element.addClass("ui-slider");
- this.initBoundaries();
-
- // Initialize mouse and key events for interaction
- this.handle = $(this.options.handle, this.element);
- if (!this.handle.length) {
- self.handle = self.generated = $(self.options.handles || [0]).map(function() {
- var handle = $("<div/>").addClass("ui-slider-handle").appendTo(self.element);
- if (this.id)
- handle.attr("id", this.id);
- return handle[0];
- });
- }
-
-
- var handleclass = function(el) {
- this.element = $(el);
- this.element.data("mouse", this);
- this.options = self.options;
-
- this.element.bind("mousedown", function() {
- if(self.currentHandle) this.blur(self.currentHandle);
- self.focus(this,1);
- });
-
- this.mouseInit();
- };
-
- $.extend(handleclass.prototype, $.ui.mouse, {
- mouseStart: function(e) { return self.start.call(self, e, this.element[0]); },
- mouseStop: function(e) { return self.stop.call(self, e, this.element[0]); },
- mouseDrag: function(e) { return self.drag.call(self, e, this.element[0]); },
- mouseCapture: function() { return true; },
- trigger: function(e) { this.mouseDown(e); }
- });
-
-
- $(this.handle)
- .each(function() {
- new handleclass(this);
- })
- .wrap('<a href="javascript:void(0)" style="cursor:default;"></a>')
- .parent()
- .bind('focus', function(e) { self.focus(this.firstChild); })
- .bind('blur', function(e) { self.blur(this.firstChild); })
- .bind('keydown', function(e) { if(!self.options.noKeyboard) self.keydown(e.keyCode, this.firstChild); })
- ;
-
- // Bind the click to the slider itself
- this.element.bind('mousedown.slider', function(e) {
- self.click.apply(self, [e]);
- self.currentHandle.data("mouse").trigger(e);
- self.firstValue = self.firstValue + 1; //This is for always triggering the change event
- });
-
- // Move the first handle to the startValue
- $.each(this.options.handles || [], function(index, handle) {
- self.moveTo(handle.start, index, true);
- });
- if (!isNaN(this.options.startValue))
- this.moveTo(this.options.startValue, 0, true);
-
- this.previousHandle = $(this.handle[0]); //set the previous handle to the first to allow clicking before selecting the handle
- if(this.handle.length == 2 && this.options.range) this.createRange();
- },
- initBoundaries: function() {
-
- var element = this.element[0], o = this.options;
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- $.extend(o, {
- axis: o.axis || (element.offsetWidth < element.offsetHeight ? 'vertical' : 'horizontal'),
- max: !isNaN(parseInt(o.max,10)) ? { x: parseInt(o.max, 10), y: parseInt(o.max, 10) } : ({ x: o.max && o.max.x || 100, y: o.max && o.max.y || 100 }),
- min: !isNaN(parseInt(o.min,10)) ? { x: parseInt(o.min, 10), y: parseInt(o.min, 10) } : ({ x: o.min && o.min.x || 0, y: o.min && o.min.y || 0 })
- });
- //Prepare the real maxValue
- o.realMax = {
- x: o.max.x - o.min.x,
- y: o.max.y - o.min.y
- };
- //Calculate stepping based on steps
- o.stepping = {
- x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps ? o.realMax.x/(o.steps.x || parseInt(o.steps, 10) || o.realMax.x) : 0),
- y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps ? o.realMax.y/(o.steps.y || parseInt(o.steps, 10) || o.realMax.y) : 0)
- };
- },
-
-
- keydown: function(keyCode, handle) {
- if(/(37|38|39|40)/.test(keyCode)) {
- this.moveTo({
- x: /(37|39)/.test(keyCode) ? (keyCode == 37 ? '-' : '+') + '=' + this.oneStep("x") : 0,
- y: /(38|40)/.test(keyCode) ? (keyCode == 38 ? '-' : '+') + '=' + this.oneStep("y") : 0
- }, handle);
- }
- },
- focus: function(handle,hard) {
- this.currentHandle = $(handle).addClass('ui-slider-handle-active');
- if (hard)
- this.currentHandle.parent()[0].focus();
- },
- blur: function(handle) {
- $(handle).removeClass('ui-slider-handle-active');
- if(this.currentHandle && this.currentHandle[0] == handle) { this.previousHandle = this.currentHandle; this.currentHandle = null; };
- },
- click: function(e) {
- // This method is only used if:
- // - The user didn't click a handle
- // - The Slider is not disabled
- // - There is a current, or previous selected handle (otherwise we wouldn't know which one to move)
-
- var pointer = [e.pageX,e.pageY];
-
- var clickedHandle = false;
- this.handle.each(function() {
- if(this == e.target)
- clickedHandle = true;
- });
- if (clickedHandle || this.options.disabled || !(this.currentHandle || this.previousHandle))
- return;
-
- // If a previous handle was focussed, focus it again
- if (!this.currentHandle && this.previousHandle)
- this.focus(this.previousHandle, true);
-
- // propagate only for distance > 0, otherwise propagation is done my drag
- this.offset = this.element.offset();
-
- this.moveTo({
- y: this.convertValue(e.pageY - this.offset.top - this.currentHandle[0].offsetHeight/2, "y"),
- x: this.convertValue(e.pageX - this.offset.left - this.currentHandle[0].offsetWidth/2, "x")
- }, null, !this.options.distance);
- },
-
-
-
- createRange: function() {
- if(this.rangeElement) return;
- this.rangeElement = $('<div></div>')
- .addClass('ui-slider-range')
- .css({ position: 'absolute' })
- .appendTo(this.element);
- this.updateRange();
- },
- removeRange: function() {
- this.rangeElement.remove();
- this.rangeElement = null;
- },
- updateRange: function() {
- var prop = this.options.axis == "vertical" ? "top" : "left";
- var size = this.options.axis == "vertical" ? "height" : "width";
- this.rangeElement.css(prop, (parseInt($(this.handle[0]).css(prop),10) || 0) + this.handleSize(0, this.options.axis == "vertical" ? "y" : "x")/2);
- this.rangeElement.css(size, (parseInt($(this.handle[1]).css(prop),10) || 0) - (parseInt($(this.handle[0]).css(prop),10) || 0));
- },
- getRange: function() {
- return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.options.axis == "vertical" ? "height" : "width"),10), this.options.axis == "vertical" ? "y" : "x") : null;
- },
-
- handleIndex: function() {
- return this.handle.index(this.currentHandle[0]);
- },
- value: function(handle, axis) {
- if(this.handle.length == 1) this.currentHandle = this.handle;
- if(!axis) axis = this.options.axis == "vertical" ? "y" : "x";
-
- var curHandle = $(handle != undefined && handle !== null ? this.handle[handle] || handle : this.currentHandle);
-
- if(curHandle.data("mouse").sliderValue) {
- return parseInt(curHandle.data("mouse").sliderValue[axis],10);
- } else {
- return parseInt(((parseInt(curHandle.css(axis == "x" ? "left" : "top"),10) / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(handle,axis))) * this.options.realMax[axis]) + this.options.min[axis],10);
- }
-
- },
- convertValue: function(value,axis) {
- return this.options.min[axis] + (value / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))) * this.options.realMax[axis];
- },
-
- translateValue: function(value,axis) {
- return ((value - this.options.min[axis]) / this.options.realMax[axis]) * (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis));
- },
- translateRange: function(value,axis) {
- if (this.rangeElement) {
- if (this.currentHandle[0] == this.handle[0] && value >= this.translateValue(this.value(1),axis))
- value = this.translateValue(this.value(1,axis) - this.oneStep(axis), axis);
- if (this.currentHandle[0] == this.handle[1] && value <= this.translateValue(this.value(0),axis))
- value = this.translateValue(this.value(0,axis) + this.oneStep(axis), axis);
- }
- if (this.options.handles) {
- var handle = this.options.handles[this.handleIndex()];
- if (value < this.translateValue(handle.min,axis)) {
- value = this.translateValue(handle.min,axis);
- } else if (value > this.translateValue(handle.max,axis)) {
- value = this.translateValue(handle.max,axis);
- }
- }
- return value;
- },
- translateLimits: function(value,axis) {
- if (value >= this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))
- value = this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis);
- if (value <= 0)
- value = 0;
- return value;
- },
- handleSize: function(handle,axis) {
- return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[0]["offset"+(axis == "x" ? "Width" : "Height")];
- },
- oneStep: function(axis) {
- return this.options.stepping[axis] || 1;
- },
-
-
- start: function(e, handle) {
-
- var o = this.options;
- if(o.disabled) return false;
-
- // Prepare the outer size
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- // This is a especially ugly fix for strange blur events happening on mousemove events
- if (!this.currentHandle)
- this.focus(this.previousHandle, true);
-
- this.offset = this.element.offset();
-
- this.handleOffset = this.currentHandle.offset();
- this.clickOffset = { top: e.pageY - this.handleOffset.top, left: e.pageX - this.handleOffset.left };
-
- this.firstValue = this.value();
-
- this.propagate('start', e);
- this.drag(e, handle);
- return true;
-
- },
- stop: function(e) {
- this.propagate('stop', e);
- if (this.firstValue != this.value())
- this.propagate('change', e);
- // This is a especially ugly fix for strange blur events happening on mousemove events
- this.focus(this.currentHandle, true);
- return false;
- },
- drag: function(e, handle) {
-
- var o = this.options;
- var position = { top: e.pageY - this.offset.top - this.clickOffset.top, left: e.pageX - this.offset.left - this.clickOffset.left};
- if(!this.currentHandle) this.focus(this.previousHandle, true); //This is a especially ugly fix for strange blur events happening on mousemove events
-
- position.left = this.translateLimits(position.left, "x");
- position.top = this.translateLimits(position.top, "y");
-
- if (o.stepping.x) {
- var value = this.convertValue(position.left, "x");
- value = Math.round(value / o.stepping.x) * o.stepping.x;
- position.left = this.translateValue(value, "x");
- }
- if (o.stepping.y) {
- var value = this.convertValue(position.top, "y");
- value = Math.round(value / o.stepping.y) * o.stepping.y;
- position.top = this.translateValue(value, "y");
- }
-
- position.left = this.translateRange(position.left, "x");
- position.top = this.translateRange(position.top, "y");
-
- if(o.axis != "vertical") this.currentHandle.css({ left: position.left });
- if(o.axis != "horizontal") this.currentHandle.css({ top: position.top });
-
- //Store the slider's value
- this.currentHandle.data("mouse").sliderValue = {
- x: Math.round(this.convertValue(position.left, "x")) || 0,
- y: Math.round(this.convertValue(position.top, "y")) || 0
- };
-
- if (this.rangeElement)
- this.updateRange();
- this.propagate('slide', e);
- return false;
- },
-
- moveTo: function(value, handle, noPropagation) {
-
- var o = this.options;
-
- // Prepare the outer size
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- //If no handle has been passed, no current handle is available and we have multiple handles, return false
- if (handle == undefined && !this.currentHandle && this.handle.length != 1)
- return false;
-
- //If only one handle is available, use it
- if (handle == undefined && !this.currentHandle)
- handle = 0;
-
- if (handle != undefined)
- this.currentHandle = this.previousHandle = $(this.handle[handle] || handle);
-
-
- if(value.x !== undefined && value.y !== undefined) {
- var x = value.x, y = value.y;
- } else {
- var x = value, y = value;
- }
-
- if(x !== undefined && x.constructor != Number) {
- var me = /^\-\=/.test(x), pe = /^\+\=/.test(x);
- if(me || pe) {
- x = this.value(null, "x") + parseInt(x.replace(me ? '=' : '+=', ''), 10);
- } else {
- x = isNaN(parseInt(x, 10)) ? undefined : parseInt(x, 10);
- }
- }
-
- if(y !== undefined && y.constructor != Number) {
- var me = /^\-\=/.test(y), pe = /^\+\=/.test(y);
- if(me || pe) {
- y = this.value(null, "y") + parseInt(y.replace(me ? '=' : '+=', ''), 10);
- } else {
- y = isNaN(parseInt(y, 10)) ? undefined : parseInt(y, 10);
- }
- }
-
- if(o.axis != "vertical" && x !== undefined) {
- if(o.stepping.x) x = Math.round(x / o.stepping.x) * o.stepping.x;
- x = this.translateValue(x, "x");
- x = this.translateLimits(x, "x");
- x = this.translateRange(x, "x");
- this.currentHandle.css({ left: x });
- }
-
- if(o.axis != "horizontal" && y !== undefined) {
- if(o.stepping.y) y = Math.round(y / o.stepping.y) * o.stepping.y;
- y = this.translateValue(y, "y");
- y = this.translateLimits(y, "y");
- y = this.translateRange(y, "y");
- this.currentHandle.css({ top: y });
- }
-
- if (this.rangeElement)
- this.updateRange();
-
- //Store the slider's value
- this.currentHandle.data("mouse").sliderValue = {
- x: Math.round(this.convertValue(x, "x")) || 0,
- y: Math.round(this.convertValue(y, "y")) || 0
- };
-
- if (!noPropagation) {
- this.propagate('start', null);
- this.propagate('stop', null);
- this.propagate('change', null);
- this.propagate("slide", null);
- }
- }
-});
-
-$.ui.slider.getter = "value";
-
-$.ui.slider.defaults = {
- handle: ".ui-slider-handle",
- distance: 1
-};
-
-})(jQuery);
-/*
- * jQuery UI Tabs
- *
- * Copyright (c) 2007, 2008 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.tabs", {
- init: function() {
- this.options.event += '.tabs'; // namespace event
-
- // create tabs
- this.tabify(true);
- },
- setData: function(key, value) {
- if ((/^selected/).test(key))
- this.select(value);
- else {
- this.options[key] = value;
- this.tabify();
- }
- },
- length: function() {
- return this.$tabs.length;
- },
- tabId: function(a) {
- return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '')
- || this.options.idPrefix + $.data(a);
- },
- ui: function(tab, panel) {
- return {
- options: this.options,
- tab: tab,
- panel: panel
- };
- },
- tabify: function(init) {
-
- this.$lis = $('li:has(a[href])', this.element);
- this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
- this.$panels = $([]);
-
- var self = this, o = this.options;
-
- this.$tabs.each(function(i, a) {
- // inline tab
- if (a.hash && a.hash.replace('#', '')) // Safari 2 reports '#' for an empty hash
- self.$panels = self.$panels.add(a.hash);
- // remote tab
- else if ($(a).attr('href') != '#') { // prevent loading the page itself if href is just "#"
- $.data(a, 'href.tabs', a.href); // required for restore on destroy
- $.data(a, 'load.tabs', a.href); // mutable
- var id = self.tabId(a);
- a.href = '#' + id;
- var $panel = $('#' + id);
- if (!$panel.length) {
- $panel = $(o.panelTemplate).attr('id', id).addClass(o.panelClass)
- .insertAfter( self.$panels[i - 1] || self.element );
- $panel.data('destroy.tabs', true);
- }
- self.$panels = self.$panels.add( $panel );
- }
- // invalid tab href
- else
- o.disabled.push(i + 1);
- });
-
- if (init) {
-
- // attach necessary classes for styling if not present
- this.element.addClass(o.navClass);
- this.$panels.each(function() {
- var $this = $(this);
- $this.addClass(o.panelClass);
- });
-
- // Selected tab
- // use "selected" option or try to retrieve:
- // 1. from fragment identifier in url
- // 2. from cookie
- // 3. from selected class attribute on <li>
- if (o.selected === undefined) {
- if (location.hash) {
- this.$tabs.each(function(i, a) {
- if (a.hash == location.hash) {
- o.selected = i;
- // prevent page scroll to fragment
- if ($.browser.msie || $.browser.opera) { // && !o.remote
- var $toShow = $(location.hash), toShowId = $toShow.attr('id');
- $toShow.attr('id', '');
- setTimeout(function() {
- $toShow.attr('id', toShowId); // restore id
- }, 500);
- }
- scrollTo(0, 0);
- return false; // break
- }
- });
- }
- else if (o.cookie) {
- var index = parseInt($.cookie('ui-tabs' + $.data(self.element)),10);
- if (index && self.$tabs[index])
- o.selected = index;
- }
- else if (self.$lis.filter('.' + o.selectedClass).length)
- o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] );
- }
- o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; // first tab selected by default
-
- // Take disabling tabs via class attribute from HTML
- // into account and update option properly.
- // A selected tab cannot become disabled.
- o.disabled = $.unique(o.disabled.concat(
- $.map(this.$lis.filter('.' + o.disabledClass),
- function(n, i) { return self.$lis.index(n); } )
- )).sort();
- if ($.inArray(o.selected, o.disabled) != -1)
- o.disabled.splice($.inArray(o.selected, o.disabled), 1);
-
- // highlight selected tab
- this.$panels.addClass(o.hideClass);
- this.$lis.removeClass(o.selectedClass);
- if (o.selected !== null) {
- this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
- this.$lis.eq(o.selected).addClass(o.selectedClass);
-
- // seems to be expected behavior that the show callback is fired
- var onShow = function() {
- $(self.element).triggerHandler('tabsshow',
- [null, self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show);
- };
-
- // load if remote tab
- if ($.data(this.$tabs[o.selected], 'load.tabs'))
- this.load(o.selected, onShow);
- // just trigger show event
- else
- onShow();
-
- }
-
- // clean up to avoid memory leaks in certain versions of IE 6
- $(window).bind('unload', function() {
- self.$tabs.unbind('.tabs');
- self.$lis = self.$tabs = self.$panels = null;
- });
-
- }
-
- // disable tabs
- for (var i = 0, li; li = this.$lis[i]; i++)
- $(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass(o.selectedClass) ? 'addClass' : 'removeClass'](o.disabledClass);
-
- // reset cache if switching from cached to not cached
- if (o.cache === false)
- this.$tabs.removeData('cache.tabs');
-
- // set up animations
- var hideFx, showFx, baseFx = { 'min-width': 0, duration: 1 }, baseDuration = 'normal';
- if (o.fx && o.fx.constructor == Array)
- hideFx = o.fx[0] || baseFx, showFx = o.fx[1] || baseFx;
- else
- hideFx = showFx = o.fx || baseFx;
-
- // reset some styles to maintain print style sheets etc.
- var resetCSS = { display: '', overflow: '', height: '' };
- if (!$.browser.msie) // not in IE to prevent ClearType font issue
- resetCSS.opacity = '';
-
- // Hide a tab, animation prevents browser scrolling to fragment,
- // $show is optional.
- function hideTab(clicked, $hide, $show) {
- $hide.animate(hideFx, hideFx.duration || baseDuration, function() { //
- $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && hideFx.opacity)
- $hide[0].style.filter = '';
- if ($show)
- showTab(clicked, $show, $hide);
- });
- }
-
- // Show a tab, animation prevents browser scrolling to fragment,
- // $hide is optional.
- function showTab(clicked, $show, $hide) {
- if (showFx === baseFx)
- $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels
- $show.animate(showFx, showFx.duration || baseDuration, function() {
- $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && showFx.opacity)
- $show[0].style.filter = '';
-
- // callback
- $(self.element).triggerHandler('tabsshow',
- [null, self.ui(clicked, $show[0])], o.show);
-
- });
- }
-
- // switch a tab
- function switchTab(clicked, $li, $hide, $show) {
- /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
- $.ajaxHistory.update(clicked.hash);
- }*/
- $li.addClass(o.selectedClass)
- .siblings().removeClass(o.selectedClass);
- hideTab(clicked, $hide, $show);
- }
-
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
- this.$tabs.unbind('.tabs').bind(o.event, function() {
-
- //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
- var $li = $(this).parents('li:eq(0)'),
- $hide = self.$panels.filter(':visible'),
- $show = $(this.hash);
-
- // If tab is already selected and not unselectable or tab disabled or
- // or is already loading or click callback returns false stop here.
- // Check if click handler returns false last so that it is not executed
- // for a disabled or loading tab!
- if (($li.hasClass(o.selectedClass) && !o.unselect)
- || $li.hasClass(o.disabledClass)
- || $(this).hasClass(o.loadingClass)
- || $(self.element).triggerHandler('tabsselect', [null, self.ui(this, $show[0])], o.select) === false
- ) {
- this.blur();
- return false;
- }
-
- self.options.selected = self.$tabs.index(this);
-
- // if tab may be closed
- if (o.unselect) {
- if ($li.hasClass(o.selectedClass)) {
- self.options.selected = null;
- $li.removeClass(o.selectedClass);
- self.$panels.stop();
- hideTab(this, $hide);
- this.blur();
- return false;
- } else if (!$hide.length) {
- self.$panels.stop();
- var a = this;
- self.load(self.$tabs.index(this), function() {
- $li.addClass(o.selectedClass).addClass(o.unselectClass);
- showTab(a, $show);
- });
- this.blur();
- return false;
- }
- }
-
- if (o.cookie)
- $.cookie('ui-tabs' + $.data(self.element), self.options.selected, o.cookie);
-
- // stop possibly running animations
- self.$panels.stop();
-
- // show new tab
- if ($show.length) {
-
- // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
- /*if ($.browser.msie && o.bookmarkable) {
- var showId = this.hash.replace('#', '');
- $show.attr('id', '');
- setTimeout(function() {
- $show.attr('id', showId); // restore id
- }, 0);
- }*/
-
- var a = this;
- self.load(self.$tabs.index(this), $hide.length ?
- function() {
- switchTab(a, $li, $hide, $show);
- } :
- function() {
- $li.addClass(o.selectedClass);
- showTab(a, $show);
- }
- );
-
- // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
- /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
- var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
- setTimeout(function() {
- scrollTo(scrollX, scrollY);
- }, 0);*/
-
- } else
- throw 'jQuery UI Tabs: Mismatching fragment identifier.';
-
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled in modern
- // browsers via CSS, also blur removes focus from address bar in Firefox
- // which can become a usability and annoying problem with tabsRotate.
- if ($.browser.msie)
- this.blur();
-
- //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
- return false;
-
- });
-
- // disable click if event is configured to something else
- if (!(/^click/).test(o.event))
- this.$tabs.bind('click.tabs', function() { return false; });
-
- },
- add: function(url, label, index) {
- if (index == undefined)
- index = this.$tabs.length; // append by default
-
- var o = this.options;
- var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label));
- $li.data('destroy.tabs', true);
-
- var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] );
-
- // try to find an existing element before creating a new one
- var $panel = $('#' + id);
- if (!$panel.length) {
- $panel = $(o.panelTemplate).attr('id', id)
- .addClass(o.hideClass)
- .data('destroy.tabs', true);
- }
- $panel.addClass(o.panelClass);
- if (index >= this.$lis.length) {
- $li.appendTo(this.element);
- $panel.appendTo(this.element[0].parentNode);
- } else {
- $li.insertBefore(this.$lis[index]);
- $panel.insertBefore(this.$panels[index]);
- }
-
- o.disabled = $.map(o.disabled,
- function(n, i) { return n >= index ? ++n : n });
-
- this.tabify();
-
- if (this.$tabs.length == 1) {
- $li.addClass(o.selectedClass);
- $panel.removeClass(o.hideClass);
- var href = $.data(this.$tabs[0], 'load.tabs');
- if (href)
- this.load(index, href);
- }
-
- // callback
- this.element.triggerHandler('tabsadd',
- [null, this.ui(this.$tabs[index], this.$panels[index])], o.add
- );
- },
- remove: function(index) {
- var o = this.options, $li = this.$lis.eq(index).remove(),
- $panel = this.$panels.eq(index).remove();
-
- // If selected tab was removed focus tab to the right or
- // in case the last tab was removed the tab to the left.
- if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1)
- this.select(index + (index + 1 < this.$tabs.length ? 1 : -1));
-
- o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
- function(n, i) { return n >= index ? --n : n });
-
- this.tabify();
-
- // callback
- this.element.triggerHandler('tabsremove',
- [null, this.ui($li.find('a')[0], $panel[0])], o.remove
- );
- },
- enable: function(index) {
- var o = this.options;
- if ($.inArray(index, o.disabled) == -1)
- return;
-
- var $li = this.$lis.eq(index).removeClass(o.disabledClass);
- if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2...
- $li.css('display', 'inline-block');
- setTimeout(function() {
- $li.css('display', 'block');
- }, 0);
- }
-
- o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });
-
- // callback
- this.element.triggerHandler('tabsenable',
- [null, this.ui(this.$tabs[index], this.$panels[index])], o.enable
- );
-
- },
- disable: function(index) {
- var self = this, o = this.options;
- if (index != o.selected) { // cannot disable already selected tab
- this.$lis.eq(index).addClass(o.disabledClass);
-
- o.disabled.push(index);
- o.disabled.sort();
-
- // callback
- this.element.triggerHandler('tabsdisable',
- [null, this.ui(this.$tabs[index], this.$panels[index])], o.disable
- );
- }
- },
- select: function(index) {
- if (typeof index == 'string')
- index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] );
- this.$tabs.eq(index).trigger(this.options.event);
- },
- load: function(index, callback) { // callback is for internal usage only
-
- var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0],
- bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs');
-
- callback = callback || function() {};
-
- // no remote or from cache - just finish with callback
- if (!url || !bypassCache && $.data(a, 'cache.tabs')) {
- callback();
- return;
- }
-
- // load remote from here on
-
- var inner = function(parent) {
- var $parent = $(parent), $inner = $parent.find('*:last');
- return $inner.length && $inner || $parent;
- };
- var cleanup = function() {
- self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass)
- .each(function() {
- if (o.spinner)
- inner(this).parent().html(inner(this).data('label.tabs'));
- });
- self.xhr = null;
- };
-
- if (o.spinner) {
- var label = inner(a).html();
- inner(a).wrapInner('<em></em>')
- .find('em').data('label.tabs', label).html(o.spinner);
- }
-
- var ajaxOptions = $.extend({}, o.ajaxOptions, {
- url: url,
- success: function(r, s) {
- $(a.hash).html(r);
- cleanup();
-
- if (o.cache)
- $.data(a, 'cache.tabs', true); // if loaded once do not load them again
-
- // callbacks
- $(self.element).triggerHandler('tabsload',
- [null, self.ui(self.$tabs[index], self.$panels[index])], o.load
- );
- o.ajaxOptions.success && o.ajaxOptions.success(r, s);
-
- // This callback is required because the switch has to take
- // place after loading has completed. Call last in order to
- // fire load before show callback...
- callback();
- }
- });
- if (this.xhr) {
- // terminate pending requests from other tabs and restore tab label
- this.xhr.abort();
- cleanup();
- }
- $a.addClass(o.loadingClass);
- setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
- self.xhr = $.ajax(ajaxOptions);
- }, 0);
-
- },
- url: function(index, url) {
- this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url);
- },
- destroy: function() {
- var o = this.options;
- this.element.unbind('.tabs')
- .removeClass(o.navClass).removeData('tabs');
- this.$tabs.each(function() {
- var href = $.data(this, 'href.tabs');
- if (href)
- this.href = href;
- var $this = $(this).unbind('.tabs');
- $.each(['href', 'load', 'cache'], function(i, prefix) {
- $this.removeData(prefix + '.tabs');
- });
- });
- this.$lis.add(this.$panels).each(function() {
- if ($.data(this, 'destroy.tabs'))
- $(this).remove();
- else
- $(this).removeClass([o.selectedClass, o.unselectClass,
- o.disabledClass, o.panelClass, o.hideClass].join(' '));
- });
- }
-});
-
-$.ui.tabs.defaults = {
- // basic setup
- unselect: false,
- event: 'click',
- disabled: [],
- cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
- // TODO history: false,
-
- // Ajax
- spinner: 'Loading&#8230;',
- cache: false,
- idPrefix: 'ui-tabs-',
- ajaxOptions: {},
-
- // animations
- fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
-
- // templates
- tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>',
- panelTemplate: '<div></div>',
-
- // CSS classes
- navClass: 'ui-tabs-nav',
- selectedClass: 'ui-tabs-selected',
- unselectClass: 'ui-tabs-unselect',
- disabledClass: 'ui-tabs-disabled',
- panelClass: 'ui-tabs-panel',
- hideClass: 'ui-tabs-hide',
- loadingClass: 'ui-tabs-loading'
-};
-
-$.ui.tabs.getter = "length";
-
-/*
- * Tabs Extensions
- */
-
-/*
- * Rotate
- */
-$.extend($.ui.tabs.prototype, {
- rotation: null,
- rotate: function(ms, continuing) {
-
- continuing = continuing || false;
-
- var self = this, t = this.options.selected;
-
- function start() {
- self.rotation = setInterval(function() {
- t = ++t < self.$tabs.length ? t : 0;
- self.select(t);
- }, ms);
- }
-
- function stop(e) {
- if (!e || e.clientX) { // only in case of a true click
- clearInterval(self.rotation);
- }
- }
-
- // start interval
- if (ms) {
- start();
- if (!continuing)
- this.$tabs.bind(this.options.event, stop);
- else
- this.$tabs.bind(this.options.event, function() {
- stop();
- t = self.options.selected;
- start();
- });
- }
- // stop interval
- else {
- stop();
- this.$tabs.unbind(this.options.event, stop);
- }
- }
-});
-
-})(jQuery);
diff --git a/content/js/jquery.watermarkinput.js b/content/js/jquery.watermarkinput.js
deleted file mode 100755
index fefa670..0000000
--- a/content/js/jquery.watermarkinput.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2007 Josh Bush (digitalbush.com)
- *
- * 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 above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * 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.
- */
-
-/*
- * Version: Beta 1
- * Release: 2007-06-01
- */
-(function($) {
- var map=new Array();
- $.Watermark = {
- ShowAll:function(){
- for (var i=0;i<map.length;i++){
- if(map[i].obj.val()==""){
- map[i].obj.val(map[i].text);
- map[i].obj.css("color",map[i].WatermarkColor);
- }else{
- map[i].obj.css("color",map[i].DefaultColor);
- }
- }
- },
- HideAll:function(){
- for (var i=0;i<map.length;i++){
- if(map[i].obj.val()==map[i].text)
- map[i].obj.val("");
- }
- }
- }
-
- $.fn.Watermark = function(text,color) {
- if(!color)
- color="#aaa";
- return this.each(
- function(){
- var input=$(this);
- var defaultColor=input.css("color");
- map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
- function clearMessage(){
- if(input.val()==text)
- input.val("");
- input.css("color",defaultColor);
- }
-
- function insertMessage(){
- if(input.val().length==0 || input.val()==text){
- input.val(text);
- input.css("color",color);
- }else
- input.css("color",defaultColor);
- }
-
- input.focus(clearMessage);
- input.blur(insertMessage);
- input.change(insertMessage);
-
- insertMessage();
- }
- );
- };
-})(jQuery); \ No newline at end of file
diff --git a/content/js/jquizme.js b/content/js/jquizme.js
deleted file mode 100644
index 09751a3..0000000
--- a/content/js/jquizme.js
+++ /dev/null
@@ -1,1028 +0,0 @@
-// jQuizMe 2.1 by Larry Battle.
-//Please give me feedback at blarry@bateru.com
-//Copyright (c) 2009 Larry Battle 12/15/2009
-//Dual licensed under the MIT and GPL licenses.
-//http://www.opensource.org/licenses/mit-license.php
-//http://www.gnu.org/licenses/gpl.html
-// quizData =[ { ques: "", ans : ""}, {ques: "", ans : ""}, etc ];
-// quiz( quizData, options ) # wordsList is an arrary of objects with the following format
-
-(function($){
- var _jQuizMeLayOut = $("<div/>").addClass( "quiz-el").append(
- $("<div/>").addClass( "q-header q-innerArea").append(
- $("<div/>").addClass( "q-counter"),
- $("<div/>").addClass( "q-title")
- ),
- $("<div/>").addClass( "q-help q-innerArea").append(
- $("<div/>").addClass( "q-help-menu" ).append(
- $( "<span/>" ).addClass( "q-quit-area" ).append(
- $( "<input type ='button'/>" ).addClass( "q-quit-btn" ),
- $( "<input type='button'/>" ).addClass( "q-quitYes-btn q-quit-confirm" ).hide(),
- $( "<input type='button'/>" ).addClass( "q-quitNo-btn q-quit-confirm" ).hide()
- ),
- $("<input type='button'/>").addClass( "q-help-btn" ),
- $( "<span/>" ).addClass( "q-timer-area" ),
- $("<div/>").addClass( "q-help-info" ).hide()
- )
- ),
- $("<div/>").addClass( "q-review-menu q-innerArea").append(
- $("<input type='button'/>").addClass( "q-details-btn q-reviewBar-btns" ),
- $("<input type='button'/>").addClass( "q-review-btn q-reviewBar-btns" ),
- $("<div/>").addClass( "q-reviewBar q-innerArea").append(
- $("<input type='button'/>").attr({ "class": "q-leftArrow q-review-arrows", "value": "<-" }),
- $("<input type='button'/>").attr({ "class": "q-rightArrow q-review-arrows", "value": "->" }),
- $( "<span/>" ).addClass( "q-review-nav" ).append(
- $("<select/>").addClass( "q-review-index-all q-review-index"),
- $("<select/>").addClass( "q-review-index-missed q-review-index").hide(),
- $("<span/>").addClass( "q-missMarker" ).show(),
- $("<input type='checkbox'/>").addClass( "q-showOnlyMissed-btn")
- )
- ).hide()
- ),
- $("<div/>").addClass( "q-intro q-innerArea" ).append(
- $( '<p/>' ).addClass( "q-intro-info" ),
- $( '<input type="button"/>' ).addClass( "q-begin-btn" )
- ).hide(),
- $("<div/>").addClass( "q-prob q-innerArea" ).append(
- $("<div/>").addClass( "q-ques q-probArea"),
- $("<div/>").addClass( "q-ans q-probArea").append(
- $( "<div/>" ).addClass( "q-ansSel" ),
- $( "<input type='button'/>" ).addClass( "q-check-btn" )
- ),
- $("<div/>").addClass( "q-result q-probArea" ).hide()
- ),
- $("<div/>").addClass( "q-gameOver q-innerArea" ).append(
- $("<div/>").addClass( "q-stat q-probArea").append(
- $("<span/>").addClass( "q-statTotal q-center"),
- $("<hr/>"),
- $("<blockquote/>").addClass( "q-statDetails"),
- $("<div/>").addClass( "q-extraStat" )
- ),
- $("<div/>").addClass( "q-options q-probArea q-center").append(
- $("<input type='button'/>").addClass( "q-restart-btn" ),
- $("<input type='button'/>").addClass( "q-del-btn" )
- )
- ).hide()
- );
-
- var areArraysSame = function( mainArr, testArr) {
- if ( mainArr.length != testArr.length ){ return false; }
- var i = mainArr.length;
-
- while( i-- ) {
- if ( $.isArray( mainArr[i] ) ) {
- if ( !areArraysSame( mainArr[i], testArr[i] ) ){ return false;}
- }
- if ( mainArr[i] !== testArr[i] ){ return false;}
- }
- return true;
- },
- toHTMLUnicode = function( str ) {
- if( typeof str !== "string" ){ return str; }
- var uni = '', i = str.length, i2 = 0;
-
- while( i-- ){
- uni += "&#" + str.charCodeAt( i2++ ) + ";";
- }
- return uni;
- },
- isMSIE = $.browser.msie,
- _lang = {
- ans:{ // _lang.ans are shown during the display of .q-result, the answer result.
- corrAns: "Correct answer(s):",
- praise: 'Great Job. Right!',
- whyAns: "Info:",
- yourAns: "Your Answer:"
- },
- btn:{ // [ "text", "title" ]
- begin: [ "Begin Quiz" ],
- check: [ "Check", "Check your answer" ],
- del: [ "Delete", "Delete quiz" ],
- help: [ "Help", 'Click for help'],
- next: [ "Next", "Next question" ],
- restart: [ "Restart", "Restart the quit over" ],
- details: [ "Details", "View score report" ],
- review: [ "Review", "Review Questions" ],
- showOnlyMissed: [ " *", "Click to show only missed questions." ],
- quit: [ "Quit", "Quit quiz" ],
- quitNo: [ "->", "Go Back" ],
- quitYes: [ '', "Yes, quit" ]
- },
- err:{
- badQType: "Invalid quiz type.",
- badKey: " is an invalid key value.",
- error: "Error",
- noQType: "No quizTypes.",
- noQues: "Quiz has no questions.",
- notArr: "Must be an array.",
- notObj: "Invalid quiz data structure. Must be an array or object."
- },
- stats:{
- right: "Right",
- rate: "Rate",
- score: "Score",
- wrong: "Wrong",
- total: "Total",
- tried: "Tried"
- },
- quiz:{
- tfEqual: " <br/>=<br/> ",
- tfFalse: "False",
- tfTrue: "True"
- }
- },
- setLangBtnTxt = function( lang ){
- var btnCls = [ "begin", "check", "del", "help", "restart", "quit", "quitYes", "quitNo", "review", "details", "showOnlyMissed" ];
- var i = btnCls.length, el;
-
- if( !lang.btn.quitYes[0] ){ lang.btn.quitYes[0] = lang.btn.quit[0] + "?"; }
-
- $( ".q-missMarker", _jQuizMeLayOut ).html( lang.btn.showOnlyMissed[0] );
- lang.btn.showOnlyMissed[0] = '';
- while( i-- ){
- el = [".q-", btnCls[ i ], "-btn"].join('');
- $( el, _jQuizMeLayOut ).attr( "value", lang.btn[ btnCls[ i ] ][0] );
- $( el, _jQuizMeLayOut ).attr( "title", lang.btn[ btnCls[ i ] ][1] );
- }
- },
- _settings = {
- addToEnd: "", // This is attached to fill in the blank quiz types.
- activeClass: "q-ol-active", // Used on multiple choice, (multiOl), quiz types.
- allQuizType: '', // This sets all questions to this quiz type.
- allRandom: false, // Randomizes all the questions, regardless of quiz type section.
- blockCheck: true, // Blocks the check-button until the user tries to answer.
- disableRestart: false, //Hide or show the restrart button on gameOver.
- disableDelete: false, //Hide or show the delete button on gameOver.
- fxType: 0, // animateType [ show/hide, fadeToggle, slideToggle, weight&heightToggle ];
- fxCode: false, //If a function, then this is used for animation. Please refer to animateType[] for examples.
- fxSpeed: "normal", // "fast", "slow", "normal" or numbers.
- help: 'None', // Provide help text/html if needed.
- hoverClass: "q-ol-hover", // Used on multiple choice, (multiOl), quiz types.
- intro: '', // Provide an text/html intro.
- multiLen : 3, // Set the number of multiple choice choices for quizType multi & multiList.
- numOfQuizQues: 0, // Sets the number of questions asked. Must be between 0 and the total questions.
- random: true, // Randomizes all the questions in each quiz type section.
- review: true, // Allows for review of questions at gameOver.
- showAns: true, // Show the answers after each question.
- showAnsInfo: true, // If provided, show the answers information after each question.
- showHTML: false, //This will show the HTML, by converting to unicode, rather than render it.
- showWrongAns: false, // If answer is wrong, then show the user's wrong answer after each question.
- statusUpdate: false, // Sends a status Update. Refer to function sendStatus.
- quizType: "fillInTheBlank", // This is only need if you send in an array and not a object with a defined quiz type.
- title: 'jQuizMe' // title displayed for quiz.
- };
-
- $.fn.jQuizMe = function( wordList, options, userLang ){
- var settings = $.extend( {}, settings, _settings, options ),
- lang = $.extend( true, {}, lang, _lang, userLang );
- setLangBtnTxt( lang );
-
- return this.each( function(){
- // currQuiz is the output file.(this is what the user sees). $( el, currQuiz) must be used when accessing elements.
- var currQuiz = {}, currIndex = 0, stickyEl = this, quit = false, userAns = [], totalQuesLen = 0,
- // The q object is where the quiz data, that was made before the quiz starts, is stored here.
- // Please beware that all the questions are stored linearly. But you can find a quiz type by using index[Max|Min].
- q = {
- // Each index is a question. [ question1, question2, question3,... ]. But not for indexMax|Min and props.
- ans: [], // Answers.
- ansSel: [], // Answer selections, the elements for inputting an answer. Ex. input text box, or a select tag.
- ansInfo: [], // Stores the answer information if provided.
- indexMax: [], // The stopping point index for a quiz type inside the q. ans, ansSel, ansInfo and ques.
- indexMin: [], // The starting point index.
- prop:[], // Stores the quiz types names in order. Used for creation of each.
- ques: [] // Questions.
- },
- stats = {
- totalQues: 0,
- quesTried: 0,
- // rightAns[] and wrongAns[] keeps an track of the q's answer index, enabling the user to review on gameOver.
- rightAns: [],
- wrongAns : [],
- accur : function(){
- var x = Math.round( this.rightAns.length / this.quesTried * 10000 ) / 100;
- return ( this.quesTried ) ? x : 0;
- },
- accurTxt : function(){
- return [ this.rightAns.length, "/", this.quesTried," = ", this.accur(), "%"].join('');
- },
- perc : function(){
- var x = Math.round( this.rightAns.length / this.totalQues * 10000 );
- return ( this.totalQues ) ? ( x / 100) : 0;
- },
- percTxt : function(){
- return [ this.rightAns.length, "/", this.numOfQues, " = ", this.perc(), "%"].join('');
- },
- reset : function(){
- this.totalQues = totalQuesLen;
- this.quesTried = 0;
- this.rightAns = [];
- this.wrongAns = [];
- }
- },
- // r means random.
- rNum = function( len ){
- return Math.floor( Math.random() * len );
- },
- rBool = function(){
- return ( (rNum( 100 ) % 2) != 1);
- },
- // rAns(): Returns a random answer from either all the questions, or a curtain quiz type.
- // iProp -> index of the desired quiz type.
- rAns = function( iProp, fromAllQues ){
- var p = ( fromAllQues ) ? q.prop[ rNum( q.prop.length ) ] : q.prop[ iProp ],
- ques = wordList[ p ][ rNum( wordList[ p ].length ) ];
-
- return ques.ans;
- },
- makeArrayRandom = function( arr ){
- var j, x, i = arr.length;
- while( i ){
- j = parseInt(Math.random() * i, 10);
- x = arr[--i];
- arr[i] = arr[j];
- arr[j] = x;
- }
- return arr;
- },
- disableMenuBar = function(){
- $( ".q-quit-btn, .q-help-btn", currQuiz ).attr( "disabled", true );
- $( ".q-help-info" ).hide();
- },
- // setCheckBtn(): Sets the check button to toggle from "check" to "next". Or just displays "next".
- // "check" shows the answer results, but "next" just changes the question.
- setCheckBtn = function(){
- var isFlashCard = '';
-
- $( ".q-check-btn", currQuiz ).unbind();
- if( settings.showAns ){
- //replaceWith forces the toggle() to reset on check-btn.
- $( ".q-check-btn", currQuiz ).replaceWith(
- $( ".q-check-btn", _jQuizMeLayOut ).clone(true)
- );
- $( ".q-check-btn", currQuiz ).attr( "disabled", settings.blockCheck ).toggle(
- function( e ){
- $( e.target ).attr( "value", lang.btn.next[0] );
- isFlashCard = $( currQuiz ).find( ".userInputArea" ).triggerHandler( "getUserAns" );
- displayAnsResult( isFlashCard );
- e.preventDefault();
- },
- function( e ){
- $( e.target ).attr( { "disabled": settings.blockCheck, "value": lang.btn.check[0] });
- nextMove();
- e.preventDefault();
- }
- );
- }
- else{
- $( ".q-check-btn", currQuiz ).attr( {"disabled": settings.blockCheck, "value": lang.btn.next[0] } )
- .click( function( e ){
- $( e.target ).attr( "disabled", settings.blockCheck );
- isFlashCard = $( currQuiz ).find( ".userInputArea" ).triggerHandler( "getUserAns" );
- displayAnsResult( isFlashCard );
- nextMove();
- e.preventDefault();
- }
- );
- }
- },
- // setQuitBtn(): Provides a quit confirm action.
- setQuitBtn = function(){
- $( ".q-quitYes-btn", currQuiz ).click( function(){
- quit = true;
- nextMove();
- });
- $( ".q-quit-confirm", currQuiz ).click( function(){
- $( ".q-quit-confirm", currQuiz ).hide(); //.q-quit-confirm calls both the quitYes and quitNo btns.
- $( ".q-quit-btn", currQuiz ).show();
- });
- $( ".q-quit-btn", currQuiz ).click( function( e ){
- $( e.target ).hide();
- $( ".q-quit-confirm", currQuiz ).show();
- });
- },
- setTotalQuesLen = function(){
- var i = q.prop.length, len = 0, numOfQQ = settings.numOfQuizQues;
-
- while( i-- ){
- len += wordList[ q.prop[ i ] ].length;
- }
- totalQuesLen = ( !numOfQQ || isNaN( numOfQQ ) || numOfQQ > len ) ? len : numOfQQ;
- stats.numOfQues = totalQuesLen;
- },
- // setQuizTypePos(): This stores the position of the beginning and end index of each quiz type.
- // This allows for each quiz type to be pinpointed to in an array.
- setQuizTypePos = function(){
- var i = 0, sum = 0, len = 0;
-
- while( q.prop[ i ] ){
- len = wordList[ q.prop[ i ] ].length;
- sum += len;
- q.indexMax[ i ] = sum - 1;
- q.indexMin[ i ] = sum - len;
- i++;
- }
- },
- // createQuizEl(): Creates new quiz element and sets default button behaviors.
- createQuizEl = function(){
- currQuiz = _jQuizMeLayOut.clone( true ).hide(); // currQuiz hide until ready.
- $( ".q-help-btn", currQuiz).toggle(
- function(){ animateThis( $( ".q-help-info", currQuiz), 1 ); },
- function(){ animateThis( $( ".q-help-info", currQuiz), 0 ); }
- );
- setTotalQuesLen();
- setQuizTypePos();
- setQuitBtn();
- setCheckBtn();
- if( settings.review ){ setReviewMenu(); }
- $( stickyEl ).append( currQuiz );
- },
- // cont(): Checks whether the questions are done or if quit was called.
- cont = function(){
- var result = ( !quit && ( currIndex < totalQuesLen ) );
- if( !result ){ quit = true; }
- return result;
- },
- // animateType[]: Stores animation styles to animate an element.
- animateType = [
- function( el, on ){ el[ ( on ) ? "show" : "hide" ]( 0 );},
- function( el, on, spd ){ el[ ( on ) ? "fadeIn" : "fadeOut" ]( spd );},
- function( el, on, spd ){ el[ ( on ) ? "slideDown" : "slideUp" ]( spd );},
- function( el, on, spd ){
- el.animate( { "height": "toggle", "width": "toggle" }, spd );
- }
- ],
- // animateThis(): Calls animations on an element and/or push a callback function.
- animateThis = function( el, isShown, func ){
- if( isShown > -1 ){
- animateType[ settings.fxType ]( el, isShown, settings.fxSpeed );
- }
- if( func ){
- el.queue( function(){ func(); $(el).dequeue();});
- }
- if( isMSIE && (isShown > 0) ){
- $(el).animate( { opacity: 1} ).css( "display", "block" );
- }
- },
- // setReviewNav(): Adds events and functions to change the review questions being viewed.
- // changeCurrIndex() is main point of focus.
- setReviewNav = function(){
- var qReviewOpt = ".q-review-index:visible option:",
- qReviewOptVal = qReviewOpt + "selected",
- changeCurrIndex = function( i ){
- var max = $( qReviewOpt + "last", currQuiz).val(),
- min = $( qReviewOpt + "first", currQuiz).val(),
- isIndexValid = ( i <= max && i >= min );
-
- if( isIndexValid ){
- $( ".q-review-index", currQuiz).val( i );
- currIndex = i;
- changeProb(true);
- displayAnsResult();
- $( ".q-reviewBar > :disabled", currQuiz).attr( "disabled", false );
- }
- // if a limit was reached. Disable the corresponding arrow.
- if( i == max || i == min ){
- $( ".q-" + (( i == min )?"left":"right") + "Arrow", currQuiz ).attr( "disabled", true );
- }
- };
- $( ".q-review-index", currQuiz).change(function(e){
- changeCurrIndex( parseInt( $(e.target).val(), 10) );
- });
- // Note: The prev||next values of the options tag are used because the list might not be in numerical order.
- $( ".q-review-arrows", currQuiz).click(function( e ){
- var isLeft = !!e.target.className.match( /left/ ),
- reviewVal = $( qReviewOptVal, currQuiz)[ ( isLeft ) ? "prev":"next" ]().val();
-
- changeCurrIndex( parseInt( reviewVal, 10) );
- });
- },
- // setReviewMenu(): Sets the events to change the view when the "review" or "details" button is clicked.
- setReviewMenu = function(){
- var qG = $( ".q-gameOver", currQuiz ), qP = $( ".q-prob", currQuiz );
-
- $( ".q-reviewBar-btns", currQuiz ).click( function( e ){
- var isDetailEl = ( e.target.className.search(/details/) > -1),
- showEl = ( isDetailEl ) ? qG : qP,
- hideEl = ( !isDetailEl ) ? qG : qP;
-
- animateThis( $( ".q-reviewBar", currQuiz), !isDetailEl );
- animateThis( hideEl, 0, function(){
- $( ".q-details-btn", currQuiz ).attr( "disabled", isDetailEl );
- $( ".q-review-btn", currQuiz ).attr( "disabled", !isDetailEl );
- animateThis( showEl, 1 );
- });
- });
- $( ".q-showOnlyMissed-btn", currQuiz ).change( function(){
- var ckd = $(this).is(":checked");
- $( ".q-review-index-missed", currQuiz )[ (ckd) ? "fadeIn":"hide" ]();
- $( ".q-review-index-all", currQuiz )[ (!ckd) ? "fadeIn":"hide" ]();
- $( ".q-review-index:visible", currQuiz ).trigger( "change" );
- });
- setReviewNav();
- },
- // updateReviewIndex(): Creates the review's select tag html for all and wrong answers.
- updateReviewIndex = function(){
- var allMissed = '', optHtml = '', markAsWrong = '', eachOpt = '',
- i = 0, totalQues = stats.totalQues, rightLen = stats.rightAns.length, right = {};
-
- while( rightLen-- ){
- right[ stats.rightAns[ rightLen ] ] = 1;
- }
- while( totalQues - i ){
- markAsWrong = ( !right[i] ) ? " *" : "";
- eachOpt = "<option value=" + i + ">";
- eachOpt += (i+1);
- eachOpt += markAsWrong;
- eachOpt += "</option>";
- optHtml += eachOpt;
- allMissed += (markAsWrong) ? eachOpt : "";
- i++;
- }
- $( ".q-review-index-all", currQuiz).html( optHtml );
- $( ".q-review-index-missed", currQuiz).html( allMissed );
- },
- // disableButtons(): If requested, on gameOver hide the restart and/or delete buttons.
- disableButtons = function(){
- if( settings.disableRestart ){ $( ".q-restart-btn", currQuiz).hide(); }
- if( settings.disableDelete ){ $( ".q-del-btn", currQuiz).hide(); }
- if( settings.disableRestart && settings.disableDelete ){
- $( ".q-options", currQuiz ).hide();
- }
- },
- // gameOver(): Creates a performance list, set's the events for restart and delete, hides unneed elements,
- // # then enables the review-bar.
- gameOver = function(){
- disableButtons();
- $( ".q-statTotal", currQuiz).html( lang.stats.score + ": " + stats.perc() + "%" );
- $( ".q-statDetails", currQuiz).html(
- [
- (lang.stats.right + ": " + stats.rightAns.length),
- (lang.stats.wrong + ": " + stats.wrongAns.length),
- (lang.stats.tried + ": " + stats.quesTried),
- (lang.stats.rate + ": " + stats.accurTxt()),
- (lang.stats.total + ": " + stats.percTxt())
- ].join('<br/>')
- );
- $( ".q-restart-btn", currQuiz).one( "click", function(){
- reStartQuiz();
- });
- $( ".q-del-btn", currQuiz).one( "click", function(){
- deleteQuiz();
- });
- $( ".q-help, .q-check-btn, .q-prob, .q-intro, .q-ans", currQuiz).hide();
- if( settings.review ){
- updateReviewIndex();
- $( ".q-review-btn", currQuiz ).one( "click", function(){
- $( ".q-review-index", currQuiz).trigger( "change" );
- displayAnsResult(); // This forces the answer info to be displayed for first question.
- if( totalQuesLen == 1 ){
- $( ".q-rightArrow, .q-showOnlyMissed-btn", currQuiz ).attr( "disabled", true );
- }
- });
- $( ".q-details-btn", currQuiz).attr( "disabled", true );
- $( ".q-review-menu", currQuiz).show();
- }
- animateThis( $( ".q-gameOver", currQuiz), 1 );
- },
- // changeProb(): Changes to next problem and updates status.
- changeProb = function( isReview ){
- var qAS = q.ansSel;
- $( ".q-counter", currQuiz).text( (currIndex + 1) + '/' + totalQuesLen );
- $( ".q-ques", currQuiz).html( q.ques[ currIndex ] );
- if( !isReview ){
- $( ".q-ansSel", currQuiz).html(
- // Checks for an index pointer; used to clone an identical q.ansSel. This was done to speed up buildQuizType.
- qAS[ isNaN( qAS[currIndex] ) ? currIndex : qAS[currIndex] ].clone(true)
- );
- $( ".q-result", currQuiz ).hide(); //.q-prob is animated to hide, so just hide .q-result.
- $( ".focusThis", currQuiz ).focus();
- $( ".clickThis", currQuiz ).click();
- }
- },
- // changeQuizInfo(): Changes the main information for the quiz.
- changeQuizInfo = function(){
- setToBeginningView();
- $( ".q-title", currQuiz).html( settings.title );
- $( ".q-help-info", currQuiz).html( settings.help );
- if( settings.intro ){
- $( ".q-prob", currQuiz ).hide();
- $( ".q-intro-info", currQuiz ).html( settings.intro );
- $( ".q-intro", currQuiz ).show();
- $( ".q-begin-btn", currQuiz ).unbind().one( "click", function(){
- animateThis( $( ".q-intro", currQuiz ), 0, function(){
- animateThis( $( ".q-prob", currQuiz ), 1 );
- });
- });
- }
- if( isMSIE ){
- //IE will still show the result for some odd reason. So you MUST show, then hide.
- var hideResults = function(){
- setTimeout( function(){ $( ".q-result", currQuiz ).show().hide(); }, 500 );
- };
- hideResults(); //If no intro, start function.
- $( ".q-begin-btn", currQuiz ).one( "click", function(e){
- hideResults(); //Wait until the quiz has begun.
- });
- }
- },
- sendStatus = function(){
- var quizInfo = {
- "right": stats.rightAns,
- "wrong": stats.wrongAns,
- "tried": stats.quesTried,
- "score": stats.perc(),
- "total": stats.totalQues,
- "hasQuit": quit,
- "quitFunc": ( !quit ) ? quitQuiz : function(){},
- "nextFunc": ( !quit ) ? changeProb : function(){}
- };
-
- settings.statusUpdate( quizInfo, currQuiz );
- },
- // nextMove(): Decides to change the problem or to quit.
- nextMove = function(){
- currIndex++; // currIndex++ must be first, to find out if there are other questions.
- var nextFunc = (cont() ? changeProb : quitQuiz),
- qEl = $( ".q-prob", currQuiz);
-
- if( !quit ){ animateThis( qEl, 0 ); }
- if( settings.statusUpdate ){ sendStatus(); }
- animateThis( qEl, -1, nextFunc ); //Push the function to the stack, so it's called in between the animations.
- if( !quit ){ animateThis( qEl, 1 ); }
-
-
- },
- // getAns(): Is used to check the answers.
- getAns = function( i ){
- return q.ans[ i || currIndex ];
- },
- // checkAns(): Changes the user's answer during the quiz and updates the stats.
- checkAns = function( isFlashCard ){
- var ans = getAns(), isAnsCorr = false;
-
- if( typeof(ans) === "string"){
- ans = $.trim( ans );
- }
- if( $.isArray( ans ) ){
- // If one element of the array matches the user's input, then it's correct.
- // This enables multiple answers to be possible.
- if( ($.inArray( userAns[currIndex], ans ) + 1) ){ isAnsCorr = true; }
- if( userAns[currIndex] == ans.toString() ){ isAnsCorr = true; }
- }
- else{
- isAnsCorr = ( userAns[currIndex] == ans || userAns[currIndex].toString().toLowerCase() == ans.toString().toLowerCase() );
- }
- if( !quit ){
- stats.quesTried++;
- stats[ ( isAnsCorr || isFlashCard ) ? "rightAns" : "wrongAns" ].push( currIndex );
- }
- return isAnsCorr;
- },
- // displayAnsResult(): Display's the answer result and information during the quiz.
- displayAnsResult = function( isFlashCard ){
- var currAns = getAns(), isUserAnsCorr = checkAns( isFlashCard ),
- isLongArr = ( $.isArray( currAns ) ) && (currAns.length > 1), show = "",
- toUni = settings.showHTML;
-
- if( toUni && !isUserAnsCorr ){
- if( isLongArr ){
- var i = currAns.length;
- currAns = currAns.concat();
-
- while( i-- ){
- currAns[ i ] = toHTMLUnicode( currAns[ i ] );
- }
- }
- else{
- currAns = toHTMLUnicode( currAns );
- }
- }
- show = ( isUserAnsCorr ) ? lang.ans.praise :
- ( lang.ans.corrAns + '<br/>' + (( isLongArr ) ? currAns.join( '<br/>' ) : currAns) );
-
- if( !isUserAnsCorr || quit ){
- if( settings.showWrongAns || quit ){
- var wrongAns = lang.ans.yourAns + "<br/>";
-
- wrongAns = ( !userAns[currIndex] ) ? "<del>" + wrongAns +"</del>" : wrongAns + (( toUni ) ? toHTMLUnicode( userAns[ currIndex ] ) : userAns[currIndex]);
- show = wrongAns + "<hr/>" + show;
- }
- if( settings.showAnsInfo && !!q.ansInfo[ currIndex ] ){
- show += "<hr/>" + lang.ans.whyAns + "<br/>" + q.ansInfo[ currIndex ];
- }
- }
- if( settings.showAns || quit ){
- $( ".q-result", currQuiz ).html( show );
- if( !quit ){
- animateThis( $( ".q-result", currQuiz ), 1 );
- }
- else{
- $( ".q-result", currQuiz ).show();
- }
- }
- },
- hasAnsSel = function( iProp, i ){
- return ( !!wordList[ q.prop[ iProp ] ] [ i ].ansSel );
- },
- rAnsSel = function( iProp, i ){
- var wAS = wordList[ q.prop[ iProp ] ] [ i ].ansSel,
- len = ( $.isArray( wAS ) ) ? wAS.length : 0;
-
- return ( len ) ? wAS[ rNum(len) ] : wAS;
- },
- // buildQuizType{}: contains all the quiz types.
- //Quiz creation: The q object is filled with the questions, answers and answer selections(what the user can choose from).
- //The user's input gets assigned to userAns[ currIndex ] ( global inside quizMe ).
- //Then nextMove() is called. Which checks to see if the user's input is contained in the answer, or is the array.
- buildQuizType = {
- // fillInTheBlank Quiz: ques = ques, ansSel = Input text[ ans ].
- 'fillInTheBlank' : function( iProp, flashVer ){
- var d;
- if( flashVer ){
- d = $( "<span/>" ).addClass( "clickThis userInputArea" ) //Enabled the checkBtn.
- .one( "click", function(){
- $( ".q-check-btn", currQuiz ).attr( "disabled", false );
- })
- .bind( "getUserAns", function(){ return 1; });
- }
- else{
- d = $( '<input type="text"/>' ).addClass( "q-quesInput focusThis userInputArea" )
- .one( "click keypress", function(){
- $( ".q-check-btn", currQuiz ).attr( "disabled", false );
- })
- .bind( "getUserAns", function(){
- userAns[currIndex] = $( ".q-quesInput", currQuiz ).val();
- userAns[currIndex] = $.trim( userAns[currIndex] );
- });
- }
- var i = q.indexMax[ iProp ], qMin = q.indexMin[ iProp ], wList = wordList[ q.prop[ iProp ] ], numOfQues = wList.length;
-
- while( numOfQues-- ){
- q.ansInfo[ i ] = wList[ numOfQues ].ansInfo || "";
- q.ans[ i ] = wList[ numOfQues ].ans;
- q.ansSel[ i ] = qMin;
- q.ques[ i ] = ( wList[ numOfQues ].ques + settings.addToEnd );
- i--;
- }
- q.ansSel[ qMin ] = d; //speed!! All the q.ansSel area reference to qMin.
- },
- 'flashCard' : function( iProp ){
- // flashCard Quiz: ques = ques, ansSel =null .
- this.fillInTheBlank( iProp, true);
- },
- 'trueOrFalse' : function( iProp ){
- // trueOrFalse Quiz:
- // ques = (typeof ans != bool) ? (real or fake ans) : ques;
- // ansSel = T / F ( radio );
- // If the answer is a bool, then there is no creation of a question: combining a right or wrong answers, to make a true or false statement.
-
- var d = $( '<div><input type="radio" value="1" class="true-radio trueRadio"/><label class="trueRadio">' + lang.quiz.tfTrue + '</label> <input type="radio" value="0" class="false-radio falseRadio"/><label class="falseRadio">' + lang.quiz.tfFalse + '</label></div>' );
-
- $( d ).addClass( "userInputArea" ).bind( "getUserAns", function(){
- var isTrue = $( ".true-radio", this ).attr( "checked" );
-
- userAns[currIndex] = lang.quiz[ ( isTrue ) ? "tfTrue" : "tfFalse" ];
- });
- $( d ).children().click( function(){
- $( ".q-check-btn", currQuiz).attr( "disabled", false );
- });
- $(".trueRadio", d).click( function(){
- $( ".true-radio", currQuiz ).attr( "checked", true );
- $( ".false-radio", currQuiz ).attr( "checked", false );
- });
- $(".falseRadio", d).click( function(){
- $( ".true-radio", currQuiz ).attr( "checked", false );
- $( ".false-radio", currQuiz ).attr( "checked", true );
- });
- var currAns, shouldAnsBeCorr = true, i = q.indexMax[ iProp ],
- qMin = q.indexMin[ iProp ], wList = wordList[ q.prop[ iProp ] ], numOfQues = wList.length,
- toUni = settings.showHTML, tfEqual = lang.quiz.tfEqual;
-
- while( numOfQues-- ){
- currAns = wList[ numOfQues ].ans;
- q.ansInfo[ i ] = wList[ numOfQues ].ansInfo || "";
- q.ansSel[ i ] = qMin;
- q.ques[ i ] = wList[ numOfQues ].ques;
-
- if( typeof currAns != "boolean" ){
- shouldAnsBeCorr = rBool();
- var result = ( shouldAnsBeCorr ) ? currAns :
- ( hasAnsSel( iProp, numOfQues ) ) ? rAnsSel( iProp, numOfQues ) : rAns( iProp ),
- a = ( !$.isArray( currAns ) || !$.isArray( result ) ) ? result == currAns : areArraysSame( result, currAns );
-
- q.ans[ i ] = lang.quiz[ ( a ) ? "tfTrue" : "tfFalse" ];
- q.ques[ i ] += tfEqual;
- q.ques[ i ] += ( toUni ) ? toHTMLUnicode( ( typeof result == "object" ) ? result.join( ',' ) : result ) : result;
- }
- else{
- q.ans[ i ] = lang.quiz[ ( currAns ) ? "tfTrue" : "tfFalse" ];
- }
- i--;
- }
- q.ansSel[ qMin ] = d;
- },
- 'multipleChoice' : function( iProp, olVer ){
- // multipleChoice Quiz:
- // ques = ques;
- // ansSel = <select>[ <option> is the answer + <option> * settings.multiLen]
- var d;
- if( olVer ){
- d = $( '<div><ol class="q-ol"></ol></div>' );
- $( d ).one( "click", function(){
- $( ".q-check-btn", currQuiz ).attr( "disabled", false );
- });
- $( ".q-ol-li", d )
- .live( "click", function( e ){
- $( e.target ).closest( ".q-ol-li" ).addClass( settings.activeClass ).siblings().removeClass( settings.activeClass );
- if( e.target.className != "q-radioBtn" ){
- $( e.target ).siblings().find( ".q-radioBtn:checked" ).attr( "checked", false );
- $( e.target ).find( ".q-radioBtn" ).attr( "checked", true );
- }else{
- $( e.target ).parent().siblings().find( ".q-radioBtn:checked" ).attr( "checked", false );
- $( e.target ).attr( "checked", true );
- }
- })
- .live( "mouseover", function( e ){
- $( e.target ).closest( ".q-ol-li" ).addClass( settings.hoverClass );
- })
- .live( "mouseout", function( e ){
- $( e.target ).closest( ".q-ol-li" ).removeClass( settings.hoverClass );
- });
- }
- else{
- d = $( '<div><select class="q-select"></select></div>' );
- $( ".q-select", d ).one( "click keypress", function( e ){
- $( ".q-check-btn", currQuiz).attr( "disabled", false );
- });
- }
- $( d ).addClass( "userInputArea" ).bind( "getUserAns", function(){
- if( olVer ){
- var elText = $( "." + settings.activeClass, currQuiz ).text();
- userAns[currIndex] = (isMSIE) ? elText.substring( 2, elText.length ) : elText;
- userAns[currIndex] = $.trim( userAns[currIndex] );
- }
- else{
- userAns[currIndex] = $( "option:selected", this ).text();
- }
- });
-
- var i = q.indexMax[ iProp ], wList = wordList[ q.prop[ iProp ] ], ansPos, optHtml, val, len,
- j = wList.length, wListRange = new Array( j ), numOfQues = wList.length,
- //Checks to see, if the request multiLen length can be supported.
- setLen = ( settings.multiLen > j ) ? j : settings.multiLen,
- toUni = settings.showHTML, hasAnsPosition = false, ansSelChoice = "";
-
- while( j-- ){
- wListRange[ j ] = j;
- }
-
- while( numOfQues-- ){
- optHtml = "";
- hasAnsPosition = false;
-
- if( hasAnsSel( iProp, numOfQues ) ){
- val = [];
- if( typeof wList[ numOfQues ].ansSel === "object" ){
- var wAnsSel = wList[ numOfQues ].ansSel, k = wAnsSel.length, valLen = 0;
-
- while( k-- ){
- if( wAnsSel[ k ] === null ){
- val[ valLen++ ] = wList[ numOfQues ].ans;
- hasAnsPosition = true;
- }
- else{
- val[ valLen++ ] = wAnsSel[ k ];
- }
- }
- }
- else{
- val[ 0 ] = wList[ numOfQues ].ansSel;
- }
- if( !hasAnsPosition ){
- val[ val.length ] = wList[ numOfQues ].ans;
- makeArrayRandom( val );
- }
- len = val.length;
-
- while( len-- ){
- ansSelChoice = ( toUni ) ? toHTMLUnicode( val[ len ] ): val[ len ];
-
- optHtml += ( olVer ) ? ["<li class = 'q-ol-li'><input type='radio' class='q-radioBtn'/> ", ansSelChoice, "</li> "].join("") :
- [ "<option>", ansSelChoice, "</option> " ].join("");
- }
- }
- else{
- var randAns = wListRange.concat();
- // Get rids of the answer Index from randAns.
- randAns.splice( numOfQues, 1 );
- len = setLen;
- ansPos = rNum( len );
- while( len-- ){
- var randIndex = rNum( randAns.length ),
- ansSelIndex = ( len == ansPos ) ? numOfQues : randAns.splice( randIndex, 1 ) || 0;
-
- ansSelChoice = ( toUni ) ? toHTMLUnicode( wList[ ansSelIndex ].ans ) : wList[ ansSelIndex ].ans;
- optHtml += ( olVer ) ? ["<li class = 'q-ol-li'><input type='radio' class='q-radioBtn'/>", ansSelChoice, "</li> "].join("") :
- [ "<option>", ansSelChoice, "</option> " ].join("");
- }
- }
- // below: innerHTML is 2x faster than $.html() but IE generates corrrupt option html
- ( olVer ) ? $( ".q-ol", d )[0].innerHTML = optHtml :
- ( isMSIE ) ? $( "select", d ).html( optHtml ) : ($( "select", d )[0].innerHTML = optHtml);
- if( isMSIE && olVer ){
- //Fixes IE CSS BUG. No spaces with list-style-position: inline.
- $( ".q-ol-li", d ).prepend( "&nbsp;&nbsp;" );
- }
-
- q.ans[ i ] = wList[ numOfQues ].ans;
- q.ansInfo[ i ] = wList[ numOfQues ].ansInfo || "";
- q.ansSel[ i ] = d.clone( true );
- q.ques[ i ] = wList[ numOfQues ].ques;
- i--;
- }
- },
- 'multipleChoiceOl' : function( iProp ){
- // multipleChoiceOlQuiz: ques = ques, ansSel = ol [ <list> real ans + <list> * settings.multipleChooseLength]
- this.multipleChoice( iProp, true);
- }
- },
- // makeQuizRandom(): If randomizeQ is false, it will randomize the each quiz type.
- // But if randomizeQ is true, it will randomize the q object.
- makeQuizRandom = function( randomizeQ ){
- if( randomizeQ ){
- var numArr = new Array( totalQuesLen ), i = numArr.length,
- temp = { ans: [], ansSel: [], ansInfo: [], ques: [] }, nArrI, qAS;
-
- while( i-- ){ numArr[ i ] = i; }
- makeArrayRandom( numArr );
- i = numArr.length;
-
- while( i-- ){
- nArrI = numArr[ i ];
- qAS = q.ansSel[ nArrI ];
-
- temp.ans[i] = q.ans[ nArrI ];
- temp.ansInfo[i] = q.ansInfo[ nArrI ] || "";
- temp.ansSel[i] = ( typeof qAS !== "number" ) ? qAS : q.ansSel[ qAS ];
- temp.ques[i] = q.ques[ nArrI ];
- }
- q.ans = temp.ans.concat();
- q.ansInfo = temp.ansInfo.concat();
- q.ansSel = temp.ansSel.concat();
- q.ques = temp.ques.concat();
- }
- else{
- var iProp = q.prop.length;
- while( iProp-- ){
- makeArrayRandom( wordList[ q.prop[ iProp ] ] );
- }
- }
- },
- makeQuizType = function(){
- //iProp is a pointer to the quizType min and max index.
- var iProp = q.prop.length, currProp = "", p, allP = settings.allQuizType,
- shortProp = {
- fill:"fillInTheBlank", cards:"flashCard", tf:"trueOrFalse", multi:"multipleChoice", multiList:"multipleChoiceOl"
- };
-
- if( settings.random ){ makeQuizRandom();}
- while( iProp-- ){
- p = allP || q.prop[ iProp ];
- currProp = shortProp[ p ] || p;
- buildQuizType[ currProp ]( iProp );
- }
- if( settings.allRandom ){ makeQuizRandom(true);}
- },
- setUserAnsBlank = function(){
- var i = totalQuesLen;
-
- while( i-- ){
- userAns[ i ] = "";
- }
- },
- // Creates and shows the new quiz.
- createNewQuizProb = function(){
- setUserAnsBlank();
- stats.reset();
- makeQuizType();
- changeQuizInfo();
- changeProb();
- if( settings.statusUpdate ){ sendStatus(); }
- animateThis( $( currQuiz ), 1 );
- },
- quitQuiz = function(){
- currIndex = 0; //Used to make updateReviewIndex start at 0.
- quit = true;
- disableMenuBar();
- gameOver();
- },
- deleteQuiz = function(){
- animateThis( $( currQuiz ), 0, function(){
- $( currQuiz ).remove();
- });
- q = {};
- },
- setToBeginningView = function(){
- $( ".q-gameOver, .q-result, .q-review-menu", currQuiz).hide();
- $( ".q-ans, .q-help, .q-check-btn, .q-help-menu, .q-prob", currQuiz ).show();
- $( ".q-quit-btn, .q-help-btn", currQuiz ).attr( "disabled", false );
- },
- reStartQuiz = function(){
- //IE likes to hide on restart.
- if( !isMSIE || ( isMSIE && settings.fxType == 3 ) ){
- animateThis( $( currQuiz ), 0 );
- }
- setToBeginningView();
- quit = false;
- currIndex = 0;
- setCheckBtn();
- createNewQuizProb();
- },
- checkAnimation = function(){
- var s = settings, spd = s.fxSpeed, spdType = { slow: 600, fast: 200, normal: 400 };
-
- s.fxSpeed = isNaN( spd ) ? ( spdType[ spd ] || 400 ) : spd;
-
- if( isMSIE ){
- $( currQuiz ).children().removeAttr("filter");
- }
- if( s.fxCode ){
- var custAnimatePos = animateType.length;
- animateType[ custAnimatePos ] = s.fxCode;
- s.fxType = custAnimatePos;
- }
- },
- // checkQTypeKeys(): Checks the keys for each question, wordList[i]. Returns error if unknown.
- checkQTypeKeys = function( quesKeys ){
- var badKey = "", i = quesKeys.length,
- validKeys = { ques:1, ans:1, ansInfo:1, ansSel:1 };
-
- if( !i ){ badKey = lang.err.noQues; }
- while( i-- ){
- if( badKey ){ break;}
- for( var currKey in quesKeys[ i ] ){
- if( quesKeys.hasOwnProperty( currKey ) || !validKeys[ currKey ] ){
- badKey = currKey + lang.err.badKey;
- break;
- }
- }
- }
- return badKey;
- },
- hasBadSyntax = function( wNames ){
- var badKey = "", goodKeys = [],
- validKeys = {
- fillInTheBlank:1, flashCard:1, trueOrFalse:1, multipleChoice:1, multipleChoiceOl:1,
- fill:1, cards:1, tf:1, multi:1, multiList:1
- };
-
- for( var prop in wNames ){
- if( wNames.hasOwnProperty( prop ) ){
- if( !validKeys[ prop ] ){
- badKey = lang.err[ ( typeof wNames === "object" ) ? "badQType" : "lang.err.notObj" ];
- }
- if( !badKey ){
- badKey = ( $.isArray( wNames[prop] ) ) ? checkQTypeKeys( wNames[prop] ) : lang.err.notArr;
- }
- if( badKey ){
- badKey = prop + " -> " + badKey;
- break;
- }
- goodKeys[ goodKeys.length ] = prop;
- }
- }
- q.prop = goodKeys.concat();
-
- if( !prop ){ badKey = lang.err.noQType; }
- if( settings.allQuizType && !badKey ){
- badKey = !validKeys[ settings.allQuizType ];
- if( badKey ){
- badKey = settings.allQuizType + " -> " + lang.err.badQType;
- }
- }
- return badKey;
- },
- // start(): This is the first function called.
- start = function(){
-
- if( $.isArray( wordList ) ){
- //Turns the array into an object.
- var tempObj = {};
- tempObj[ settings.allQuizType || settings.quizType ] = wordList;
- wordList = tempObj;
- }
-
- var err = ( wordList ) ? hasBadSyntax( wordList ) : lang.err.noQues;
- if( err ){
- err = "jQuizMe " + lang.err.error + ": " + err;
- return $( stickyEl ).text( err );
- }
- checkAnimation();
- createQuizEl();
- createNewQuizProb();
- return currQuiz;
- }(); // Auto starts.
- });
- };
- $.fn.jQuizMe.version = "2.1";
-})(jQuery); \ No newline at end of file
diff --git a/content/js/kDoc.js b/content/js/kDoc.js
deleted file mode 100755
index cf14bc2..0000000
--- a/content/js/kDoc.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(document).ready(
- function(){
-
- var back = 'index.html';
-
- var parseUrlParams = function(){
- var doc = '';
- var params = window.location.search.slice(1).split('&');
- if (params){
- back = params[0].split('=')[1];
- doc = params[1].split('=')[1];
- }
-
- $('#iframeLessonPlan').attr('src', "" + doc + ".html");
- };
-
- var $kHeader = $('#kHeader').kHeader({title:"Lesson Plan", zoom: true});
-
-
- $('#kHeaderBackBtn').click(function(){ window.location = back; });
-
- parseUrlParams();
- Karma.scaleToViewport();
-}); \ No newline at end of file
diff --git a/content/js/karma.js b/content/js/karma.js
deleted file mode 100755
index 3d29073..0000000
--- a/content/js/karma.js
+++ /dev/null
@@ -1,1758 +0,0 @@
-/* Documentation Note:
- * Public methods and properties are commented with /** some text *\/
- * and private methods and properties are commented with //
- *
- * Please leave it that way to keep this documentation sane
- */
-
-
-/*
-* Karma Framework
-* http://karmaeducation.org
-*
-* Copyright (c) 2009
-* Bryan W Berry bryan@olenepal.org
-* Felipe López Toledo zer.subzero@gmail.com
-*
-* Under MIT 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 above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* 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.
-*/
-
-/**
-* @fileOverview Contains karma library
-* @author Bryan Berry <bryan@olenepal.org>
-* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
-*/
-
-
-//common.js modules use exports object
-if(!this.exports) {
- exports = {};
-}
-
-
-
-/** Karma is the namespace for the Karma library and Karma() is the constructor
- * function for the Karma library object Karma.
- * Karma() checks if the current document type is set to HTML 5, throws
- * an error if not. Otherwise, initializes the karma object and returns
- * a reference to that object.
- * @namespace Global namespace for Karma library
- * @constructor
- * @param {Object} [options={}] options for intializing Karma library
- * @param {String} [options.locale=''] sets current locale Not Yet Implemented
- * @param {Array} [options.image=[]] array of images to be converted into a collection
- * @param {Array} [options.audio=[]] array of audio to be converted into a collection
- * @param {Array} [options.video=[]] NYI array of videos to be converted into a collection
- * @param {Array} [options.svg=[]] array of SVG elements to be
- * converted into a collection. Each SVG element must already exist in the html document
- * @param {Array} [options.canvas=[]] array of canvas elements
- * to be converted into a collection. Each canvas element must already exist in the
- * html document and width and height of each element must be set as attributes
- * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
- * <!DOCTYPE html>
- * @throws {Error} If any of the initialization parameters are invalid values
- * @returns {Object} Karma -- reference to the initialized Karma library
- * @example
- *
- * var k = Karma({
- * image: [
- * {name: "ninja", file: "ninja.png"},
- * {name: "cowboy", file: "cowboy.png"}
- * ],
- * audio: [
- * {name: "woosh", file: "woosh.ogg"},
- * {name: "yeehaw", file: "yeehaw.ogg"}
- * ],
- * video: [ //Not Yet Implemented
- * {name: "attack", file: "attack.ogv"},
- * {name: "ride", file: "ride.ogv"}
- * ]
- * canvas: [
- * {name: "ninja", domId: "ninjaCanvas"},
- * {name: "cowboy", domId: "cowboyCanvas"}
- * ],
- * svg: [
- * {name: "ninja", domId: "ninjaSvg"},
- * {name: "cowboy", domId: "cowboySvg"}
- * ],
- * });
- * Next, call the ready function with a callback to your program code
- *
- * k.ready(function () { ... your application code . . . }
- *
- * after that you can access each asset like so
- * k.image.ninja;
- * k.svg.cowboy;
- * k.audio.yeehaw.play();
- * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
- *
- */
-var Karma = exports.Karma = function (options) {
- Karma._isHtml5(document.doctype.nodeName);
-
- if ( Karma._initialized === true ) {
- return Karma;
- } else {
- return Karma._init(options);
- }
-};
-
-
-//helper functions
-
-/**This emulates the Object.create method in ecmascript 5 spec
- * This isn't a full implementation as it doesn't support an all of Object.create's features
- * This has the same functionality as Crockford's beget method
- * and this primary building block for prototypal inheritance in
- * this library
- * @param {Object} parent that the new object's prototype should point to
- * @returns {Object} a new object whose prototype is parent
- * @example
- *
- * var ninja = { weapon : "sword" };
- * var ninja1 = Karma.create(ninja);
- * ninja1.weapon === "sword"
- */
-Karma.create = function (parent){
- function F () {};
- F.prototype = parent;
- return new F();
-};
-
-/** Returns a shallow copy of the passed in object
- * @param {Object} target to be copied
- * @returns {Object} a shallow copy of target
- */
-Karma.clone = function (target){
- var copy = {};
- for ( var i in target ) {
- if(target.hasOwnProperty(i)){
- copy[i] = target[i];
- }
- }
- return copy;
-};
-
-/** Extends properties of the target object with those of
- * the source object
- * @param {Object} target object to be extended
- * @param {Object} source whose properties will extend target
- * @returns {Object} target extended by source
- */
-Karma.objectPlus = function (target, source){
- for ( var i in source){
- if (source.hasOwnProperty(i)){
- target[i] = source[i];
- }
- }
- return target;
-};
-
-Karma.extend = Karma.objectPlus;
-
-/** Creates a new object that is a prototype of the first argument
- * then extends it with the properties of the second argument
- * @param {Object} parent1 will be prototype of returned object
- * @param {Object} parent2 will extend properties of returned object
- * @returns {Object} object that whose prototype is parent1 and has
- * been extended with properties of parent2
- */
-Karma.copyObjectPlus = function (parent1, parent2){
- function F () {};
- F.prototype = parent1;
- var G = new F();
- return Karma.objectPlus(G, parent2);
-};
-
-
-//Throws big ugly error if doctype isn't html5
-Karma._isHtml5 = function (doctype){
- var regex = new RegExp('^html$', 'i');
- if(!regex.test(doctype)){
- var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
- "in order to use Karma. Karma require you use html5";
- var errorElem = document.createElement('div');
- errorElem.setAttribute('id', 'errorDoctype');
- errorElem.innerText = errorMsg;
- document.body.appendChild(errorElem);
- throw new Error(errorMsg);
- }
-};
-
-/**
- * Shuffles an array of items randomly
- * @param {Array} oldList of choices to be shuffled
- * @returns {Array} newlist of choices randomly reordered
- */
-Karma.shuffle = function (oldList) {
- var newList = oldList.slice(0);
- for (var i = newList.length - 1; i > 0; i -= 1) {
- var j = Karma.rand(0, i);
- var t = newList[i];
- newList[i] = newList[j];
- newList[j] = t;
- }
- return newList;
-};
-
-
-/**
- * Converts a number to numerals in the specified locale. Currently only
- * supports Nepali
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
-Karma.convertNumToLocale = function(num, locale){
- locale = locale || Karma.locale;
- //48 is the base for western numerals
- var convertDigit = function(digit){
-
- var numBase = 48;
- var prefix = "u00";
-
- if (locale === "ne"){
- prefix = "u0";
- numBase = 2406;
- }
-
- return '\\' + prefix +
- (numBase + parseInt(digit)).toString(16);
- };
-
- var charArray = num.toString().split("").map(convertDigit);
- return eval('"' + charArray.join('') + '"');
-};
-
-/**
- * @name Karma._n
- * @function
- * @public
- * Alias for Karma.convertNumToLocale. Converts a number to numerals to
- * Karma.locale or to specified locale. Currently only supports Nepali
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
-Karma._n = Karma.convertNumToLocale;
-
-/* Scales the dimensions of document.body to the innerHeight and innerWidth
- * of the viewport, i.e. browser window, with a minor offset to the height to
- * make sure the scrollbars do not appear
- */
-Karma.scaleToViewport = function(){
- var width = window.innerWidth;
- var height = window.innerHeight;
-
- //hack to ensure scrollbars don't appear
- if (height === 900){
- height = "" + 900 + "px";
- } else {
- height = "" + (height - 13) + "px";
- }
-
- document.body.style.width = "" + width + "px";
- document.body.style.height = height;
-};
-
-Karma.scaleWindow = function(){
- var width = "1200px";
- var height = "900px";
- var viewportHeight = "760px";
- var $body = $('body');
- var $kMain = $('#kMain');
-
- if (window.innerWidth < 1150){
- width = "950px";
- height = "600px";
- viewportHeight = "460px";
- $body.css('border', '2px solid black');
-
- // 460/760 * 16 = 9.6
- $kMain.css('font-size', '9.6px');
- }
-
- $body.css({border: '2px solid black', width: width, height: height});
- $kMain.css({width: width, height: viewportHeight});
-
-
-};
-
- // Below are geometry and math helper methods
-
-/**
- * Converts a value from degrees to radians.
- * @param {Number} angle The angle in degrees
- * @returns {Number} The angle in radians
- */
-Karma.radians = function( angle ){
- return ( angle / 180 ) * Math.PI;
-};
-
-/**
- * Gets the square of the Euclidian (ordinary) distance between 2 points.
- * @param {Object} Point No. 0
- * @param {Number} Point0.x
- * @param {Number} Point0.y
- * @param {Object} Point No. 1
- * @param {Number} Point1.x
- * @param {Number} Point1.y
- * @returns {Number} The square of the Euclidian distance
- * @example
- *
- * p0 = {x:0, y:1};
- * p1 = {x:50, y:70};
- * var d = distance2(p0, p1);
- *
- */
-Karma.distance2 = function ( p0, p1 ) {
- return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
-};
-
-/**
- * Gets the Euclidian (ordinary) distance between 2 points.<br>
- * <b>Warning:</b> It's slower than distance2 function
- * @param {Object} Point No. 0
- * @param {Number} Point0.x
- * @param {Number} Point0.y
- * @param {Object} Point No. 1
- * @param {Number} Point1.x
- * @param {Number} Point1.y
- * @returns {Number} The Euclidian distance
- * @example
- *
- * p0 = {x:0, y:1};
- * p1 = {x:50, y:70};
- * var d = distance2(p0, p1);
- *
- */
-Karma.distance = function ( p0, p1 ) {
- return Math.sqrt( this.distance2( p0, p1 ) );
-};
-
-/** Returns a random number within the range provided
- * @param {Number} lower limit of the range, lowest number that can be returned
- * @param {Number} upper limit of the range, highest number that can be returned
- * @returns {Number} number that is >= lower and <= upper
- * @example
- *
- * var num = rand(0, 10);
- *
- * //num could be 0, 1, 2, 3 ... or 10
- *
- */
-Karma.rand = function ( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-
-Karma.extend(Karma, {
- /** This is the global locale as passed to Karma(),
- * such as "en", "es_SP"
- * @fieldOf Karma
- * @property {string} locale This is the global locale as passed to Karma()
- * @default 'en'
- */
- locale : 'en',
- /** Collection of images with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- image : {},
- /** Collection of audio files with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- audio : {},
- /** Collection of html 5 canvases with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- canvas : {},
- /** Collection of svgs with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- svg : {},
- /** Collection of videos with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- video : {},
- _localized : false,
- _assetPath : "assets/",
- _localePath : "",
- _initialized : false,
- _statusDiv: undefined,
- _loaderDiv : undefined,
- _counters : { total : 0, errors : 0, loaded : 0},
-
- //This constructs the Karma object per values provided by the user
- _init: function(options) {
- this._initialized = true;
-
- //set up message that show count of assets loaded
- //and has an ordered list to append error messages to
- var _statusDiv = this._statusDiv = document.createElement('div');
- this._loaderDiv = this._loaderDiv = document.createElement('div');
- var errorList = document.createElement('ol');
-
- _statusDiv.setAttribute('id', 'karma-status');
- _statusDiv.setAttribute('style', 'position:absolute;');
- _statusDiv.innerHTML = 'Karma is loading ...';
- this._loaderDiv.setAttribute('id', 'karma-loader');
- this._loaderDiv.setAttribute('class', 'status');
- errorList.setAttribute('id', 'errorList');
-
- _statusDiv.appendChild(this._loaderDiv);
- this._statusDiv.appendChild(errorList);
- document.body.appendChild(_statusDiv);
-
- //regular expression that matches the name of aprivate property
- // the karma object
- var regexPrivate = new RegExp('^_.*');
-
- for ( var option in options ) {
- if (options.hasOwnProperty(option)){
- if (option === "image" || option === "audio" || option ===
- "svg" || option === "video" || option === "canvas"){
-
- if(!(options[option] instanceof Array)){
- throw new Error("" + option + " must be an array");
- } else if (options[option].length === 0){
- continue;
- }
- } else if (regexPrivate.test(option)){
- //don't overwrite a private property of karma object
- continue;
- }
-
- switch (option){
- case "locale":
-
- if (this._isValidLocale(options[option])){
- this.locale = this._normalizeLocale(options[option]);
- this._localized = true;
- this._localePath = Karma._computeLocalePath(this.locale);
- } else {
- throw new Error("locale provided to karma._init() is invalid");
- }
-
- break;
- case "image":
- options[option]._type = 'image';
- Karma._makeCollection(options[option], 'image');
- break;
- case "audio":
- options[option]._type = 'audio';
- Karma._makeCollection(options[option], 'audio');
- break;
- case "video":
- options[option]._type = 'video';
- Karma._makeCollection(options[option], 'video');
- break;
- case "svg":
- options[option]._type = 'svg';
- Karma._makeCollection(options[option], 'svg');
- break;
- case "canvas":
- options[option]._type = 'canvas';
- Karma._makeCollection(options[option], 'canvas');
- break;
- }
- }
- }
-
-
-
- return this;
- },
-
- /** Waits until all assets loaded(ready), then calls callback cb
- * @memberOf Karma
- * @param {Function} [cb] callback function
- * @returns this
- * @throws {Error} if Karma is not initialized with the
- * Karma({ options }) function
- * @example
- *
- * var k = Karma({ . . . your assets here . . . });
- * k.ready(function(){ .. your code here . . .});
- *
- * your code will not be called until all assets have been loaded
- * into collections
- *
- */
- ready : function( cb ) {
- var that = this;
- if (Karma._initialized !== true){
- throw new Error("Karma not initialized");
- }
-
- if (this._counters.loaded !== this._counters.total){
- setTimeout(function(){ that.ready(cb);}, 5);
- } else if (cb) {
- //hide the "Karma is loading..." message
- this._statusDiv.setAttribute('style', 'display:none;');
-
- cb();
- } else if (!cb) {
- //hide the "Karma is loading..." message
- this._statusDiv.setAttribute('style', 'display:none;');
-
- //if no options passed, show it works message
- this._showStarterMessage();
- }
-
-
-
-
- return this;
- },
-
- //Display Apache-like "It works" message if no options
- _showStarterMessage : function (){
- var starterMsg = document.createElement('div');
- starterMsg.setAttribute('id', 'starterMsg');
- starterMsg.innerHTML = "<h1>It Works</h1>";
- document.body.appendChild(starterMsg);
- },
-
- //Updates visible counter of how many assets are loaded
- _updateStatus : function (errorMsg) {
- var loaded = this._counters.loaded;
- var total = this._counters.total;
- var errors = this._counters.errors;
- this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
- "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
- if (errorMsg) {
- var liError = document.createElement('li');
- liError.innerHTML = errorMsg;
- var errorList = document.getElementById('errorList');
- errorList.appendChild(liError);
- }
- },
-
- //matches 2 letter country code then optionally
- //a dash or underscore followed by a country or language identifier
- //i currently only allow a language identifier 2-3 chars long
- _isValidLocale : function (locale) {
- var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
- return localeRegex.test(locale);
- },
-
- _normalizeLocale : function(locale) {
- var lang = "";
- var country = "";
- var divider = "";
-
- lang = locale.slice(0, 2).toLowerCase();
- divider = "_";
- country = locale.slice(3, 6).toUpperCase();
-
- return locale.length > 2 ? "" + lang + divider + country : lang;
- },
-
-
-
-});
-
-//Helper functions for creating assets
-Karma._isLocalized = function (boolLocalized) {
- if (typeof boolLocalized === "boolean" ) {
- if(boolLocalized === true &&
- Karma.locale === undefined){
- throw new Error("You cannot localize a media asset" +
- " if the global locale for Karma isn't set");
- } else {
- return boolLocalized;
- }
- } else if (typeof boolLocalized === undefined){
- return false;
- } else{
- throw new Error("This is not a valid value for the localized option");
- }
-};
-
-Karma._computeLocalePath = function(locale) {
- return Karma._assetPath + locale + "/";
-};
-
-
-
-
-Karma._makeCollection = function (configs, type){
- var makeAsset = function (config){
- var asset = undefined;
- var target = undefined;
- switch(type){
- case "image":
- target = Karma.kImage;
- break;
- case "audio":
- target = Karma.kAudio;
- break;
- case "video":
- target = Karma.kVideo;
- break;
- case "svg":
- target = Karma.kSvg;
- break;
- case "canvas":
- target = Karma.kCanvas;
- break;
- }
-
- asset = Karma.create(target)._init(config);
- Karma[type][config.name] = asset;
- };
-
- configs.forEach(function(config){ makeAsset(config);});
-};
-
-
-
-
-
-//Prototype objects for assets
-
-
-/** Prototype object for images
- * @class This object is the prototype for images submitted to Karma in the
- * Karma() method
- * @ throws {Error} if the image asset is set to be localized but
- * the global locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- * @example
- * kImage is the prototype object for images. This 'media' asset is loaded
- * in a distinctly different way from the canvas or svg assets.
- *
- */
-Karma.kImage =
- {
- /** file location of image
- * @type String
- * @default ""
- */
- file : "",
- /** media object
- * @type Image
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this image
- _localized : false,
- _type : "image",
- //initializes kImage instance with values provided by user
- _init : function (image) {
- image._localized = image._localized || false;
- Karma._counters.total++;
-
- if (image.name === undefined || image.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = image.name;
- this.file = image.file;
- }
-
- this.media = new Image();
-
- if(Karma._isLocalized(image._localized)){
- this._localized = image._localized;
- this._path = Karma._localePath + "image/";
- } else {
- this._path = Karma._assetPath + "image/";
- }
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the image is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
-
- that.media.addEventListener(
- "load",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
- }
-
-};
-
-/** Prototype object for audio files
- * @class This object is the prototype for audio files submitted to Karma in the
- * Karma() method
- * @ throws {Error} if the individual audio asset is set to be localized but
- * the globale locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- * @example
- * kAudio is the prototype object for audio
- * The audio assets are loaded in a distinctly different way
- * from the canvas or svg assets. They also have distinctly different
- * helper methods
- *
- * You initialize the kAudio assets by passing an array of objects
- */
-Karma.kAudio = {
- /** file location of asset
- * @type String
- * @default ""
- */
- file : "",
- /** Media object. You can access the src, autobuffer, autoplay, loop, and
- * controls attributes
- * via the media property of kAudio. Read more about the properties of the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#media-element-attributes">HTML 5 media element</a>
- * @type Audio
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this asset
- _localized : false,
- _type : "audio",
- //initializes kAudio instance with values provided by user
- _init : function (audio) {
- audio._localized = audio._localized || false;
- Karma._counters.total++;
-
- if (audio.name === undefined || audio.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = audio.name;
- this.file = audio.file;
- }
-
- this.media = new Audio();
-
- if(Karma._isLocalized(audio._localized)){
- this._localized = audio._localized;
- this._path = Karma._localePath + "audio/";
- } else {
- this._path = Karma._assetPath + "audio/";
- }
-
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
- this.media.autobuffer = true;
- this.media.load();
-
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the asset is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
- //'canplaythrough' event is a Browser Hack recommended by chromium devs
- //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
-
- that.media.addEventListener(
- "canplaythrough",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- },
- /** Plays the audio file */
- play : function () {
- this.media.play();
- }
-
-};
-
-/** NYI:Prototype object for Video files
- * @class Not Yet Implemented:This object is the prototype for video files submitted
- * to Karma in the Karma() method
- * @ throws {Error} if the individual video asset is set to be localized but
- * the globale locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- */
-Karma.kVideo = {
- /** file location of asset
- * @type String
- * @default ""
- */
- file : "",
- /** media object
- * @type Video
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this asset
- _localized : false,
- _type : "video",
- //initializes kVideo instance with values provided by user
- _init : function (video) {
- //Not Yet Implemented
- Karma._counters.errors++;
- throw new Error("Video is not Yet Implemented");
-
- video._localized = video._localized || false;
- Karma._counters.total++;
-
- if (video.name === undefined || video.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = video.name;
- this.file = video.file;
- }
-
- this.media = new Video();
-
- if(Karma._isLocalized(video._localized)){
- this._localized = video._localized;
- this._path = Karma._localePath + "video/";
- } else {
- this._path = Karma._assetPath + "video/";
- }
-
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the asset is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
- //'canplaythrough' event is a Browser Hack recommended by chromium devs
- //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
-
- that.media.addEventListener(
- "canplaythrough",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- }
-
-};
-
-
-
-/** Prototype object for each canvas element submitted to Karma in the
- * Karma() method
- * @throws {Error} if the name and domId for the canvas element are not specified
- * @thows {Error} if the supplied domId does not match an element in the DOM
- * @class This object is the prototype for each canvas element submitted to Karma in the
- * Karma() method
- */
-Karma.kCanvas = {
- /** Name of the canvas, used internally by karma.js
- * @type String
- * @default ''
- */
- name : '',
- /** Width of canvas element
- * @type Number
- * @default 0
- */
- width: 0,
- /** Height of canvas element
- * @type Number
- * @default 0
- */
- height: 0,
- /** Whether canvas is visible
- * @type boolean
- * @default true
- */
- visible: true,
- /** Element ID for canvas element in html document. This value is read-only
- * @type String
- * @default undefined
- */
- domId: undefined,
- /** Reference to the DOM element
- * @type DOMElement
- * @default undefined
- * @example
- * //You can access all properties and methods of the underlying DOM element
- * //using the 'node' property
- * Karma.canvas.someCanvas.node.dispatchEvent( ... some event ...);
- * var stuff = Karma.canvas.someCanvas.node.innerHTML;
- *
- */
- node: undefined,
- /** The 2 Dimensional Rendering context property for this canvas
- * @type 2DRenderingContext
- * @default undefined
- * @example
- * //Almost all of the context attributes and methods are wrapped in helper functions
- * //but you can also access them directly using the ctx property
- * Karma.canvas.someCanvas.ctx.drawImage(someImage, x, y);
- * Karma.canvas.someCanvas.ctx.fillStyle = "#ffffff";
- */
- ctx: undefined,
-
- //initializes object with values provides by user
- _init: function (config) {
- for (var option in config){
- if (config.hasOwnProperty(option)){
- switch (option){
- case "name":
- this.name = config[option];
- break;
- case "domId":
- this.domId = config[option];
- break;
- case "width":
- if(!this.height){
- throw new Error("If you specify a width you must also" +
- "specify a height");
- }
- this.width = config[option];
- break;
- case "height":
- if(!this.width){
- throw new Error("If you specify a height you must also" +
- "specify a width");
- }
- this.height = parseInt(config.option, 10);
- break;
- case "fps":
- this.fps = parseInt(config.option, 10);
- break;
- }
- }
- }
-
- if(this.domId && document.getElementById(this.domId)){
- this.node = document.getElementById(this.domId);
- this.ctx = this.node.getContext('2d');
- } else {
- throw new Error('you must specify a valid domId that' +
- 'is in your html page');
- }
-
- if(!config.height && !config.width){
- this.width = parseInt(this.node.getAttribute('width'), 10);
- this.height = parseInt(this.node.getAttribute('height'), 10);
- }
-
- return this;
- },
- /** Clear area of canvas element specified by parameters, if no
- * parameters supplied, clears entire canvas
- * @param {Number} [x=0] x coordinate, defaults to zero if left blank
- * @param {Number} [y=0] y coordinate, defaults to zero if left blank
- * @param {Number} [width=0] width of area to be cleared, defaults
- * entire width of canvas
- * @param {Number} [height=0] height of area to be cleared, defaults
- * entire height of canvas
- * @returns this
- * @example
- *
- * k.canvas.ninja.clear();
- * // clears the entire ninja canvas
- *
- * k.canvas.ninja.clear(0, 10, 20, 30);
- * //clears a specific portion of the ninja canvas
- *
- */
- clear : function ( x, y, width, height ) {
- var that = this;
- that.ctx.clearRect(
- x || 0,
- y || 0,
- width || that.width,
- height || that.height
- );
- return that;
- },
-
- /** The globalAlpha attribute gives an alpha value that is applied to shapes
- * and images before they are composited onto the canvas
- * @param {Number} number in the range from 0.0 to 1.0
- * @returns this
- */
- globalAlpha : function (attribute){
- var name = 'globalAlpha';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the globalCompositeOperation attribute, which sets how shapes and images
- * are drawn onto the existing bitmap, once they have had globalAlpha and the
- * current transformation matrix applied.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} globalCompositeOperation source-atop,
- * source-in, source-out,
- * source-over, destination-atop, destination-in, destination-out, destination-over,
- * lighter
- * @returns this
- */
- globalCompositeOperation: function (attribute){
- var name = ' globalCompositeOperation';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the lineWidth attribute which gives the width of lines, in coordinate space
- * units.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {Number} lineWidth
- * @returns this
- */
- lineWidth: function (attribute){
- var name = 'lineWidth';
- this.ctx[name] = attribute;
- return this;
- },
- /** The lineCap attribute defines the type of endings that UAs will place on
- * the end of lines.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} type butt, round, square
- * @returns this
- */
- lineCap: function (attribute){
- var name = 'lineCap';
- this.ctx[name] = attribute;
- return this;
- },
- /** The lineJoin attribute defines the type of corners that UAs will place
- * where two lines meet. The three valid values are bevel, round, and miter.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} type
- * @returns this
- */
- lineJoin: function (attribute){
- var name = 'lineJoin';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the miter limit
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {Number} number
- * @returns this
- */
- miterLimit: function (attribute){
- var name = 'miterLimit';
- this.ctx[name] = attribute;
- return this;
- },
- /** Sets the font property and takes the same syntax as setting the font property
- * in CSS
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String}
- * @returns this
- */
- font: function (attribute){
- var name = 'font';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Changes the text alignment. The possible values are start, end, left, right,
- * and center. The default is start. Other values are ignored.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {string} alignment
- * @returns this
- */
- textAlign: function (attribute){
- var name = 'textAlign';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Changes the baseline alignment. If the value is one of top, hanging, middle,
- * alphabetic, ideographic, or bottom, then the value must be changed to the new value.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} alignment
- * @returns this
- */
- textBaseline: function (attribute){
- var name = 'textBaseline';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Save the current state of the context
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- save : function ( ){
- var name = 'save';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Restore the saved context
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- restore : function ( ){
- var name = 'restore';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Perform a scale transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- scale : function ( ){
- var name = 'scale';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Perform a rotation transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- rotate : function ( ){
- var name = 'rotate';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Performa a translation transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- translate : function ( ){
- var name = 'translate';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Transform the identity matrix
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- transform : function ( ){
- var name = 'transform';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Set the transform
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- setTransform : function ( ){
- var name = 'setTransform';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Clear a rectangular area
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- clearRect : function ( ){
- var name = 'clearRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Fill a rectangular area
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillRect : function ( ){
- var name = 'fillRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Draw the outline of the rectangle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeRect : function ( ){
- var name = 'strokeRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Begin a path
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- beginPath : function ( ){
- var name = 'beginPath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** End a path
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- closePath : function ( ){
- var name = 'closePath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Move to specified coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- moveTo : function ( ){
- var name = 'moveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
-
- /** Draw a line to the given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- lineTo : function ( ){
- var name = 'lineTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Draw a quadratic curve to given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- quadraticCurveTo : function ( ){
- var name = 'quadraticCurveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Draw a bezier curve to given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- bezierCurveTo : function ( ){
- var name = 'bezierCurveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Draw an arc to the given points
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- arcTo : function ( ){
- var name = 'arcTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Create an arc
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- arc : function ( ){
- var name = 'arc';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Create a rectangle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- rect : function ( ){
- var name = 'rect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** fill in the current subpaths with the current fillstyle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fill : function ( ){
- var name = 'fill';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Stroke the subpaths
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- stroke : function ( ){
- var name = 'stroke';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- clip : function ( ){
- var name = 'clip';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillText : function ( ){
- var name = 'fillText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeText : function ( ){
- var name = 'strokeText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- measureText : function ( ){
- var name = 'measureText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- isPointInPath : function ( ){
- var name = 'isPointInPath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Sets the stroke style
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeStyle: function (attribute){
- var name = 'strokeStyle';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the fill style
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillStyle: function (attribute){
- var name = 'fillStyle';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createLinearGradient : function ( ){
- var name = 'createLinearGradient';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createRadialGradient : function ( ){
- var name = 'createRadialGradient';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createPattern : function ( ){
- var name = 'createPattern';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowOffsetX: function (attribute){
- var name = 'shadowOffsetX';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowOffsetY: function (attribute){
- var name = 'shadowOffsetY';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowBlur: function (attribute){
- var name = 'shadowBlur';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowColor: function (attribute){
- var name = 'shadowColor';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- drawImage : function ( ){
- var name = 'drawImage';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- getImageData : function ( ){
- var name = 'getImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- putImageData : function ( ){
- var name = 'putImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createImageData : function ( ){
- var name = 'createImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- drawWindow : function ( ){
- var name = 'drawWindow';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
-
-
-
-};
-
-
-/** Prototype object for each svg element submitted to Karma in the
- * Karma() method
- * @throws {Error} if the name and domId for the svg element are not specified
- * @thows {Error} if the supplied domId does not match an element in the DOM
- * @class This object is the prototype for each svg element submitted to Karma in the
- * Karma() method
- */
-Karma.kSvg = {
- /** name of instance, used internally
- * @typeof string
- * @default ""
- */
- name : "",
- /** width of element
- * @type number
- * @default 0
- */
- width: 0,
- /** height of element
- * @type number
- * @default 0
- */
- height: 0,
- /** Status of element, either "loaded" or "error"
- * @type string
- * @default ""
- */
- status: "",
- /** Whether canvas is visible. This value is read-only
- * @type boolean
- * @default true
- */
- visible: true,
- /** Element ID for canvas element in html document.
- * @type String
- * @default undefined
- */
- domId: undefined,
- /** Reference to the DOM element.
- * @type DOMElement
- * @default undefined
- * @example
- * //You can access all properties and methods of the underlying DOM element
- * //using the 'node' property
- * Karma.svg.someSvg.node.dispatchEvent;
- * Karma.svg.someSvg.node.addEvenListener(...);
- */
- node: undefined,
- /** Reference to the SVGDocument. You can use the this.doc to manipulate
- * the SVG document
- * @type SVGDocument
- * @default undefined
- * @example
- * var myElem = Karma.svg.someSvg.doc.getElementById('foobar');
- * Karma.svg.someSvg.doc.createElement(...);
- * Karma.svg.someSvg.doc.removeChild(someNode);
- *
- */
- doc: undefined,
- /** Reference to the root element of the SVG Document
- * @type DocumentElement
- * @default undefined
- * @example
- * // The root element is equivalent to "document" in a regular html document
- * // The root attribute is used frequently with the jQuery SVG plugin for CSS selectors
- * $('#someId', Karma.svg.someSvg.root).css(.. manipulate css attributes ...);
- */
- root: undefined,
- _localized : undefined,
- _init: function (config) {
- Karma._counters.total++;
-
- for (var option in config){
- if (config.hasOwnProperty(option)){
- switch (option){
- case "name":
- this.name = config[option];
- break;
- case "domId":
- this.domId = config[option];
- break;
- case "width":
- if(!this.height){
- throw new Error("If you specify a width you must also" +
- "specify a height");
- }
- this.width = parseInt(config[option], 10);
- break;
- case "height":
- if(!this.width){
- throw new Error("If you specify a height you must also" +
- "specify a width");
- }
- this.height = config[option];
- break;
- }
- }
- }
-
- if(this.domId && document.getElementById(this.domId)){
- this.node = document.getElementById(this.domId);
- } else {
- throw new Error('you must specify a valid domId that' +
- 'is in your html page');
- }
-
- if(!config.height && !config.width){
- this.width = parseInt(this.node.getAttribute('width'), 10);
- this.height = parseInt(this.node.getAttribute('height'), 10);
- }
-
- var that = this;
- that._addEventHandlers();
-
- return this;
-
-
- },
- _addEventHandlers : function () {
- var that = this;
- that.doc = that.node.getSVGDocument();
- that.node.addEventListener(
- "load",
- function (e) {
- that.doc = that.node.getSVGDocument();
- that.root = that.doc.documentElement;
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";
- }, false);
-
- that.node.addEventListener(
- "error",
- function (e) {
- Karma._counters.loaded--;
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.node.addEventListener(
- "abort",
- function (e) {
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- }
-};
diff --git a/content/js/kglobal.js b/content/js/kglobal.js
deleted file mode 100755
index 4479363..0000000
--- a/content/js/kglobal.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Functions that are common in all lessons
- *
- */
-
-var flag_start = 0,i,j,flag;
-var path = '../../../MenuStage.html'; // MenuStage.html path for the location of flash interface
-
-function gotoMainStage(){
- window.location = path;
-}
-//enable or disable the control buttons
-function controlButtonDisplay(button,status){
- var opacity;
- if(status === 'enabled'){
- opacity = 1;
- cursor = 'pointer';
- }else{
- opacity = .3;
- cursor = 'default';
- }
- var buttonCss = {
- 'opacity':opacity,
- 'cursor':cursor
- };
- $('#'+button).css(buttonCss);
-}
-//generate a random numbers between two limits
-function genRand( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-/*
- Function to generate a set of random numbers and assign it to a variable supplied
- @params: randVar - > The variable in which the random numbers to be stored
- lower -> lower number
- upper -> upper number
- include lower and upper limit
- Currently it generates numbers betweem 0-upper (exclude upper)
-*/
-function shuffleNumbers(randVar,lower,upper) {
- var total_nums = upper-lower;
- randVar[0] = genRand(0,total_nums-1);
- for(i= 1; i < total_nums; i++){
- do{
- flag = 0;
- randVar[i] = genRand(0,total_nums-1);
- for(j=0; j<i; j++){
- if(randVar[i] === randVar[j]){
- flag++;
- }
- }
- }while(flag != 0 ); //end of do while loop
- }
-}
-
-
diff --git a/content/js/kkarma.js b/content/js/kkarma.js
deleted file mode 100755
index 3d29073..0000000
--- a/content/js/kkarma.js
+++ /dev/null
@@ -1,1758 +0,0 @@
-/* Documentation Note:
- * Public methods and properties are commented with /** some text *\/
- * and private methods and properties are commented with //
- *
- * Please leave it that way to keep this documentation sane
- */
-
-
-/*
-* Karma Framework
-* http://karmaeducation.org
-*
-* Copyright (c) 2009
-* Bryan W Berry bryan@olenepal.org
-* Felipe López Toledo zer.subzero@gmail.com
-*
-* Under MIT 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 above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* 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.
-*/
-
-/**
-* @fileOverview Contains karma library
-* @author Bryan Berry <bryan@olenepal.org>
-* @author Felipe Lopez Toledo <zer.subzero@gmail.com>
-*/
-
-
-//common.js modules use exports object
-if(!this.exports) {
- exports = {};
-}
-
-
-
-/** Karma is the namespace for the Karma library and Karma() is the constructor
- * function for the Karma library object Karma.
- * Karma() checks if the current document type is set to HTML 5, throws
- * an error if not. Otherwise, initializes the karma object and returns
- * a reference to that object.
- * @namespace Global namespace for Karma library
- * @constructor
- * @param {Object} [options={}] options for intializing Karma library
- * @param {String} [options.locale=''] sets current locale Not Yet Implemented
- * @param {Array} [options.image=[]] array of images to be converted into a collection
- * @param {Array} [options.audio=[]] array of audio to be converted into a collection
- * @param {Array} [options.video=[]] NYI array of videos to be converted into a collection
- * @param {Array} [options.svg=[]] array of SVG elements to be
- * converted into a collection. Each SVG element must already exist in the html document
- * @param {Array} [options.canvas=[]] array of canvas elements
- * to be converted into a collection. Each canvas element must already exist in the
- * html document and width and height of each element must be set as attributes
- * @throws {Error} if the document type declaration is not set to HTML 5, e.g.
- * <!DOCTYPE html>
- * @throws {Error} If any of the initialization parameters are invalid values
- * @returns {Object} Karma -- reference to the initialized Karma library
- * @example
- *
- * var k = Karma({
- * image: [
- * {name: "ninja", file: "ninja.png"},
- * {name: "cowboy", file: "cowboy.png"}
- * ],
- * audio: [
- * {name: "woosh", file: "woosh.ogg"},
- * {name: "yeehaw", file: "yeehaw.ogg"}
- * ],
- * video: [ //Not Yet Implemented
- * {name: "attack", file: "attack.ogv"},
- * {name: "ride", file: "ride.ogv"}
- * ]
- * canvas: [
- * {name: "ninja", domId: "ninjaCanvas"},
- * {name: "cowboy", domId: "cowboyCanvas"}
- * ],
- * svg: [
- * {name: "ninja", domId: "ninjaSvg"},
- * {name: "cowboy", domId: "cowboySvg"}
- * ],
- * });
- * Next, call the ready function with a callback to your program code
- *
- * k.ready(function () { ... your application code . . . }
- *
- * after that you can access each asset like so
- * k.image.ninja;
- * k.svg.cowboy;
- * k.audio.yeehaw.play();
- * k.canvas.ninja.drawImage(k.image.ninja, 0, 0);
- *
- */
-var Karma = exports.Karma = function (options) {
- Karma._isHtml5(document.doctype.nodeName);
-
- if ( Karma._initialized === true ) {
- return Karma;
- } else {
- return Karma._init(options);
- }
-};
-
-
-//helper functions
-
-/**This emulates the Object.create method in ecmascript 5 spec
- * This isn't a full implementation as it doesn't support an all of Object.create's features
- * This has the same functionality as Crockford's beget method
- * and this primary building block for prototypal inheritance in
- * this library
- * @param {Object} parent that the new object's prototype should point to
- * @returns {Object} a new object whose prototype is parent
- * @example
- *
- * var ninja = { weapon : "sword" };
- * var ninja1 = Karma.create(ninja);
- * ninja1.weapon === "sword"
- */
-Karma.create = function (parent){
- function F () {};
- F.prototype = parent;
- return new F();
-};
-
-/** Returns a shallow copy of the passed in object
- * @param {Object} target to be copied
- * @returns {Object} a shallow copy of target
- */
-Karma.clone = function (target){
- var copy = {};
- for ( var i in target ) {
- if(target.hasOwnProperty(i)){
- copy[i] = target[i];
- }
- }
- return copy;
-};
-
-/** Extends properties of the target object with those of
- * the source object
- * @param {Object} target object to be extended
- * @param {Object} source whose properties will extend target
- * @returns {Object} target extended by source
- */
-Karma.objectPlus = function (target, source){
- for ( var i in source){
- if (source.hasOwnProperty(i)){
- target[i] = source[i];
- }
- }
- return target;
-};
-
-Karma.extend = Karma.objectPlus;
-
-/** Creates a new object that is a prototype of the first argument
- * then extends it with the properties of the second argument
- * @param {Object} parent1 will be prototype of returned object
- * @param {Object} parent2 will extend properties of returned object
- * @returns {Object} object that whose prototype is parent1 and has
- * been extended with properties of parent2
- */
-Karma.copyObjectPlus = function (parent1, parent2){
- function F () {};
- F.prototype = parent1;
- var G = new F();
- return Karma.objectPlus(G, parent2);
-};
-
-
-//Throws big ugly error if doctype isn't html5
-Karma._isHtml5 = function (doctype){
- var regex = new RegExp('^html$', 'i');
- if(!regex.test(doctype)){
- var errorMsg = "ERROR: The doctype must be set to <!DOCTYPE html> " +
- "in order to use Karma. Karma require you use html5";
- var errorElem = document.createElement('div');
- errorElem.setAttribute('id', 'errorDoctype');
- errorElem.innerText = errorMsg;
- document.body.appendChild(errorElem);
- throw new Error(errorMsg);
- }
-};
-
-/**
- * Shuffles an array of items randomly
- * @param {Array} oldList of choices to be shuffled
- * @returns {Array} newlist of choices randomly reordered
- */
-Karma.shuffle = function (oldList) {
- var newList = oldList.slice(0);
- for (var i = newList.length - 1; i > 0; i -= 1) {
- var j = Karma.rand(0, i);
- var t = newList[i];
- newList[i] = newList[j];
- newList[j] = t;
- }
- return newList;
-};
-
-
-/**
- * Converts a number to numerals in the specified locale. Currently only
- * supports Nepali
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
-Karma.convertNumToLocale = function(num, locale){
- locale = locale || Karma.locale;
- //48 is the base for western numerals
- var convertDigit = function(digit){
-
- var numBase = 48;
- var prefix = "u00";
-
- if (locale === "ne"){
- prefix = "u0";
- numBase = 2406;
- }
-
- return '\\' + prefix +
- (numBase + parseInt(digit)).toString(16);
- };
-
- var charArray = num.toString().split("").map(convertDigit);
- return eval('"' + charArray.join('') + '"');
-};
-
-/**
- * @name Karma._n
- * @function
- * @public
- * Alias for Karma.convertNumToLocale. Converts a number to numerals to
- * Karma.locale or to specified locale. Currently only supports Nepali
- * @param {Number} Number to be converted
- * @param {locale} locale that number should be converted to
- * @returns {String} Unicode string for localized numeral
- */
-Karma._n = Karma.convertNumToLocale;
-
-/* Scales the dimensions of document.body to the innerHeight and innerWidth
- * of the viewport, i.e. browser window, with a minor offset to the height to
- * make sure the scrollbars do not appear
- */
-Karma.scaleToViewport = function(){
- var width = window.innerWidth;
- var height = window.innerHeight;
-
- //hack to ensure scrollbars don't appear
- if (height === 900){
- height = "" + 900 + "px";
- } else {
- height = "" + (height - 13) + "px";
- }
-
- document.body.style.width = "" + width + "px";
- document.body.style.height = height;
-};
-
-Karma.scaleWindow = function(){
- var width = "1200px";
- var height = "900px";
- var viewportHeight = "760px";
- var $body = $('body');
- var $kMain = $('#kMain');
-
- if (window.innerWidth < 1150){
- width = "950px";
- height = "600px";
- viewportHeight = "460px";
- $body.css('border', '2px solid black');
-
- // 460/760 * 16 = 9.6
- $kMain.css('font-size', '9.6px');
- }
-
- $body.css({border: '2px solid black', width: width, height: height});
- $kMain.css({width: width, height: viewportHeight});
-
-
-};
-
- // Below are geometry and math helper methods
-
-/**
- * Converts a value from degrees to radians.
- * @param {Number} angle The angle in degrees
- * @returns {Number} The angle in radians
- */
-Karma.radians = function( angle ){
- return ( angle / 180 ) * Math.PI;
-};
-
-/**
- * Gets the square of the Euclidian (ordinary) distance between 2 points.
- * @param {Object} Point No. 0
- * @param {Number} Point0.x
- * @param {Number} Point0.y
- * @param {Object} Point No. 1
- * @param {Number} Point1.x
- * @param {Number} Point1.y
- * @returns {Number} The square of the Euclidian distance
- * @example
- *
- * p0 = {x:0, y:1};
- * p1 = {x:50, y:70};
- * var d = distance2(p0, p1);
- *
- */
-Karma.distance2 = function ( p0, p1 ) {
- return (p1.x - p0.x) * (p1.x - p0.x) + (p1.y - p1.y) * (p1.y - p1.y);
-};
-
-/**
- * Gets the Euclidian (ordinary) distance between 2 points.<br>
- * <b>Warning:</b> It's slower than distance2 function
- * @param {Object} Point No. 0
- * @param {Number} Point0.x
- * @param {Number} Point0.y
- * @param {Object} Point No. 1
- * @param {Number} Point1.x
- * @param {Number} Point1.y
- * @returns {Number} The Euclidian distance
- * @example
- *
- * p0 = {x:0, y:1};
- * p1 = {x:50, y:70};
- * var d = distance2(p0, p1);
- *
- */
-Karma.distance = function ( p0, p1 ) {
- return Math.sqrt( this.distance2( p0, p1 ) );
-};
-
-/** Returns a random number within the range provided
- * @param {Number} lower limit of the range, lowest number that can be returned
- * @param {Number} upper limit of the range, highest number that can be returned
- * @returns {Number} number that is >= lower and <= upper
- * @example
- *
- * var num = rand(0, 10);
- *
- * //num could be 0, 1, 2, 3 ... or 10
- *
- */
-Karma.rand = function ( lower, upper ){
- return Math.floor(Math.random() * (upper - lower + 1) + lower);
-};
-
-
-Karma.extend(Karma, {
- /** This is the global locale as passed to Karma(),
- * such as "en", "es_SP"
- * @fieldOf Karma
- * @property {string} locale This is the global locale as passed to Karma()
- * @default 'en'
- */
- locale : 'en',
- /** Collection of images with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- image : {},
- /** Collection of audio files with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- audio : {},
- /** Collection of html 5 canvases with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- canvas : {},
- /** Collection of svgs with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- svg : {},
- /** Collection of videos with special helper
- * methods added to each reference
- * @fieldOf Karma
- * @type object
- * @default empty object
- */
- video : {},
- _localized : false,
- _assetPath : "assets/",
- _localePath : "",
- _initialized : false,
- _statusDiv: undefined,
- _loaderDiv : undefined,
- _counters : { total : 0, errors : 0, loaded : 0},
-
- //This constructs the Karma object per values provided by the user
- _init: function(options) {
- this._initialized = true;
-
- //set up message that show count of assets loaded
- //and has an ordered list to append error messages to
- var _statusDiv = this._statusDiv = document.createElement('div');
- this._loaderDiv = this._loaderDiv = document.createElement('div');
- var errorList = document.createElement('ol');
-
- _statusDiv.setAttribute('id', 'karma-status');
- _statusDiv.setAttribute('style', 'position:absolute;');
- _statusDiv.innerHTML = 'Karma is loading ...';
- this._loaderDiv.setAttribute('id', 'karma-loader');
- this._loaderDiv.setAttribute('class', 'status');
- errorList.setAttribute('id', 'errorList');
-
- _statusDiv.appendChild(this._loaderDiv);
- this._statusDiv.appendChild(errorList);
- document.body.appendChild(_statusDiv);
-
- //regular expression that matches the name of aprivate property
- // the karma object
- var regexPrivate = new RegExp('^_.*');
-
- for ( var option in options ) {
- if (options.hasOwnProperty(option)){
- if (option === "image" || option === "audio" || option ===
- "svg" || option === "video" || option === "canvas"){
-
- if(!(options[option] instanceof Array)){
- throw new Error("" + option + " must be an array");
- } else if (options[option].length === 0){
- continue;
- }
- } else if (regexPrivate.test(option)){
- //don't overwrite a private property of karma object
- continue;
- }
-
- switch (option){
- case "locale":
-
- if (this._isValidLocale(options[option])){
- this.locale = this._normalizeLocale(options[option]);
- this._localized = true;
- this._localePath = Karma._computeLocalePath(this.locale);
- } else {
- throw new Error("locale provided to karma._init() is invalid");
- }
-
- break;
- case "image":
- options[option]._type = 'image';
- Karma._makeCollection(options[option], 'image');
- break;
- case "audio":
- options[option]._type = 'audio';
- Karma._makeCollection(options[option], 'audio');
- break;
- case "video":
- options[option]._type = 'video';
- Karma._makeCollection(options[option], 'video');
- break;
- case "svg":
- options[option]._type = 'svg';
- Karma._makeCollection(options[option], 'svg');
- break;
- case "canvas":
- options[option]._type = 'canvas';
- Karma._makeCollection(options[option], 'canvas');
- break;
- }
- }
- }
-
-
-
- return this;
- },
-
- /** Waits until all assets loaded(ready), then calls callback cb
- * @memberOf Karma
- * @param {Function} [cb] callback function
- * @returns this
- * @throws {Error} if Karma is not initialized with the
- * Karma({ options }) function
- * @example
- *
- * var k = Karma({ . . . your assets here . . . });
- * k.ready(function(){ .. your code here . . .});
- *
- * your code will not be called until all assets have been loaded
- * into collections
- *
- */
- ready : function( cb ) {
- var that = this;
- if (Karma._initialized !== true){
- throw new Error("Karma not initialized");
- }
-
- if (this._counters.loaded !== this._counters.total){
- setTimeout(function(){ that.ready(cb);}, 5);
- } else if (cb) {
- //hide the "Karma is loading..." message
- this._statusDiv.setAttribute('style', 'display:none;');
-
- cb();
- } else if (!cb) {
- //hide the "Karma is loading..." message
- this._statusDiv.setAttribute('style', 'display:none;');
-
- //if no options passed, show it works message
- this._showStarterMessage();
- }
-
-
-
-
- return this;
- },
-
- //Display Apache-like "It works" message if no options
- _showStarterMessage : function (){
- var starterMsg = document.createElement('div');
- starterMsg.setAttribute('id', 'starterMsg');
- starterMsg.innerHTML = "<h1>It Works</h1>";
- document.body.appendChild(starterMsg);
- },
-
- //Updates visible counter of how many assets are loaded
- _updateStatus : function (errorMsg) {
- var loaded = this._counters.loaded;
- var total = this._counters.total;
- var errors = this._counters.errors;
- this._loaderDiv.innerHTML = "Loaded " + loaded + " / " + total +
- "" + (errors > 0 ? " Errors [ " + errors +" ]" : '');
- if (errorMsg) {
- var liError = document.createElement('li');
- liError.innerHTML = errorMsg;
- var errorList = document.getElementById('errorList');
- errorList.appendChild(liError);
- }
- },
-
- //matches 2 letter country code then optionally
- //a dash or underscore followed by a country or language identifier
- //i currently only allow a language identifier 2-3 chars long
- _isValidLocale : function (locale) {
- var localeRegex = new RegExp('^[a-zA-Z][a-zA-Z]([-_][a-zA-z]{2,3})?$');
- return localeRegex.test(locale);
- },
-
- _normalizeLocale : function(locale) {
- var lang = "";
- var country = "";
- var divider = "";
-
- lang = locale.slice(0, 2).toLowerCase();
- divider = "_";
- country = locale.slice(3, 6).toUpperCase();
-
- return locale.length > 2 ? "" + lang + divider + country : lang;
- },
-
-
-
-});
-
-//Helper functions for creating assets
-Karma._isLocalized = function (boolLocalized) {
- if (typeof boolLocalized === "boolean" ) {
- if(boolLocalized === true &&
- Karma.locale === undefined){
- throw new Error("You cannot localize a media asset" +
- " if the global locale for Karma isn't set");
- } else {
- return boolLocalized;
- }
- } else if (typeof boolLocalized === undefined){
- return false;
- } else{
- throw new Error("This is not a valid value for the localized option");
- }
-};
-
-Karma._computeLocalePath = function(locale) {
- return Karma._assetPath + locale + "/";
-};
-
-
-
-
-Karma._makeCollection = function (configs, type){
- var makeAsset = function (config){
- var asset = undefined;
- var target = undefined;
- switch(type){
- case "image":
- target = Karma.kImage;
- break;
- case "audio":
- target = Karma.kAudio;
- break;
- case "video":
- target = Karma.kVideo;
- break;
- case "svg":
- target = Karma.kSvg;
- break;
- case "canvas":
- target = Karma.kCanvas;
- break;
- }
-
- asset = Karma.create(target)._init(config);
- Karma[type][config.name] = asset;
- };
-
- configs.forEach(function(config){ makeAsset(config);});
-};
-
-
-
-
-
-//Prototype objects for assets
-
-
-/** Prototype object for images
- * @class This object is the prototype for images submitted to Karma in the
- * Karma() method
- * @ throws {Error} if the image asset is set to be localized but
- * the global locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- * @example
- * kImage is the prototype object for images. This 'media' asset is loaded
- * in a distinctly different way from the canvas or svg assets.
- *
- */
-Karma.kImage =
- {
- /** file location of image
- * @type String
- * @default ""
- */
- file : "",
- /** media object
- * @type Image
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this image
- _localized : false,
- _type : "image",
- //initializes kImage instance with values provided by user
- _init : function (image) {
- image._localized = image._localized || false;
- Karma._counters.total++;
-
- if (image.name === undefined || image.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = image.name;
- this.file = image.file;
- }
-
- this.media = new Image();
-
- if(Karma._isLocalized(image._localized)){
- this._localized = image._localized;
- this._path = Karma._localePath + "image/";
- } else {
- this._path = Karma._assetPath + "image/";
- }
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the image is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
-
- that.media.addEventListener(
- "load",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
- }
-
-};
-
-/** Prototype object for audio files
- * @class This object is the prototype for audio files submitted to Karma in the
- * Karma() method
- * @ throws {Error} if the individual audio asset is set to be localized but
- * the globale locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- * @example
- * kAudio is the prototype object for audio
- * The audio assets are loaded in a distinctly different way
- * from the canvas or svg assets. They also have distinctly different
- * helper methods
- *
- * You initialize the kAudio assets by passing an array of objects
- */
-Karma.kAudio = {
- /** file location of asset
- * @type String
- * @default ""
- */
- file : "",
- /** Media object. You can access the src, autobuffer, autoplay, loop, and
- * controls attributes
- * via the media property of kAudio. Read more about the properties of the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#media-element-attributes">HTML 5 media element</a>
- * @type Audio
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this asset
- _localized : false,
- _type : "audio",
- //initializes kAudio instance with values provided by user
- _init : function (audio) {
- audio._localized = audio._localized || false;
- Karma._counters.total++;
-
- if (audio.name === undefined || audio.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = audio.name;
- this.file = audio.file;
- }
-
- this.media = new Audio();
-
- if(Karma._isLocalized(audio._localized)){
- this._localized = audio._localized;
- this._path = Karma._localePath + "audio/";
- } else {
- this._path = Karma._assetPath + "audio/";
- }
-
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
- this.media.autobuffer = true;
- this.media.load();
-
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the asset is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
- //'canplaythrough' event is a Browser Hack recommended by chromium devs
- //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
-
- that.media.addEventListener(
- "canplaythrough",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- },
- /** Plays the audio file */
- play : function () {
- this.media.play();
- }
-
-};
-
-/** NYI:Prototype object for Video files
- * @class Not Yet Implemented:This object is the prototype for video files submitted
- * to Karma in the Karma() method
- * @ throws {Error} if the individual video asset is set to be localized but
- * the globale locale is not set on the Karma object
- * @ throws {Error} if the name and file properties are not supplied
- */
-Karma.kVideo = {
- /** file location of asset
- * @type String
- * @default ""
- */
- file : "",
- /** media object
- * @type Video
- * @default undefined
- */
- media : undefined,
- //actual path to the file
- _path : "",
- //if using localized version of this asset
- _localized : false,
- _type : "video",
- //initializes kVideo instance with values provided by user
- _init : function (video) {
- //Not Yet Implemented
- Karma._counters.errors++;
- throw new Error("Video is not Yet Implemented");
-
- video._localized = video._localized || false;
- Karma._counters.total++;
-
- if (video.name === undefined || video.file === undefined){
- throw new Error("properties name and file have to be defined");
- } else {
- this.name = video.name;
- this.file = video.file;
- }
-
- this.media = new Video();
-
- if(Karma._isLocalized(video._localized)){
- this._localized = video._localized;
- this._path = Karma._localePath + "video/";
- } else {
- this._path = Karma._assetPath + "video/";
- }
-
-
- //IMPORTANT: This one magic line loads the file
- this.media.src = this.src = this._path + this.file;
-
- //add event handlers
- this._addEventHandlers();
-
- return this;
- },
- //Adds event handlers to update the counters when
- //the asset is successfully or unsuccessfully loaded
- _addEventHandlers : function () {
- var that = this;
- //'canplaythrough' event is a Browser Hack recommended by chromium devs
- //http://code.google.com/p/chromium/issues/detail?id=20251&q=loading%20audio&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS#c4
-
- that.media.addEventListener(
- "canplaythrough",
- function (e) {
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";}, false);
-
- that.media.addEventListener(
- "error",
- function (e) {
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.media.addEventListener(
- "abort",
- function (e) {
- Karma._counters.total++;
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- }
-
-};
-
-
-
-/** Prototype object for each canvas element submitted to Karma in the
- * Karma() method
- * @throws {Error} if the name and domId for the canvas element are not specified
- * @thows {Error} if the supplied domId does not match an element in the DOM
- * @class This object is the prototype for each canvas element submitted to Karma in the
- * Karma() method
- */
-Karma.kCanvas = {
- /** Name of the canvas, used internally by karma.js
- * @type String
- * @default ''
- */
- name : '',
- /** Width of canvas element
- * @type Number
- * @default 0
- */
- width: 0,
- /** Height of canvas element
- * @type Number
- * @default 0
- */
- height: 0,
- /** Whether canvas is visible
- * @type boolean
- * @default true
- */
- visible: true,
- /** Element ID for canvas element in html document. This value is read-only
- * @type String
- * @default undefined
- */
- domId: undefined,
- /** Reference to the DOM element
- * @type DOMElement
- * @default undefined
- * @example
- * //You can access all properties and methods of the underlying DOM element
- * //using the 'node' property
- * Karma.canvas.someCanvas.node.dispatchEvent( ... some event ...);
- * var stuff = Karma.canvas.someCanvas.node.innerHTML;
- *
- */
- node: undefined,
- /** The 2 Dimensional Rendering context property for this canvas
- * @type 2DRenderingContext
- * @default undefined
- * @example
- * //Almost all of the context attributes and methods are wrapped in helper functions
- * //but you can also access them directly using the ctx property
- * Karma.canvas.someCanvas.ctx.drawImage(someImage, x, y);
- * Karma.canvas.someCanvas.ctx.fillStyle = "#ffffff";
- */
- ctx: undefined,
-
- //initializes object with values provides by user
- _init: function (config) {
- for (var option in config){
- if (config.hasOwnProperty(option)){
- switch (option){
- case "name":
- this.name = config[option];
- break;
- case "domId":
- this.domId = config[option];
- break;
- case "width":
- if(!this.height){
- throw new Error("If you specify a width you must also" +
- "specify a height");
- }
- this.width = config[option];
- break;
- case "height":
- if(!this.width){
- throw new Error("If you specify a height you must also" +
- "specify a width");
- }
- this.height = parseInt(config.option, 10);
- break;
- case "fps":
- this.fps = parseInt(config.option, 10);
- break;
- }
- }
- }
-
- if(this.domId && document.getElementById(this.domId)){
- this.node = document.getElementById(this.domId);
- this.ctx = this.node.getContext('2d');
- } else {
- throw new Error('you must specify a valid domId that' +
- 'is in your html page');
- }
-
- if(!config.height && !config.width){
- this.width = parseInt(this.node.getAttribute('width'), 10);
- this.height = parseInt(this.node.getAttribute('height'), 10);
- }
-
- return this;
- },
- /** Clear area of canvas element specified by parameters, if no
- * parameters supplied, clears entire canvas
- * @param {Number} [x=0] x coordinate, defaults to zero if left blank
- * @param {Number} [y=0] y coordinate, defaults to zero if left blank
- * @param {Number} [width=0] width of area to be cleared, defaults
- * entire width of canvas
- * @param {Number} [height=0] height of area to be cleared, defaults
- * entire height of canvas
- * @returns this
- * @example
- *
- * k.canvas.ninja.clear();
- * // clears the entire ninja canvas
- *
- * k.canvas.ninja.clear(0, 10, 20, 30);
- * //clears a specific portion of the ninja canvas
- *
- */
- clear : function ( x, y, width, height ) {
- var that = this;
- that.ctx.clearRect(
- x || 0,
- y || 0,
- width || that.width,
- height || that.height
- );
- return that;
- },
-
- /** The globalAlpha attribute gives an alpha value that is applied to shapes
- * and images before they are composited onto the canvas
- * @param {Number} number in the range from 0.0 to 1.0
- * @returns this
- */
- globalAlpha : function (attribute){
- var name = 'globalAlpha';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the globalCompositeOperation attribute, which sets how shapes and images
- * are drawn onto the existing bitmap, once they have had globalAlpha and the
- * current transformation matrix applied.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} globalCompositeOperation source-atop,
- * source-in, source-out,
- * source-over, destination-atop, destination-in, destination-out, destination-over,
- * lighter
- * @returns this
- */
- globalCompositeOperation: function (attribute){
- var name = ' globalCompositeOperation';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the lineWidth attribute which gives the width of lines, in coordinate space
- * units.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {Number} lineWidth
- * @returns this
- */
- lineWidth: function (attribute){
- var name = 'lineWidth';
- this.ctx[name] = attribute;
- return this;
- },
- /** The lineCap attribute defines the type of endings that UAs will place on
- * the end of lines.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} type butt, round, square
- * @returns this
- */
- lineCap: function (attribute){
- var name = 'lineCap';
- this.ctx[name] = attribute;
- return this;
- },
- /** The lineJoin attribute defines the type of corners that UAs will place
- * where two lines meet. The three valid values are bevel, round, and miter.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} type
- * @returns this
- */
- lineJoin: function (attribute){
- var name = 'lineJoin';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the miter limit
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {Number} number
- * @returns this
- */
- miterLimit: function (attribute){
- var name = 'miterLimit';
- this.ctx[name] = attribute;
- return this;
- },
- /** Sets the font property and takes the same syntax as setting the font property
- * in CSS
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String}
- * @returns this
- */
- font: function (attribute){
- var name = 'font';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Changes the text alignment. The possible values are start, end, left, right,
- * and center. The default is start. Other values are ignored.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {string} alignment
- * @returns this
- */
- textAlign: function (attribute){
- var name = 'textAlign';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Changes the baseline alignment. If the value is one of top, hanging, middle,
- * alphabetic, ideographic, or bottom, then the value must be changed to the new value.
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param {String} alignment
- * @returns this
- */
- textBaseline: function (attribute){
- var name = 'textBaseline';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Save the current state of the context
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- save : function ( ){
- var name = 'save';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Restore the saved context
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- restore : function ( ){
- var name = 'restore';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Perform a scale transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- scale : function ( ){
- var name = 'scale';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Perform a rotation transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- rotate : function ( ){
- var name = 'rotate';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Performa a translation transformation
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- translate : function ( ){
- var name = 'translate';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Transform the identity matrix
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- transform : function ( ){
- var name = 'transform';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Set the transform
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- setTransform : function ( ){
- var name = 'setTransform';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Clear a rectangular area
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- clearRect : function ( ){
- var name = 'clearRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Fill a rectangular area
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillRect : function ( ){
- var name = 'fillRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Draw the outline of the rectangle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeRect : function ( ){
- var name = 'strokeRect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Begin a path
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- beginPath : function ( ){
- var name = 'beginPath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** End a path
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- closePath : function ( ){
- var name = 'closePath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Move to specified coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- moveTo : function ( ){
- var name = 'moveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
-
- /** Draw a line to the given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- lineTo : function ( ){
- var name = 'lineTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Draw a quadratic curve to given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- quadraticCurveTo : function ( ){
- var name = 'quadraticCurveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Draw a bezier curve to given coordinates
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- bezierCurveTo : function ( ){
- var name = 'bezierCurveTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Draw an arc to the given points
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- arcTo : function ( ){
- var name = 'arcTo';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Create an arc
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- arc : function ( ){
- var name = 'arc';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Create a rectangle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- rect : function ( ){
- var name = 'rect';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** fill in the current subpaths with the current fillstyle
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fill : function ( ){
- var name = 'fill';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** Stroke the subpaths
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- stroke : function ( ){
- var name = 'stroke';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- clip : function ( ){
- var name = 'clip';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillText : function ( ){
- var name = 'fillText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeText : function ( ){
- var name = 'strokeText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- measureText : function ( ){
- var name = 'measureText';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- isPointInPath : function ( ){
- var name = 'isPointInPath';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
- /** Sets the stroke style
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- strokeStyle: function (attribute){
- var name = 'strokeStyle';
- this.ctx[name] = attribute;
- return this;
- },
-
- /** Sets the fill style
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- fillStyle: function (attribute){
- var name = 'fillStyle';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createLinearGradient : function ( ){
- var name = 'createLinearGradient';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createRadialGradient : function ( ){
- var name = 'createRadialGradient';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createPattern : function ( ){
- var name = 'createPattern';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowOffsetX: function (attribute){
- var name = 'shadowOffsetX';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowOffsetY: function (attribute){
- var name = 'shadowOffsetY';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowBlur: function (attribute){
- var name = 'shadowBlur';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- shadowColor: function (attribute){
- var name = 'shadowColor';
- this.ctx[name] = attribute;
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- drawImage : function ( ){
- var name = 'drawImage';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- getImageData : function ( ){
- var name = 'getImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- putImageData : function ( ){
- var name = 'putImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- createImageData : function ( ){
- var name = 'createImageData';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
- /** description
- * For full details see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation">W3C docs</a>
- * @param
- * @returns this
- */
- drawWindow : function ( ){
- var name = 'drawWindow';
- this.ctx[name].apply(this.ctx, arguments);
- return this;
- },
-
-
-
-
-};
-
-
-/** Prototype object for each svg element submitted to Karma in the
- * Karma() method
- * @throws {Error} if the name and domId for the svg element are not specified
- * @thows {Error} if the supplied domId does not match an element in the DOM
- * @class This object is the prototype for each svg element submitted to Karma in the
- * Karma() method
- */
-Karma.kSvg = {
- /** name of instance, used internally
- * @typeof string
- * @default ""
- */
- name : "",
- /** width of element
- * @type number
- * @default 0
- */
- width: 0,
- /** height of element
- * @type number
- * @default 0
- */
- height: 0,
- /** Status of element, either "loaded" or "error"
- * @type string
- * @default ""
- */
- status: "",
- /** Whether canvas is visible. This value is read-only
- * @type boolean
- * @default true
- */
- visible: true,
- /** Element ID for canvas element in html document.
- * @type String
- * @default undefined
- */
- domId: undefined,
- /** Reference to the DOM element.
- * @type DOMElement
- * @default undefined
- * @example
- * //You can access all properties and methods of the underlying DOM element
- * //using the 'node' property
- * Karma.svg.someSvg.node.dispatchEvent;
- * Karma.svg.someSvg.node.addEvenListener(...);
- */
- node: undefined,
- /** Reference to the SVGDocument. You can use the this.doc to manipulate
- * the SVG document
- * @type SVGDocument
- * @default undefined
- * @example
- * var myElem = Karma.svg.someSvg.doc.getElementById('foobar');
- * Karma.svg.someSvg.doc.createElement(...);
- * Karma.svg.someSvg.doc.removeChild(someNode);
- *
- */
- doc: undefined,
- /** Reference to the root element of the SVG Document
- * @type DocumentElement
- * @default undefined
- * @example
- * // The root element is equivalent to "document" in a regular html document
- * // The root attribute is used frequently with the jQuery SVG plugin for CSS selectors
- * $('#someId', Karma.svg.someSvg.root).css(.. manipulate css attributes ...);
- */
- root: undefined,
- _localized : undefined,
- _init: function (config) {
- Karma._counters.total++;
-
- for (var option in config){
- if (config.hasOwnProperty(option)){
- switch (option){
- case "name":
- this.name = config[option];
- break;
- case "domId":
- this.domId = config[option];
- break;
- case "width":
- if(!this.height){
- throw new Error("If you specify a width you must also" +
- "specify a height");
- }
- this.width = parseInt(config[option], 10);
- break;
- case "height":
- if(!this.width){
- throw new Error("If you specify a height you must also" +
- "specify a width");
- }
- this.height = config[option];
- break;
- }
- }
- }
-
- if(this.domId && document.getElementById(this.domId)){
- this.node = document.getElementById(this.domId);
- } else {
- throw new Error('you must specify a valid domId that' +
- 'is in your html page');
- }
-
- if(!config.height && !config.width){
- this.width = parseInt(this.node.getAttribute('width'), 10);
- this.height = parseInt(this.node.getAttribute('height'), 10);
- }
-
- var that = this;
- that._addEventHandlers();
-
- return this;
-
-
- },
- _addEventHandlers : function () {
- var that = this;
- that.doc = that.node.getSVGDocument();
- that.node.addEventListener(
- "load",
- function (e) {
- that.doc = that.node.getSVGDocument();
- that.root = that.doc.documentElement;
- Karma._counters.loaded++;
- Karma._updateStatus();
- that.status = "loaded";
- }, false);
-
- that.node.addEventListener(
- "error",
- function (e) {
- Karma._counters.loaded--;
- Karma._counters.errors++;
- that.status = "error";
- var errorMsg = "Error: " + that._type.toUpperCase() +
- " " + that.name + " cannot be loaded.";
- Karma._updateStatus(errorMsg);
- },
- false);
- that.node.addEventListener(
- "abort",
- function (e) {
- that.status = "aborted";
- var errorMsg = "ABORT: " + that._type.toUpperCase() +
- " " + that.name + " loading was aborted.";
- Karma._updateStatus(errorMsg);
-
- }, false);
-
- }
-};
diff --git a/content/js/langs/en.js b/content/js/langs/en.js
deleted file mode 100755
index 075bef7..0000000
--- a/content/js/langs/en.js
+++ /dev/null
@@ -1,169 +0,0 @@
-tinyMCE.addI18n({en:{
-common:{
-edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
-apply:"Apply",
-insert:"Insert",
-update:"Update",
-cancel:"Cancel",
-close:"Close",
-browse:"Browse",
-class_name:"Class",
-not_set:"-- Not set --",
-clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
-clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
-popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
-invalid_data:"Error: Invalid values entered, these are marked in red.",
-more_colors:"More colors"
-},
-contextmenu:{
-align:"Alignment",
-left:"Left",
-center:"Center",
-right:"Right",
-full:"Full"
-},
-insertdatetime:{
-date_fmt:"%Y-%m-%d",
-time_fmt:"%H:%M:%S",
-insertdate_desc:"Insert date",
-inserttime_desc:"Insert time",
-months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
-months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
-day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
-day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
-},
-print:{
-print_desc:"Print"
-},
-preview:{
-preview_desc:"Preview"
-},
-directionality:{
-ltr_desc:"Direction left to right",
-rtl_desc:"Direction right to left"
-},
-layer:{
-insertlayer_desc:"Insert new layer",
-forward_desc:"Move forward",
-backward_desc:"Move backward",
-absolute_desc:"Toggle absolute positioning",
-content:"New layer..."
-},
-save:{
-save_desc:"Save",
-cancel_desc:"Cancel all changes"
-},
-nonbreaking:{
-nonbreaking_desc:"Insert non-breaking space character"
-},
-iespell:{
-iespell_desc:"Run spell checking",
-download:"ieSpell not detected. Do you want to install it now?"
-},
-advhr:{
-advhr_desc:"Horizontal rule"
-},
-emotions:{
-emotions_desc:"Emotions"
-},
-searchreplace:{
-search_desc:"Find",
-replace_desc:"Find/Replace"
-},
-advimage:{
-image_desc:"Insert/edit image"
-},
-advlink:{
-link_desc:"Insert/edit link"
-},
-xhtmlxtras:{
-cite_desc:"Citation",
-abbr_desc:"Abbreviation",
-acronym_desc:"Acronym",
-del_desc:"Deletion",
-ins_desc:"Insertion",
-attribs_desc:"Insert/Edit Attributes"
-},
-style:{
-desc:"Edit CSS Style"
-},
-paste:{
-paste_text_desc:"Paste as Plain Text",
-paste_word_desc:"Paste from Word",
-selectall_desc:"Select All"
-},
-paste_dlg:{
-text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
-text_linebreaks:"Keep linebreaks",
-word_title:"Use CTRL+V on your keyboard to paste the text into the window."
-},
-table:{
-desc:"Inserts a new table",
-row_before_desc:"Insert row before",
-row_after_desc:"Insert row after",
-delete_row_desc:"Delete row",
-col_before_desc:"Insert column before",
-col_after_desc:"Insert column after",
-delete_col_desc:"Remove column",
-split_cells_desc:"Split merged table cells",
-merge_cells_desc:"Merge table cells",
-row_desc:"Table row properties",
-cell_desc:"Table cell properties",
-props_desc:"Table properties",
-paste_row_before_desc:"Paste table row before",
-paste_row_after_desc:"Paste table row after",
-cut_row_desc:"Cut table row",
-copy_row_desc:"Copy table row",
-del:"Delete table",
-row:"Row",
-col:"Column",
-cell:"Cell"
-},
-autosave:{
-unload_msg:"The changes you made will be lost if you navigate away from this page.",
-restore_content: "Restore auto-saved content",
-warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
-},
-fullscreen:{
-desc:"Toggle fullscreen mode"
-},
-media:{
-desc:"Insert / edit embedded media",
-edit:"Edit embedded media"
-},
-fullpage:{
-desc:"Document properties"
-},
-template:{
-desc:"Insert predefined template content"
-},
-visualchars:{
-desc:"Visual control characters on/off."
-},
-spellchecker:{
-desc:"Toggle spellchecker",
-menu:"Spellchecker settings",
-ignore_word:"Ignore word",
-ignore_words:"Ignore all",
-langs:"Languages",
-wait:"Please wait...",
-sug:"Suggestions",
-no_sug:"No suggestions",
-no_mpell:"No misspellings found."
-},
-pagebreak:{
-desc:"Insert page break."
-},
-advlist : {
- types : 'Types',
- def : 'Default',
- lower_alpha : "Lower alpha",
- lower_greek : "Lower greek",
- lower_roman : "Lower roman",
- upper_alpha : "Upper alpha",
- upper_roman : "Upper roman",
- circle : "Circle",
- disc : "Disc",
- square : "Square"
-}
-}}); \ No newline at end of file
diff --git a/content/js/learner_lesson.js b/content/js/learner_lesson.js
deleted file mode 100755
index 223e450..0000000
--- a/content/js/learner_lesson.js
+++ /dev/null
@@ -1,228 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma();
-
- k.ready(function() {
-
- activities;
-
- k.ready(function(){
-
- //game logic
-
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 5;
- var rows = 2 + (activities.length / cells);
- var maxx = 1100;
- var cellsize = 64;
- var maxy = rows * 2 * cellsize;
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 1.7 * cellsize;
- var ystart = maxy - cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
-
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX
- y = $e.pageY
- $.each(acts, function() {
- xy = this;
- // directory structure: content/subject/milestone/activity
- // for learners, we want the 'red' activity
- url = window.location+"";
- if ((x > xy[1])&&(x < xy[1]+cellsize)&&(y < xy[2])&&(y > xy[2] - cellsize) ){
- if ((xy[5]=='red') || (url.indexOf('?F') > -1)){
- //set path
- if (xy[3] == "EPaath"){
- pth = "../../../src/FrameWork.html#" + xy[4];
- }else if (xy[3] == "Karma"){
- last = xy[0].charAt(xy[0].length-1);
- pth = xy[4] + '/index.html?F'+last;
- }else if (xy[3] == 'NKarma'){
- pth = xy[4] + '/index.html';
- }else if (xy[3] == "Siyavula"){
- pth = xy[4] + '.html';
- }else if (xy[3] == 'Sugar'){
- pth = xy[4] + '/index.html';
- }else{
- pth = "../../"+"content/unavailable.html";
- };
- //start session
- $('<div id="temp" />')
- .load('http://localhost:8008/cgi-bin/session.py',
- {'activity':xy[4]},
- function(){
- window.location = pth;
- });
- };
- };
- });
- });
- // ladder
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- ctx.beginPath();
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {
- break;
- };
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if (activity < activities.length){
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) &&
- (activity < activities.length)) {
- if (row % 2 == 0) {
- ctx.fillStyle = 'yellow';
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.closePath();
- ctx.fill();
- } else {
- x = xstart;
- ctx.fillStyle = 'yellow';
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.closePath();
- ctx.fill();
- }
- }
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta;
- }
- }
-
- function drawarrow(x,y,sz) {
- ctx.fillStyle='black';
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.stroke();
- };
-
- function drawlogo(x, y, activity) {
- var capcolor;
- id = activities[activity][0];
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- if ((activities[activity].length) > 3){
- capcolor = activities[activity][5];
- }else{
- capcolor = 'cyan';
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls, capcolor];
- sz = cellsize
- if (id == 0){
- // draw milestone
- ctx.moveTo(x,y);
- ctx.lineTo(x,y-sz);
- ctx.moveTo(x+sz, y-sz);
- ctx.lineTo(x+sz, y);
- ctx.moveTo(x, y-sz);
- ctx.arc(x+0.5*sz,y-sz,0.5*sz,Math.PI,0,0);
- ctx.fillStyle = 'black';
- ctx.fillText(ix, x + (sz * 0.3), y-(sz * 0.4), sz);
- ctx.stroke();
- } else {
- // draw logo
- ctx.moveTo(x,y);
- ctx.lineTo(x,y-sz);
- ctx.strokeStyle = 'black';
- ctx.stroke();
- ctx.fillStyle = capcolor;
- ctx.fillRect(x,y-sz,sz, sz/2);
- ctx.textAlign = 'center';
- ctx.font = '20pt Arial';
- ctx.fillStyle = 'black';
- ctx.fillText(ix,x+sz/2,y-sz/2-10,sz);
- };
- }
- }
-
- draw();
-
- });
- });
-
-});
diff --git a/content/js/learner_subject.js b/content/js/learner_subject.js
deleted file mode 100755
index 1c45220..0000000
--- a/content/js/learner_subject.js
+++ /dev/null
@@ -1,224 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma();
-
- k.ready(function() {
-
- activities;
-
- k.ready(function(){
-
- //game logic
-
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 6;
- var rows = 2 + (activities.length / cells);
- var maxx = 1200;
- var cellsize = 64;
- var sz = cellsize;
- var maxy = rows * 1.5 * cellsize;
- if (maxy < 673){
- maxy = 673;;
- };
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 1.7 * cellsize;
- var ystart = maxy - cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
-
- url = window.location+"";
- if(url.indexOf('index')<0){
- mode = 'faculty'
- }else{
- mode = 'student'
- }
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX
- y = $e.pageY
- $.each(acts, function() {
- xy = this;
- // directory structure: content/subject/milestone/activity
- if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2])
- && (y > xy[2] - cellsize)
- && (mode == 'faculty')) {
- pth = xy[4]+'/index.html';
- window.location = pth;
- }else if (xy[5] == 'red'){
- pth = xy[4]+'/index.html';
- window.location = pth;
- };
- });
- });
- // ladder
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- ctx.beginPath();
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {
- break;
- };
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if (activity < activities.length){
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.fillstyle='yellow';
- ctx.fillRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) &&
- (activity < activities.length)) {
- if (row % 2 == 0) {
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.closePath();
- ctx.fillStyle='yellow'
- ctx.fill()
- } else {
- x = xstart;
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.closePath();
- ctx.fillStyle='yellow'
- ctx.fill()
- }
- }
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta;
- }
- }
-
- function drawarrow(x,y,sz) {
- ctx.fillStyle = 'black'
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.stroke();
- };
-
- function drawmilestone(activity){
- var capcolor;
- x = activity[1];
- y = activity[2];
- capcolor = activity[5];
- ctx.fillStyle = 'chartreuse';
- ctx.fillRect(x,y-cellsize,cellsize,cellsize);
- ctx.fillStyle = 'black'
- ctx.fillText(ix, x + (cellsize * 0.3), y-(cellsize * 0.4), cellsize);
- ctx.beginPath();
- ctx.moveTo(x, y-cellsize);
- ctx.arc(x+0.5*cellsize,y-cellsize,0.5*cellsize,Math.PI,0,0);
- ctx.closePath();
- ctx.fillStyle = capcolor;
- ctx.fill();
- ctx.fillStyle = 'yellow';
- };
-
- function drawlogo(x, y, activity) {
- var il, ty, ls, cc;
- id = 0; /* we always have a milestone here */
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- if ((activities[activity].length) > 4){
- cc = activities[activity][5];
- }else{
- cc = 'cyan';
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls, cc];
- if (id < 2){
- drawmilestone(acts[idx]);
- } else {
- // draw logo
- alert('draw logo - should not happen');
- ctx.drawImage(k.image[logos[id-1]].media, x, y - cellsize);
- if (ix > 0) {
- ctx.textAlign = 'center'
- ctx.fillStyle = 'black'
- ctx.fillText(ix, x + cellsize/2, y+cellsize/4, cellsize);
- };
- };
- }
- }
-
- draw();
-
- });
- });
-
-});
diff --git a/content/js/math.js b/content/js/math.js
deleted file mode 100755
index a0b9da4..0000000
--- a/content/js/math.js
+++ /dev/null
@@ -1,274 +0,0 @@
-var ctx, xs, ys, columnWidth, rowHeight, solution, steps, typeFlag;
-var decimalNumber,words,ask,txtComment,spaces;
-var digits, WBDigits, WBTeen, WBTens;
-var whole, decimal,wholeDigits,dcmlDigits;
-var caseno, cases;
-
-txtComment = '';
-spaces = ' ';
-WBDigits=['zero','one','two','three','four','five','six','seven','eight','nine'];
-WBTeens=['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen'];
-WBTens=['','','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety'];
-
-function word(s){
- n = parseInt(s);
- if (n<10){
- return WBDigits[n]
- } else if (n<20) {
- return WBTeens[n-10]
- } else {
- x = Math.floor(n/10);
- y = n%10;
- if (y>1){
- return WBTens[x] + '-' + WBDigits[y];
- } else {
- return WBTens[x];
- };
- };
-};
-
-function getUnits(theDigits){
- s = "";
- units = theDigits.length+"";
- switch(units){
- case "1":
- if(theDigits[0] != '0'){
- s = word(theDigits[0]);
- };
- break;
- case "2":
- indx = theDigits[1]*10+parseInt(theDigits[0]);
- s = word(indx);
- break;
- case "3":
- s = s + word(theDigits[2]) + ' hundred ';
- indx = theDigits[1]*10+parseInt(theDigits[0]);
- if(indx>0){
- s = s + word(indx);
- };
- break;
- };
- return s;
-};
-
-function getDecimals(theDigits){
- s = "";
- decimals = theDigits.length+"";
- switch(decimals){
- case "1":
- s = word(theDigits[0]) + ' tenths';
- break;
- case "2":
- indx = theDigits[1]*10+parseInt(theDigits[0]);
- s = word(indx) + ' hundredths';
- break;
- case "3":
- if(parseInt(theDigits[2])>0){
- s = word(theDigits[2]) + ' hundred ';
- };
- indx = theDigits[1]*10+parseInt(theDigits[0]);
- s = s + word(indx) + ' thousandths';
- break;
- default:
- alert(decimals+' should not happen');
- };
- return s;
-};
-
-function getWords(theDigits){
- test=theDigits.join("");
- if (test.indexOf('.')>0){
- parts = test.split('.');
- decimalDigits=parts[0].split("");
- unitDigits=parts[1].split("");
- }else{
- decimalDigits = [];
- unitDigits=test.split("");
- };
- decimals = decimalDigits.length;
- units = unitDigits.length;
- if(units>0){
- words = getUnits(unitDigits);
- }else{
- words = '';
- };
- if(decimals>0){
- dwords = getDecimals(decimalDigits);
- if(dwords.length>0){
- if(words.length>0){
- words = words + ' and ' + dwords;
- }else{
- words = dwords;
- };
- };
- };
- return words
-};
-
-function getWholeWords(words){
- pos = words.indexOf(' and ');
- if(pos>0){
- txt = words.substring(0,pos);
- return txt;
- }else{
- return "";
- }
-};
-
-function getRandom(a,b) {
- c = Math.random()
- return Math.floor(c * (b-a) + a)
-};
-
-function generate_compare(op1,op2){
- if (op1 == op2){
- return '=';
- } else if (op1 < op2){
- return '<';
- } else {
- return '>';
- };
-};
-
-function expandNumber(number){
- position = 0;
- rest = number;
- digits = [];
- while (rest > 0) {
- digit = rest%10;
- digits[position] = digit;
- position += 1;
- rest = (rest - digit) / 10;
- };
- return digits;
-};
-
-function drawDigits(row, xunits, theDigits){
- y = ys + (row+2)*50;
- xl = xunits - 20;
- for(i=0;i<theDigits.length;i++){
- x = xl-(i*columnWidth);
- ctx.fillText(theDigits[i],x,y-10);
- ctx.stroke();
- };
-};
-
-function drawHighlight(row,x,number,color){
- y = ys + (row+2)*50;
- save = ctx.fillStyle;
- ctx.fillStyle = color;
- ctx.fillText(number,x,y-10);
- ctx.stroke();
- ctx.fillStyle = save;
-};
-
-function drawBlanks(row,col,cols){
- y = ys + (row+2)*50;
- x = xs + 50 + col*columnWidth;
- ctx.clearRect(x,y-50,x+50-col*columnWidth,y);
-};
-
-function drawNumber(row, x, number){
- y = ys + (row+2)*50;
- ctx.fillText(number,x,y-10);
- ctx.stroke()
-};
-
-function drawLine(xs,ys,xf,yf){
- ctx.moveTo(xs,ys)
- ctx.lineTo(xf,yf)
- ctx.stroke()
-};
-
-function drawTotal(row, xunits, sub, cols){
- //draw heavier line at base of row for cols columns from right
- //if sub is true, draw not so bold a line
- y = ys + (row+2)*50;
- xl = xunits;
- drawLine(xl - cols * columnWidth, y, xl, y);
-};
-
-function drawComment(row, xunits, txt){
- if(row==0){
- y = ys;
- x = xs;
- align=ctx.textAlign;
- ctx.textAlign='left';
- ctx.fillText(spaces,x,y-10);
- ctx.stroke();
- }else{
- y = ys + (row+2)*50;
- x = xunits + 25;
- align = ctx.textAlign;
- };
- ctx.fillText(txt,x,y-10);
- ctx.stroke();
- ctx.textAlign = align;
-};
-
-function drawPanel(name){
- // draw lines
- xf = xs+3*columnWidth
- yf = ys+rows*rowHeight
- first = xs+columnWidth
- second = xs+2*columnWidth
- // horizontal
- drawLine(xs,ys,xf,ys);
- drawLine(xs,ys+rowHeight,xf,2*rowHeight);
- drawLine(xs,ys+2*rowHeight,xf,3*rowHeight);
- //drawLine(xs,yf,xf,yf);
- // vertical
- drawLine(xs,ys,xs,yf);
- drawLine(xf,ys,xf,yf);
- drawLine(first,ys+rowHeight,first,yf);
- drawLine(second,ys+rowHeight,second,yf);
- // text
- font = ctx.font;
- align = ctx.textAlign;
- ctx.font = "12pt Arial";
- ctx.textAlign = "left";
- ctx.fillText(name[0], first+10, ys+40);
- ctx.stroke();
- ctx.fillText(name[1],xs+10, ys+90);
- ctx.stroke();
- ctx.fillText(name[2], first+10, ys+90);
- ctx.stroke();
- ctx.fillText(name[3], second+10, ys+90);
- ctx.stroke();
- ctx.font = font;
- ctx.textAlign = align;
-};
-
-//draw place value table
-function draw(){
- // set up canvas
- var canvas = document.getElementById('placeValue');
- if (canvas.getContext){
- ctx = canvas.getContext('2d');
- var maxx = 1198;
- var maxy = 700;
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- ctx.fillStyle = 'black';
- ctx.strokeStyle = 'black';
- ctx.font = "20pt Arial";
- ctx.textAlign = "center";
- // draw panels
- columnWidth = 100;
- rowHeight = 50;
- rows = 7;
- xs = 50 + 6*columnWidth;
- ys = 50
- decimals = ['thousandths','10ths','100ths','1000ths']
- drawPanel(decimals);
- xs = 50 + 3*columnWidth;
- units = ['units','hundreds','tens','ones']
- drawPanel(units);
- xs = 50;
- thousands = ['thousands','hundreds','tens','ones']
- drawPanel(thousands);
- drawComment(1,30+6*columnWidth,'.')
- } else {
- alert('oops');
- };
-};
diff --git a/content/js/menu.js b/content/js/menu.js
deleted file mode 100755
index 9c0b0c4..0000000
--- a/content/js/menu.js
+++ /dev/null
@@ -1,217 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma();
-
- k.ready(function() {
-
- activities;
-
- k.ready(function(){
-
- //game logic
-
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 5;
- var rows = 2 + (activities.length / cells);
- var maxx = 1100;
- var cellsize = 64;
- var maxy = rows * 2 * cellsize + 50;
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 1.7 * cellsize;
- var ystart = maxy - cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
- var done = 0;
-
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX
- y = $e.pageY
- $.each(acts, function() {
- xy = this;
- // directory structure: activity/content/subject/milestone + folder per activity
- if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2]) && (y > xy[2] - cellsize) ) {
- pth = "../../" + "unavailable.html";
- if (xy[3] == "EPaath"){
- pth = "../../../src/FrameWork.html#" + xy[4];
- };
- if (xy[3] == "NKarma"){
- pth = xy[4] + '/index.html';
- };
- if (xy[3] == "Siyavula"){
- pth = xy[4] + '.html';
- };
- if (xy[3] == 'Sugar'){
- pth = xy[4] + '/index.html';
- };
- window.location = pth;
- };
- });
- });
- // ladder
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {
- break;
- };
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if ((done < 1) && (activity < activities.length)){
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.fillStyle = 'chartreuse'
- ctx.fillRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) &&
- (activity < activities.length))
- {
- if (row % 2 == 0) {
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.closePath();
- ctx.fillStyle = 'yellow';
- ctx.fill();
- } else {
- x = xstart;
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.closePath();
- ctx.fillStyle = 'yellow';
- ctx.fill();
- }
- }
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta;
- }
- }
-
- function drawarrow(x,y,sz) {
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.stroke();
- };
-
- function drawlogo(x, y, activity) {
- id = activities[activity][0];
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- if ((activities[activity].length) > 4){
- flagcolor = activities[activity][5];
- }else{
- flagcolor = 'white';
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls];
- sz = cellsize
- if (id == 0){
- done = 1;
- // draw milestone
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y-sz,sz,sz);
- ctx.fill();
- ctx.fillStyle = 'black';
- ctx.beginPath();
- ctx.arc(x+0.5*sz,y-sz,0.5*sz,Math.PI,0,0);
- ctx.closePath();
- ctx.fillStyle = 'blue';
- ctx.fill();
- ctx.fillStyle = 'black';
- ctx.fillText(ix, x + (sz * 0.3), y-(sz * 0.4), sz);
- } else {
- // draw logo
- ctx.moveTo(x,y);
- ctx.lineTo(x,y-sz);
- ctx.stroke();
- ctx.fillStyle = flagcolor;
- ctx.fillRect(x,y-sz,sz, sz/2);
- ctx.fillStyle = 'black';
- ctx.textAlign = 'center';
- ctx.font = '20pt Arial';
- ctx.fillText(ix,x+sz/2,y-sz/2-10,sz);
- };
- }
- }
-
- draw();
-
- });
- });
-
-});
diff --git a/content/js/navigation.js b/content/js/navigation.js
deleted file mode 100755
index 6d1ea70..0000000
--- a/content/js/navigation.js
+++ /dev/null
@@ -1,43 +0,0 @@
-$(document).ready(function(){
-
- $('#linkHome').click(function(){
- linkHome();
- });
- $('#linkEnglish').click(function(){
- linkEnglish();
- });
- $('#linkMathematics').click(function(){
- linkMathematics();
- });
- $('#linkExplore').click(function(){
- linkExplore();
- });
- $('#linkBack').click(function(){
- goback();
- });
- $('#linkBackOne').click(function(){
- gobackOne();
- });
- $('#linkBackTwo').click(function(){
- gobackTwo();
- });
- $('#linkBackThree').click(function(){
- gobackThree();
- });
- $('#linkApply').click(function(){
- apply();
- });
- $('#linkQuit').click(function(){
- quit();
- });
- $('#linkEdit').click(function(){
- edit();
- });
- $('#linkBegin').click(function(){
- commence();
- });
-
-
-}); //end of document.read
-
-
diff --git a/content/js/qunit.js b/content/js/qunit.js
deleted file mode 100755
index b7ee538..0000000
--- a/content/js/qunit.js
+++ /dev/null
@@ -1,1027 +0,0 @@
-/*
- * QUnit - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2009 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- */
-
-(function(window) {
-
-var QUnit = {
-
- // Initialize the configuration options
- init: function() {
- config = {
- stats: { all: 0, bad: 0 },
- moduleStats: { all: 0, bad: 0 },
- started: +new Date,
- blocking: false,
- autorun: false,
- assertions: [],
- filters: [],
- queue: []
- };
-
- var tests = id("qunit-tests"),
- banner = id("qunit-banner"),
- result = id("qunit-testresult");
-
- if ( tests ) {
- tests.innerHTML = "";
- }
-
- if ( banner ) {
- banner.className = "";
- }
-
- if ( result ) {
- result.parentNode.removeChild( result );
- }
- },
-
- // call on start of module test to prepend name to all tests
- module: function(name, testEnvironment) {
- config.currentModule = name;
-
- synchronize(function() {
- if ( config.currentModule ) {
- QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
- }
-
- config.currentModule = name;
- config.moduleTestEnvironment = testEnvironment;
- config.moduleStats = { all: 0, bad: 0 };
-
- QUnit.moduleStart( name, testEnvironment );
- });
- },
-
- asyncTest: function(testName, expected, callback) {
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = 0;
- }
-
- QUnit.test(testName, expected, callback, true);
- },
-
- test: function(testName, expected, callback, async) {
- var name = testName, testEnvironment, testEnvironmentArg;
-
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = null;
- }
- // is 2nd argument a testEnvironment?
- if ( expected && typeof expected === 'object') {
- testEnvironmentArg = expected;
- expected = null;
- }
-
- if ( config.currentModule ) {
- name = config.currentModule + " module: " + name;
- }
-
- if ( !validTest(name) ) {
- return;
- }
-
- synchronize(function() {
- QUnit.testStart( testName );
-
- testEnvironment = extend({
- setup: function() {},
- teardown: function() {}
- }, config.moduleTestEnvironment);
- if (testEnvironmentArg) {
- extend(testEnvironment,testEnvironmentArg);
- }
-
- // allow utility functions to access the current test environment
- QUnit.current_testEnvironment = testEnvironment;
-
- config.assertions = [];
- config.expected = null;
-
- if ( arguments.length >= 3 ) {
- config.expected = callback;
- callback = arguments[2];
- }
-
- try {
- if ( !config.pollution ) {
- saveGlobal();
- }
-
- testEnvironment.setup.call(testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Setup failed on " + name + ": " + e.message );
- }
-
- if ( async ) {
- QUnit.stop();
- }
-
- try {
- callback.call(testEnvironment);
- } catch(e) {
- fail("Test " + name + " died, exception and test follows", e, callback);
- QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message );
- // else next test will carry the responsibility
- saveGlobal();
-
- // Restart the tests if they're blocking
- if ( config.blocking ) {
- start();
- }
- }
- });
-
- synchronize(function() {
- try {
- checkPollution();
- testEnvironment.teardown.call(testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Teardown failed on " + name + ": " + e.message );
- }
-
- try {
- QUnit.reset();
- } catch(e) {
- fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset);
- }
-
- if ( config.expected && config.expected != config.assertions.length ) {
- QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" );
- }
-
- var good = 0, bad = 0,
- tests = id("qunit-tests");
-
- config.stats.all += config.assertions.length;
- config.moduleStats.all += config.assertions.length;
-
- if ( tests ) {
- var ol = document.createElement("ol");
- ol.style.display = "none";
-
- for ( var i = 0; i < config.assertions.length; i++ ) {
- var assertion = config.assertions[i];
-
- var li = document.createElement("li");
- li.className = assertion.result ? "pass" : "fail";
- li.innerHTML = assertion.message || "(no message)";
- ol.appendChild( li );
-
- if ( assertion.result ) {
- good++;
- } else {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
-
- var b = document.createElement("strong");
- b.innerHTML = name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>";
-
- addEvent(b, "click", function() {
- var next = b.nextSibling, display = next.style.display;
- next.style.display = display === "none" ? "block" : "none";
- });
-
- addEvent(b, "dblclick", function(e) {
- var target = (e || window.event).target;
- if ( target.nodeName.toLowerCase() === "strong" ) {
- var text = "", node = target.firstChild;
-
- while ( node.nodeType === 3 ) {
- text += node.nodeValue;
- node = node.nextSibling;
- }
-
- text = text.replace(/(^\s*|\s*$)/g, "");
-
- if ( window.location ) {
- window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text);
- }
- }
- });
-
- var li = document.createElement("li");
- li.className = bad ? "fail" : "pass";
- li.appendChild( b );
- li.appendChild( ol );
- tests.appendChild( li );
-
- if ( bad ) {
- var toolbar = id("qunit-testrunner-toolbar");
- if ( toolbar ) {
- toolbar.style.display = "block";
- id("qunit-filter-pass").disabled = null;
- id("qunit-filter-missing").disabled = null;
- }
- }
-
- } else {
- for ( var i = 0; i < config.assertions.length; i++ ) {
- if ( !config.assertions[i].result ) {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
- }
-
- QUnit.testDone( testName, bad, config.assertions.length );
-
- if ( !window.setTimeout && !config.queue.length ) {
- done();
- }
- });
-
- if ( window.setTimeout && !config.doneTimer ) {
- config.doneTimer = window.setTimeout(function(){
- if ( !config.queue.length ) {
- done();
- } else {
- synchronize( done );
- }
- }, 13);
- }
- },
-
- /**
- * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
- */
- expect: function(asserts) {
- config.expected = asserts;
- },
-
- /**
- * Asserts true.
- * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
- */
- ok: function(a, msg) {
- QUnit.log(a, msg);
-
- config.assertions.push({
- result: !!a,
- message: msg
- });
- },
-
- /**
- * Checks that the first two arguments are equal, with an optional message.
- * Prints out both actual and expected values.
- *
- * Prefered to ok( actual == expected, message )
- *
- * @example equals( format("Received {0} bytes.", 2), "Received 2 bytes." );
- *
- * @param Object actual
- * @param Object expected
- * @param String message (optional)
- */
- equals: function(actual, expected, message) {
- push(expected == actual, actual, expected, message);
- },
-
- same: function(a, b, message) {
- push(QUnit.equiv(a, b), a, b, message);
- },
-
- start: function() {
- // A slight delay, to avoid any current callbacks
- if ( window.setTimeout ) {
- window.setTimeout(function() {
- if ( config.timeout ) {
- clearTimeout(config.timeout);
- }
-
- config.blocking = false;
- process();
- }, 13);
- } else {
- config.blocking = false;
- process();
- }
- },
-
- stop: function(timeout) {
- config.blocking = true;
-
- if ( timeout && window.setTimeout ) {
- config.timeout = window.setTimeout(function() {
- QUnit.ok( false, "Test timed out" );
- QUnit.start();
- }, timeout);
- }
- },
-
- /**
- * Resets the test setup. Useful for tests that modify the DOM.
- */
- reset: function() {
- if ( window.jQuery ) {
- jQuery("#main").html( config.fixture );
- jQuery.event.global = {};
- jQuery.ajaxSettings = extend({}, config.ajaxSettings);
- }
- },
-
- /**
- * Trigger an event on an element.
- *
- * @example triggerEvent( document.body, "click" );
- *
- * @param DOMElement elem
- * @param String type
- */
- triggerEvent: function( elem, type, event ) {
- if ( document.createEvent ) {
- event = document.createEvent("MouseEvents");
- event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- elem.dispatchEvent( event );
-
- } else if ( elem.fireEvent ) {
- elem.fireEvent("on"+type);
- }
- },
-
- // Safe object type checking
- is: function( type, obj ) {
- return Object.prototype.toString.call( obj ) === "[object "+ type +"]";
- },
-
- // Logging callbacks
- done: function(failures, total) {},
- log: function(result, message) {},
- testStart: function(name) {},
- testDone: function(name, failures, total) {},
- moduleStart: function(name, testEnvironment) {},
- moduleDone: function(name, failures, total) {}
-};
-
-// Maintain internal state
-var config = {
- // The queue of tests to run
- queue: [],
-
- // block until document ready
- blocking: true
-};
-
-// Load paramaters
-(function() {
- var location = window.location || { search: "", protocol: "file:" },
- GETParams = location.search.slice(1).split('&');
-
- for ( var i = 0; i < GETParams.length; i++ ) {
- GETParams[i] = decodeURIComponent( GETParams[i] );
- if ( GETParams[i] === "noglobals" ) {
- GETParams.splice( i, 1 );
- i--;
- config.noglobals = true;
- } else if ( GETParams[i].search('=') > -1 ) {
- GETParams.splice( i, 1 );
- i--;
- }
- }
-
- // restrict modules/tests by get parameters
- config.filters = GETParams;
-
- // Figure out if we're running the tests from a server or not
- QUnit.isLocal = !!(location.protocol === 'file:');
-})();
-
-// Expose the API as global variables, unless an 'exports'
-// object exists, in that case we assume we're in CommonJS
-if ( typeof exports === "undefined" || typeof require === "undefined" ) {
- extend(window, QUnit);
- window.QUnit = QUnit;
-} else {
- extend(exports, QUnit);
- exports.QUnit = QUnit;
-}
-
-if ( typeof document === "undefined" || document.readyState === "complete" ) {
- config.autorun = true;
-}
-
-addEvent(window, "load", function() {
- // Initialize the config, saving the execution queue
- var oldconfig = extend({}, config);
- QUnit.init();
- extend(config, oldconfig);
-
- config.blocking = false;
-
- var userAgent = id("qunit-userAgent");
- if ( userAgent ) {
- userAgent.innerHTML = navigator.userAgent;
- }
-
- var toolbar = id("qunit-testrunner-toolbar");
- if ( toolbar ) {
- toolbar.style.display = "none";
-
- var filter = document.createElement("input");
- filter.type = "checkbox";
- filter.id = "qunit-filter-pass";
- filter.disabled = true;
- addEvent( filter, "click", function() {
- var li = document.getElementsByTagName("li");
- for ( var i = 0; i < li.length; i++ ) {
- if ( li[i].className.indexOf("pass") > -1 ) {
- li[i].style.display = filter.checked ? "none" : "block";
- }
- }
- });
- toolbar.appendChild( filter );
-
- var label = document.createElement("label");
- label.setAttribute("for", "qunit-filter-pass");
- label.innerHTML = "Hide passed tests";
- toolbar.appendChild( label );
-
- var missing = document.createElement("input");
- missing.type = "checkbox";
- missing.id = "qunit-filter-missing";
- missing.disabled = true;
- addEvent( missing, "click", function() {
- var li = document.getElementsByTagName("li");
- for ( var i = 0; i < li.length; i++ ) {
- if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) {
- li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block";
- }
- }
- });
- toolbar.appendChild( missing );
-
- label = document.createElement("label");
- label.setAttribute("for", "qunit-filter-missing");
- label.innerHTML = "Hide missing tests (untested code is broken code)";
- toolbar.appendChild( label );
- }
-
- var main = id('main');
- if ( main ) {
- config.fixture = main.innerHTML;
- }
-
- if ( window.jQuery ) {
- config.ajaxSettings = window.jQuery.ajaxSettings;
- }
-
- QUnit.start();
-});
-
-function done() {
- if ( config.doneTimer && window.clearTimeout ) {
- window.clearTimeout( config.doneTimer );
- config.doneTimer = null;
- }
-
- if ( config.queue.length ) {
- config.doneTimer = window.setTimeout(function(){
- if ( !config.queue.length ) {
- done();
- } else {
- synchronize( done );
- }
- }, 13);
-
- return;
- }
-
- config.autorun = true;
-
- // Log the last module results
- if ( config.currentModule ) {
- QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
- }
-
- var banner = id("qunit-banner"),
- tests = id("qunit-tests"),
- html = ['Tests completed in ',
- +new Date - config.started, ' milliseconds.<br/>',
- '<span class="bad">', config.stats.all - config.stats.bad, '</span> tests of <span class="all">', config.stats.all, '</span> passed, ', config.stats.bad,' failed.'].join('');
-
- if ( banner ) {
- banner.className += " " + (config.stats.bad ? "fail" : "pass");
- }
-
- if ( tests ) {
- var result = id("qunit-testresult");
-
- if ( !result ) {
- result = document.createElement("p");
- result.id = "qunit-testresult";
- result.className = "result";
- tests.parentNode.insertBefore( result, tests.nextSibling );
- }
-
- result.innerHTML = html;
- }
-
- QUnit.done( config.stats.bad, config.stats.all );
-}
-
-function validTest( name ) {
- var i = config.filters.length,
- run = false;
-
- if ( !i ) {
- return true;
- }
-
- while ( i-- ) {
- var filter = config.filters[i],
- not = filter.charAt(0) == '!';
-
- if ( not ) {
- filter = filter.slice(1);
- }
-
- if ( name.indexOf(filter) !== -1 ) {
- return !not;
- }
-
- if ( not ) {
- run = true;
- }
- }
-
- return run;
-}
-
-function push(result, actual, expected, message) {
- message = message || (result ? "okay" : "failed");
- QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
-}
-
-function synchronize( callback ) {
- config.queue.push( callback );
-
- if ( config.autorun && !config.blocking ) {
- process();
- }
-}
-
-function process() {
- while ( config.queue.length && !config.blocking ) {
- config.queue.shift()();
- }
-}
-
-function saveGlobal() {
- config.pollution = [];
-
- if ( config.noglobals ) {
- for ( var key in window ) {
- config.pollution.push( key );
- }
- }
-}
-
-function checkPollution( name ) {
- var old = config.pollution;
- saveGlobal();
-
- var newGlobals = diff( old, config.pollution );
- if ( newGlobals.length > 0 ) {
- ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
- config.expected++;
- }
-
- var deletedGlobals = diff( config.pollution, old );
- if ( deletedGlobals.length > 0 ) {
- ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
- config.expected++;
- }
-}
-
-// returns a new Array with the elements that are in a but not in b
-function diff( a, b ) {
- var result = a.slice();
- for ( var i = 0; i < result.length; i++ ) {
- for ( var j = 0; j < b.length; j++ ) {
- if ( result[i] === b[j] ) {
- result.splice(i, 1);
- i--;
- break;
- }
- }
- }
- return result;
-}
-
-function fail(message, exception, callback) {
- if ( typeof console !== "undefined" && console.error && console.warn ) {
- console.error(message);
- console.error(exception);
- console.warn(callback.toString());
-
- } else if ( window.opera && opera.postError ) {
- opera.postError(message, exception, callback.toString);
- }
-}
-
-function extend(a, b) {
- for ( var prop in b ) {
- a[prop] = b[prop];
- }
-
- return a;
-}
-
-function addEvent(elem, type, fn) {
- if ( elem.addEventListener ) {
- elem.addEventListener( type, fn, false );
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, fn );
- } else {
- fn();
- }
-}
-
-function id(name) {
- return !!(typeof document !== "undefined" && document && document.getElementById) &&
- document.getElementById( name );
-}
-
-// Test for equality any JavaScript type.
-// Discussions and reference: http://philrathe.com/articles/equiv
-// Test suites: http://philrathe.com/tests/equiv
-// Author: Philippe Rathé <prathe@gmail.com>
-QUnit.equiv = function () {
-
- var innerEquiv; // the real equiv function
- var callers = []; // stack to decide between skip/abort functions
-
-
- // Determine what is o.
- function hoozit(o) {
- if (QUnit.is("String", o)) {
- return "string";
-
- } else if (QUnit.is("Boolean", o)) {
- return "boolean";
-
- } else if (QUnit.is("Number", o)) {
-
- if (isNaN(o)) {
- return "nan";
- } else {
- return "number";
- }
-
- } else if (typeof o === "undefined") {
- return "undefined";
-
- // consider: typeof null === object
- } else if (o === null) {
- return "null";
-
- // consider: typeof [] === object
- } else if (QUnit.is( "Array", o)) {
- return "array";
-
- // consider: typeof new Date() === object
- } else if (QUnit.is( "Date", o)) {
- return "date";
-
- // consider: /./ instanceof Object;
- // /./ instanceof RegExp;
- // typeof /./ === "function"; // => false in IE and Opera,
- // true in FF and Safari
- } else if (QUnit.is( "RegExp", o)) {
- return "regexp";
-
- } else if (typeof o === "object") {
- return "object";
-
- } else if (QUnit.is( "Function", o)) {
- return "function";
- } else {
- return undefined;
- }
- }
-
- // Call the o related callback with the given arguments.
- function bindCallbacks(o, callbacks, args) {
- var prop = hoozit(o);
- if (prop) {
- if (hoozit(callbacks[prop]) === "function") {
- return callbacks[prop].apply(callbacks, args);
- } else {
- return callbacks[prop]; // or undefined
- }
- }
- }
-
- var callbacks = function () {
-
- // for string, boolean, number and null
- function useStrictEquality(b, a) {
- if (b instanceof a.constructor || a instanceof b.constructor) {
- // to catch short annotaion VS 'new' annotation of a declaration
- // e.g. var i = 1;
- // var j = new Number(1);
- return a == b;
- } else {
- return a === b;
- }
- }
-
- return {
- "string": useStrictEquality,
- "boolean": useStrictEquality,
- "number": useStrictEquality,
- "null": useStrictEquality,
- "undefined": useStrictEquality,
-
- "nan": function (b) {
- return isNaN(b);
- },
-
- "date": function (b, a) {
- return hoozit(b) === "date" && a.valueOf() === b.valueOf();
- },
-
- "regexp": function (b, a) {
- return hoozit(b) === "regexp" &&
- a.source === b.source && // the regex itself
- a.global === b.global && // and its modifers (gmi) ...
- a.ignoreCase === b.ignoreCase &&
- a.multiline === b.multiline;
- },
-
- // - skip when the property is a method of an instance (OOP)
- // - abort otherwise,
- // initial === would have catch identical references anyway
- "function": function () {
- var caller = callers[callers.length - 1];
- return caller !== Object &&
- typeof caller !== "undefined";
- },
-
- "array": function (b, a) {
- var i;
- var len;
-
- // b could be an object literal here
- if ( ! (hoozit(b) === "array")) {
- return false;
- }
-
- len = a.length;
- if (len !== b.length) { // safe and faster
- return false;
- }
- for (i = 0; i < len; i++) {
- if ( ! innerEquiv(a[i], b[i])) {
- return false;
- }
- }
- return true;
- },
-
- "object": function (b, a) {
- var i;
- var eq = true; // unless we can proove it
- var aProperties = [], bProperties = []; // collection of strings
-
- // comparing constructors is more strict than using instanceof
- if ( a.constructor !== b.constructor) {
- return false;
- }
-
- // stack constructor before traversing properties
- callers.push(a.constructor);
-
- for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
-
- aProperties.push(i); // collect a's properties
-
- if ( ! innerEquiv(a[i], b[i])) {
- eq = false;
- }
- }
-
- callers.pop(); // unstack, we are done
-
- for (i in b) {
- bProperties.push(i); // collect b's properties
- }
-
- // Ensures identical properties name
- return eq && innerEquiv(aProperties.sort(), bProperties.sort());
- }
- };
- }();
-
- innerEquiv = function () { // can take multiple arguments
- var args = Array.prototype.slice.apply(arguments);
- if (args.length < 2) {
- return true; // end transition
- }
-
- return (function (a, b) {
- if (a === b) {
- return true; // catch the most you can
- } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) {
- return false; // don't lose time with error prone cases
- } else {
- return bindCallbacks(a, callbacks, [b, a]);
- }
-
- // apply transition with (1..n) arguments
- })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
- };
-
- return innerEquiv;
-
-}();
-
-/**
- * jsDump
- * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
- * Date: 5/15/2008
- * @projectDescription Advanced and extensible data dumping for Javascript.
- * @version 1.0.0
- * @author Ariel Flesler
- * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
- */
-QUnit.jsDump = (function() {
- function quote( str ) {
- return '"' + str.toString().replace(/"/g, '\\"') + '"';
- };
- function literal( o ) {
- return o + '';
- };
- function join( pre, arr, post ) {
- var s = jsDump.separator(),
- base = jsDump.indent(),
- inner = jsDump.indent(1);
- if ( arr.join )
- arr = arr.join( ',' + s + inner );
- if ( !arr )
- return pre + post;
- return [ pre, inner + arr, base + post ].join(s);
- };
- function array( arr ) {
- var i = arr.length, ret = Array(i);
- this.up();
- while ( i-- )
- ret[i] = this.parse( arr[i] );
- this.down();
- return join( '[', ret, ']' );
- };
-
- var reName = /^function (\w+)/;
-
- var jsDump = {
- parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
- var parser = this.parsers[ type || this.typeOf(obj) ];
- type = typeof parser;
-
- return type == 'function' ? parser.call( this, obj ) :
- type == 'string' ? parser :
- this.parsers.error;
- },
- typeOf:function( obj ) {
- var type;
- if ( obj === null ) {
- type = "null";
- } else if (typeof obj === "undefined") {
- type = "undefined";
- } else if (QUnit.is("RegExp", obj)) {
- type = "regexp";
- } else if (QUnit.is("Date", obj)) {
- type = "date";
- } else if (QUnit.is("Function", obj)) {
- type = "function";
- } else if (QUnit.is("Array", obj)) {
- type = "array";
- } else if (QUnit.is("Window", obj) || QUnit.is("global", obj)) {
- type = "window";
- } else if (QUnit.is("HTMLDocument", obj)) {
- type = "document";
- } else if (QUnit.is("HTMLCollection", obj) || QUnit.is("NodeList", obj)) {
- type = "nodelist";
- } else if (/^\[object HTML/.test(Object.prototype.toString.call( obj ))) {
- type = "node";
- } else {
- type = typeof obj;
- }
- return type;
- },
- separator:function() {
- return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
- },
- indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
- if ( !this.multiline )
- return '';
- var chr = this.indentChar;
- if ( this.HTML )
- chr = chr.replace(/\t/g,' ').replace(/ /g,'&nbsp;');
- return Array( this._depth_ + (extra||0) ).join(chr);
- },
- up:function( a ) {
- this._depth_ += a || 1;
- },
- down:function( a ) {
- this._depth_ -= a || 1;
- },
- setParser:function( name, parser ) {
- this.parsers[name] = parser;
- },
- // The next 3 are exposed so you can use them
- quote:quote,
- literal:literal,
- join:join,
- //
- _depth_: 1,
- // This is the list of parsers, to modify them, use jsDump.setParser
- parsers:{
- window: '[Window]',
- document: '[Document]',
- error:'[ERROR]', //when no parser is found, shouldn't happen
- unknown: '[Unknown]',
- 'null':'null',
- undefined:'undefined',
- 'function':function( fn ) {
- var ret = 'function',
- name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
- if ( name )
- ret += ' ' + name;
- ret += '(';
-
- ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
- return join( ret, this.parse(fn,'functionCode'), '}' );
- },
- array: array,
- nodelist: array,
- arguments: array,
- object:function( map ) {
- var ret = [ ];
- this.up();
- for ( var key in map )
- ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
- this.down();
- return join( '{', ret, '}' );
- },
- node:function( node ) {
- var open = this.HTML ? '&lt;' : '<',
- close = this.HTML ? '&gt;' : '>';
-
- var tag = node.nodeName.toLowerCase(),
- ret = open + tag;
-
- for ( var a in this.DOMAttrs ) {
- var val = node[this.DOMAttrs[a]];
- if ( val )
- ret += ' ' + a + '=' + this.parse( val, 'attribute' );
- }
- return ret + close + open + '/' + tag + close;
- },
- functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
- var l = fn.length;
- if ( !l ) return '';
-
- var args = Array(l);
- while ( l-- )
- args[l] = String.fromCharCode(97+l);//97 is 'a'
- return ' ' + args.join(', ') + ' ';
- },
- key:quote, //object calls it internally, the key part of an item in a map
- functionCode:'[code]', //function calls it internally, it's the content of the function
- attribute:quote, //node calls it internally, it's an html attribute value
- string:quote,
- date:quote,
- regexp:literal, //regex
- number:literal,
- 'boolean':literal
- },
- DOMAttrs:{//attributes to dump from nodes, name=>realName
- id:'id',
- name:'name',
- 'class':'className'
- },
- HTML:true,//if true, entities are escaped ( <, >, \t, space and \n )
- indentChar:' ',//indentation unit
- multiline:true //if true, items in a collection, are separated by a \n, else just a space.
- };
-
- return jsDump;
-})();
-
-})(this);
diff --git a/content/js/raphael-min.js b/content/js/raphael-min.js
deleted file mode 100755
index eac42bb..0000000
--- a/content/js/raphael-min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Raphael 1.0 RC1.4 - JavaScript Vector Library
- *
- * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
- */
-window.Raphael=(function(){var Y=/[, ]+/,g=document,L=window,P={was:"Raphael" in window,is:window.Raphael},f=function(){return l.apply(f,arguments);},b={},q={"clip-rect":"0 0 10e9 10e9",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},u={"clip-rect":"csv",cx:"number",cy:"number",fill:"colour","fill-opacity":"number","font-size":"number",height:"number",opacity:"number",path:"path",r:"number",rotation:"csv",rx:"number",ry:"number",scale:"csv",stroke:"colour","stroke-opacity":"number","stroke-width":"number",translation:"csv",width:"number",x:"number",y:"number"},v=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup"];f.version="1.0 RC1.4";f.type=(window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML");f.svg=!(f.vml=f.type=="VML");f.idGenerator=0;f.fn={};f.is=function(i,e){e=(e+"").toLowerCase();if(e=="undefined"&&typeof i=="undefined"){return true;}if(i==null&&e=="null"){return true;}return Object.prototype.toString.call(i).replace(/^\[object\s+|\]$/gi,"").toLowerCase()==e;};f.setWindow=function(e){L=e;g=L.document;};f.hsb2rgb=X(function(af,ad,aj){if(f.is(af,"object")&&"h" in af&&"s" in af&&"b" in af){aj=af.b;ad=af.s;af=af.h;}var aa,ab,ak;if(aj==0){return{r:0,g:0,b:0,hex:"#000"};}if(af>1||ad>1||aj>1){af/=255;ad/=255;aj/=255;}var ac=Math.floor(af*6),ag=(af*6)-ac,Z=aj*(1-ad),R=aj*(1-(ad*ag)),al=aj*(1-(ad*(1-ag)));aa=[aj,R,Z,Z,al,aj,aj][ac];ab=[al,aj,aj,R,Z,Z,al][ac];ak=[Z,Z,al,aj,aj,R,Z][ac];aa*=255;ab*=255;ak*=255;var ah={r:aa,g:ab,b:ak},e=Math.round(aa).toString(16),ae=Math.round(ab).toString(16),ai=Math.round(ak).toString(16);if(e.length==1){e="0"+e;}if(ae.length==1){ae="0"+ae;}if(ai.length==1){ai="0"+ai;}ah.hex="#"+e+ae+ai;return ah;},f);f.rgb2hsb=X(function(e,i,ad){if(f.is(e,"object")&&"r" in e&&"g" in e&&"b" in e){ad=e.b;i=e.g;e=e.r;}if(f.is(e,"string")){var af=f.getRGB(e);e=af.r;i=af.g;ad=af.b;}if(e>1||i>1||ad>1){e/=255;i/=255;ad/=255;}var ac=Math.max(e,i,ad),R=Math.min(e,i,ad),aa,Z,ab=ac;if(R==ac){return{h:0,s:0,b:ac};}else{var ae=(ac-R);Z=ae/ac;if(e==ac){aa=(i-ad)/ae;}else{if(i==ac){aa=2+((ad-e)/ae);}else{aa=4+((e-i)/ae);}}aa/=6;if(aa<0){aa+=1;}if(aa>1){aa-=1;}}return{h:aa,s:Z,b:ab};},f);f._path2string=function(){var Z="",ac;for(var R=0,aa=this.length;R<aa;R++){for(var e=0,ab=this[R].length;e<ab;e++){Z+=this[R][e];e&&e!=ab-1&&(Z+=",");}R!=aa-1&&(Z+="\n");}return Z.replace(/,(?=-)/g,"");};function X(Z,i,e){function R(){var aa=Array.prototype.splice.call(arguments,0,arguments.length),ab=aa.join("\u25ba");R.cache=R.cache||{};R.count=R.count||[];if(ab in R.cache){return e?e(R.cache[ab]):R.cache[ab];}if(R.count.length>1000){delete R.cache[R.count.unshift()];}R.count.push(ab);R.cache[ab]=Z.apply(i,aa);return e?e(R.cache[ab]):R.cache[ab];}return R;}f.getRGB=X(function(e){var af={aliceblue:"#f0f8ff",amethyst:"#96c",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},ab;if((e+"").toLowerCase() in af){e=af[e.toString().toLowerCase()];}if(!e){return{r:0,g:0,b:0,hex:"#000"};}if(e=="none"){return{r:-1,g:-1,b:-1,hex:"none"};}var R,Z,ae,ac=(e+"").match(/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i);if(ac){if(ac[2]){ae=parseInt(ac[2].substring(5),16);Z=parseInt(ac[2].substring(3,5),16);R=parseInt(ac[2].substring(1,3),16);}if(ac[3]){ae=parseInt(ac[3].substring(3)+ac[3].substring(3),16);Z=parseInt(ac[3].substring(2,3)+ac[3].substring(2,3),16);R=parseInt(ac[3].substring(1,2)+ac[3].substring(1,2),16);}if(ac[4]){ac=ac[4].split(/\s*,\s*/);R=parseFloat(ac[0]);Z=parseFloat(ac[1]);ae=parseFloat(ac[2]);}if(ac[5]){ac=ac[5].split(/\s*,\s*/);R=parseFloat(ac[0])*2.55;Z=parseFloat(ac[1])*2.55;ae=parseFloat(ac[2])*2.55;}if(ac[6]){ac=ac[6].split(/\s*,\s*/);R=parseFloat(ac[0]);Z=parseFloat(ac[1]);ae=parseFloat(ac[2]);return f.hsb2rgb(R,Z,ae);}if(ac[7]){ac=ac[7].split(/\s*,\s*/);R=parseFloat(ac[0])*2.55;Z=parseFloat(ac[1])*2.55;ae=parseFloat(ac[2])*2.55;return f.hsb2rgb(R,Z,ae);}ac={r:R,g:Z,b:ae};var i=Math.round(R).toString(16),aa=Math.round(Z).toString(16),ad=Math.round(ae).toString(16);(i.length==1)&&(i="0"+i);(aa.length==1)&&(aa="0"+aa);(ad.length==1)&&(ad="0"+ad);ac.hex="#"+i+aa+ad;ab=ac;}else{ab={r:-1,g:-1,b:-1,hex:"none"};}return ab;},f);f.getColor=function(i){var R=this.getColor.start=this.getColor.start||{h:0,s:1,b:i||0.75},e=this.hsb2rgb(R.h,R.s,R.b);R.h+=0.075;if(R.h>1){R.h=0;R.s-=0.2;if(R.s<=0){this.getColor.start={h:0,s:1,b:R.b};}}return e.hex;};f.getColor.reset=function(){delete this.start;};f.parsePathString=X(function(e){if(!e){return null;}var R={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];if(f.is(e,"array")&&f.is(e[0],"array")){i=t(e);}if(!i.length){(e+"").replace(/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(aa,Z,ad){var ac=[],ab=Z.toLowerCase();ad.replace(/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(af,ae){ae&&ac.push(+ae);});while(ac.length>=R[ab]){i.push([Z].concat(ac.splice(0,R[ab])));if(!R[ab]){break;}}});}i.toString=f._path2string;return i;});var C=X(function(ag){if(!ag){return{x:0,y:0,width:0,height:0};}ag=O(ag);var ad=0,ac=0,Z=[],R=[];for(var aa=0,af=ag.length;aa<af;aa++){if(ag[aa][0]=="M"){ad=ag[aa][1];ac=ag[aa][2];Z.push(ad);R.push(ac);}else{var ab=J(ad,ac,ag[aa][1],ag[aa][2],ag[aa][3],ag[aa][4],ag[aa][5],ag[aa][6]);Z=Z.concat(ab.min.x,ab.max.x);R=R.concat(ab.min.y,ab.max.y);}}var e=Math.min.apply(0,Z),ae=Math.min.apply(0,R);return{x:e,y:ae,width:Math.max.apply(0,Z)-e,height:Math.max.apply(0,R)-ae};}),t=function(ac){var Z=[];if(!f.is(ac,"array")||!f.is(ac&&ac[0],"array")){ac=f.parsePathString(ac);}for(var R=0,aa=ac.length;R<aa;R++){Z[R]=[];for(var e=0,ab=ac[R].length;e<ab;e++){Z[R][e]=ac[R][e];}}Z.toString=f._path2string;return Z;},c=X(function(aa){if(!f.is(aa,"array")||!f.is(aa&&aa[0],"array")){aa=f.parsePathString(aa);}var ag=[],ai=0,ah=0,al=0,ak=0,Z=0;if(aa[0][0]=="M"){ai=aa[0][1];ah=aa[0][2];al=ai;ak=ah;Z++;ag.push(["M",ai,ah]);}for(var ad=Z,am=aa.length;ad<am;ad++){var e=ag[ad]=[],aj=aa[ad];if(aj[0]!=aj[0].toLowerCase()){e[0]=aj[0].toLowerCase();switch(e[0]){case"a":e[1]=aj[1];e[2]=aj[2];e[3]=aj[3];e[4]=aj[4];e[5]=aj[5];e[6]=+(aj[6]-ai).toFixed(3);e[7]=+(aj[7]-ah).toFixed(3);break;case"v":e[1]=+(aj[1]-ah).toFixed(3);break;case"m":al=aj[1];ak=aj[2];default:for(var ac=1,ae=aj.length;ac<ae;ac++){e[ac]=+(aj[ac]-((ac%2)?ai:ah)).toFixed(3);}}}else{e=ag[ad]=[];if(aj[0]=="m"){al=aj[1]+ai;ak=aj[2]+ah;}for(var ab=0,R=aj.length;ab<R;ab++){ag[ad][ab]=aj[ab];}}var af=ag[ad].length;switch(ag[ad][0]){case"z":ai=al;ah=ak;break;case"h":ai+=+ag[ad][af-1];break;case"v":ah+=+ag[ad][af-1];break;default:ai+=+ag[ad][af-2];ah+=+ag[ad][af-1];}}ag.toString=f._path2string;return ag;},0,t),w=X(function(aa){if(!f.is(aa,"array")||!f.is(aa&&aa[0],"array")){aa=f.parsePathString(aa);}var af=[],ah=0,ag=0,ak=0,aj=0,Z=0;if(aa[0][0]=="M"){ah=+aa[0][1];ag=+aa[0][2];ak=ah;aj=ag;Z++;af[0]=["M",ah,ag];}for(var ad=Z,al=aa.length;ad<al;ad++){var e=af[ad]=[],ai=aa[ad];if(ai[0]!=(ai[0]+"").toUpperCase()){e[0]=(ai[0]+"").toUpperCase();switch(e[0]){case"A":e[1]=ai[1];e[2]=ai[2];e[3]=ai[3];e[4]=ai[4];e[5]=ai[5];e[6]=+(ai[6]+ah);e[7]=+(ai[7]+ag);break;case"V":e[1]=+ai[1]+ag;break;case"H":e[1]=+ai[1]+ah;break;case"M":ak=+ai[1]+ah;aj=+ai[2]+ag;default:for(var ac=1,ae=ai.length;ac<ae;ac++){e[ac]=+ai[ac]+((ac%2)?ah:ag);}}}else{for(var ab=0,R=ai.length;ab<R;ab++){af[ad][ab]=ai[ab];}}switch(e[0]){case"Z":ah=ak;ag=aj;break;case"H":ah=e[1];break;case"V":ag=e[1];break;default:ah=af[ad][af[ad].length-2];ag=af[ad][af[ad].length-1];}}af.toString=f._path2string;return af;},null,t),d=function(i,Z,e,R){return[i,Z,e,R,e,R];},x=function(i,Z,ab,aa,e,R){return[2/3*i+1/3*ab,2/3*Z+1/3*aa,2/3*i+1/3*e,2/3*Z+1/3*R,e,R];},r=function(ak,aP,au,ar,al,af,aa,aj,aO,am){var aq=Math.PI*120/180,e=Math.PI/180*(+al||0),ay=[],av,aL=X(function(aQ,aT,i){var aS=aQ*Math.cos(i)-aT*Math.sin(i),aR=aQ*Math.sin(i)+aT*Math.cos(i);return{x:aS,y:aR};});if(!am){av=aL(ak,aP,-e);ak=av.x;aP=av.y;av=aL(aj,aO,-e);aj=av.x;aO=av.y;var R=Math.cos(Math.PI/180*al),ah=Math.sin(Math.PI/180*al),aA=(ak-aj)/2,az=(aP-aO)/2;au=Math.max(au,Math.abs(aA));ar=Math.max(ar,Math.abs(az));var Z=au*au,aD=ar*ar,aF=(af==aa?-1:1)*Math.sqrt(Math.abs((Z*aD-Z*az*az-aD*aA*aA)/(Z*az*az+aD*aA*aA))),ao=aF*au*az/ar+(ak+aj)/2,an=aF*-ar*aA/au+(aP+aO)/2,ae=Math.asin((aP-an)/ar),ad=Math.asin((aO-an)/ar);ae=ak<ao?Math.PI-ae:ae;ad=aj<ao?Math.PI-ad:ad;ae<0&&(ae=Math.PI*2+ae);ad<0&&(ad=Math.PI*2+ad);if(aa&&ae>ad){ae=ae-Math.PI*2;}if(!aa&&ad>ae){ad=ad-Math.PI*2;}}else{ae=am[0];ad=am[1];ao=am[2];an=am[3];}var ai=ad-ae;if(Math.abs(ai)>aq){var ap=ad,at=aj,ag=aO;ad=ae+aq*(aa&&ad>ae?1:-1);aj=ao+au*Math.cos(ad);aO=an+ar*Math.sin(ad);ay=r(aj,aO,au,ar,al,0,aa,at,ag,[ad,ap,ao,an]);}ai=ad-ae;var ac=Math.cos(ae),aN=Math.sin(ae),ab=Math.cos(ad),aM=Math.sin(ad),aB=Math.tan(ai/4),aE=4/3*au*aB,aC=4/3*ar*aB,aK=[ak,aP],aJ=[ak+aE*aN,aP-aC*ac],aI=[aj+aE*aM,aO-aC*ab],aG=[aj,aO];aJ[0]=2*aK[0]-aJ[0];aJ[1]=2*aK[1]-aJ[1];if(am){return[aJ,aI,aG].concat(ay);}else{ay=[aJ,aI,aG].concat(ay).join(",").split(",");var aw=[];for(var aH=0,ax=ay.length;aH<ax;aH++){aw[aH]=aH%2?aL(ay[aH-1],ay[aH],e).y:aL(ay[aH],ay[aH+1],e).x;}return aw;}},A=X(function(i,e,ao,am,ab,aa,ad,ac,ai){var ag=Math.pow(1-ai,3)*i+Math.pow(1-ai,2)*3*ai*ao+(1-ai)*3*ai*ai*ab+Math.pow(ai,3)*ad,ae=Math.pow(1-ai,3)*e+Math.pow(1-ai,2)*3*ai*am+(1-ai)*3*ai*ai*aa+Math.pow(ai,3)*ac,ak=i+2*ai*(ao-i)+ai*ai*(ab-2*ao+i),aj=e+2*ai*(am-e)+ai*ai*(aa-2*am+e),an=ao+2*ai*(ab-ao)+ai*ai*(ad-2*ab+ao),al=am+2*ai*(aa-am)+ai*ai*(ac-2*aa+am),ah=(1-ai)*i+ai*ao,af=(1-ai)*e+ai*am,Z=(1-ai)*ab+ai*ad,R=(1-ai)*aa+ai*ac;return{x:ag,y:ae,m:{x:ak,y:aj},n:{x:an,y:al},start:{x:ah,y:af},end:{x:Z,y:R}};}),J=X(function(i,e,Z,R,am,al,ai,af){var ak=(am-2*Z+i)-(ai-2*am+Z),ah=2*(Z-i)-2*(am-Z),ae=i-Z,ac=(-ah+Math.sqrt(ah*ah-4*ak*ae))/2/ak,aa=(-ah-Math.sqrt(ah*ah-4*ak*ae))/2/ak,ag=[e,af],aj=[i,ai],ad=A(i,e,Z,R,am,al,ai,af,ac>0&&ac<1?ac:0),ab=A(i,e,Z,R,am,al,ai,af,aa>0&&aa<1?aa:0);aj=aj.concat(ad.x,ab.x);ag=ag.concat(ad.y,ab.y);ak=(al-2*R+e)-(af-2*al+R);ah=2*(R-e)-2*(al-R);ae=e-R;ac=(-ah+Math.sqrt(ah*ah-4*ak*ae))/2/ak;aa=(-ah-Math.sqrt(ah*ah-4*ak*ae))/2/ak;ad=A(i,e,Z,R,am,al,ai,af,ac>0&&ac<1?ac:0);ab=A(i,e,Z,R,am,al,ai,af,aa>0&&aa<1?aa:0);aj=aj.concat(ad.x,ab.x);ag=ag.concat(ad.y,ab.y);return{min:{x:Math.min.apply(Math,aj),y:Math.min.apply(Math,ag)},max:{x:Math.max.apply(Math,aj),y:Math.max.apply(Math,ag)}};}),O=X(function(al,ag){var aa=w(al),ah=ag&&w(ag),ai={x:0,y:0,bx:0,by:0,X:0,Y:0},e={x:0,y:0,bx:0,by:0,X:0,Y:0},ac=function(am,an){var i,ao;if(!am){return["C",an.x,an.y,an.x,an.y,an.x,an.y];}switch(am[0]){case"M":an.X=am[1];an.Y=am[2];break;case"A":am=["C"].concat(r.apply(0,[an.x,an.y].concat(am.slice(1))));break;case"S":i=an.x+(an.x-(an.bx||an.x));ao=an.y+(an.y-(an.by||an.y));am=["C",i,ao].concat(am.slice(1));break;case"T":i=an.x+(an.x-(an.bx||an.x));ao=an.y+(an.y-(an.by||an.y));am=["C"].concat(x(an.x,an.y,i,ao,am[1],am[2]));break;case"Q":am=["C"].concat(x(an.x,an.y,am[1],am[2],am[3],am[4]));break;case"L":am=["C"].concat(d(an.x,an.y,am[1],am[2]));break;case"H":am=["C"].concat(d(an.x,an.y,am[1],an.y));break;case"V":am=["C"].concat(d(an.x,an.y,an.x,am[1]));break;case"Z":am=["C"].concat(d(an.x,an.y,an.X,an.Y));break;}return am;},R=function(am,an){if(am[an].length>7){am[an].shift();var ao=am[an];while(ao.length){am.splice(an++,0,["C"].concat(ao.splice(0,6)));}am.splice(an,1);aj=Math.max(aa.length,ah&&ah.length||0);}},Z=function(aq,ap,an,am,ao){if(aq&&ap&&aq[ao][0]=="M"&&ap[ao][0]!="M"){ap.splice(ao,0,["M",am.x,am.y]);an.bx=0;an.by=0;an.x=aq[ao][1];an.y=aq[ao][2];aj=Math.max(aa.length,ah&&ah.length||0);}};for(var ae=0,aj=Math.max(aa.length,ah&&ah.length||0);ae<aj;ae++){aa[ae]=ac(aa[ae],ai);R(aa,ae);ah&&(ah[ae]=ac(ah[ae],e));ah&&R(ah,ae);Z(aa,ah,ai,e,ae);Z(ah,aa,e,ai,ae);var ad=aa[ae],ak=ah&&ah[ae],ab=ad.length,af=ah&&ak.length;ai.bx=ad[ab-4]||0;ai.by=ad[ab-3]||0;ai.x=ad[ab-2];ai.y=ad[ab-1];e.bx=ah&&(ak[af-4]||0);e.by=ah&&(ak[af-3]||0);e.x=ah&&ak[af-2];e.y=ah&&ak[af-1];}return ah?[aa,ah]:aa;},null,t),n=X(function(ah){if(f.is(ah,"string")){ah=ah.split(/\s*\-\s*/);var Z=ah.shift();if(Z.toLowerCase()=="v"){Z=90;}else{if(Z.toLowerCase()=="h"){Z=0;}else{Z=parseFloat(Z);}}Z=-Z;var af={angle:Z,type:"linear",dots:[],vector:[0,0,Math.cos(Z*Math.PI/180).toFixed(3),Math.sin(Z*Math.PI/180).toFixed(3)]},ag=1/(Math.max(Math.abs(af.vector[2]),Math.abs(af.vector[3]))||1);af.vector[2]*=ag;af.vector[3]*=ag;if(af.vector[2]<0){af.vector[0]=-af.vector[2];af.vector[2]=0;}if(af.vector[3]<0){af.vector[1]=-af.vector[3];af.vector[3]=0;}af.vector[0]=af.vector[0];af.vector[1]=af.vector[1];af.vector[2]=af.vector[2];af.vector[3]=af.vector[3];for(var ac=0,ai=ah.length;ac<ai;ac++){var e={},ae=ah[ac].match(/^([^:]*):?([\d\.]*)/);e.color=f.getRGB(ae[1]).hex;ae[2]&&(e.offset=ae[2]+"%");af.dots.push(e);}for(var ac=1,ai=af.dots.length-1;ac<ai;ac++){if(!af.dots[ac].offset){var R=parseFloat(af.dots[ac-1].offset||0),aa=false;for(var ab=ac+1;ab<ai;ab++){if(af.dots[ab].offset){aa=af.dots[ab].offset;break;}}if(!aa){aa=100;ab=ai;}aa=parseFloat(aa);var ad=(aa-R)/(ab-ac+1);for(;ac<ab;ac++){R+=ad;af.dots[ac].offset=R+"%";}}}return af;}else{return ah;}}),G=function(){var R,i,aa,Z,e;if(f.is(arguments[0],"string")||f.is(arguments[0],"object")){if(f.is(arguments[0],"string")){R=g.getElementById(arguments[0]);}else{R=arguments[0];}if(R.tagName){if(arguments[1]==null){return{container:R,width:R.style.pixelWidth||R.offsetWidth,height:R.style.pixelHeight||R.offsetHeight};}else{return{container:R,width:arguments[1],height:arguments[2]};}}}else{if(f.is(arguments[0],"number")&&arguments.length>3){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]};}}},a=function(e,R){var i=this;for(var Z in R){if(R.hasOwnProperty(Z)&&!(Z in e)){switch(typeof R[Z]){case"function":(function(aa){e[Z]=e===i?aa:function(){return aa.apply(i,arguments);};})(R[Z]);break;case"object":e[Z]=e[Z]||{};a.call(this,e[Z],R[Z]);break;default:e[Z]=R[Z];break;}}}};if(f.svg){b.svgns="http://www.w3.org/2000/svg";b.xlink="http://www.w3.org/1999/xlink";var N=function(e){return +e+(Math.floor(e)==e)*0.5;};var z=function(ab){for(var R=0,Z=ab.length;R<Z;R++){if(ab[R][0].toLowerCase()!="a"){for(var e=1,aa=ab[R].length;e<aa;e++){ab[R][e]=N(ab[R][e]);}}else{ab[R][6]=N(ab[R][6]);ab[R][7]=N(ab[R][7]);}}return ab;};var B=function(R,e){if(e){for(var i in e){if(e.hasOwnProperty(i)){R.setAttribute(i,e[i]);}}}else{return g.createElementNS(b.svgns,R);}};f.toString=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version;};var W=function(e,Z){var i=B("path");Z.canvas&&Z.canvas.appendChild(i);var R=new m(i,Z);R.type="path";F(R,{fill:"none",stroke:"#000",path:e});return R;};var M=function(ad,ab,ae){ab=n(ab);var aa=B((ab.type||"linear")+"Gradient");aa.id="r"+(f.idGenerator++).toString(36);if(ab.vector&&ab.vector.length){B(aa,{x1:ab.vector[0],y1:ab.vector[1],x2:ab.vector[2],y2:ab.vector[3]});}ae.defs.appendChild(aa);var ac=true;for(var R=0,Z=ab.dots.length;R<Z;R++){var e=B("stop");if(ab.dots[R].offset){ac=false;}B(e,{offset:ab.dots[R].offset?ab.dots[R].offset:(R==0)?"0%":"100%","stop-color":f.getRGB(ab.dots[R].color).hex||"#fff"});aa.appendChild(e);}if(ac&&ab.dots[Z-1].opacity!=null){B(e,{"stop-opacity":ab.dots[Z-1].opacity});}B(ad,{fill:"url(#"+aa.id+")",opacity:1,"fill-opacity":1});ad.style.fill="";ad.style.opacity=1;ad.style.fillOpacity=1;};var s=function(i){var e=i.getBBox();B(i.pattern,{patternTransform:f.format("translate({0},{1})",e.x,e.y)});};var F=function(ah,aq){var ak={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},am=ah.node,ai=ah.attrs,ae=ah.attr("rotation"),ab=function(ay,ax){ax=ak[(ax+"").toLowerCase()];if(ax){var av=ay.attrs["stroke-width"]||"1",at={round:av,square:av,butt:0}[ay.attrs["stroke-linecap"]||aq["stroke-linecap"]]||0,aw=[];var au=ax.length;while(au--){aw[au]=ax[au]*av+((au%2)?1:-1)*at;}B(am,{"stroke-dasharray":aw.join(",")});}};parseFloat(ae)&&ah.rotate(0,true);for(var al in aq){if(aq.hasOwnProperty(al)){if(!(al in q)){continue;}var aj=aq[al];ai[al]=aj;switch(al){case"href":case"title":case"target":var ao=am.parentNode;if(ao.tagName.toLowerCase()!="a"){var Z=B("a");ao.insertBefore(Z,am);Z.appendChild(am);ao=Z;}ao.setAttributeNS(ah.paper.xlink,al,aj);break;case"clip-rect":var i=(aj+"").split(Y);if(i.length==4){ah.clip&&ah.clip.parentNode.parentNode.removeChild(ah.clip.parentNode);var R=B("clipPath"),an=B("rect");R.id="r"+(f.idGenerator++).toString(36);B(an,{x:i[0],y:i[1],width:i[2],height:i[3]});R.appendChild(an);ah.paper.defs.appendChild(R);B(am,{"clip-path":"url(#"+R.id+")"});ah.clip=an;}if(!aj){var ap=g.getElementById(am.getAttribute("clip-path").replace(/(^url\(#|\)$)/g,""));ap&&ap.parentNode.removeChild(ap);B(am,{"clip-path":""});delete ah.clip;}break;case"path":if(aj&&ah.type=="path"){ai.path=z(w(aj));B(am,{d:ai.path});}case"width":am.setAttribute(al,aj);if(ai.fx){al="x";aj=ai.x;}else{break;}case"x":if(ai.fx){aj=-ai.x-(ai.width||0);}case"rx":if(al=="rx"&&ah.type=="rect"){break;}case"cx":am.setAttribute(al,aj);ah.pattern&&s(ah);break;case"height":am.setAttribute(al,aj);if(ai.fy){al="y";aj=ai.y;}else{break;}case"y":if(ai.fy){aj=-ai.y-(ai.height||0);}case"ry":if(al=="ry"&&ah.type=="rect"){break;}case"cy":am.setAttribute(al,aj);ah.pattern&&s(ah);break;case"r":if(ah.type=="rect"){B(am,{rx:aj,ry:aj});}else{am.setAttribute(al,aj);}break;case"src":if(ah.type=="image"){am.setAttributeNS(ah.paper.xlink,"href",aj);}break;case"stroke-width":am.style.strokeWidth=aj;am.setAttribute(al,aj);if(ai["stroke-dasharray"]){ab(ah,ai["stroke-dasharray"]);}break;case"stroke-dasharray":ab(ah,aj);break;case"rotation":ae=aj;ah.rotate(aj,true);break;case"translation":var ac=(aj+"").split(Y);ah.translate((+ac[0]+1||2)-1,(+ac[1]+1||2)-1);break;case"scale":var ac=(aj+"").split(Y);ah.scale(+ac[0]||1,+ac[1]||+ac[0]||1,+ac[2]||null,+ac[3]||null);break;case"fill":var aa=(aj+"").match(/^url\(['"]?([^\)]+)['"]?\)$/i);if(aa){var R=B("pattern"),ag=B("image");R.id="r"+(f.idGenerator++).toString(36);B(R,{x:0,y:0,patternUnits:"userSpaceOnUse"});B(ag,{x:0,y:0});ag.setAttributeNS(ah.paper.xlink,"href",aa[1]);R.appendChild(ag);var ar=g.createElement("img");ar.style.position="absolute";ar.style.top="-9999em";ar.style.left="-9999em";ar.onload=function(){B(R,{width:this.offsetWidth,height:this.offsetHeight});B(ag,{width:this.offsetWidth,height:this.offsetHeight});g.body.removeChild(this);b.safari();};g.body.appendChild(ar);ar.src=aa[1];ah.paper.defs.appendChild(R);am.style.fill="url(#"+R.id+")";B(am,{fill:"url(#"+R.id+")"});ah.pattern=R;ah.pattern&&s(ah);break;}delete aq.gradient;delete ai.gradient;if(!f.is(ai.opacity,"undefined")&&f.is(aq.opacity,"undefined")){am.style.opacity=ai.opacity;B(am,{opacity:ai.opacity});}if(!f.is(ai["fill-opacity"],"undefined")&&f.is(aq["fill-opacity"],"undefined")){am.style.fillOpacity=ai["fill-opacity"];B(am,{"fill-opacity":ai["fill-opacity"]});}case"stroke":am.style[al]=f.getRGB(aj).hex;am.setAttribute(al,f.getRGB(aj).hex);break;case"gradient":M(am,aj,ah.paper);break;case"opacity":case"fill-opacity":if(ai.gradient){var e=g.getElementById(am.getAttribute("fill").replace(/^url\(#|\)$/g,""));if(e){var ad=e.getElementsByTagName("stop");ad[ad.length-1].setAttribute("stop-opacity",aj);}break;}default:al=="font-size"&&(aj=parseInt(aj,10)+"px");var af=al.replace(/(\-.)/g,function(at){return at.substring(1).toUpperCase();});am.style[af]=aj;am.setAttribute(al,aj);break;}}}T(ah,aq);parseInt(ae,10)&&ah.rotate(ae,true);};var K=1.2;var T=function(e,aa){if(e.type!="text"||!("text" in aa||"font" in aa||"font-size" in aa||"x" in aa||"y" in aa)){return;}var af=e.attrs,R=e.node,ah=R.firstChild?parseInt(g.defaultView.getComputedStyle(R.firstChild,"").getPropertyValue("font-size"),10):10;if("text" in aa){while(R.firstChild){R.removeChild(R.firstChild);}var Z=(aa.text+"").split("\n");for(var ab=0,ag=Z.length;ab<ag;ab++){var ad=B("tspan");ab&&B(ad,{dy:ah*K,x:af.x});ad.appendChild(g.createTextNode(Z[ab]));R.appendChild(ad);}}else{var Z=R.getElementsByTagName("tspan");for(var ab=0,ag=Z.length;ab<ag;ab++){ab&&B(Z[ab],{dy:ah*K,x:af.x});}}B(R,{y:af.y});var ac=e.getBBox(),ae=af.y-(ac.y+ac.height/2);ae&&B(R,{y:af.y+ae});};var m=function(i,e){var Z=0,R=0;this[0]=i;this.node=i;this.paper=e;this.attrs=this.attrs||{};this.transformations=[];this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};};m.prototype.rotate=function(i,e,Z){if(i==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy].join(" ");}return this._.rt.deg;}var R=this.getBBox();i=(i+"").split(Y);if(i.length-1){e=parseFloat(i[1]);Z=parseFloat(i[2]);}i=parseFloat(i[0]);if(e!=null){this._.rt.deg=i;}else{this._.rt.deg+=i;}(Z==null)&&(e=null);this._.rt.cx=e;this._.rt.cy=Z;e=e==null?R.x+R.width/2:e;Z=Z==null?R.y+R.height/2:Z;if(this._.rt.deg){this.transformations[0]=f.format("rotate({0} {1} {2})",this._.rt.deg,e,Z);this.clip&&B(this.clip,{transform:f.format("rotate({0} {1} {2})",-this._.rt.deg,e,Z)});}else{this.transformations[0]="";this.clip&&B(this.clip,{transform:""});}B(this.node,{transform:this.transformations.join(" ")});return this;};m.prototype.hide=function(){this.node.style.display="none";return this;};m.prototype.show=function(){this.node.style.display="block";return this;};m.prototype.remove=function(){this.node.parentNode.removeChild(this.node);};m.prototype.getBBox=function(){if(this.type=="path"){return C(this.attrs.path);}if(this.node.style.display=="none"){this.show();var Z=true;}var ad={};try{ad=this.node.getBBox();}catch(ab){}finally{ad=ad||{};}if(this.type=="text"){ad={x:ad.x,y:Infinity,width:ad.width,height:0};for(var R=0,aa=this.node.getNumberOfChars();R<aa;R++){var ac=this.node.getExtentOfChar(R);(ac.y<ad.y)&&(ad.y=ac.y);(ac.y+ac.height-ad.y>ad.height)&&(ad.height=ac.y+ac.height-ad.y);}}Z&&this.hide();return ad;};m.prototype.attr=function(){if(arguments.length==1&&f.is(arguments[0],"string")){if(arguments[0]=="translation"){return this.translate();}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}return this.attrs[arguments[0]];}if(arguments.length==1&&f.is(arguments[0],"array")){var e={};for(var i in arguments[0]){if(arguments[0].hasOwnProperty(i)){e[arguments[0][i]]=this.attrs[arguments[0][i]];}}return e;}if(arguments.length==2){var R={};R[arguments[0]]=arguments[1];F(this,R);}else{if(arguments.length==1&&f.is(arguments[0],"object")){F(this,arguments[0]);}}return this;};m.prototype.toFront=function(){this.node.parentNode.appendChild(this.node);return this;};m.prototype.toBack=function(){if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);}return this;};m.prototype.insertAfter=function(e){if(e.node.nextSibling){e.node.parentNode.insertBefore(this.node,e.node.nextSibling);}else{e.node.parentNode.appendChild(this.node);}return this;};m.prototype.insertBefore=function(e){var i=e.node;i.parentNode.insertBefore(this.node,i);return this;};m.prototype.blur=function(e){if(e!="none"){var i=B("filter"),R=B("feGaussianBlur");i.id="r"+(f.idGenerator++).toString(36);B(R,{stdDeviation:+e||1.5});i.appendChild(R);this.paper.defs.appendChild(i);this._blur=i;B(this.node,{filter:"url(#"+i.id+")"});}else{if(this._blur){this._blur.parentNode.removeChild(this._blur);delete this._blur;}this.node.removeAttribute("filter");}};var D=function(i,e,ab,aa){e=N(e);ab=N(ab);var Z=B("circle");i.canvas&&i.canvas.appendChild(Z);var R=new m(Z,i);R.attrs={cx:e,cy:ab,r:aa,fill:"none",stroke:"#000"};R.type="circle";B(Z,R.attrs);return R;};var I=function(R,e,ad,i,ab,ac){e=N(e);ad=N(ad);var aa=B("rect");R.canvas&&R.canvas.appendChild(aa);var Z=new m(aa,R);Z.attrs={x:e,y:ad,width:i,height:ab,r:ac||0,rx:ac||0,ry:ac||0,fill:"none",stroke:"#000"};Z.type="rect";B(aa,Z.attrs);return Z;};var h=function(i,e,ac,ab,aa){e=N(e);ac=N(ac);var Z=B("ellipse");i.canvas&&i.canvas.appendChild(Z);var R=new m(Z,i);R.attrs={cx:e,cy:ac,rx:ab,ry:aa,fill:"none",stroke:"#000"};R.type="ellipse";B(Z,R.attrs);return R;};var p=function(R,ac,e,ad,i,ab){var aa=B("image");B(aa,{x:e,y:ad,width:i,height:ab,preserveAspectRatio:"none"});aa.setAttributeNS(R.xlink,"href",ac);R.canvas&&R.canvas.appendChild(aa);var Z=new m(aa,R);Z.attrs={x:e,y:ad,width:i,height:ab,src:ac};Z.type="image";return Z;};var H=function(i,e,ab,aa){var Z=B("text");B(Z,{x:e,y:ab,"text-anchor":"middle"});i.canvas&&i.canvas.appendChild(Z);var R=new m(Z,i);R.attrs={x:e,y:ab,"text-anchor":"middle",text:aa,font:q.font,stroke:"none",fill:"#000"};R.type="text";F(R,R.attrs);return R;};var E=function(i,e){this.width=i||this.width;this.height=e||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);return this;};var l=function(){var aa=G.apply(null,arguments),R=aa.container,ac=aa.x,ab=aa.y,Z=aa.width,ad=aa.height;if(!R){throw new Error("SVG container not found.");}b.canvas=B("svg");var e=b.canvas,ae=e.style;e.setAttribute("width",Z||512);b.width=Z||512;e.setAttribute("height",ad||342);b.height=ad||342;if(R==1){g.body.appendChild(e);ae.position="absolute";ae.left=ac+"px";ae.top=ab+"px";}else{if(R.firstChild){R.insertBefore(e,R.firstChild);}else{R.appendChild(e);}}R={canvas:e,clear:function(){while(this.canvas.firstChild){this.canvas.removeChild(this.canvas.firstChild);}this.desc=B("desc");this.defs=B("defs");this.desc.appendChild(g.createTextNode("Created with Rapha\u00ebl"));this.canvas.appendChild(this.desc);this.canvas.appendChild(this.defs);}};for(var i in b){if(b.hasOwnProperty(i)){if(i!="create"){R[i]=b[i];}}}a.call(R,R,f.fn);R.clear();R.raphael=f;return R;};b.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);};if({"Apple Computer, Inc.":1,"Google Inc.":1}[navigator.vendor]){b.safari=function(){var e=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){e.remove();});};}else{b.safari=function(){};}}if(f.vml){var y=function(ac){var aa=O(ac);for(var R=0,Z=aa.length;R<Z;R++){aa[R][0]=(aa[R][0]+"").toLowerCase();aa[R][0]=="z"&&(aa[R][0]="x");for(var e=1,ab=aa[R].length;e<ab;e++){aa[R][e]=Math.round(aa[R][e]);}}return(aa+"");};f.toString=function(){return"Your browser doesn\u2019t support SVG. Assuming it is Internet Explorer and falling down to VML.\nYou are running Rapha\u00ebl "+this.version;};var W=function(e,ab){var Z=V("group"),ac=Z.style;ac.position="absolute";ac.left=0;ac.top=0;ac.width=ab.width+"px";ac.height=ab.height+"px";Z.coordsize=ab.coordsize;Z.coordorigin=ab.coordorigin;var R=V("shape"),i=R.style;i.width=ab.width+"px";i.height=ab.height+"px";R.path="";R.coordsize=this.coordsize;R.coordorigin=this.coordorigin;Z.appendChild(R);var aa=new m(R,Z,ab);aa.isAbsolute=true;aa.type="path";aa.path=[];aa.Path="";if(e){aa.attrs.path=f.parsePathString(e);aa.node.path=y(aa.attrs.path);}F(aa,{fill:"none",stroke:"#000"});aa.setBox();ab.canvas.appendChild(Z);return aa;};var F=function(af,aj){af.attrs=af.attrs||{};var ah=af.node,ak=af.attrs,ac=ah.style,Z,ao=af;for(var ad in aj){if(aj.hasOwnProperty(ad)){ak[ad]=aj[ad];}}aj.href&&(ah.href=aj.href);aj.title&&(ah.title=aj.title);aj.target&&(ah.target=aj.target);if(aj.path&&af.type=="path"){ak.path=f.parsePathString(aj.path);ah.path=y(ak.path);}if(aj.rotation!=null){af.rotate(aj.rotation,true);}if(aj.translation){Z=(aj.translation+"").split(Y);af.translate(Z[0],Z[1]);}if(aj.scale){Z=(aj.scale+"").split(Y);af.scale(+Z[0]||1,+Z[1]||+Z[0]||1,+Z[2]||null,+Z[3]||null);}if("clip-rect" in aj){var e=(aj["clip-rect"]+"").split(Y);if(e.length==4){e[2]=+e[2]+(+e[0]);e[3]=+e[3]+(+e[1]);var ae=ah.clipRect||g.createElement("div"),an=ae.style,ab=ah.parentNode;an.clip=f.format("rect({0}px {2}px {3}px {1}px)",e);if(!ah.clipRect){an.position="absolute";an.top=0;an.left=0;an.width=af.paper.width+"px";an.height=af.paper.height+"px";ab.parentNode.insertBefore(ae,ab);ae.appendChild(ab);ah.clipRect=ae;}}if(!aj["clip-rect"]){ah.clipRect&&(ah.clipRect.style.clip="");}}if(af.type=="image"&&aj.src){ah.src=aj.src;}if(af.type=="image"&&aj.opacity){ah.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+(aj.opacity*100)+")";ac.filter=(ah.filterMatrix||"")+(ah.filterOpacity||"");}aj.font&&(ac.font=aj.font);aj["font-family"]&&(ac.fontFamily='"'+aj["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,"")+'"');aj["font-size"]&&(ac.fontSize=aj["font-size"]);aj["font-weight"]&&(ac.fontWeight=aj["font-weight"]);aj["font-style"]&&(ac.fontStyle=aj["font-style"]);if(aj.opacity!=null||aj["stroke-width"]!=null||aj.fill!=null||aj.stroke!=null||aj["stroke-width"]!=null||aj["stroke-opacity"]!=null||aj["fill-opacity"]!=null||aj["stroke-dasharray"]!=null||aj["stroke-miterlimit"]!=null||aj["stroke-linejoin"]!=null||aj["stroke-linecap"]!=null){ah=af.shape||ah;var ai=(ah.getElementsByTagName("fill")&&ah.getElementsByTagName("fill")[0]),al=false;!ai&&(al=ai=V("fill"));if("fill-opacity" in aj||"opacity" in aj){var i=((+ak["fill-opacity"]+1||2)-1)*((+ak.opacity+1||2)-1);i<0&&(i=0);i>1&&(i=1);ai.opacity=i;}aj.fill&&(ai.on=true);if(ai.on==null||aj.fill=="none"){ai.on=false;}if(ai.on&&aj.fill){var R=aj.fill.match(/^url\(([^\)]+)\)$/i);if(R){ai.src=R[1];ai.type="tile";}else{ai.color=f.getRGB(aj.fill).hex;ai.src="";ai.type="solid";}}al&&ah.appendChild(ai);var aa=(ah.getElementsByTagName("stroke")&&ah.getElementsByTagName("stroke")[0]),am=false;!aa&&(am=aa=V("stroke"));if((aj.stroke&&aj.stroke!="none")||aj["stroke-width"]||aj["stroke-opacity"]!=null||aj["stroke-dasharray"]||aj["stroke-miterlimit"]||aj["stroke-linejoin"]||aj["stroke-linecap"]){aa.on=true;}(aj.stroke=="none"||aa.on==null||aj.stroke==0||aj["stroke-width"]==0)&&(aa.on=false);aa.on&&aj.stroke&&(aa.color=f.getRGB(aj.stroke).hex);var i=((+ak["stroke-opacity"]+1||2)-1)*((+ak.opacity+1||2)-1);i<0&&(i=0);i>1&&(i=1);aa.opacity=i;aj["stroke-linejoin"]&&(aa.joinstyle=aj["stroke-linejoin"]||"miter");aa.miterlimit=aj["stroke-miterlimit"]||8;aj["stroke-linecap"]&&(aa.endcap={butt:"flat",square:"square",round:"round"}[aj["stroke-linecap"]]||"miter");aj["stroke-width"]&&(aa.weight=(parseFloat(aj["stroke-width"])||1)*12/16);if(aj["stroke-dasharray"]){var ag={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};aa.dashstyle=ag[aj["stroke-dasharray"]]||"";}am&&ah.appendChild(aa);}if(ao.type=="text"){var ac=b.span.style;ak.font&&(ac.font=ak.font);ak["font-family"]&&(ac.fontFamily=ak["font-family"]);ak["font-size"]&&(ac.fontSize=ak["font-size"]);ak["font-weight"]&&(ac.fontWeight=ak["font-weight"]);ak["font-style"]&&(ac.fontStyle=ak["font-style"]);b.span.innerHTML=ao.node.string.replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>");ao.W=ak.w=b.span.offsetWidth;ao.H=ak.h=b.span.offsetHeight;ao.X=ak.x;ao.Y=ak.y+Math.round(ao.H/2);switch(ak["text-anchor"]){case"start":ao.node.style["v-text-align"]="left";ao.bbx=Math.round(ao.W/2);break;case"end":ao.node.style["v-text-align"]="right";ao.bbx=-Math.round(ao.W/2);break;default:ao.node.style["v-text-align"]="center";break;}}};var o=function(i,e,aa,Z){var R=Math.round(Math.atan((parseFloat(aa)-parseFloat(i))/(parseFloat(Z)-parseFloat(e)))*57.29)||0;if(!R&&parseFloat(i)<parseFloat(e)){R=180;}R-=180;if(R<0){R+=360;}return R;};var M=function(ad,ac){ac=n(ac);ad.attrs=ad.attrs||{};var R=ad.attrs,ab=ad.node.getElementsByTagName("fill");ad.attrs.gradient=ac;ad=ad.shape||ad.node;if(ab.length){ab=ab[0];}else{ab=V("fill");}if(ac.dots.length){ab.on=true;ab.method="none";ab.type=((ac.type+"").toLowerCase()=="radial")?"gradientTitle":"gradient";if(!f.is(ac.dots[0].color,"undefined")){ab.color=f.getRGB(ac.dots[0].color).hex;}if(!f.is(ac.dots[ac.dots.length-1].color,"undefined")){ab.color2=f.getRGB(ac.dots[ac.dots.length-1].color).hex;}var ae=[];for(var Z=0,aa=ac.dots.length;Z<aa;Z++){if(ac.dots[Z].offset){ae.push(ac.dots[Z].offset+" "+f.getRGB(ac.dots[Z].color).hex);}}var e=f.is(ac.dots[ac.dots.length-1].opacity,"undefined")?(f.is(R.opacity,"undefined")?1:R.opacity):ac.dots[ac.dots.length-1].opacity;if(ae.length){ab.colors.value=ae.join(",");e=f.is(R.opacity,"undefined")?1:R.opacity;}else{ab.colors&&(ab.colors.value="0% "+ab.color);}ab.opacity=e;if(!f.is(ac.angle,"undefined")){ab.angle=(-ac.angle+270)%360;}else{if(ac.vector){ab.angle=o.apply(null,ac.vector);}}if((ac.type+"").toLowerCase()=="radial"){ab.focus="100%";ab.focusposition="0.5 0.5";}}};var m=function(aa,ac,e){var ab=0,R=0,i=0,Z=1;this[0]=aa;this.node=aa;this.X=0;this.Y=0;this.attrs={};this.Group=ac;this.paper=e;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};};m.prototype.rotate=function(i,e,R){if(i==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy].join(" ");}return this._.rt.deg;}i=(i+"").split(Y);if(i.length-1){e=parseFloat(i[1]);R=parseFloat(i[2]);}i=parseFloat(i[0]);if(e!=null){this._.rt.deg=i;}else{this._.rt.deg+=i;}(R==null)&&(e=null);this._.rt.cx=e;this._.rt.cy=R;this.setBox(this.attrs,e,R);this.Group.style.rotation=this._.rt.deg;return this;};m.prototype.setBox=function(ab,ac,aa){var R=this.Group.style,ad=(this.shape&&this.shape.style)||this.node.style;ab=ab||{};for(var ae in ab){if(ab.hasOwnProperty(ae)){this.attrs[ae]=ab[ae];}}ac=ac||this._.rt.cx;aa=aa||this._.rt.cy;var ah=this.attrs,ak,aj,al,ag;switch(this.type){case"circle":ak=ah.cx-ah.r;aj=ah.cy-ah.r;al=ag=ah.r*2;break;case"ellipse":ak=ah.cx-ah.rx;aj=ah.cy-ah.ry;al=ah.rx*2;ag=ah.ry*2;break;case"rect":case"image":ak=ah.x;aj=ah.y;al=ah.width||0;ag=ah.height||0;break;case"text":this.textpath.v=["m",Math.round(ah.x),", ",Math.round(ah.y-2),"l",Math.round(ah.x)+1,", ",Math.round(ah.y-2)].join("");ak=ah.x-Math.round(this.W/2);aj=ah.y-this.H/2;al=this.W;ag=this.H;break;case"path":if(!this.attrs.path){ak=0;aj=0;al=this.paper.width;ag=this.paper.height;}else{var af=C(this.attrs.path);ak=af.x;aj=af.y;al=af.width;ag=af.height;}break;default:ak=0;aj=0;al=this.paper.width;ag=this.paper.height;break;}ac=(ac==null)?ak+al/2:ac;aa=(aa==null)?aj+ag/2:aa;var Z=ac-this.paper.width/2,ai=aa-this.paper.height/2;if(this.type=="path"||this.type=="text"){(R.left!=Z+"px")&&(R.left=Z+"px");(R.top!=ai+"px")&&(R.top=ai+"px");this.X=this.type=="text"?ak:-Z;this.Y=this.type=="text"?aj:-ai;this.W=al;this.H=ag;(ad.left!=-Z+"px")&&(ad.left=-Z+"px");(ad.top!=-ai+"px")&&(ad.top=-ai+"px");}else{(R.left!=Z+"px")&&(R.left=Z+"px");(R.top!=ai+"px")&&(R.top=ai+"px");this.X=ak;this.Y=aj;this.W=al;this.H=ag;(R.width!=this.paper.width+"px")&&(R.width=this.paper.width+"px");(R.height!=this.paper.height+"px")&&(R.height=this.paper.height+"px");(ad.left!=ak-Z+"px")&&(ad.left=ak-Z+"px");(ad.top!=aj-ai+"px")&&(ad.top=aj-ai+"px");(ad.width!=al+"px")&&(ad.width=al+"px");(ad.height!=ag+"px")&&(ad.height=ag+"px");var am=(+ab.r||0)/(Math.min(al,ag));if(this.type=="rect"&&this.arcsize!=am&&(am||this.arcsize)){var e=V(am?"roundrect":"rect");e.arcsize=am;this.Group.appendChild(e);this.node.parentNode.removeChild(this.node);this.node=e;this.arcsize=am;F(this,this.attrs);this.setBox(this.attrs);}}};m.prototype.hide=function(){this.Group.style.display="none";return this;};m.prototype.show=function(){this.Group.style.display="block";return this;};m.prototype.getBBox=function(){if(this.type=="path"){return C(this.attrs.path);}return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H};};m.prototype.remove=function(){this[0].parentNode.removeChild(this[0]);this.Group.parentNode.removeChild(this.Group);this.shape&&this.shape.parentNode.removeChild(this.shape);};m.prototype.attr=function(){if(arguments.length==1&&f.is(arguments[0],"string")){if(arguments[0]=="translation"){return this.translate();}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}return this.attrs[arguments[0]];}if(this.attrs&&arguments.length==1&&f.is(arguments[0],"array")){var e={};for(var R=0,Z=arguments[0].length;R<Z;R++){e[arguments[0][R]]=this.attrs[arguments[0][R]];}return e;}var aa;if(arguments.length==2){aa={};aa[arguments[0]]=arguments[1];}if(arguments.length==1&&f.is(arguments[0],"object")){aa=arguments[0];}if(aa){if(aa.gradient){M(this,aa.gradient);}if(aa.text&&this.type=="text"){this.node.string=aa.text;}F(this,aa);this.setBox(this.attrs);}return this;};m.prototype.toFront=function(){this.Group.parentNode.appendChild(this.Group);return this;};m.prototype.toBack=function(){if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);}return this;};m.prototype.insertAfter=function(e){if(e.Group.nextSibling){e.Group.parentNode.insertBefore(this.Group,e.Group.nextSibling);}else{e.Group.parentNode.appendChild(this.Group);}return this;};m.prototype.insertBefore=function(e){e.Group.parentNode.insertBefore(this.Group,e.Group);return this;};m.prototype.blur=function(e){var i=this.node.style,R=i.filter;R=R.replace(/progid:DXImageTransform\.Microsoft\.Blur\(pixelradius\=[^\)]+\)/g,"");if(e!="none"){i.filter=R+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+e||1.5)+")";i.margin=f.format("-{0}px 0 0 -{0}px",Math.round(+e||1.5));}else{i.filter=R;i.margin=0;}};var D=function(i,ae,ad,e){var aa=V("group"),Z=aa.style,R=V("oval"),ac=R.style;Z.position="absolute";Z.left=0;Z.top=0;Z.width=i.width+"px";Z.height=i.height+"px";aa.coordsize=i.coordsize;aa.coordorigin=i.coordorigin;aa.appendChild(R);var ab=new m(R,aa,i);ab.type="circle";F(ab,{stroke:"#000",fill:"none"});ab.attrs.cx=ae;ab.attrs.cy=ad;ab.attrs.r=e;ab.setBox({x:ae-e,y:ad-e,width:e*2,height:e*2});i.canvas.appendChild(aa);return ab;};var I=function(i,ae,ad,af,aa,e){var ab=V("group"),Z=ab.style,R=V(e?"roundrect":"rect"),ag=(+e||0)/(Math.min(af,aa));R.arcsize=ag;Z.position="absolute";Z.left=0;Z.top=0;Z.width=i.width+"px";Z.height=i.height+"px";ab.coordsize=i.coordsize;ab.coordorigin=i.coordorigin;ab.appendChild(R);var ac=new m(R,ab,i);ac.type="rect";F(ac,{stroke:"#000"});ac.arcsize=ag;ac.setBox({x:ae,y:ad,width:af,height:aa,r:+e});i.canvas.appendChild(ab);return ac;};var h=function(e,af,ae,R,i){var ab=V("group"),aa=ab.style,Z=V("oval"),ad=Z.style;aa.position="absolute";aa.left=0;aa.top=0;aa.width=e.width+"px";aa.height=e.height+"px";ab.coordsize=e.coordsize;ab.coordorigin=e.coordorigin;ab.appendChild(Z);var ac=new m(Z,ab,e);ac.type="ellipse";F(ac,{stroke:"#000"});ac.attrs.cx=af;ac.attrs.cy=ae;ac.attrs.rx=R;ac.attrs.ry=i;ac.setBox({x:af-R,y:ae-i,width:R*2,height:i*2});e.canvas.appendChild(ab);return ac;};var p=function(i,e,af,ae,ag,aa){var ab=V("group"),Z=ab.style,R=V("image"),ad=R.style;Z.position="absolute";Z.left=0;Z.top=0;Z.width=i.width+"px";Z.height=i.height+"px";ab.coordsize=i.coordsize;ab.coordorigin=i.coordorigin;R.src=e;ab.appendChild(R);var ac=new m(R,ab,i);ac.type="image";ac.attrs.src=e;ac.attrs.x=af;ac.attrs.y=ae;ac.attrs.w=ag;ac.attrs.h=aa;ac.setBox({x:af,y:ae,width:ag,height:aa});i.canvas.appendChild(ab);return ac;};var H=function(i,af,ae,ag){var ab=V("group"),aa=ab.style,Z=V("shape"),ad=Z.style,ah=V("path"),e=ah.style,R=V("textpath");aa.position="absolute";aa.left=0;aa.top=0;aa.width=i.width+"px";aa.height=i.height+"px";ab.coordsize=i.coordsize;ab.coordorigin=i.coordorigin;ah.v=["m",Math.round(af),", ",Math.round(ae),"l",Math.round(af)+1,", ",Math.round(ae)].join("");ah.textpathok=true;ad.width=i.width;ad.height=i.height;aa.position="absolute";aa.left=0;aa.top=0;aa.width=i.width;aa.height=i.height;R.string=ag;R.on=true;Z.appendChild(R);Z.appendChild(ah);ab.appendChild(Z);var ac=new m(R,ab,i);ac.shape=Z;ac.textpath=ah;ac.type="text";ac.attrs.text=ag;ac.attrs.x=af;ac.attrs.y=ae;ac.attrs.w=1;ac.attrs.h=1;F(ac,{font:q.font,stroke:"none",fill:"#000"});ac.setBox();i.canvas.appendChild(ab);return ac;};var E=function(R,e){var i=this.canvas.style;this.width=parseFloat(R||this.width);this.height=parseFloat(e||this.height);i.width=this.width+"px";i.height=this.height+"px";i.clip="rect(0 "+this.width+"px "+this.height+"px 0)";this.coordsize=this.width+" "+this.height;return this;};g.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!g.namespaces.rvml&&g.namespaces.add("rvml","urn:schemas-microsoft-com:vml");var V=function(e){return g.createElement("<rvml:"+e+' class="rvml">');};}catch(U){var V=function(e){return g.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');};}var l=function(){var Z=G.apply(null,arguments),i=Z.container,ae=Z.height,af,R=Z.width,ad=Z.x,ac=Z.y;if(!i){throw new Error("VML container not found.");}var ab=b.canvas=g.createElement("div"),aa=ab.style;R=parseFloat(R)||"512px";ae=parseFloat(ae)||"342px";b.width=R;b.height=ae;b.coordsize=R+" "+ae;b.coordorigin="0 0";b.span=g.createElement("span");af=b.span.style;ab.appendChild(b.span);af.position="absolute";af.left="-99999px";af.top="-99999px";af.padding=0;af.margin=0;af.lineHeight=1;af.display="inline";aa.width=R+"px";aa.height=ae+"px";aa.position="absolute";aa.clip="rect(0 "+R+"px "+ae+"px 0)";if(i==1){g.body.appendChild(ab);aa.left=ad+"px";aa.top=ac+"px";i={style:{width:R,height:ae}};}else{i.style.width=R;i.style.height=ae;if(i.firstChild){i.insertBefore(ab,i.firstChild);}else{i.appendChild(ab);}}for(var e in b){if(b.hasOwnProperty(e)){i[e]=b[e];}}a.call(i,i,f.fn);i.clear=function(){while(ab.firstChild){ab.removeChild(ab.firstChild);}};i.raphael=f;return i;};b.remove=function(){this.canvas.parentNode.removeChild(this.canvas);};b.safari=function(){};}var j=(function(){if(g.addEventListener){return function(aa,R,i,e){var Z=function(ab){return i.call(e,ab);};aa.addEventListener(R,Z,false);return function(){aa.removeEventListener(R,Z,false);return true;};};}else{if(g.attachEvent){return function(ab,Z,R,i){var aa=function(ac){return R.call(i,ac||L.event);};ab.attachEvent("on"+Z,aa);var e=function(){ab.detachEvent("on"+Z,aa);return true;};if(Z=="mouseover"){ab.attachEvent("onmouseenter",aa);return function(){ab.detachEvent("onmouseenter",aa);return e();};}else{if(Z=="mouseout"){ab.attachEvent("onmouseleave",aa);return function(){ab.detachEvent("onmouseleave",aa);return e();};}}return e;};}}})();for(var Q=v.length;Q--;){(function(e){m.prototype[e]=function(i){if(f.is(i,"function")){this.events=this.events||{};this.events[e]=this.events[e]||{};this.events[e][i]=this.events[e][i]||[];this.events[e][i].push(j(this.shape||this.node,e,i,this));}return this;};m.prototype["un"+e]=function(i){this.events&&this.events[e]&&this.events[e][i]&&this.events[e][i].length&&this.events[e][i].shift()()&&!this.events[e][i].length&&delete this.events[e][i];};})(v[Q]);}b.circle=function(e,R,i){return D(this,e,R,i);};b.rect=function(e,aa,i,R,Z){return I(this,e,aa,i,R,Z);};b.ellipse=function(e,Z,R,i){return h(this,e,Z,R,i);};b.path=function(e){e&&!f.is(e,"string")&&!f.is(e[0],"array")&&(e+="");return W(f.format.apply(f,arguments),this);};b.image=function(Z,e,aa,i,R){return p(this,Z,e,aa,i,R);};b.text=function(e,R,i){return H(this,e,R,i);};b.set=function(e){arguments.length>1&&(e=Array.prototype.splice.call(arguments,0,arguments.length));return new k(e);};b.setSize=E;m.prototype.stop=function(){clearTimeout(this.animation_in_progress);return this;};m.prototype.scale=function(aj,ai,Z,R){if(aj==null&&ai==null){return{x:this._.sx,y:this._.sy,toString:function(){return this.x+" "+this.y;}};}ai=ai||aj;!+ai&&(ai=aj);var an,al,am,ak,aA=this.attrs;if(aj!=0){var ah=this.getBBox(),ae=ah.x+ah.width/2,ab=ah.y+ah.height/2,az=aj/this._.sx,ay=ai/this._.sy;Z=(+Z||Z==0)?Z:ae;R=(+R||R==0)?R:ab;var ag=Math.round(aj/Math.abs(aj)),ad=Math.round(ai/Math.abs(ai)),aq=this.node.style,aC=Z+(ae-Z)*ag*az,aB=R+(ab-R)*ad*ay;switch(this.type){case"rect":case"image":var af=aA.width*ag*az,ap=aA.height*ad*ay,ac=aC-af/2,aa=aB-ap/2;this.attr({width:af,height:ap,x:ac,y:aa});break;case"circle":case"ellipse":this.attr({rx:aA.rx*az,ry:aA.ry*ay,r:aA.r*az,cx:aC,cy:aB});break;case"path":var at=c(aA.path),au=true;for(var aw=0,ao=at.length;aw<ao;aw++){var ar=at[aw];if(ar[0].toUpperCase()=="M"&&au){continue;}else{au=false;}if(f.svg&&ar[0].toUpperCase()=="A"){ar[at[aw].length-2]*=az;ar[at[aw].length-1]*=ay;ar[1]*=az;ar[2]*=ay;ar[5]=+(ag+ad?!!+ar[5]:!+ar[5]);}else{for(var av=1,ax=ar.length;av<ax;av++){ar[av]*=(av%2)?az:ay;}}}var e=C(at),an=aC-e.x-e.width/2,al=aB-e.y-e.height/2;at=c(at);at[0][1]+=an;at[0][2]+=al;this.attr({path:at.join(" ")});break;}if(this.type in {text:1,image:1}&&(ag!=1||ad!=1)){if(this.transformations){this.transformations[2]="scale(".concat(ag,",",ad,")");this.node.setAttribute("transform",this.transformations.join(" "));an=(ag==-1)?-aA.x-(af||0):aA.x;al=(ad==-1)?-aA.y-(ap||0):aA.y;this.attr({x:an,y:al});aA.fx=ag-1;aA.fy=ad-1;}else{this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11=".concat(ag,", M12=0, M21=0, M22=",ad,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");aq.filter=(this.node.filterMatrix||"")+(this.node.filterOpacity||"");}}else{if(this.transformations){this.transformations[2]="";this.node.setAttribute("transform",this.transformations.join(" "));aA.fx=0;aA.fy=0;}else{this.node.filterMatrix="";aq.filter=(this.node.filterMatrix||"")+(this.node.filterOpacity||"");}}aA.scale=[aj,ai,Z,R].join(" ");this._.sx=aj;this._.sy=ai;}return this;};f.easing_formulas={linear:function(e){return e;},"<":function(e){return Math.pow(e,3);},">":function(e){return Math.pow(e-1,3)+1;},"<>":function(e){e=e*2;if(e<1){return Math.pow(e,3)/2;}e-=2;return(Math.pow(e,3)+2)/2;},backIn:function(i){var e=1.70158;return i*i*((e+1)*i-e);},backOut:function(i){i=i-1;var e=1.70158;return i*i*((e+1)*i+e)+1;},elastic:function(R){if(R==0||R==1){return R;}var i=0.3,e=i/4;return Math.pow(2,-10*R)*Math.sin((R-e)*(2*Math.PI)/i)+1;},bounce:function(Z){var i=7.5625,R=2.75,e;if(Z<(1/R)){e=i*Z*Z;}else{if(Z<(2/R)){Z-=(1.5/R);e=i*Z*Z+0.75;}else{if(Z<(2.5/R)){Z-=(2.25/R);e=i*Z*Z+0.9375;}else{Z-=(2.625/R);e=i*Z*Z+0.984375;}}}return e;}};m.prototype.animate=function(at,aj,ai,aa){clearTimeout(this.animation_in_progress);if(f.is(ai,"function")||!ai){aa=ai||null;}var am={},R={},ag={},af={x:0,y:0};for(var ak in at){if(at.hasOwnProperty(ak)){if(ak in u){am[ak]=this.attr(ak);(am[ak]==null)&&(am[ak]=q[ak]);R[ak]=at[ak];switch(u[ak]){case"number":ag[ak]=(R[ak]-am[ak])/aj;break;case"colour":am[ak]=f.getRGB(am[ak]);var al=f.getRGB(R[ak]);ag[ak]={r:(al.r-am[ak].r)/aj,g:(al.g-am[ak].g)/aj,b:(al.b-am[ak].b)/aj};break;case"path":var ab=O(am[ak],R[ak]);am[ak]=ab[0];R[ak]=ab[1];ag[ak]=[];for(var ao=0,ae=am[ak].length;ao<ae;ao++){ag[ak][ao]=[0];for(var an=1,aq=am[ak][ao].length;an<aq;an++){ag[ak][ao][an]=(R[ak][ao][an]-am[ak][ao][an])/aj;}}break;case"csv":var e=(at[ak]+"").split(Y),ad=(am[ak]+"").split(Y);switch(ak){case"translation":am[ak]=[0,0];ag[ak]=[e[0]/aj,e[1]/aj];break;case"rotation":am[ak]=(ad[1]==e[1]&&ad[2]==e[2])?ad:[0,e[1],e[2]];ag[ak]=[(e[0]-am[ak][0])/aj,0,0];break;case"scale":at[ak]=e;am[ak]=(am[ak]+"").split(Y);ag[ak]=[(e[0]-am[ak][0])/aj,(e[1]-am[ak][1])/aj,0,0];break;case"clip-rect":am[ak]=(am[ak]+"").split(Y);ag[ak]=[];var ao=4;while(ao--){ag[ak][ao]=(e[ao]-am[ak][ao])/aj;}break;}R[ak]=e;}}}}var Z=+new Date,ah=0,ar=function(i){return +i>255?255:+i;},ac=this;(function ap(){var av=new Date-Z,aD={},au;if(av<aj){var aB=f.easing_formulas[ai]?f.easing_formulas[ai](av/aj):av/aj;for(var az in am){if(am.hasOwnProperty(az)){switch(u[az]){case"number":au=+am[az]+aB*aj*ag[az];break;case"colour":au="rgb("+[ar(Math.round(am[az].r+aB*aj*ag[az].r)),ar(Math.round(am[az].g+aB*aj*ag[az].g)),ar(Math.round(am[az].b+aB*aj*ag[az].b))].join(",")+")";break;case"path":au=[];for(var ax=0,aE=am[az].length;ax<aE;ax++){au[ax]=[am[az][ax][0]];for(var aw=1,ay=am[az][ax].length;aw<ay;aw++){au[ax][aw]=+am[az][ax][aw]+aB*aj*ag[az][ax][aw];}au[ax]=au[ax].join(" ");}au=au.join(" ");break;case"csv":switch(az){case"translation":var aC=ag[az][0]*(av-ah),aA=ag[az][1]*(av-ah);af.x+=aC;af.y+=aA;au=[aC,aA].join(" ");break;case"rotation":au=+am[az][0]+aB*aj*ag[az][0];am[az][1]&&(au+=","+am[az][1]+","+am[az][2]);break;case"scale":au=[+am[az][0]+aB*aj*ag[az][0],+am[az][1]+aB*aj*ag[az][1],(2 in at[az]?at[az][2]:""),(3 in at[az]?at[az][3]:"")].join(" ");break;case"clip-rect":au=[];var ax=4;while(ax--){au[ax]=+am[az][ax]+aB*aj*ag[az][ax];}break;}break;}aD[az]=au;}}ac.attr(aD);ac.animation_in_progress=setTimeout(ap);f.svg&&b.safari();}else{(af.x||af.y)&&ac.translate(-af.x,-af.y);ac.attr(at);clearTimeout(ac.animation_in_progress);f.svg&&b.safari();(f.is(aa,"function"))&&aa.call(ac);}ah=av;})();return this;};m.prototype.translate=function(e,R){if(e==null){return{x:this._.tx,y:this._.ty};}this._.tx+=+e;this._.ty+=+R;switch(this.type){case"circle":case"ellipse":this.attr({cx:+e+this.attrs.cx,cy:+R+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+e+this.attrs.x,y:+R+this.attrs.y});break;case"path":var i=c(this.attrs.path);i[0][1]+=+e;i[0][2]+=+R;this.attr({path:i});break;}return this;};var k=function(e){this.items=[];this.length=0;if(e){for(var R=0,Z=e.length;R<Z;R++){if(e[R]&&(e[R].constructor==m||e[R].constructor==k)){this[this.items.length]=this.items[this.items.length]=e[R];this.length++;}}}};k.prototype.push=function(){var aa,e;for(var R=0,Z=arguments.length;R<Z;R++){aa=arguments[R];if(aa&&(aa.constructor==m||aa.constructor==k)){e=this.items.length;this[e]=this.items[e]=aa;this.length++;}}return this;};k.prototype.pop=function(){delete this[this.length--];return this.items.pop();};for(var S in m.prototype){if(m.prototype.hasOwnProperty(S)){k.prototype[S]=(function(e){return function(){for(var R=0,Z=this.items.length;R<Z;R++){this.items[R][e].apply(this.items[R],arguments);}return this;};})(S);}}k.prototype.attr=function(R,ac){if(R&&f.is(R,"array")&&f.is(R[0],"object")){for(var e=0,ab=R.length;e<ab;e++){this.items[e].attr(R[e]);}}else{for(var Z=0,aa=this.items.length;Z<aa;Z++){this.items[Z].attr.apply(this.items[Z],arguments);}}return this;};k.prototype.getBBox=function(){var e=[],ac=[],R=[],aa=[];for(var Z=this.items.length;Z--;){var ab=this.items[Z].getBBox();e.push(ab.x);ac.push(ab.y);R.push(ab.x+ab.width);aa.push(ab.y+ab.height);}e=Math.min.apply(Math,e);ac=Math.min.apply(Math,ac);return{x:e,y:ac,width:Math.max.apply(Math,R)-e,height:Math.max.apply(Math,aa)-ac};};f.registerFont=function(i){if(!i.face){return i;}this.fonts=this.fonts||{};var Z={w:i.w,face:{},glyphs:{}},R=i.face["font-family"];for(var ac in i.face){if(i.face.hasOwnProperty(ac)){Z.face[ac]=i.face[ac];}}if(this.fonts[R]){this.fonts[R].push(Z);}else{this.fonts[R]=[Z];}if(!i.svg){Z.face["units-per-em"]=parseInt(i.face["units-per-em"],10);for(var aa in i.glyphs){if(i.glyphs.hasOwnProperty(aa)){var ab=i.glyphs[aa];Z.glyphs[aa]={w:ab.w,k:{},d:ab.d&&"M"+ab.d.replace(/[mlcxtrv]/g,function(ad){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[ad]||"M";})+"z"};if(ab.k){for(var e in ab.k){if(ab.khasOwnProperty(e)){Z.glyphs[aa].k[e]=ab.k[e];}}}}}}return i;};b.getFont=function(ae,af,R,aa){aa=aa||"normal";R=R||"normal";af=+af||{normal:400,bold:700,lighter:300,bolder:800}[af]||400;var ab=f.fonts[ae];if(!ab){var Z=new RegExp("(^|\\s)"+ae.replace(/[^\w\d\s+!~.:_-]/g,"")+"(\\s|$)","i");for(var e in f.fonts){if(f.fonts.hasOwnProperty(e)){if(Z.test(e)){ab=f.fonts[e];break;}}}}var ac;if(ab){for(var ad=0,ag=ab.length;ad<ag;ad++){ac=ab[ad];if(ac.face["font-weight"]==af&&(ac.face["font-style"]==R||!ac.face["font-style"])&&ac.face["font-stretch"]==aa){break;}}}return ac;};b.print=function(ag,af,ad,R,ak){var ab=this.set(),ae=(ad+"").split(""),e=0,aj="",aa;f.is(R,"string")&&(R=this.getFont(R));if(R){aa=(ak||16)/R.face["units-per-em"];for(var ac=0,ah=ae.length;ac<ah;ac++){var Z=ac&&R.glyphs[ae[ac-1]]||{},ai=R.glyphs[ae[ac]];e+=ac?(Z.w||R.w)+(Z.k&&Z.k[ae[ac]]||0):0;ai&&ai.d&&ab.push(this.path(ai.d).attr({fill:"#000",stroke:"none",translation:[e,0]}));}ab.scale(aa,aa,0,af).translate(ag,(ak||16)/2);}return ab;};f.format=function(i){var e=f.is(arguments[1],"array")?[0].concat(arguments[1]):arguments;i&&f.is(i,"string")&&e.length-1&&(i=i.replace(/\{(\d+)\}/g,function(Z,R){return e[++R]==null?"":e[R];}));return i;};f.ninja=function(){var R=window.Raphael,i;if(P.was){window.Raphael=P.is;}else{try{delete window.Raphael;}catch(Z){window.Raphael=i;}}return R;};f.el=m.prototype;return f;})(); \ No newline at end of file
diff --git a/content/js/subject.js b/content/js/subject.js
deleted file mode 100755
index 3d42a65..0000000
--- a/content/js/subject.js
+++ /dev/null
@@ -1,219 +0,0 @@
-$(document).ready(
- function(){
- var k = Karma();
-
- k.ready(function() {
-
- activities;
-
- k.ready(function(){
-
- //game logic
- function draw(){
- var canvas = document.getElementById('ladder');
- if (canvas.getContext){
- var ctx = canvas.getContext('2d');
- var cells = 8;
- var rows = 2 + (activities.length / cells);
- var maxx = 1200;
- var cellsize = 56;
- var sz = cellsize;
- var maxy = rows * 1.5 * cellsize;
- if (maxy < 500){ maxy = 800; };
- maxy = 800;
- canvas.setAttribute('width', maxx);
- canvas.setAttribute('height', maxy);
- var x = 0;
- var y = 0;
- var odd = 1;
- var xstart = 64;
- var ystart = maxy - 0.5*cellsize;
- var row = 0;
- var cell = 0;
- var id = -1;
- var ix = 0;
- var idm = 0;
- var activity = 0;
- var flag = 0;
- var acts = new Array();
- var idx = 0
- var il = ""
- var xy;
- var pth;
- var count = 0;
- var year = 0
- var local = 0;
-
- $("canvas").click(function($e) {
- // find out which act in acts was clicked
- x = $e.pageX;
- y = $e.pageY;
- $.each(acts, function() {
- xy = this;
- // here we need to download or go to activity
- if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2])
- && (y > xy[2] - cellsize) ) {
- save = xy[4];
- if (xy[5].indexOf('cyan')>-1) { //download
- $('<div id="temp" />').load(
- 'http://localhost:8008/cgi-bin/fetch_milestone.py',
- {'code':xy[0],'milestone':xy[4]},
- function(responseText, status, xhr) {
- //refresh when done
- pth = save+'/index.html'
- last = xy[0].charAt(xy[0].length-1);
- window.location = pth+'?F'+last;
- });
- }else{ //go to activity
- pth = xy[4]+'/index.html';
- last = xy[0].charAt(xy[0].length-1);
- window.location = pth+'?F'+last;
- };
- };
- });
- });
-
- //ladder
- ctx.font = "14pt Arial";
- ctx.textAlign = "center";
- x = xstart;
- y = ystart;
- ctx.beginPath();
- sz = cellsize;
- drawarrow(x,y,sz);
- offset=0;
- delta = 1;
- for(row=0;row<rows;row++){
- if (activity == activities.length) {break;};
- if (offset == 0){
- x = xstart;
- } else {
- x = xstart+offset-sz*3/2;
- };
- for(cell=0;cell<cells;cell++){
- xsave = x;
- if (activity < activities.length){
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz*3/2, sz/4);
- drawlogo(x,y,activity);
- activity = activity + 1;
- x = x + 3/2*sz;
- if (delta > 0) {
- if (cell+1 < cells) {
- ctx.fillstyle='yellow';
- ctx.fillRect(x,y,sz,sz/4);
- x = xsave + sz*5/2;
- } else {
- x = xsave + sz*3/2;
- };
- } else {
- if (cell > 0) {
- ctx.fillStyle = 'yellow';
- ctx.fillRect(x,y,sz,sz/4);
- };
- if (cell+1<cells){
- x = xsave - sz*5/2;
- } else {
- x = xsave-sz*3/2;
- };
- };
- };
- };
- if ((row + 1 < rows) && (activity < activities.length)) {
- x = drawloop(x,y,row);
- y = y - 2.25 * cellsize;
- offset = x - xstart;
- delta = -delta
- };
- };
- };
-
- function drawloop(x,y,row) {
- if (row % 2 == 0) {
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
- ctx.closePath();
- ctx.fillStyle='yellow'
- ctx.fill()
- } else {
- x = xstart;
- ctx.beginPath();
- ctx.moveTo(x,y);
- ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
- ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
- ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
- ctx.closePath();
- ctx.fillStyle='yellow';
- ctx.fill();
- };
- return x;
- };
-
- function drawarrow(x,y,sz) {
- ctx.fillStyle = 'black'
- ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
- ctx.moveTo(x-sz/2,y);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.moveTo(x-sz/2,y+sz/2);
- ctx.lineTo(x-sz/5,y+sz/8);
- ctx.stroke();
- };
-
- function drawmilestone(activity){
- var capcolor;
- x = activity[1];
- y = activity[2];
- capcolor = activity[5];
- ctx.fillStyle = 'chartreuse';
- ctx.fillRect(x,y-cellsize,cellsize,cellsize);
- ctx.fillStyle = 'black'
- ctx.fillText(ix, x + (cellsize * 0.3), y-(cellsize * 0.4), cellsize);
- ctx.beginPath();
- ctx.moveTo(x, y-cellsize);
- ctx.arc(x+0.5*cellsize,y-cellsize,0.5*cellsize,Math.PI,0,0);
- ctx.closePath();
- ctx.fillStyle = capcolor;
- ctx.fill();
- ctx.fillStyle = 'yellow';
- };
-
- function drawlogo(x, y, activity) {
- var il, ty, ls, cc;
- id = activities[activity][0];
- ix = activities[activity][1];
- if ((activities[activity].length) > 1){
- il = activities[activity][2];
- } else {
- il = "";
- };
- if ((activities[activity].length) > 2){
- ty = activities[activity][3];
- }else{
- ty = "";
- };
- if ((activities[activity].length) > 3){
- ls = activities[activity][4];
- }else{
- ls = "";
- };
- if ((activities[activity].length) > 4){
- cc = activities[activity][5];
- }else{
- cc = 'cyan';
- };
- idx = idx + 1;
- acts[idx] = [il, x, y, ty, ls, cc, id];
- drawmilestone(acts[idx]);
- };
- };
-
- draw();
-
- });
- });
-});
diff --git a/content/js/themes/advanced/editor_template.js b/content/js/themes/advanced/editor_template.js
deleted file mode 100755
index fc4abe1..0000000
--- a/content/js/themes/advanced/editor_template.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",classes:n["class"],selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){i.execCommand("mceToggleFormat",false,n);return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){i.execCommand("FontName",false,l);return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=this.settings,m=d.get(j.id+"_tbl"),n=d.get(j.id+"_ifr");i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);d.setStyle(m,"height","");d.setStyle(n,"height",l);if(k.theme_advanced_resize_horizontal){d.setStyle(m,"width","");d.setStyle(n,"width",i);if(i<m.clientWidth){d.setStyle(n,"width",m.clientWidth)}}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":"&#160;");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:n,ch:E})}}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(r,z,l,x,j){var C=this,i,y=0,B,u,D=C.settings,A,k,w,m,q;e.each(C.stateControls,function(n){z.setActive(n,r.queryCommandState(C.controls[n][1]))});function o(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}z.setActive("visualaid",r.hasVisual);z.setDisabled("undo",!r.undoManager.hasUndo()&&!r.typing);z.setDisabled("redo",!r.undoManager.hasRedo());z.setDisabled("outdent",!r.queryCommandState("Outdent"));i=o("A");if(u=z.get("link")){if(!i||!i.name){u.setDisabled(!i&&x);u.setActive(!!i)}}if(u=z.get("unlink")){u.setDisabled(!i&&x);u.setActive(!!i&&!i.name)}if(u=z.get("anchor")){u.setActive(!!i&&i.name)}i=o("IMG");if(u=z.get("image")){u.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(u=z.get("styleselect")){C._importClasses();m=[];f(u.items,function(n){m.push(n.value)});q=r.formatter.matchAll(m);u.select(q[0])}if(u=z.get("formatselect")){i=o(d.isBlock);if(i){u.select(i.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!A&&p.className){A=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(u=z.get("fontselect")){u.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(u=z.get("fontsizeselect")){if(D.theme_advanced_runtime_fontsize&&!k&&!A){k=r.dom.getStyle(l,"fontSize",true)}u.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===A){return true}})}if(D.theme_advanced_path&&D.theme_advanced_statusbar_location){i=d.get(r.id+"_path")||d.add(r.id+"_path_row","span",{id:r.id+"_path"});d.setHTML(i,"");o(function(E){var p=E.nodeName.toLowerCase(),s,v,t="";if(E.nodeType!=1||E.nodeName==="BR"||(d.hasClass(E,"mceItemHidden")||d.hasClass(E,"mceItemRemoved"))){return}if(B=d.getAttrib(E,"mce_name")){p=B}if(e.isIE&&E.scopeName!=="HTML"){p=E.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(B=d.getAttrib(E,"src")){t+="src: "+B+" "}break;case"a":if(B=d.getAttrib(E,"name")){t+="name: "+B+" ";p+="#"+B}if(B=d.getAttrib(E,"href")){t+="href: "+B+" "}break;case"font":if(B=d.getAttrib(E,"face")){t+="font: "+B+" "}if(B=d.getAttrib(E,"size")){t+="size: "+B+" "}if(B=d.getAttrib(E,"color")){t+="color: "+B+" "}break;case"span":if(B=d.getAttrib(E,"style")){t+="style: "+B+" "}break}if(B=d.getAttrib(E,"id")){t+="id: "+B+" "}if(B=E.className){B=B.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(B){t+="class: "+B+" ";if(d.isBlock(E)||p=="img"||p=="span"){p+="."+B}}}p=p.replace(/(html:)/g,"");p={name:p,node:E,title:t};C.onResolveName.dispatch(C,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(y++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},r.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file
diff --git a/content/js/themes/advanced/langs/en.js b/content/js/themes/advanced/langs/en.js
deleted file mode 100755
index 075bef7..0000000
--- a/content/js/themes/advanced/langs/en.js
+++ /dev/null
@@ -1,169 +0,0 @@
-tinyMCE.addI18n({en:{
-common:{
-edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
-apply:"Apply",
-insert:"Insert",
-update:"Update",
-cancel:"Cancel",
-close:"Close",
-browse:"Browse",
-class_name:"Class",
-not_set:"-- Not set --",
-clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
-clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
-popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
-invalid_data:"Error: Invalid values entered, these are marked in red.",
-more_colors:"More colors"
-},
-contextmenu:{
-align:"Alignment",
-left:"Left",
-center:"Center",
-right:"Right",
-full:"Full"
-},
-insertdatetime:{
-date_fmt:"%Y-%m-%d",
-time_fmt:"%H:%M:%S",
-insertdate_desc:"Insert date",
-inserttime_desc:"Insert time",
-months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
-months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
-day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
-day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
-},
-print:{
-print_desc:"Print"
-},
-preview:{
-preview_desc:"Preview"
-},
-directionality:{
-ltr_desc:"Direction left to right",
-rtl_desc:"Direction right to left"
-},
-layer:{
-insertlayer_desc:"Insert new layer",
-forward_desc:"Move forward",
-backward_desc:"Move backward",
-absolute_desc:"Toggle absolute positioning",
-content:"New layer..."
-},
-save:{
-save_desc:"Save",
-cancel_desc:"Cancel all changes"
-},
-nonbreaking:{
-nonbreaking_desc:"Insert non-breaking space character"
-},
-iespell:{
-iespell_desc:"Run spell checking",
-download:"ieSpell not detected. Do you want to install it now?"
-},
-advhr:{
-advhr_desc:"Horizontal rule"
-},
-emotions:{
-emotions_desc:"Emotions"
-},
-searchreplace:{
-search_desc:"Find",
-replace_desc:"Find/Replace"
-},
-advimage:{
-image_desc:"Insert/edit image"
-},
-advlink:{
-link_desc:"Insert/edit link"
-},
-xhtmlxtras:{
-cite_desc:"Citation",
-abbr_desc:"Abbreviation",
-acronym_desc:"Acronym",
-del_desc:"Deletion",
-ins_desc:"Insertion",
-attribs_desc:"Insert/Edit Attributes"
-},
-style:{
-desc:"Edit CSS Style"
-},
-paste:{
-paste_text_desc:"Paste as Plain Text",
-paste_word_desc:"Paste from Word",
-selectall_desc:"Select All"
-},
-paste_dlg:{
-text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
-text_linebreaks:"Keep linebreaks",
-word_title:"Use CTRL+V on your keyboard to paste the text into the window."
-},
-table:{
-desc:"Inserts a new table",
-row_before_desc:"Insert row before",
-row_after_desc:"Insert row after",
-delete_row_desc:"Delete row",
-col_before_desc:"Insert column before",
-col_after_desc:"Insert column after",
-delete_col_desc:"Remove column",
-split_cells_desc:"Split merged table cells",
-merge_cells_desc:"Merge table cells",
-row_desc:"Table row properties",
-cell_desc:"Table cell properties",
-props_desc:"Table properties",
-paste_row_before_desc:"Paste table row before",
-paste_row_after_desc:"Paste table row after",
-cut_row_desc:"Cut table row",
-copy_row_desc:"Copy table row",
-del:"Delete table",
-row:"Row",
-col:"Column",
-cell:"Cell"
-},
-autosave:{
-unload_msg:"The changes you made will be lost if you navigate away from this page.",
-restore_content: "Restore auto-saved content",
-warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
-},
-fullscreen:{
-desc:"Toggle fullscreen mode"
-},
-media:{
-desc:"Insert / edit embedded media",
-edit:"Edit embedded media"
-},
-fullpage:{
-desc:"Document properties"
-},
-template:{
-desc:"Insert predefined template content"
-},
-visualchars:{
-desc:"Visual control characters on/off."
-},
-spellchecker:{
-desc:"Toggle spellchecker",
-menu:"Spellchecker settings",
-ignore_word:"Ignore word",
-ignore_words:"Ignore all",
-langs:"Languages",
-wait:"Please wait...",
-sug:"Suggestions",
-no_sug:"No suggestions",
-no_mpell:"No misspellings found."
-},
-pagebreak:{
-desc:"Insert page break."
-},
-advlist : {
- types : 'Types',
- def : 'Default',
- lower_alpha : "Lower alpha",
- lower_greek : "Lower greek",
- lower_roman : "Lower roman",
- upper_alpha : "Upper alpha",
- upper_roman : "Upper roman",
- circle : "Circle",
- disc : "Disc",
- square : "Square"
-}
-}}); \ No newline at end of file
diff --git a/content/js/ui.core-draggable-resizable-dialog.js b/content/js/ui.core-draggable-resizable-dialog.js
deleted file mode 100755
index af96b59..0000000
--- a/content/js/ui.core-draggable-resizable-dialog.js
+++ /dev/null
@@ -1,2756 +0,0 @@
-/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;jQuery.ui || (function($) {
-
-var _remove = $.fn.remove,
- isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
-
-//Helper functions and ui object
-$.ui = {
- version: "1.7.2",
-
- // $.ui.plugin is deprecated. Use the proxy pattern instead.
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set || !instance.element[0].parentNode) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
-
- contains: function(a, b) {
- return document.compareDocumentPosition
- ? a.compareDocumentPosition(b) & 16
- : a !== b && a.contains(b);
- },
-
- hasScroll: function(el, a) {
-
- //If overflow is hidden, the element might have extra content, but the user wants to hide it
- if ($(el).css('overflow') == 'hidden') { return false; }
-
- var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
- has = false;
-
- if (el[scroll] > 0) { return true; }
-
- // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
- el[scroll] = 1;
- has = (el[scroll] > 0);
- el[scroll] = 0;
- return has;
- },
-
- isOverAxis: function(x, reference, size) {
- //Determines when x coordinate is over "b" element axis
- return (x > reference) && (x < (reference + size));
- },
-
- isOver: function(y, x, top, left, height, width) {
- //Determines when x, y coordinates is over "b" element
- return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
- },
-
- keyCode: {
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
-};
-
-// WAI-ARIA normalization
-if (isFF2) {
- var attr = $.attr,
- removeAttr = $.fn.removeAttr,
- ariaNS = "http://www.w3.org/2005/07/aaa",
- ariaState = /^aria-/,
- ariaRole = /^wairole:/;
-
- $.attr = function(elem, name, value) {
- var set = value !== undefined;
-
- return (name == 'role'
- ? (set
- ? attr.call(this, elem, name, "wairole:" + value)
- : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
- : (ariaState.test(name)
- ? (set
- ? elem.setAttributeNS(ariaNS,
- name.replace(ariaState, "aaa:"), value)
- : attr.call(this, elem, name.replace(ariaState, "aaa:")))
- : attr.apply(this, arguments)));
- };
-
- $.fn.removeAttr = function(name) {
- return (ariaState.test(name)
- ? this.each(function() {
- this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
- }) : removeAttr.call(this, name));
- };
-}
-
-//jQuery plugins
-$.fn.extend({
- remove: function() {
- // Safari has a native remove event which actually removes DOM elements,
- // so we have to use triggerHandler instead of trigger (#3037).
- $("*", this).add(this).each(function() {
- $(this).triggerHandler("remove");
- });
- return _remove.apply(this, arguments );
- },
-
- enableSelection: function() {
- return this
- .attr('unselectable', 'off')
- .css('MozUserSelect', '')
- .unbind('selectstart.ui');
- },
-
- disableSelection: function() {
- return this
- .attr('unselectable', 'on')
- .css('MozUserSelect', 'none')
- .bind('selectstart.ui', function() { return false; });
- },
-
- scrollParent: function() {
- var scrollParent;
- if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- }
-
- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
- }
-});
-
-
-//Additional selectors
-$.extend($.expr[':'], {
- data: function(elem, i, match) {
- return !!$.data(elem, match[3]);
- },
-
- focusable: function(element) {
- var nodeName = element.nodeName.toLowerCase(),
- tabIndex = $.attr(element, 'tabindex');
- return (/input|select|textarea|button|object/.test(nodeName)
- ? !element.disabled
- : 'a' == nodeName || 'area' == nodeName
- ? element.href || !isNaN(tabIndex)
- : !isNaN(tabIndex))
- // the element and all of its ancestors must be visible
- // the browser may report that the area is hidden
- && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
- },
-
- tabbable: function(element) {
- var tabIndex = $.attr(element, 'tabindex');
- return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
- }
-});
-
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-function getter(namespace, plugin, method, args) {
- function getMethods(type) {
- var methods = $[namespace][plugin][type] || [];
- return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
- }
-
- var methods = getMethods('getter');
- if (args.length == 1 && typeof args[0] == 'string') {
- methods = methods.concat(getMethods('getterSetter'));
- }
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- // prevent calls to internal methods
- if (isMethodCall && options.substring(0, 1) == '_') {
- return this;
- }
-
- // handle getter methods
- if (isMethodCall && getter(namespace, name, options, args)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- // handle initialization and non-getter methods
- return this.each(function() {
- var instance = $.data(this, name);
-
- // constructor
- (!instance && !isMethodCall &&
- $.data(this, name, new $[namespace][name](this, options))._init());
-
- // method call
- (instance && isMethodCall && $.isFunction(instance[options]) &&
- instance[options].apply(instance, args));
- });
- };
-
- // create widget constructor
- $[namespace] = $[namespace] || {};
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.namespace = namespace;
- this.widgetName = name;
- this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({},
- $.widget.defaults,
- $[namespace][name].defaults,
- $.metadata && $.metadata.get(element)[name],
- options);
-
- this.element = $(element)
- .bind('setData.' + name, function(event, key, value) {
- if (event.target == element) {
- return self._setData(key, value);
- }
- })
- .bind('getData.' + name, function(event, key) {
- if (event.target == element) {
- return self._getData(key);
- }
- })
- .bind('remove', function() {
- return self.destroy();
- });
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-
- // TODO: merge getter and getterSetter properties from widget prototype
- // and plugin prototype
- $[namespace][name].getterSetter = 'option';
-};
-
-$.widget.prototype = {
- _init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName)
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
- .removeAttr('aria-disabled');
- },
-
- option: function(key, value) {
- var options = key,
- self = this;
-
- if (typeof key == "string") {
- if (value === undefined) {
- return this._getData(key);
- }
- options = {};
- options[key] = value;
- }
-
- $.each(options, function(key, value) {
- self._setData(key, value);
- });
- },
- _getData: function(key) {
- return this.options[key];
- },
- _setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element
- [value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled' + ' ' +
- this.namespace + '-state-disabled')
- .attr("aria-disabled", value);
- }
- },
-
- enable: function() {
- this._setData('disabled', false);
- },
- disable: function() {
- this._setData('disabled', true);
- },
-
- _trigger: function(type, event, data) {
- var callback = this.options[type],
- eventName = (type == this.widgetEventPrefix
- ? type : this.widgetEventPrefix + type);
-
- event = $.Event(event);
- event.type = eventName;
-
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if (event.originalEvent) {
- for (var i = $.event.props.length, prop; i;) {
- prop = $.event.props[--i];
- event[prop] = event.originalEvent[prop];
- }
- }
-
- this.element.trigger(event, data);
-
- return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
- || event.isDefaultPrevented());
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- _mouseInit: function() {
- var self = this;
-
- this.element
- .bind('mousedown.'+this.widgetName, function(event) {
- return self._mouseDown(event);
- })
- .bind('click.'+this.widgetName, function(event) {
- if(self._preventClickEvent) {
- self._preventClickEvent = false;
- event.stopImmediatePropagation();
- return false;
- }
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- _mouseDown: function(event) {
- // don't let more than one widget handle mouseStart
- // TODO: figure out why we have to use originalEvent
- event.originalEvent = event.originalEvent || {};
- if (event.originalEvent.mouseHandled) { return; }
-
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this._mouseUp(event));
-
- this._mouseDownEvent = event;
-
- var self = this,
- btnIsLeft = (event.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = (this._mouseStart(event) !== false);
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(event) {
- return self._mouseMove(event);
- };
- this._mouseUpDelegate = function(event) {
- return self._mouseUp(event);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- // preventDefault() is used to prevent the selection of text here -
- // however, in Safari, this causes select boxes not to be selectable
- // anymore, so this fix is needed
- ($.browser.safari || event.preventDefault());
-
- event.originalEvent.mouseHandled = true;
- return true;
- },
-
- _mouseMove: function(event) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !event.button) {
- return this._mouseUp(event);
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted =
- (this._mouseStart(this._mouseDownEvent, event) !== false);
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
- }
-
- return !this._mouseStarted;
- },
-
- _mouseUp: function(event) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this._preventClickEvent = (event.target == this._mouseDownEvent.target);
- this._mouseStop(event);
- }
-
- return false;
- },
-
- _mouseDistanceMet: function(event) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
- ) >= this.options.distance
- );
- },
-
- _mouseDelayMet: function(event) {
- return this.mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function(event) {},
- _mouseDrag: function(event) {},
- _mouseStop: function(event) {},
- _mouseCapture: function(event) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
-/*
- * jQuery UI Draggable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
- this.element[0].style.position = 'relative';
-
- (this.options.addClasses && this.element.addClass("ui-draggable"));
- (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
-
- this._mouseInit();
-
- },
-
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element
- .removeData("draggable")
- .unbind(".draggable")
- .removeClass("ui-draggable"
- + " ui-draggable-dragging"
- + " ui-draggable-disabled");
- this._mouseDestroy();
- },
-
- _mouseCapture: function(event) {
-
- var o = this.options;
-
- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
- return false;
-
- //Quit if we're not on a valid handle
- this.handle = this._getHandle(event);
- if (!this.handle)
- return false;
-
- return true;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options;
-
- //Create and append the visible helper
- this.helper = this._createHelper(event);
-
- //Cache the helper size
- this._cacheHelperProportions();
-
- //If ddmanager is used for droppables, set the global draggable
- if($.ui.ddmanager)
- $.ui.ddmanager.current = this;
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- //Cache the margins of the original element
- this._cacheMargins();
-
- //Store the helper's css position
- this.cssPosition = this.helper.css("position");
- this.scrollParent = this.helper.scrollParent();
-
- //The element's absolute position on the page minus margins
- this.offset = this.element.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- $.extend(this.offset, {
- click: { //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
- });
-
- //Generate the original position
- this.originalPosition = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
-
- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
- if(o.cursorAt)
- this._adjustOffsetFromHelper(o.cursorAt);
-
- //Set a containment if given in the options
- if(o.containment)
- this._setContainment();
-
- //Call plugins and callbacks
- this._trigger("start", event);
-
- //Recache the helper size
- this._cacheHelperProportions();
-
- //Prepare the droppable offsets
- if ($.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
-
- this.helper.addClass("ui-draggable-dragging");
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
-
- _mouseDrag: function(event, noPropagation) {
-
- //Compute the helpers position
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- if (!noPropagation) {
- var ui = this._uiHash();
- this._trigger('drag', event, ui);
- this.position = ui.position;
- }
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- //If we are using droppables, inform the manager about the drop
- var dropped = false;
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- dropped = $.ui.ddmanager.drop(this, event);
-
- //if a drop comes from outside (a sortable)
- if(this.dropped) {
- dropped = this.dropped;
- this.dropped = false;
- }
-
- if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
- self._trigger("stop", event);
- self._clear();
- });
- } else {
- this._trigger("stop", event);
- this._clear();
- }
-
- return false;
- },
-
- _getHandle: function(event) {
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
- $(this.options.handle, this.element)
- .find("*")
- .andSelf()
- .each(function() {
- if(this == event.target) handle = true;
- });
-
- return handle;
-
- },
-
- _createHelper: function(event) {
-
- var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
-
- if(!helper.parents('body').length)
- helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
-
- if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
- helper.css("position", "absolute");
-
- return helper;
-
- },
-
- _adjustOffsetFromHelper: function(obj) {
- if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
- if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
- if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- },
-
- _getParentOffset: function() {
-
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset();
-
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
- po = { top: 0, left: 0 };
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- },
-
- _getRelativeOffset: function() {
-
- if(this.cssPosition == "relative") {
- var p = this.element.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return { top: 0, left: 0 };
- }
-
- },
-
- _cacheMargins: function() {
- this.margins = {
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
- },
-
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
-
- _setContainment: function() {
-
- var o = this.options;
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
- var ce = $(o.containment)[0]; if(!ce) return;
- var co = $(o.containment).offset();
- var over = ($(ce).css("overflow") != 'hidden');
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
- ];
- } else if(o.containment.constructor == Array) {
- this.containment = o.containment;
- }
-
- },
-
- _convertPositionTo: function(d, pos) {
-
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- return {
- top: (
- pos.top // The absolute mouse position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
- ),
- left: (
- pos.left // The absolute mouse position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
- )
- };
-
- },
-
- _generatePosition: function(event) {
-
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- // This is another very weird special case that only happens for relative elements:
- // 1. If the css position is relative
- // 2. and the scroll parent is the document or similar to the offset parent
- // we have to refresh the relative offset during the scroll so there are no jumps
- if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
- this.offset.relative = this._getRelativeOffset();
- }
-
- var pageX = event.pageX;
- var pageY = event.pageY;
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
- if(this.containment) {
- if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
- if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
- if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
- if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
- }
-
- if(o.grid) {
- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
- pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
- pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- }
-
- return {
- top: (
- pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
- ),
- left: (
- pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
- )
- };
-
- },
-
- _clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
-
- _trigger: function(type, event, ui) {
- ui = ui || this._uiHash();
- $.ui.plugin.call(this, type, [event, ui]);
- if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
- return $.widget.prototype._trigger.call(this, type, event, ui);
- },
-
- plugins: {},
-
- _uiHash: function(event) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs, //deprecated
- offset: this.positionAbs
- };
- }
-
-}));
-
-$.extend($.ui.draggable, {
- version: "1.7.2",
- eventPrefix: "drag",
- defaults: {
- addClasses: true,
- appendTo: "parent",
- axis: false,
- cancel: ":input,option",
- connectToSortable: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- delay: 0,
- distance: 1,
- grid: false,
- handle: false,
- helper: "original",
- iframeFix: false,
- opacity: false,
- refreshPositions: false,
- revert: false,
- revertDuration: 500,
- scope: "default",
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: false,
- snapMode: "both",
- snapTolerance: 20,
- stack: false,
- zIndex: false
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options,
- uiSortable = $.extend({}, ui, { item: inst.element });
- inst.sortables = [];
- $(o.connectToSortable).each(function() {
- var sortable = $.data(this, 'sortable');
- if (sortable && !sortable.options.disabled) {
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
- sortable._trigger("activate", event, uiSortable);
- }
- });
-
- },
- stop: function(event, ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable"),
- uiSortable = $.extend({}, ui, { item: inst.element });
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
-
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
-
- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
- if(this.shouldRevert) this.instance.options.revert = true;
-
- //Trigger the stop of the sortable
- this.instance._mouseStop(event);
-
- this.instance.options.helper = this.instance.options._helper;
-
- //If the helper has been the original item, restore properties in the sortable
- if(inst.options.helper == 'original')
- this.instance.currentItem.css({ top: 'auto', left: 'auto' });
-
- } else {
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
- this.instance._trigger("deactivate", event, uiSortable);
- }
-
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
- var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
- var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
- var itemHeight = o.height, itemWidth = o.width;
- var itemTop = o.top, itemLeft = o.left;
-
- return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
- };
-
- $.each(inst.sortables, function(i) {
-
- //Copy over some variables to allow calling the sortable's native _intersectsWith
- this.instance.positionAbs = inst.positionAbs;
- this.instance.helperProportions = inst.helperProportions;
- this.instance.offset.click = inst.offset.click;
-
- if(this.instance._intersectsWith(this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
-
- this.instance.isOver = 1;
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- event.target = this.instance.currentItem[0];
- this.instance._mouseCapture(event, true);
- this.instance._mouseStart(event, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst._trigger("toSortable", event);
- inst.dropped = this.instance.element; //draggable revert needs that
- //hack so receive/update callbacks work (mostly)
- inst.currentItem = inst.element;
- this.instance.fromOutside = inst;
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance._mouseDrag(event);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
-
- //Prevent reverting on this forced stop
- this.instance.options.revert = false;
-
- // The out event needs to be triggered independently
- this.instance._trigger('out', event, this.instance._uiHash(this.instance));
-
- this.instance._mouseStop(event, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst._trigger("fromSortable", event);
- inst.dropped = false; //draggable revert needs that
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(event, ui) {
- var t = $('body'), o = $(this).data('draggable').options;
- if (t.css("cursor")) o._cursor = t.css("cursor");
- t.css("cursor", o.cursor);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if (o._cursor) $('body').css("cursor", o._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(event, ui) {
- var o = $(this).data('draggable').options;
- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(event, ui) {
- $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data('draggable').options;
- if(t.css("opacity")) o._opacity = t.css("opacity");
- t.css('opacity', o.opacity);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if(o._opacity) $(ui.helper).css('opacity', o._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(event, ui) {
- var i = $(this).data("draggable");
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
- },
- drag: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options, scrolled = false;
-
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
-
- if(!o.axis || o.axis != 'x') {
- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
- else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
- }
-
- if(!o.axis || o.axis != 'y') {
- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
- else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
- }
-
- } else {
-
- if(!o.axis || o.axis != 'x') {
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(!o.axis || o.axis != 'y') {
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(i, event);
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options;
- i.snapElements = [];
-
- $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != i.element[0]) i.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options;
- var d = o.snapTolerance;
-
- var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
- if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = false;
- continue;
- }
-
- if(o.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= d;
- var bs = Math.abs(b - y1) <= d;
- var ls = Math.abs(l - x2) <= d;
- var rs = Math.abs(r - x1) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
- }
-
- var first = (ts || bs || ls || rs);
-
- if(o.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= d;
- var bs = Math.abs(b - y2) <= d;
- var ls = Math.abs(l - x1) <= d;
- var rs = Math.abs(r - x2) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
- }
-
- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
-
- };
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(event, ui) {
-
- var o = $(this).data("draggable").options;
-
- var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = o.stack.min + i;
- });
-
- this[0].style.zIndex = o.stack.min + group.length;
-
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("draggable").options;
- if(t.css("zIndex")) o._zIndex = t.css("zIndex");
- t.css('zIndex', o.zIndex);
- },
- stop: function(event, ui) {
- var o = $(this).data("draggable").options;
- if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Resizable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.resizable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- var self = this, o = this.options;
- this.element.addClass("ui-resizable");
-
- $.extend(this, {
- _aspectRatio: !!(o.aspectRatio),
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
- });
-
- //Wrap the element if it cannot hold child nodes
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
-
- //Opera fix for relative positioning
- if (/relative/.test(this.element.css('position')) && $.browser.opera)
- this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- this.element.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
- position: this.element.css('position'),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css('top'),
- left: this.element.css('left')
- })
- );
-
- //Overwrite the original this.element
- this.element = this.element.parent().data(
- "resizable", this.element.data('resizable')
- );
-
- this.elementIsWrapper = true;
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- this.originalResizeStyle = this.originalElement.css('resize');
- this.originalElement.css('resize', 'none');
-
- //Push the actual element to our proportionallyResize internal array
- this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
-
- // avoid IE jump (hard set the margin)
- this.originalElement.css({ margin: this.originalElement.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
-
- }
-
- this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
- if(this.handles.constructor == String) {
-
- if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
- var n = this.handles.split(","); this.handles = {};
-
- for(var i = 0; i < n.length; i++) {
-
- var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
- var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
-
- // increase zIndex of sw, se, ne, nw axis
- //TODO : this modifies original option
- if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
-
- //TODO : What's going on here?
- if ('se' == handle) {
- axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
- };
-
- //Insert into internal handles object and append to element
- this.handles[handle] = '.ui-resizable-'+handle;
- this.element.append(axis);
- }
-
- }
-
- this._renderAxis = function(target) {
-
- target = target || this.element;
-
- for(var i in this.handles) {
-
- if(this.handles[i].constructor == String)
- this.handles[i] = $(this.handles[i], this.element).show();
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(this.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
-
- }
-
- //TODO: What's that good for? There's not anything to be executed left
- if(!$(this.handles[i]).length)
- continue;
-
- }
- };
-
- //TODO: make renderAxis a prototype function
- this._renderAxis(this.element);
-
- this._handles = $('.ui-resizable-handle', this.element)
- .disableSelection();
-
- //Matching axis name
- this._handles.mouseover(function() {
- if (!self.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- this._handles.hide();
- $(this.element)
- .addClass("ui-resizable-autohide")
- .hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- self._handles.show();
- },
- function(){
- if (!self.resizing) {
- $(this).addClass("ui-resizable-autohide");
- self._handles.hide();
- }
- });
- }
-
- //Initialize the mouse interaction
- this._mouseInit();
-
- },
-
- destroy: function() {
-
- this._mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- //TODO: Unwrap at same DOM position
- if (this.elementIsWrapper) {
- _destroy(this.element);
- var wrapper = this.element;
- wrapper.parent().append(
- this.originalElement.css({
- position: wrapper.css('position'),
- width: wrapper.outerWidth(),
- height: wrapper.outerHeight(),
- top: wrapper.css('top'),
- left: wrapper.css('left')
- })
- ).end().remove();
- }
-
- this.originalElement.css('resize', this.originalResizeStyle);
- _destroy(this.originalElement);
-
- },
-
- _mouseCapture: function(event) {
-
- var handle = false;
- for(var i in this.handles) {
- if($(this.handles[i])[0] == event.target) handle = true;
- }
-
- return this.options.disabled || !!handle;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options, iniPos = this.element.position(), el = this.element;
-
- this.resizing = true;
- this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix for http://dev.jquery.com/ticket/1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
- el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && (/relative/).test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- if (o.containment) {
- curleft += $(o.containment).scrollLeft() || 0;
- curtop += $(o.containment).scrollTop() || 0;
- }
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
-
- //Aspect Ratio
- this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
-
- var cursor = $('.ui-resizable-' + this.axis).css('cursor');
- $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
-
- el.addClass("ui-resizable-resizing");
- this._propagate("start", event);
- return true;
- },
-
- _mouseDrag: function(event) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (this._aspectRatio || event.shiftKey)
- data = this._updateRatio(data, event);
-
- data = this._respectSize(data, event);
-
- // plugins callbacks need to be called first
- this._propagate("resize", event);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!this._helper && this._proportionallyResizeElements.length)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this._trigger('resize', event, this.ui());
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- this.resizing = false;
- var o = this.options, self = this;
-
- if(this._helper) {
- var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- self.helper.height(self.size.height);
- self.helper.width(self.size.width);
-
- if (this._helper && !o.animate) this._proportionallyResize();
- }
-
- $('body').css('cursor', 'auto');
-
- this.element.removeClass("ui-resizable-resizing");
-
- this._propagate("stop", event);
-
- if (this._helper) this.helper.remove();
- return false;
-
- },
-
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (isNumber(data.left)) this.position.left = data.left;
- if (isNumber(data.top)) this.position.top = data.top;
- if (isNumber(data.height)) this.size.height = data.height;
- if (isNumber(data.width)) this.size.width = data.width;
- },
-
- _updateRatio: function(data, event) {
-
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height * this.aspectRatio);
- else if (data.width) data.height = (csize.width / this.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
-
- _respectSize: function(data, event) {
-
- var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
-
- _proportionallyResize: function() {
-
- var o = this.options;
- if (!this._proportionallyResizeElements.length) return;
- var element = this.helper || this.element;
-
- for (var i=0; i < this._proportionallyResizeElements.length; i++) {
-
- var prel = this._proportionallyResizeElements[i];
-
- if (!this.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- this.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
-
- if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
- continue;
-
- prel.css({
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
- });
-
- };
-
- },
-
- _renderProxy: function() {
-
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(this._helper) {
-
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset TODO: This seems broken
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(this._helper).css({
- width: this.element.outerWidth() + pxyoffset,
- height: this.element.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex //TODO: Don't modify option
- });
-
- this.helper
- .appendTo("body")
- .disableSelection();
-
- } else {
- this.helper = this.element;
- }
-
- },
-
- _change: {
- e: function(event, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(event, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- sw: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- },
- ne: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- nw: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- }
- },
-
- _propagate: function(n, event) {
- $.ui.plugin.call(this, n, [event, this.ui()]);
- (n != "resize" && this._trigger(n, event, this.ui()));
- },
-
- plugins: {},
-
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- }
-
-}));
-
-$.extend($.ui.resizable, {
- version: "1.7.2",
- eventPrefix: "resize",
- defaults: {
- alsoResize: false,
- animate: false,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: false,
- autoHide: false,
- cancel: ":input,option",
- containment: false,
- delay: 0,
- distance: 1,
- ghost: false,
- grid: false,
- handles: "e,s,se",
- helper: false,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- zIndex: 1000
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options;
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera) {
- self._revertToRelativePosition = true;
- el.css({ position: 'absolute', top: 'auto', left: 'auto' });
- }
-
- el.css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable");
-
- //Opera fixing relative position
- if (self._revertToRelativePosition && $.browser.opera) {
- self._revertToRelativePosition = false;
- el.css({ position: 'relative' });
- }
-
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options;
-
- var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration,
- easing: o.animateEasing,
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self._propagate("resize", event);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
- // i'm a node, so compute top, left, right, bottom
- else {
- var element = $(ce), p = [];
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
-
- self.containerOffset = element.offset();
- self.containerPosition = element.position();
- self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options,
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
-
- if (cp.left < (self._helper ? co.left : 0)) {
- self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width / o.aspectRatio;
- self.position.left = o.helper ? co.left : 0;
- }
-
- if (cp.top < (self._helper ? co.top : 0)) {
- self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height * o.aspectRatio;
- self.position.top = self._helper ? co.top : 0;
- }
-
- self.offset.left = self.parentData.left+self.position.left;
- self.offset.top = self.parentData.top+self.position.top;
-
- var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
- hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
-
- var isParent = self.containerElement.get(0) == self.element.parent().get(0),
- isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
-
- if(isParent && isOffsetRelative) woset -= self.parentData.left;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width / self.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height * self.aspectRatio;
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
-
- if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- if (self._helper && !o.animate && (/static/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options, cs = self.size;
-
- self.ghost = self.originalElement.clone();
- self.ghost
- .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
- .addClass('ui-resizable-ghost')
- .addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-var num = function(v) {
- return parseInt(v, 10) || 0;
-};
-
-var isNumber = function(value) {
- return !isNaN(parseInt(value, 10));
-};
-
-})(jQuery);
-/*
- * jQuery UI Dialog 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
- },
-
- uiDialogClasses =
- 'ui-dialog ' +
- 'ui-widget ' +
- 'ui-widget-content ' +
- 'ui-corner-all ';
-
-$.widget("ui.dialog", {
-
- _init: function() {
- this.originalTitle = this.element.attr('title');
-
- var self = this,
- options = this.options,
-
- title = options.title || this.originalTitle || '&nbsp;',
- titleId = $.ui.dialog.getTitleId(this.element),
-
- uiDialog = (this.uiDialog = $('<div/>'))
- .appendTo(document.body)
- .hide()
- .addClass(uiDialogClasses + options.dialogClass)
- .css({
- position: 'absolute',
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
- (options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event));
- })
- .attr({
- role: 'dialog',
- 'aria-labelledby': titleId
- })
- .mousedown(function(event) {
- self.moveToTop(false, event);
- }),
-
- uiDialogContent = this.element
- .show()
- .removeAttr('title')
- .addClass(
- 'ui-dialog-content ' +
- 'ui-widget-content')
- .appendTo(uiDialog),
-
- uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>'))
- .addClass(
- 'ui-dialog-titlebar ' +
- 'ui-widget-header ' +
- 'ui-corner-all ' +
- 'ui-helper-clearfix'
- )
- .prependTo(uiDialog),
-
- uiDialogTitlebarClose = $('<a href="#"/>')
- .addClass(
- 'ui-dialog-titlebar-close ' +
- 'ui-corner-all'
- )
- .attr('role', 'button')
- .hover(
- function() {
- uiDialogTitlebarClose.addClass('ui-state-hover');
- },
- function() {
- uiDialogTitlebarClose.removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- uiDialogTitlebarClose.addClass('ui-state-focus');
- })
- .blur(function() {
- uiDialogTitlebarClose.removeClass('ui-state-focus');
- })
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function(event) {
- self.close(event);
- return false;
- })
- .appendTo(uiDialogTitlebar),
-
- uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
- .addClass(
- 'ui-icon ' +
- 'ui-icon-closethick'
- )
- .text(options.closeText)
- .appendTo(uiDialogTitlebarClose),
-
- uiDialogTitle = $('<span/>')
- .addClass('ui-dialog-title')
- .attr('id', titleId)
- .html(title)
- .prependTo(uiDialogTitlebar);
-
- uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
-
- (options.draggable && $.fn.draggable && this._makeDraggable());
- (options.resizable && $.fn.resizable && this._makeResizable());
-
- this._createButtons(options.buttons);
- this._isOpen = false;
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
-
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content ui-widget-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
-
- (this.originalTitle && this.element.attr('title', this.originalTitle));
- },
-
- close: function(event) {
- var self = this;
-
- if (false === self._trigger('beforeclose', event)) {
- return;
- }
-
- (self.overlay && self.overlay.destroy());
- self.uiDialog.unbind('keypress.ui-dialog');
-
- (self.options.hide
- ? self.uiDialog.hide(self.options.hide, function() {
- self._trigger('close', event);
- })
- : self.uiDialog.hide() && self._trigger('close', event));
-
- $.ui.dialog.overlay.resize();
-
- self._isOpen = false;
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- if (self.options.modal) {
- var maxZ = 0;
- $('.ui-dialog').each(function() {
- if (this != self.uiDialog[0]) {
- maxZ = Math.max(maxZ, $(this).css('z-index'));
- }
- });
- $.ui.dialog.maxZ = maxZ;
- }
- },
-
- isOpen: function() {
- return this._isOpen;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force, event) {
-
- if ((this.options.modal && !force)
- || (!this.options.stack && !this.options.modal)) {
- return this._trigger('focus', event);
- }
-
- if (this.options.zIndex > $.ui.dialog.maxZ) {
- $.ui.dialog.maxZ = this.options.zIndex;
- }
- (this.overlay && this.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = ++$.ui.dialog.maxZ));
-
- //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
- // http://ui.jquery.com/bugs/ticket/3193
- var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') };
- this.uiDialog.css('z-index', ++$.ui.dialog.maxZ);
- this.element.attr(saveScroll);
- this._trigger('focus', event);
- },
-
- open: function() {
- if (this._isOpen) { return; }
-
- var options = this.options,
- uiDialog = this.uiDialog;
-
- this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
- (uiDialog.next().length && uiDialog.appendTo('body'));
- this._size();
- this._position(options.position);
- uiDialog.show(options.show);
- this.moveToTop(true);
-
- // prevent tabbing out of modal dialogs
- (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) {
- if (event.keyCode != $.ui.keyCode.TAB) {
- return;
- }
-
- var tabbables = $(':tabbable', this),
- first = tabbables.filter(':first')[0],
- last = tabbables.filter(':last')[0];
-
- if (event.target == last && !event.shiftKey) {
- setTimeout(function() {
- first.focus();
- }, 1);
- } else if (event.target == first && event.shiftKey) {
- setTimeout(function() {
- last.focus();
- }, 1);
- }
- }));
-
- // set focus to the first tabbable element in the content area or the first button
- // if there are no tabbable elements, set focus on the dialog itself
- $([])
- .add(uiDialog.find('.ui-dialog-content :tabbable:first'))
- .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
- .add(uiDialog)
- .filter(':first')
- .focus();
-
- this._trigger('open');
- this._isOpen = true;
- },
-
- _createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = $('<div></div>')
- .addClass(
- 'ui-dialog-buttonpane ' +
- 'ui-widget-content ' +
- 'ui-helper-clearfix'
- );
-
- // if we already have a button pane, remove it
- this.uiDialog.find('.ui-dialog-buttonpane').remove();
-
- (typeof buttons == 'object' && buttons !== null &&
- $.each(buttons, function() { return !(hasButtons = true); }));
- if (hasButtons) {
- $.each(buttons, function(name, fn) {
- $('<button type="button"></button>')
- .addClass(
- 'ui-state-default ' +
- 'ui-corner-all'
- )
- .text(name)
- .click(function() { fn.apply(self.element[0], arguments); })
- .hover(
- function() {
- $(this).addClass('ui-state-hover');
- },
- function() {
- $(this).removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- $(this).addClass('ui-state-focus');
- })
- .blur(function() {
- $(this).removeClass('ui-state-focus');
- })
- .appendTo(uiDialogButtonPane);
- });
- uiDialogButtonPane.appendTo(this.uiDialog);
- }
- },
-
- _makeDraggable: function() {
- var self = this,
- options = this.options,
- heightBeforeDrag;
-
- this.uiDialog.draggable({
- cancel: '.ui-dialog-content',
- handle: '.ui-dialog-titlebar',
- containment: 'document',
- start: function() {
- heightBeforeDrag = options.height;
- $(this).height($(this).height()).addClass("ui-dialog-dragging");
- (options.dragStart && options.dragStart.apply(self.element[0], arguments));
- },
- drag: function() {
- (options.drag && options.drag.apply(self.element[0], arguments));
- },
- stop: function() {
- $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
- (options.dragStop && options.dragStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- },
-
- _makeResizable: function(handles) {
- handles = (handles === undefined ? this.options.resizable : handles);
- var self = this,
- options = this.options,
- resizeHandles = typeof handles == 'string'
- ? handles
- : 'n,e,s,w,se,sw,ne,nw';
-
- this.uiDialog.resizable({
- cancel: '.ui-dialog-content',
- alsoResize: this.element,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: function() {
- $(this).addClass("ui-dialog-resizing");
- (options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
- },
- resize: function() {
- (options.resize && options.resize.apply(self.element[0], arguments));
- },
- handles: resizeHandles,
- stop: function() {
- $(this).removeClass("ui-dialog-resizing");
- options.height = $(this).height();
- options.width = $(this).width();
- (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- })
- .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
- },
-
- _position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += wnd.width() - this.uiDialog.outerWidth();
- break;
- default:
- case 'center':
- pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += wnd.height() - this.uiDialog.outerHeight();
- break;
- default:
- case 'middle':
- pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2;
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- _setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "buttons":
- this._createButtons(value);
- break;
- case "closeText":
- this.uiDialogTitlebarCloseText.text(value);
- break;
- case "dialogClass":
- this.uiDialog
- .removeClass(this.options.dialogClass)
- .addClass(uiDialogClasses + value);
- break;
- case "draggable":
- (value
- ? this._makeDraggable()
- : this.uiDialog.draggable('destroy'));
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this._position(value);
- break;
- case "resizable":
- var uiDialog = this.uiDialog,
- isResizable = this.uiDialog.is(':data(resizable)');
-
- // currently resizable, becoming non-resizable
- (isResizable && !value && uiDialog.resizable('destroy'));
-
- // currently resizable, changing handles
- (isResizable && typeof value == 'string' &&
- uiDialog.resizable('option', 'handles', value));
-
- // currently non-resizable, becoming resizable
- (isResizable || this._makeResizable(value));
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).html(value || '&nbsp;');
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
-
- $.widget.prototype._setData.apply(this, arguments);
- },
-
- _size: function() {
- /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
- * divs will both have width and height set, so we need to reset them
- */
- var options = this.options;
-
- // reset content sizing
- this.element.css({
- height: 0,
- minHeight: 0,
- width: 'auto'
- });
-
- // reset wrapper sizing
- // determine the height of all the non-content elements
- var nonContentHeight = this.uiDialog.css({
- height: 'auto',
- width: options.width
- })
- .height();
-
- this.element
- .css({
- minHeight: Math.max(options.minHeight - nonContentHeight, 0),
- height: options.height == 'auto'
- ? 'auto'
- : Math.max(options.height - nonContentHeight, 0)
- });
- }
-});
-
-$.extend($.ui.dialog, {
- version: "1.7.2",
- defaults: {
- autoOpen: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- dialogClass: '',
- draggable: true,
- hide: null,
- height: 'auto',
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: 'center',
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
- },
-
- getter: 'isOpen',
-
- uuid: 0,
- maxZ: 0,
-
- getTitleId: function($el) {
- return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid);
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- maxZ: 0,
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(event) { return event + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- // handle $(el).dialog().dialog('close') (see #4065)
- if ($.ui.dialog.overlay.instances.length) {
- $(document).bind($.ui.dialog.overlay.events, function(event) {
- var dialogZ = $(event.target).parents('.ui-dialog').css('zIndex') || 0;
- return (dialogZ > $.ui.dialog.overlay.maxZ);
- });
- }
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(event) {
- (dialog.options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event));
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div></div>').appendTo(document.body)
- .addClass('ui-widget-overlay').css({
- width: this.width(),
- height: this.height()
- });
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- var maxZ = 0;
- $.each(this.instances, function() {
- maxZ = Math.max(maxZ, this.css('z-index'));
- });
- this.maxZ = maxZ;
- },
-
- height: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
diff --git a/content/js/ui.core.js b/content/js/ui.core.js
deleted file mode 100755
index 5493e0a..0000000
--- a/content/js/ui.core.js
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
-;jQuery.ui || (function($) {
-
-var _remove = $.fn.remove,
- isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
-
-//Helper functions and ui object
-$.ui = {
- version: "1.7.2",
-
- // $.ui.plugin is deprecated. Use the proxy pattern instead.
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set || !instance.element[0].parentNode) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
-
- contains: function(a, b) {
- return document.compareDocumentPosition
- ? a.compareDocumentPosition(b) & 16
- : a !== b && a.contains(b);
- },
-
- hasScroll: function(el, a) {
-
- //If overflow is hidden, the element might have extra content, but the user wants to hide it
- if ($(el).css('overflow') == 'hidden') { return false; }
-
- var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
- has = false;
-
- if (el[scroll] > 0) { return true; }
-
- // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
- el[scroll] = 1;
- has = (el[scroll] > 0);
- el[scroll] = 0;
- return has;
- },
-
- isOverAxis: function(x, reference, size) {
- //Determines when x coordinate is over "b" element axis
- return (x > reference) && (x < (reference + size));
- },
-
- isOver: function(y, x, top, left, height, width) {
- //Determines when x, y coordinates is over "b" element
- return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
- },
-
- keyCode: {
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38
- }
-};
-
-// WAI-ARIA normalization
-if (isFF2) {
- var attr = $.attr,
- removeAttr = $.fn.removeAttr,
- ariaNS = "http://www.w3.org/2005/07/aaa",
- ariaState = /^aria-/,
- ariaRole = /^wairole:/;
-
- $.attr = function(elem, name, value) {
- var set = value !== undefined;
-
- return (name == 'role'
- ? (set
- ? attr.call(this, elem, name, "wairole:" + value)
- : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
- : (ariaState.test(name)
- ? (set
- ? elem.setAttributeNS(ariaNS,
- name.replace(ariaState, "aaa:"), value)
- : attr.call(this, elem, name.replace(ariaState, "aaa:")))
- : attr.apply(this, arguments)));
- };
-
- $.fn.removeAttr = function(name) {
- return (ariaState.test(name)
- ? this.each(function() {
- this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
- }) : removeAttr.call(this, name));
- };
-}
-
-//jQuery plugins
-$.fn.extend({
- remove: function() {
- // Safari has a native remove event which actually removes DOM elements,
- // so we have to use triggerHandler instead of trigger (#3037).
- $("*", this).add(this).each(function() {
- $(this).triggerHandler("remove");
- });
- return _remove.apply(this, arguments );
- },
-
- enableSelection: function() {
- return this
- .attr('unselectable', 'off')
- .css('MozUserSelect', '')
- .unbind('selectstart.ui');
- },
-
- disableSelection: function() {
- return this
- .attr('unselectable', 'on')
- .css('MozUserSelect', 'none')
- .bind('selectstart.ui', function() { return false; });
- },
-
- scrollParent: function() {
- var scrollParent;
- if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- }
-
- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
- }
-});
-
-
-//Additional selectors
-$.extend($.expr[':'], {
- data: function(elem, i, match) {
- return !!$.data(elem, match[3]);
- },
-
- focusable: function(element) {
- var nodeName = element.nodeName.toLowerCase(),
- tabIndex = $.attr(element, 'tabindex');
- return (/input|select|textarea|button|object/.test(nodeName)
- ? !element.disabled
- : 'a' == nodeName || 'area' == nodeName
- ? element.href || !isNaN(tabIndex)
- : !isNaN(tabIndex))
- // the element and all of its ancestors must be visible
- // the browser may report that the area is hidden
- && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
- },
-
- tabbable: function(element) {
- var tabIndex = $.attr(element, 'tabindex');
- return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
- }
-});
-
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-function getter(namespace, plugin, method, args) {
- function getMethods(type) {
- var methods = $[namespace][plugin][type] || [];
- return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
- }
-
- var methods = getMethods('getter');
- if (args.length == 1 && typeof args[0] == 'string') {
- methods = methods.concat(getMethods('getterSetter'));
- }
- return ($.inArray(method, methods) != -1);
-}
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
-
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- // prevent calls to internal methods
- if (isMethodCall && options.substring(0, 1) == '_') {
- return this;
- }
-
- // handle getter methods
- if (isMethodCall && getter(namespace, name, options, args)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- // handle initialization and non-getter methods
- return this.each(function() {
- var instance = $.data(this, name);
-
- // constructor
- (!instance && !isMethodCall &&
- $.data(this, name, new $[namespace][name](this, options))._init());
-
- // method call
- (instance && isMethodCall && $.isFunction(instance[options]) &&
- instance[options].apply(instance, args));
- });
- };
-
- // create widget constructor
- $[namespace] = $[namespace] || {};
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.namespace = namespace;
- this.widgetName = name;
- this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
- this.widgetBaseClass = namespace + '-' + name;
-
- this.options = $.extend({},
- $.widget.defaults,
- $[namespace][name].defaults,
- $.metadata && $.metadata.get(element)[name],
- options);
-
- this.element = $(element)
- .bind('setData.' + name, function(event, key, value) {
- if (event.target == element) {
- return self._setData(key, value);
- }
- })
- .bind('getData.' + name, function(event, key) {
- if (event.target == element) {
- return self._getData(key);
- }
- })
- .bind('remove', function() {
- return self.destroy();
- });
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
-
- // TODO: merge getter and getterSetter properties from widget prototype
- // and plugin prototype
- $[namespace][name].getterSetter = 'option';
-};
-
-$.widget.prototype = {
- _init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName)
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
- .removeAttr('aria-disabled');
- },
-
- option: function(key, value) {
- var options = key,
- self = this;
-
- if (typeof key == "string") {
- if (value === undefined) {
- return this._getData(key);
- }
- options = {};
- options[key] = value;
- }
-
- $.each(options, function(key, value) {
- self._setData(key, value);
- });
- },
- _getData: function(key) {
- return this.options[key];
- },
- _setData: function(key, value) {
- this.options[key] = value;
-
- if (key == 'disabled') {
- this.element
- [value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled' + ' ' +
- this.namespace + '-state-disabled')
- .attr("aria-disabled", value);
- }
- },
-
- enable: function() {
- this._setData('disabled', false);
- },
- disable: function() {
- this._setData('disabled', true);
- },
-
- _trigger: function(type, event, data) {
- var callback = this.options[type],
- eventName = (type == this.widgetEventPrefix
- ? type : this.widgetEventPrefix + type);
-
- event = $.Event(event);
- event.type = eventName;
-
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if (event.originalEvent) {
- for (var i = $.event.props.length, prop; i;) {
- prop = $.event.props[--i];
- event[prop] = event.originalEvent[prop];
- }
- }
-
- this.element.trigger(event, data);
-
- return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
- || event.isDefaultPrevented());
- }
-};
-
-$.widget.defaults = {
- disabled: false
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- _mouseInit: function() {
- var self = this;
-
- this.element
- .bind('mousedown.'+this.widgetName, function(event) {
- return self._mouseDown(event);
- })
- .bind('click.'+this.widgetName, function(event) {
- if(self._preventClickEvent) {
- self._preventClickEvent = false;
- event.stopImmediatePropagation();
- return false;
- }
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- _mouseDown: function(event) {
- // don't let more than one widget handle mouseStart
- // TODO: figure out why we have to use originalEvent
- event.originalEvent = event.originalEvent || {};
- if (event.originalEvent.mouseHandled) { return; }
-
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this._mouseUp(event));
-
- this._mouseDownEvent = event;
-
- var self = this,
- btnIsLeft = (event.which == 1),
- elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = (this._mouseStart(event) !== false);
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(event) {
- return self._mouseMove(event);
- };
- this._mouseUpDelegate = function(event) {
- return self._mouseUp(event);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- // preventDefault() is used to prevent the selection of text here -
- // however, in Safari, this causes select boxes not to be selectable
- // anymore, so this fix is needed
- ($.browser.safari || event.preventDefault());
-
- event.originalEvent.mouseHandled = true;
- return true;
- },
-
- _mouseMove: function(event) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !event.button) {
- return this._mouseUp(event);
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted =
- (this._mouseStart(this._mouseDownEvent, event) !== false);
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
- }
-
- return !this._mouseStarted;
- },
-
- _mouseUp: function(event) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this._preventClickEvent = (event.target == this._mouseDownEvent.target);
- this._mouseStop(event);
- }
-
- return false;
- },
-
- _mouseDistanceMet: function(event) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
- ) >= this.options.distance
- );
- },
-
- _mouseDelayMet: function(event) {
- return this.mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function(event) {},
- _mouseDrag: function(event) {},
- _mouseStop: function(event) {},
- _mouseCapture: function(event) { return true; }
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 1,
- delay: 0
-};
-
-})(jQuery);
diff --git a/content/js/ui.dialog.js b/content/js/ui.dialog.js
deleted file mode 100755
index fdd5b26..0000000
--- a/content/js/ui.dialog.js
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * jQuery UI Dialog 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
-(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
- },
-
- uiDialogClasses =
- 'ui-dialog ' +
- 'ui-widget ' +
- 'ui-widget-content ' +
- 'ui-corner-all ';
-
-$.widget("ui.dialog", {
-
- _init: function() {
- this.originalTitle = this.element.attr('title');
-
- var self = this,
- options = this.options,
-
- title = options.title || this.originalTitle || '&nbsp;',
- titleId = $.ui.dialog.getTitleId(this.element),
-
- uiDialog = (this.uiDialog = $('<div/>'))
- .appendTo(document.body)
- .hide()
- .addClass(uiDialogClasses + options.dialogClass)
- .css({
- position: 'absolute',
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
- (options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event));
- })
- .attr({
- role: 'dialog',
- 'aria-labelledby': titleId
- })
- .mousedown(function(event) {
- self.moveToTop(false, event);
- }),
-
- uiDialogContent = this.element
- .show()
- .removeAttr('title')
- .addClass(
- 'ui-dialog-content ' +
- 'ui-widget-content')
- .appendTo(uiDialog),
-
- uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>'))
- .addClass(
- 'ui-dialog-titlebar ' +
- 'ui-widget-header ' +
- 'ui-corner-all ' +
- 'ui-helper-clearfix'
- )
- .prependTo(uiDialog),
-
- uiDialogTitlebarClose = $('<a href="#"/>')
- .addClass(
- 'ui-dialog-titlebar-close ' +
- 'ui-corner-all'
- )
- .attr('role', 'button')
- .hover(
- function() {
- uiDialogTitlebarClose.addClass('ui-state-hover');
- },
- function() {
- uiDialogTitlebarClose.removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- uiDialogTitlebarClose.addClass('ui-state-focus');
- })
- .blur(function() {
- uiDialogTitlebarClose.removeClass('ui-state-focus');
- })
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function(event) {
- self.close(event);
- return false;
- })
- .appendTo(uiDialogTitlebar),
-
- uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
- .addClass(
- 'ui-icon ' +
- 'ui-icon-closethick'
- )
- .text(options.closeText)
- .appendTo(uiDialogTitlebarClose),
-
- uiDialogTitle = $('<span/>')
- .addClass('ui-dialog-title')
- .attr('id', titleId)
- .html(title)
- .prependTo(uiDialogTitlebar);
-
- uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
-
- (options.draggable && $.fn.draggable && this._makeDraggable());
- (options.resizable && $.fn.resizable && this._makeResizable());
-
- this._createButtons(options.buttons);
- this._isOpen = false;
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
-
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content ui-widget-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
-
- (this.originalTitle && this.element.attr('title', this.originalTitle));
- },
-
- close: function(event) {
- var self = this;
-
- if (false === self._trigger('beforeclose', event)) {
- return;
- }
-
- (self.overlay && self.overlay.destroy());
- self.uiDialog.unbind('keypress.ui-dialog');
-
- (self.options.hide
- ? self.uiDialog.hide(self.options.hide, function() {
- self._trigger('close', event);
- })
- : self.uiDialog.hide() && self._trigger('close', event));
-
- $.ui.dialog.overlay.resize();
-
- self._isOpen = false;
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- if (self.options.modal) {
- var maxZ = 0;
- $('.ui-dialog').each(function() {
- if (this != self.uiDialog[0]) {
- maxZ = Math.max(maxZ, $(this).css('z-index'));
- }
- });
- $.ui.dialog.maxZ = maxZ;
- }
- },
-
- isOpen: function() {
- return this._isOpen;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force, event) {
-
- if ((this.options.modal && !force)
- || (!this.options.stack && !this.options.modal)) {
- return this._trigger('focus', event);
- }
-
- if (this.options.zIndex > $.ui.dialog.maxZ) {
- $.ui.dialog.maxZ = this.options.zIndex;
- }
- (this.overlay && this.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = ++$.ui.dialog.maxZ));
-
- //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
- // http://ui.jquery.com/bugs/ticket/3193
- var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') };
- this.uiDialog.css('z-index', ++$.ui.dialog.maxZ);
- this.element.attr(saveScroll);
- this._trigger('focus', event);
- },
-
- open: function() {
- if (this._isOpen) { return; }
-
- var options = this.options,
- uiDialog = this.uiDialog;
-
- this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
- (uiDialog.next().length && uiDialog.appendTo('body'));
- this._size();
- this._position(options.position);
- uiDialog.show(options.show);
- this.moveToTop(true);
-
- // prevent tabbing out of modal dialogs
- (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) {
- if (event.keyCode != $.ui.keyCode.TAB) {
- return;
- }
-
- var tabbables = $(':tabbable', this),
- first = tabbables.filter(':first')[0],
- last = tabbables.filter(':last')[0];
-
- if (event.target == last && !event.shiftKey) {
- setTimeout(function() {
- first.focus();
- }, 1);
- } else if (event.target == first && event.shiftKey) {
- setTimeout(function() {
- last.focus();
- }, 1);
- }
- }));
-
- // set focus to the first tabbable element in the content area or the first button
- // if there are no tabbable elements, set focus on the dialog itself
- $([])
- .add(uiDialog.find('.ui-dialog-content :tabbable:first'))
- .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
- .add(uiDialog)
- .filter(':first')
- .focus();
-
- this._trigger('open');
- this._isOpen = true;
- },
-
- _createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = $('<div></div>')
- .addClass(
- 'ui-dialog-buttonpane ' +
- 'ui-widget-content ' +
- 'ui-helper-clearfix'
- );
-
- // if we already have a button pane, remove it
- this.uiDialog.find('.ui-dialog-buttonpane').remove();
-
- (typeof buttons == 'object' && buttons !== null &&
- $.each(buttons, function() { return !(hasButtons = true); }));
- if (hasButtons) {
- $.each(buttons, function(name, fn) {
- $('<button type="button"></button>')
- .addClass(
- 'ui-state-default ' +
- 'ui-corner-all'
- )
- .text(name)
- .click(function() { fn.apply(self.element[0], arguments); })
- .hover(
- function() {
- $(this).addClass('ui-state-hover');
- },
- function() {
- $(this).removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- $(this).addClass('ui-state-focus');
- })
- .blur(function() {
- $(this).removeClass('ui-state-focus');
- })
- .appendTo(uiDialogButtonPane);
- });
- uiDialogButtonPane.appendTo(this.uiDialog);
- }
- },
-
- _makeDraggable: function() {
- var self = this,
- options = this.options,
- heightBeforeDrag;
-
- this.uiDialog.draggable({
- cancel: '.ui-dialog-content',
- handle: '.ui-dialog-titlebar',
- containment: 'document',
- start: function() {
- heightBeforeDrag = options.height;
- $(this).height($(this).height()).addClass("ui-dialog-dragging");
- (options.dragStart && options.dragStart.apply(self.element[0], arguments));
- },
- drag: function() {
- (options.drag && options.drag.apply(self.element[0], arguments));
- },
- stop: function() {
- $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
- (options.dragStop && options.dragStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- },
-
- _makeResizable: function(handles) {
- handles = (handles === undefined ? this.options.resizable : handles);
- var self = this,
- options = this.options,
- resizeHandles = typeof handles == 'string'
- ? handles
- : 'n,e,s,w,se,sw,ne,nw';
-
- this.uiDialog.resizable({
- cancel: '.ui-dialog-content',
- alsoResize: this.element,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: function() {
- $(this).addClass("ui-dialog-resizing");
- (options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
- },
- resize: function() {
- (options.resize && options.resize.apply(self.element[0], arguments));
- },
- handles: resizeHandles,
- stop: function() {
- $(this).removeClass("ui-dialog-resizing");
- options.height = $(this).height();
- options.width = $(this).width();
- (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
- $.ui.dialog.overlay.resize();
- }
- })
- .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
- },
-
- _position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += wnd.width() - this.uiDialog.outerWidth();
- break;
- default:
- case 'center':
- pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += wnd.height() - this.uiDialog.outerHeight();
- break;
- default:
- case 'middle':
- pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2;
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- _setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "buttons":
- this._createButtons(value);
- break;
- case "closeText":
- this.uiDialogTitlebarCloseText.text(value);
- break;
- case "dialogClass":
- this.uiDialog
- .removeClass(this.options.dialogClass)
- .addClass(uiDialogClasses + value);
- break;
- case "draggable":
- (value
- ? this._makeDraggable()
- : this.uiDialog.draggable('destroy'));
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this._position(value);
- break;
- case "resizable":
- var uiDialog = this.uiDialog,
- isResizable = this.uiDialog.is(':data(resizable)');
-
- // currently resizable, becoming non-resizable
- (isResizable && !value && uiDialog.resizable('destroy'));
-
- // currently resizable, changing handles
- (isResizable && typeof value == 'string' &&
- uiDialog.resizable('option', 'handles', value));
-
- // currently non-resizable, becoming resizable
- (isResizable || this._makeResizable(value));
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).html(value || '&nbsp;');
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
-
- $.widget.prototype._setData.apply(this, arguments);
- },
-
- _size: function() {
- /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
- * divs will both have width and height set, so we need to reset them
- */
- var options = this.options;
-
- // reset content sizing
- this.element.css({
- height: 0,
- minHeight: 0,
- width: 'auto'
- });
-
- // reset wrapper sizing
- // determine the height of all the non-content elements
- var nonContentHeight = this.uiDialog.css({
- height: 'auto',
- width: options.width
- })
- .height();
-
- this.element
- .css({
- minHeight: Math.max(options.minHeight - nonContentHeight, 0),
- height: options.height == 'auto'
- ? 'auto'
- : Math.max(options.height - nonContentHeight, 0)
- });
- }
-});
-
-$.extend($.ui.dialog, {
- version: "1.7.2",
- defaults: {
- autoOpen: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- dialogClass: '',
- draggable: true,
- hide: null,
- height: 'auto',
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: 'center',
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
- },
-
- getter: 'isOpen',
-
- uuid: 0,
- maxZ: 0,
-
- getTitleId: function($el) {
- return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid);
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- maxZ: 0,
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(event) { return event + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- // handle $(el).dialog().dialog('close') (see #4065)
- if ($.ui.dialog.overlay.instances.length) {
- $(document).bind($.ui.dialog.overlay.events, function(event) {
- var dialogZ = $(event.target).parents('.ui-dialog').css('zIndex') || 0;
- return (dialogZ > $.ui.dialog.overlay.maxZ);
- });
- }
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(event) {
- (dialog.options.closeOnEscape && event.keyCode
- && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event));
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div></div>').appendTo(document.body)
- .addClass('ui-widget-overlay').css({
- width: this.width(),
- height: this.height()
- });
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- var maxZ = 0;
- $.each(this.instances, function() {
- maxZ = Math.max(maxZ, this.css('z-index'));
- });
- this.maxZ = maxZ;
- },
-
- height: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
diff --git a/content/js/ui.draggable.js b/content/js/ui.draggable.js
deleted file mode 100755
index 0402f0e..0000000
--- a/content/js/ui.draggable.js
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
- * jQuery UI Draggable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
- this.element[0].style.position = 'relative';
-
- (this.options.addClasses && this.element.addClass("ui-draggable"));
- (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
-
- this._mouseInit();
-
- },
-
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element
- .removeData("draggable")
- .unbind(".draggable")
- .removeClass("ui-draggable"
- + " ui-draggable-dragging"
- + " ui-draggable-disabled");
- this._mouseDestroy();
- },
-
- _mouseCapture: function(event) {
-
- var o = this.options;
-
- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
- return false;
-
- //Quit if we're not on a valid handle
- this.handle = this._getHandle(event);
- if (!this.handle)
- return false;
-
- return true;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options;
-
- //Create and append the visible helper
- this.helper = this._createHelper(event);
-
- //Cache the helper size
- this._cacheHelperProportions();
-
- //If ddmanager is used for droppables, set the global draggable
- if($.ui.ddmanager)
- $.ui.ddmanager.current = this;
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- //Cache the margins of the original element
- this._cacheMargins();
-
- //Store the helper's css position
- this.cssPosition = this.helper.css("position");
- this.scrollParent = this.helper.scrollParent();
-
- //The element's absolute position on the page minus margins
- this.offset = this.element.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- $.extend(this.offset, {
- click: { //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
- });
-
- //Generate the original position
- this.originalPosition = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
-
- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
- if(o.cursorAt)
- this._adjustOffsetFromHelper(o.cursorAt);
-
- //Set a containment if given in the options
- if(o.containment)
- this._setContainment();
-
- //Call plugins and callbacks
- this._trigger("start", event);
-
- //Recache the helper size
- this._cacheHelperProportions();
-
- //Prepare the droppable offsets
- if ($.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
-
- this.helper.addClass("ui-draggable-dragging");
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
-
- _mouseDrag: function(event, noPropagation) {
-
- //Compute the helpers position
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- if (!noPropagation) {
- var ui = this._uiHash();
- this._trigger('drag', event, ui);
- this.position = ui.position;
- }
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- //If we are using droppables, inform the manager about the drop
- var dropped = false;
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- dropped = $.ui.ddmanager.drop(this, event);
-
- //if a drop comes from outside (a sortable)
- if(this.dropped) {
- dropped = this.dropped;
- this.dropped = false;
- }
-
- if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
- self._trigger("stop", event);
- self._clear();
- });
- } else {
- this._trigger("stop", event);
- this._clear();
- }
-
- return false;
- },
-
- _getHandle: function(event) {
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
- $(this.options.handle, this.element)
- .find("*")
- .andSelf()
- .each(function() {
- if(this == event.target) handle = true;
- });
-
- return handle;
-
- },
-
- _createHelper: function(event) {
-
- var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
-
- if(!helper.parents('body').length)
- helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
-
- if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
- helper.css("position", "absolute");
-
- return helper;
-
- },
-
- _adjustOffsetFromHelper: function(obj) {
- if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
- if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
- if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- },
-
- _getParentOffset: function() {
-
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset();
-
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
- po = { top: 0, left: 0 };
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- },
-
- _getRelativeOffset: function() {
-
- if(this.cssPosition == "relative") {
- var p = this.element.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return { top: 0, left: 0 };
- }
-
- },
-
- _cacheMargins: function() {
- this.margins = {
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
- },
-
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
-
- _setContainment: function() {
-
- var o = this.options;
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
- var ce = $(o.containment)[0]; if(!ce) return;
- var co = $(o.containment).offset();
- var over = ($(ce).css("overflow") != 'hidden');
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
- ];
- } else if(o.containment.constructor == Array) {
- this.containment = o.containment;
- }
-
- },
-
- _convertPositionTo: function(d, pos) {
-
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- return {
- top: (
- pos.top // The absolute mouse position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
- ),
- left: (
- pos.left // The absolute mouse position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
- )
- };
-
- },
-
- _generatePosition: function(event) {
-
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- // This is another very weird special case that only happens for relative elements:
- // 1. If the css position is relative
- // 2. and the scroll parent is the document or similar to the offset parent
- // we have to refresh the relative offset during the scroll so there are no jumps
- if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
- this.offset.relative = this._getRelativeOffset();
- }
-
- var pageX = event.pageX;
- var pageY = event.pageY;
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
- if(this.containment) {
- if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
- if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
- if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
- if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
- }
-
- if(o.grid) {
- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
- pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
- pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- }
-
- return {
- top: (
- pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
- ),
- left: (
- pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
- )
- };
-
- },
-
- _clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
-
- _trigger: function(type, event, ui) {
- ui = ui || this._uiHash();
- $.ui.plugin.call(this, type, [event, ui]);
- if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
- return $.widget.prototype._trigger.call(this, type, event, ui);
- },
-
- plugins: {},
-
- _uiHash: function(event) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs, //deprecated
- offset: this.positionAbs
- };
- }
-
-}));
-
-$.extend($.ui.draggable, {
- version: "1.7.2",
- eventPrefix: "drag",
- defaults: {
- addClasses: true,
- appendTo: "parent",
- axis: false,
- cancel: ":input,option",
- connectToSortable: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- delay: 0,
- distance: 1,
- grid: false,
- handle: false,
- helper: "original",
- iframeFix: false,
- opacity: false,
- refreshPositions: false,
- revert: false,
- revertDuration: 500,
- scope: "default",
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: false,
- snapMode: "both",
- snapTolerance: 20,
- stack: false,
- zIndex: false
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options,
- uiSortable = $.extend({}, ui, { item: inst.element });
- inst.sortables = [];
- $(o.connectToSortable).each(function() {
- var sortable = $.data(this, 'sortable');
- if (sortable && !sortable.options.disabled) {
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
- sortable._trigger("activate", event, uiSortable);
- }
- });
-
- },
- stop: function(event, ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable"),
- uiSortable = $.extend({}, ui, { item: inst.element });
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
-
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
-
- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
- if(this.shouldRevert) this.instance.options.revert = true;
-
- //Trigger the stop of the sortable
- this.instance._mouseStop(event);
-
- this.instance.options.helper = this.instance.options._helper;
-
- //If the helper has been the original item, restore properties in the sortable
- if(inst.options.helper == 'original')
- this.instance.currentItem.css({ top: 'auto', left: 'auto' });
-
- } else {
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
- this.instance._trigger("deactivate", event, uiSortable);
- }
-
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
- var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
- var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
- var itemHeight = o.height, itemWidth = o.width;
- var itemTop = o.top, itemLeft = o.left;
-
- return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
- };
-
- $.each(inst.sortables, function(i) {
-
- //Copy over some variables to allow calling the sortable's native _intersectsWith
- this.instance.positionAbs = inst.positionAbs;
- this.instance.helperProportions = inst.helperProportions;
- this.instance.offset.click = inst.offset.click;
-
- if(this.instance._intersectsWith(this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
-
- this.instance.isOver = 1;
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- event.target = this.instance.currentItem[0];
- this.instance._mouseCapture(event, true);
- this.instance._mouseStart(event, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst._trigger("toSortable", event);
- inst.dropped = this.instance.element; //draggable revert needs that
- //hack so receive/update callbacks work (mostly)
- inst.currentItem = inst.element;
- this.instance.fromOutside = inst;
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance._mouseDrag(event);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
-
- //Prevent reverting on this forced stop
- this.instance.options.revert = false;
-
- // The out event needs to be triggered independently
- this.instance._trigger('out', event, this.instance._uiHash(this.instance));
-
- this.instance._mouseStop(event, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst._trigger("fromSortable", event);
- inst.dropped = false; //draggable revert needs that
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(event, ui) {
- var t = $('body'), o = $(this).data('draggable').options;
- if (t.css("cursor")) o._cursor = t.css("cursor");
- t.css("cursor", o.cursor);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if (o._cursor) $('body').css("cursor", o._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(event, ui) {
- var o = $(this).data('draggable').options;
- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(event, ui) {
- $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data('draggable').options;
- if(t.css("opacity")) o._opacity = t.css("opacity");
- t.css('opacity', o.opacity);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if(o._opacity) $(ui.helper).css('opacity', o._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(event, ui) {
- var i = $(this).data("draggable");
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
- },
- drag: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options, scrolled = false;
-
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
-
- if(!o.axis || o.axis != 'x') {
- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
- else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
- }
-
- if(!o.axis || o.axis != 'y') {
- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
- else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
- }
-
- } else {
-
- if(!o.axis || o.axis != 'x') {
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(!o.axis || o.axis != 'y') {
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(i, event);
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options;
- i.snapElements = [];
-
- $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != i.element[0]) i.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options;
- var d = o.snapTolerance;
-
- var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
- if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = false;
- continue;
- }
-
- if(o.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= d;
- var bs = Math.abs(b - y1) <= d;
- var ls = Math.abs(l - x2) <= d;
- var rs = Math.abs(r - x1) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
- }
-
- var first = (ts || bs || ls || rs);
-
- if(o.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= d;
- var bs = Math.abs(b - y2) <= d;
- var ls = Math.abs(l - x1) <= d;
- var rs = Math.abs(r - x2) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
- }
-
- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
-
- };
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(event, ui) {
-
- var o = $(this).data("draggable").options;
-
- var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = o.stack.min + i;
- });
-
- this[0].style.zIndex = o.stack.min + group.length;
-
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("draggable").options;
- if(t.css("zIndex")) o._zIndex = t.css("zIndex");
- t.css('zIndex', o.zIndex);
- },
- stop: function(event, ui) {
- var o = $(this).data("draggable").options;
- if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
- }
-});
-
-})(jQuery);
diff --git a/content/js/ui.droppable.js b/content/js/ui.droppable.js
deleted file mode 100755
index 8e7be33..0000000
--- a/content/js/ui.droppable.js
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * jQuery UI Droppable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- */
-(function($) {
-
-$.widget("ui.droppable", {
-
- _init: function() {
-
- var o = this.options, accept = o.accept;
- this.isover = 0; this.isout = 1;
-
- this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
- return d.is(accept);
- };
-
- //Store the droppable's proportions
- this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
-
- // Add the reference and positions to the manager
- $.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
- $.ui.ddmanager.droppables[this.options.scope].push(this);
-
- (this.options.addClasses && this.element.addClass("ui-droppable"));
-
- },
-
- destroy: function() {
- var drop = $.ui.ddmanager.droppables[this.options.scope];
- for ( var i = 0; i < drop.length; i++ )
- if ( drop[i] == this )
- drop.splice(i, 1);
-
- this.element
- .removeClass("ui-droppable ui-droppable-disabled")
- .removeData("droppable")
- .unbind(".droppable");
- },
-
- _setData: function(key, value) {
-
- if(key == 'accept') {
- this.options.accept = value && $.isFunction(value) ? value : function(d) {
- return d.is(value);
- };
- } else {
- $.widget.prototype._setData.apply(this, arguments);
- }
-
- },
-
- _activate: function(event) {
- var draggable = $.ui.ddmanager.current;
- if(this.options.activeClass) this.element.addClass(this.options.activeClass);
- (draggable && this._trigger('activate', event, this.ui(draggable)));
- },
-
- _deactivate: function(event) {
- var draggable = $.ui.ddmanager.current;
- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
- (draggable && this._trigger('deactivate', event, this.ui(draggable)));
- },
-
- _over: function(event) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
- this._trigger('over', event, this.ui(draggable));
- }
-
- },
-
- _out: function(event) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
- this._trigger('out', event, this.ui(draggable));
- }
-
- },
-
- _drop: function(event,custom) {
-
- var draggable = custom || $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
-
- var childrenIntersection = false;
- this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
- var inst = $.data(this, 'droppable');
- if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
- childrenIntersection = true; return false;
- }
- });
- if(childrenIntersection) return false;
-
- if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
- this._trigger('drop', event, this.ui(draggable));
- return this.element;
- }
-
- return false;
-
- },
-
- ui: function(c) {
- return {
- draggable: (c.currentItem || c.element),
- helper: c.helper,
- position: c.position,
- absolutePosition: c.positionAbs, //deprecated
- offset: c.positionAbs
- };
- }
-
-});
-
-$.extend($.ui.droppable, {
- version: "1.7.2",
- eventPrefix: 'drop',
- defaults: {
- accept: '*',
- activeClass: false,
- addClasses: true,
- greedy: false,
- hoverClass: false,
- scope: 'default',
- tolerance: 'intersect'
- }
-});
-
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
-
- if (!droppable.offset) return false;
-
- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
- var l = droppable.offset.left, r = l + droppable.proportions.width,
- t = droppable.offset.top, b = t + droppable.proportions.height;
-
- switch (toleranceMode) {
- case 'fit':
- return (l < x1 && x2 < r
- && t < y1 && y2 < b);
- break;
- case 'intersect':
- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
- && x2 - (draggable.helperProportions.width / 2) < r // Left Half
- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
- break;
- case 'pointer':
- var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
- draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
- isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
- return isOver;
- break;
- case 'touch':
- return (
- (y1 >= t && y1 <= b) || // Top edge touching
- (y2 >= t && y2 <= b) || // Bottom edge touching
- (y1 < t && y2 > b) // Surrounded vertically
- ) && (
- (x1 >= l && x1 <= r) || // Left edge touching
- (x2 >= l && x2 <= r) || // Right edge touching
- (x1 < l && x2 > r) // Surrounded horizontally
- );
- break;
- default:
- return false;
- break;
- }
-
-};
-
-/*
- This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
- current: null,
- droppables: { 'default': [] },
- prepareOffsets: function(t, event) {
-
- var m = $.ui.ddmanager.droppables[t.options.scope];
- var type = event ? event.type : null; // workaround for #2317
- var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
-
- droppablesLoop: for (var i = 0; i < m.length; i++) {
-
- if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
- for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
- m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
-
- m[i].offset = m[i].element.offset();
- m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
-
- if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
-
- }
-
- },
- drop: function(draggable, event) {
-
- var dropped = false;
- $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
-
- if(!this.options) return;
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
- dropped = this._drop.call(this, event);
-
- if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- this.isout = 1; this.isover = 0;
- this._deactivate.call(this, event);
- }
-
- });
- return dropped;
-
- },
- drag: function(draggable, event) {
-
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
-
- //Run through all droppables and check their positions based on specific tolerance options
-
- $.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
-
- if(this.options.disabled || this.greedyChild || !this.visible) return;
- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
-
- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
- if(!c) return;
-
- var parentInstance;
- if (this.options.greedy) {
- var parent = this.element.parents(':data(droppable):eq(0)');
- if (parent.length) {
- parentInstance = $.data(parent[0], 'droppable');
- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
- }
- }
-
- // we just moved into a greedy child
- if (parentInstance && c == 'isover') {
- parentInstance['isover'] = 0;
- parentInstance['isout'] = 1;
- parentInstance._out.call(parentInstance, event);
- }
-
- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
- this[c == "isover" ? "_over" : "_out"].call(this, event);
-
- // we just moved out of a greedy child
- if (parentInstance && c == 'isout') {
- parentInstance['isout'] = 0;
- parentInstance['isover'] = 1;
- parentInstance._over.call(parentInstance, event);
- }
- });
-
- }
-};
-
-})(jQuery);
diff --git a/content/js/ui.feedback.js b/content/js/ui.feedback.js
deleted file mode 100755
index 1bd650f..0000000
--- a/content/js/ui.feedback.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @fileOverview a scoreboard widget
-* @author Bryan Berry <bryan@olenepal.org>
-* uses MIT License
-*/
-
-
-
-(function($){
-
- // This is a dummy function, just here as placeholder to
- // to make the jsdoc tool happy
- /** @name $.ui.feedback
- * @namespace Feedback widget
- */
- $.ui.feedback = function(){};
-
- $.widget('ui.feedback',
- /** @lends $.ui.feedback.prototype */
- {
- /** Displays the correct icon in the center of the screen
- * and plays the sound "correct" if loaded
- */
- correct: function(){
- var $correct = this.$correct.css('display','block');
- setTimeout ( function() {
- $correct.fadeOut(500);
- }, 500);
- if (Karma && Karma.audio && Karma.audio.correct){
- Karma.audio.correct.play();
- }
-
- },
- /** Displays the incorrect icon in the center of the screen
- * and plays the sound "incorrect" if loaded
- */
- incorrect: function(){
-
- var $incorrect = this.$incorrect.css('display','block');
- setTimeout ( function() {
- $incorrect.fadeOut(500);
- }, 500);
-
- //this.$incorrect.css('display','block').fadeOut(3000);
- if (Karma && Karma.audio && Karma.audio.incorrect){
- Karma.audio.incorrect.play();
- }
-
- },
- /** Display a happy face and text that says "You win!"
- *
- */
- win: function(){
- this.$win.show();
- this.$overlay.show();
- },
- /** Display an unhappy face and text that says "You lose!"
- *
- */
- lose: function(){
- this.$lose.show();
- this.$overlay.show();
- },
- _init : function(){
- var self = this;
-
- this.element
- .addClass('ui-feedback')
- .css({position:'absolute',
- top: '40%', left: '40%'});
-
- this.$correct = $('<div></div>')
- .addClass('ui-feedback-correct')
- .appendTo(this.element);
-
- this.$incorrect = $('<div></div>')
- .addClass('ui-feedback-incorrect')
- .appendTo(this.element);
-
- this.$win = $("<div class='ui-feedback-over'>" +
- "<div class='ui-feedback-win'></div>" +
- "<div class='ui-feedback-txt'>You win!" +
- "</div></div>")
- .click(
- function(){
- self.$win.hide();
- self.$overlay.hide();
- }
- )
- .appendTo(this.element);
-
- this.$lose = $("<div class='ui-feedback-over'>" +
- "<div class='ui-feedback-lose'></div>" +
- "<div class='ui-feedback-txt'>You lose!" +
- "</div></div>")
- .click(
- function(){
- self.$lose.hide();
- self.$overlay.hide();
- }
- )
- .appendTo(this.element);
-
- this.$overlay = $('<div></div>')
- .addClass('ui-feedback-overlay')
- .appendTo($('body'));
-
-
-
- $('body')
- .bind('feedbackCorrect', function(){
- self.correct();
- })
- .bind('feedbackIncorrect', function(){
- self.incorrect();
- });
-
- },
- /** Removes the feedback widget and all related data from the DOM */
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.feedback.getter = [];
-
- /** Default settings for the feedback widget
- * @namespace Default settings for the feedback widget
- * @extends $.ui.feedback
- */
- $.ui.feedback.defaults = {
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/js/ui.kFooter.js b/content/js/ui.kFooter.js
deleted file mode 100755
index d5ede51..0000000
--- a/content/js/ui.kFooter.js
+++ /dev/null
@@ -1,369 +0,0 @@
-/**
-* @fileOverview a footer widget
-* @author Bryan Berry <bryan@olenepal.org>
-* uses MIT License
-*/
-
-
-
-(function($){
-
- // This is a dummy function, just here as placeholder to
- // to make the jsdoc tool happy
- /** @name $.ui.kFooter
- * @namespace kFooter widget
- * @example Emits the event kFooterWinGame when the maxScore is reached <br />
- * Emits the event kFooterRestart when game restarted <br />
- * Start button emits kFooterStart event when clicked <br />
- * Restart button emits kFooterRestart event when clicked <br />
- * Pause button emits the kFooterPause event when clicked <br />
- */
- $.ui.kFooter = function(){};
-
- $.widget('ui.kFooter',
- /** @lends $.ui.kFooter.prototype */
- {
- /** Gets the current score
- * @returns {Number} current score
- */
- getScore : function(){
- return this._getData('score');
- },
- /** Sets the current score
- * @param {Number} newScore new score
- */
- setScore : function(newScore){
- this._setData('score', parseInt(newScore));
- this._refresh();
- },
- /** Gets the current total
- * @returns {Number} current total
- */
- getTotal : function(){
- return this._getData('total');
- },
- /** Sets the current total
- * @param {Number} newTotal new total
- */
- setTotal : function(newTotal){
- this._setData('total', parseInt(newTotal));
- this._refresh();
- },
- /**
- * Resets the score and total to initial values and triggers
- * the "kFooterRestart" event
- */
- restart : function(){
- this.element.trigger('kFooterRestart');
- this._setData('score', this._getData('initialScore'));
- this._setData('total', this._getData('initialTotal'));
- this._refresh();
- },
- /** Increments the score by 1 or by the supplied numeric argument
- * @param {Number} [val] increment value
- */
- inc : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') + incVal);
- this._refresh();
- if(this._getData('winScore') === this._getData('score')){
- this.element.trigger('kFooterWinGame');
- }
- },
- /** Increments the total by 1 or by the supplied numeric argument
- * @param {Number} [val] increment value
- */
- incTotal : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') + incVal);
- this._refresh();
- },
- /** Decrements the score by 1 or by the supplied numeric argument
- * @param {Number} [val] decrement value
- */
- dec : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') - decVal);
- this._refresh();
- },
- /** Decrements the total by 1 or by the supplied numeric argument
- * @param {Number} [val] decrement value
- */
- decTotal : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') - decVal);
- this._refresh();
- },
- /** Start the timer, defaults to 0:00 if no arguments supplied
- * @param {Number} [minutes] value for minutes, default to 0
- * @param {Number} [seconds] value for seconds, default to 0
- */
- startTimer : function(minutes, seconds){
- var timerRunning = this._getData('timerRunning')|| false;
-
- if (this._$timer && timerRunning === false){
- var mins = minutes || 0;
- var secs = seconds || 0;
- var timerId = null;
- var self = this;
-
-
- this._setData('mins', mins);
- this._setData('secs', secs);
-
- var addLeadingZero = function(num){
- if(''.concat(num).length === 1){
- return "0".concat(num);
- } else {
- return num;
- }
-
- };
-
- var increaseTimer = function(){
- if (self._getData('timerRunning') === false){
- return;
- }
-
- var s = self._getData('secs') + 1;
- var m = null;
- var timerId = null;
-
- if (s < 60) {
- self._setData('secs', s);
- self._$timerSecs.text(self._n(addLeadingZero(s)));
- } else {
- s = 0;
- m = self._getData('mins') + 1;
- self._$timerSecs.text(self._n(addLeadingZero(s)));
- self._$timerMins.text(self._n(addLeadingZero(m)));
- self._setData('secs', s);
- self._setData('mins', m);
- }
-
- timerId = setTimeout(increaseTimer, 1000);
- self._setData('timerId', timerId);
-
- };
-
- timerId = setTimeout(increaseTimer , 1000);
-
- this._setData('timerRunning', true);
- this._setData('timerId', timerId);
- }
- },
- /** Stop the timer
- */
- stopTimer : function(){
- this._setData('timerRunning', false);
- },
- _c : function(val){
- if($.i18n){
- return $._c('$.ui.kFooter', val);
- }
- return val;
- },
- _n : function(val, loc){
- if ($.i18n){
- return $._n(val, loc);
- }
- return val;
- },
- _init : function(){
-
- var divDisplay = "inline";
- var score = this.options.score;
- var total = this.options.total;
- var self = this;
-
- var options = $.extend({}, $.ui.kFooter.defaults, this.options);
-
- this._setData('initialScore', parseInt(options.score));
- this._setData('initialTotal', parseInt(options.total));
- this._setData('score', parseInt(options.score));
- this._setData('total', parseInt(options.total));
- this._setData('winScore', parseInt(options.winningScore));
- this._setData('locale', options.locale);
-
-
- this.element.addClass('ui-widget ui-widget-content ' +
- ' ui-kFooter');
-
-
- var $kFooter = $("<ul></ul>");
-
-
- if(options.scoreboard === true){
-
- var $scoreboard = $("<li class='left'>" + this._c("Score") +
- "</li>" + "<li class='left'>" +
- "<span id='kFooterScore' class='ui-corner-all number'>" +
- this._n(score) + "</span></li>" +
- "<li class='left'>" + this._c("Total") + "</li>" +
- "<li class='left'><span id='kFooterTotal' " +
- "class='ui-corner-all number'>" +
- this._n(total) + "</span></li>")
- .appendTo($kFooter);
-
- this._score = $('#kFooterScore', $scoreboard);
- this._total = $('#kFooterTotal', $scoreboard);
-
- }
-
- if(options.timer === true){
- this._$timer = $("<li class='left'>" + this._c("Timer") +
- "</li>" +
- "<li class='left'><span id='kFooterMins'" +
- "class='ui-corner-all" +
- " number timer'>" + this._n("00") +
- "</span></li>" +
- "<li class='left'><span id='kFooterSecs'" +
- "class='ui-corner-all " +
- "number timer'>"+ this._n("00") +
- "</span></li>")
- .appendTo($kFooter);
-
- this._$timerMins = $('#kFooterMins', this._$timer);
- this._$timerSecs = $('#kFooterSecs', this._$timer);
- }
-
- //if options.checkAnswerBtn === true
-
- if (options.restartButton === true){
- var $restartButton = $("<li class='right'><button " +
- "class='ui-corner-all ui-state-default'>" +
- "<span class='ui-icon ui-icon-arrowrefresh-1-w'>" +
- "</span>" +
- "<span class='text left'>" +
- this._c('Play Again') +
- "</span></button></li>")
- .click(function(){
- self.startTimer();
- self.restart();
- })
- .appendTo($kFooter);
- }
-
- if (options.pauseButton === true){
- var $pauseButton = $("<li class='right'><button " +
- "class='ui-corner-all ui-state-default'>" +
- "<span class='ui-icon ui-icon-pause'>" +
- "</span>" +
- "<span class='text left'>" + this._c('Pause') +
- "</span></button></li>")
- .click(function(){
- self.stopTimer();
- self.element.trigger('kFooterPause');
- })
- .appendTo($kFooter);
- }
-
- if (options.startButton === true){
- var $startButton = $("<li class='right'><button " +
- "class='ui-corner-all ui-state-default'>" +
- "<span class='ui-icon ui-icon-play'>" +
- "</span>" +
- "<span class='text left'>" + this._c('Start') +
- "</span></button></li>")
- .click(function(){
- self.startTimer();
- self.element.trigger('kFooterStart');
- })
- .appendTo($kFooter);
- }
-
- $('button', $kFooter).hover(
- function(){
- $(this).addClass("ui-state-hover");
- },
- function(){
- $(this).removeClass("ui-state-hover");
- });
-
-
- // Check if any html w/in this.element, if so wrap it in <li> </li>
- // and add to $kFooter later
- var $userHtml = this.element
- .children()
- .appendTo($kFooter);
-
-
- $userHtml.wrap('<li class="left"></li>');
-
- //get rid of userHtml
- this.element.empty();
-
- this.element.append($kFooter);
-
- },
- _refresh : function(){
- this._score.text(this._n(this._getData('score')));
- this._total.text(this._n(this._getData('total')));
- },
- /** Removes the kFooter widget and all related data from the DOM */
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.kFooter.getter = ['getScore', 'getTotal', '_n', '_' ];
-
- $.ui.kFooter.i18n = {};
-
-
- /** Default settings for the kFooter widget
- * @namespace Default settings for the kFooter widget
- * @extends $.ui.kFooter
- */
- $.ui.kFooter.defaults = {
- /** Initial score
- * @type Number
- * @default 0
- */
- score: 0,
- /** Initial total
- * @type Number
- * @default 0
- */
- total: 0,
- /** The score that will win the game
- * @type Number
- * @default 0
- */
- winningScore: 0,
- /** Default locale, valid options are "en" and "ne"
- * @type String
- * @default "en"
- */
- locale: "ne",
- /** Display the scoreboard
- * @type boolean
- * @default true
- */
- scoreboard: true,
- /** Display the Start Button
- * @type boolean
- * @default false
- */
- startButton: false,
- /** Display the Retart Button
- * @type boolean
- * @default true
- */
- restartButton: true,
- /** Display the Pause Button
- * @type boolean
- * @default false
- */
- pauseButton: false,
- /** Display the timer
- * @type boolean
- * @default false
- */
- timer: false
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/js/ui.kHeader.js b/content/js/ui.kHeader.js
deleted file mode 100755
index 966c85a..0000000
--- a/content/js/ui.kHeader.js
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
-* @fileOverview a Header widget
-* @author Bryan Berry <bryan@olenepal.org>
-* uses MIT License
-*/
-
-
-
-(function($){
-
- // This is a dummy function, just here as placeholder to
- // to make the jsdoc tool happy
- /** @name $.ui.kHeader
- * @namespace kHeader widget
- * @example
- */
- $.ui.kHeader = function(){};
-
- $.widget('ui.kHeader',
- /** @lends $.ui.kHeader.prototype */
- { _c : function(val){
- if($.i18n){
- return $._c('$.ui.kHeader', val);
- }
- return val;
- },
- _n : function(val, loc){
- if ($.i18n){
- return $._n(val, loc);
- }
- return val;
- },
-
- _init : function(){
- var options = $.extend({}, $.ui.kHeader.defaults, this.options);
-
- this.element.addClass('ui-widget ui-widget-content');
-
- var $kHeader = $("<ul></ul>");
-
- var backLink = "#";
- var urlParams = window.location.search.slice(1).split('&');
- if (urlParams){
- backLink = urlParams[0].split('=')[1];
- }
-
- var $backBtn = $("<li class='left'> <a href='" + backLink +
- "' class='kHeader-btn kHeader-back'></a></li>")
- .appendTo($kHeader);
-
- var $lessonTitle = $("<li class='left kHeader-title'>" +
- "<span>" + options.title +
- "</span></li>")
- .appendTo($kHeader);
-
-
-
- if (options.lessonPlan || options.teacherNote){
-
- var $dropDownArrow = $("<span class='kHeader-kDoc right'>" +
- "</span>")
- .appendTo($lessonTitle);
-
- var $dropDownArea = $("<div class='drop-down'></div>");
-
- if (options.lessonPlan){
- $("<div>" +
- "<a href='./kDoc.html?back=index.html&doc=lessonPlan'>" +
- this._c("Lesson Plan") + "</a></div>")
- .appendTo($dropDownArea);
- }
-
- if (options.teachersNote){
- $("<div>" +
- "<a href='./kDoc.html?back=index.html&doc=teachersNote'>" +
- this._c("Teacher's Note") + "</a></div>")
- .appendTo($dropDownArea);
- }
-
- $dropDownArea.appendTo($dropDownArrow);
-
- $dropDownArrow.hover(
- function(){
- $dropDownArea.show();
- },
- function(){
- $dropDownArea.hide();
- }
- );
-
- }
-
- if(options.zoom === true){
-
- var iframeScale = 1.0;
- var translateY = 0;
- var getIframeStyle = function(){
- return window.frames[0].document.body.style;
- };
-
- var zoomIn = function(){
- var iframeStyle = getIframeStyle();
- iframeScale = iframeScale + 0.1;
- translateY = translateY + 50;
- var scale = 'scale(' + iframeScale + ')';
- var translate = "translate(0px, " + translateY + "px)";
-
- iframeStyle.MozTransform = scale + ' ' + translate;
- iframeStyle.WebkitTransform = scale + ' ' + translate;
- };
-
- var zoomOut = function(){
- var iframeStyle = getIframeStyle();
- iframeScale = iframeScale - 0.1;
- translateY = translateY - 50;
-
- var scale = 'scale(' + iframeScale + ')';
- var translate = "translate(0px, " + translateY + "px)";
-
-
- iframeStyle.MozTransform = scale + ' ' + translate;
- iframeStyle.WebkitTransform = scale + ' ' + translate;
-
- };
-
- $("<li class='left kHeader-zoomIn kHeader-btn'>" +
- " </li>")
- .click(zoomIn)
- .appendTo($kHeader);
-
- $("<li class='left kHeader-zoomOut " +
- "kHeader-btn'> </li>")
- .click(zoomOut)
- .appendTo($kHeader);
- }
-
-
-
- if($('#' + options.help).length){
- if($.ui.dialog){
- var $help = $('#'+ options.help)
- .dialog({
- position:[ "right", "top"],
- modal:'true',autoOpen:false,width:500,
- height: 400,
- dialogClass: 'kHeader-help'
- });
- } else {
-
- if(console){
- console.log("You need to add the jQuery UI dialog" +
- " widget in order to use Help feature.");
- }
- }
-
- }
-
- $("<li class='right'> <a href='#'" +
- "' class='kHeader-btn kHeader-help'></a></li>")
- .click(function(){
- if($.ui.dialog && $help){
- $help.dialog('open');
- }
- })
- .appendTo($kHeader);
-
-
- $("<li class='right'> <a href='http://olenepal.org'" +
- "' class='kHeader-btn kHeader-brand'" +
- "title='साà¤à¤¾ शिकà¥à¤·à¤¾ ई-पाटी'></a></li>")
- .appendTo($kHeader);
-
- this.element.append($kHeader);
-
- //0-width divs that hold hover imgs for pre-loading
- var $preloadImgDivs = $("<div class='kHeader-preload-img " +
- "kHeader-preload-back'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-zoom-in'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-zoom-out'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-ole'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-help'></div>"
- )
- .appendTo($kHeader);
-
- },
- /** Removes the kHeader widget and all related data from the DOM */
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.kHeader.getter = [];
-
- $.ui.kHeader.i18n = {};
-
- /** Default settings for the kHeader widget
- * @namespace Default settings for the kHeader widget
- * @extends $.ui.kHeader
- */
- $.ui.kHeader.defaults = {
- /** title
- * @type String
- * @default ""
- */
- title: "",
- /** Turns on zoom buttons
- * @type boolean
- * @default false
- */
- zoom: false,
- /** Creates drop-down with link to lesson plan
- * @type boolean or string file path to lesson plan
- * @default false
- */
- lessonPlan: false,
- /** Creates drop-down with link to teachersNote
- * @type boolean or string file path to teachersNote
- * @default false
- */
- teachersNote: false,
- /** Id of element containing help text
- * @type String
- * @default "kHelp"
- */
- help: "kHelp"
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/js/ui.resizable.js b/content/js/ui.resizable.js
deleted file mode 100755
index 6172d6c..0000000
--- a/content/js/ui.resizable.js
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * jQuery UI Resizable 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
-(function($) {
-
-$.widget("ui.resizable", $.extend({}, $.ui.mouse, {
-
- _init: function() {
-
- var self = this, o = this.options;
- this.element.addClass("ui-resizable");
-
- $.extend(this, {
- _aspectRatio: !!(o.aspectRatio),
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
- });
-
- //Wrap the element if it cannot hold child nodes
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
-
- //Opera fix for relative positioning
- if (/relative/.test(this.element.css('position')) && $.browser.opera)
- this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- this.element.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
- position: this.element.css('position'),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css('top'),
- left: this.element.css('left')
- })
- );
-
- //Overwrite the original this.element
- this.element = this.element.parent().data(
- "resizable", this.element.data('resizable')
- );
-
- this.elementIsWrapper = true;
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- this.originalResizeStyle = this.originalElement.css('resize');
- this.originalElement.css('resize', 'none');
-
- //Push the actual element to our proportionallyResize internal array
- this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
-
- // avoid IE jump (hard set the margin)
- this.originalElement.css({ margin: this.originalElement.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
-
- }
-
- this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
- if(this.handles.constructor == String) {
-
- if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
- var n = this.handles.split(","); this.handles = {};
-
- for(var i = 0; i < n.length; i++) {
-
- var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
- var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
-
- // increase zIndex of sw, se, ne, nw axis
- //TODO : this modifies original option
- if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
-
- //TODO : What's going on here?
- if ('se' == handle) {
- axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
- };
-
- //Insert into internal handles object and append to element
- this.handles[handle] = '.ui-resizable-'+handle;
- this.element.append(axis);
- }
-
- }
-
- this._renderAxis = function(target) {
-
- target = target || this.element;
-
- for(var i in this.handles) {
-
- if(this.handles[i].constructor == String)
- this.handles[i] = $(this.handles[i], this.element).show();
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(this.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
-
- }
-
- //TODO: What's that good for? There's not anything to be executed left
- if(!$(this.handles[i]).length)
- continue;
-
- }
- };
-
- //TODO: make renderAxis a prototype function
- this._renderAxis(this.element);
-
- this._handles = $('.ui-resizable-handle', this.element)
- .disableSelection();
-
- //Matching axis name
- this._handles.mouseover(function() {
- if (!self.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- this._handles.hide();
- $(this.element)
- .addClass("ui-resizable-autohide")
- .hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- self._handles.show();
- },
- function(){
- if (!self.resizing) {
- $(this).addClass("ui-resizable-autohide");
- self._handles.hide();
- }
- });
- }
-
- //Initialize the mouse interaction
- this._mouseInit();
-
- },
-
- destroy: function() {
-
- this._mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- //TODO: Unwrap at same DOM position
- if (this.elementIsWrapper) {
- _destroy(this.element);
- var wrapper = this.element;
- wrapper.parent().append(
- this.originalElement.css({
- position: wrapper.css('position'),
- width: wrapper.outerWidth(),
- height: wrapper.outerHeight(),
- top: wrapper.css('top'),
- left: wrapper.css('left')
- })
- ).end().remove();
- }
-
- this.originalElement.css('resize', this.originalResizeStyle);
- _destroy(this.originalElement);
-
- },
-
- _mouseCapture: function(event) {
-
- var handle = false;
- for(var i in this.handles) {
- if($(this.handles[i])[0] == event.target) handle = true;
- }
-
- return this.options.disabled || !!handle;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options, iniPos = this.element.position(), el = this.element;
-
- this.resizing = true;
- this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix for http://dev.jquery.com/ticket/1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
- el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && (/relative/).test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- if (o.containment) {
- curleft += $(o.containment).scrollLeft() || 0;
- curtop += $(o.containment).scrollTop() || 0;
- }
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
-
- //Aspect Ratio
- this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
-
- var cursor = $('.ui-resizable-' + this.axis).css('cursor');
- $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
-
- el.addClass("ui-resizable-resizing");
- this._propagate("start", event);
- return true;
- },
-
- _mouseDrag: function(event) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (this._aspectRatio || event.shiftKey)
- data = this._updateRatio(data, event);
-
- data = this._respectSize(data, event);
-
- // plugins callbacks need to be called first
- this._propagate("resize", event);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!this._helper && this._proportionallyResizeElements.length)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this._trigger('resize', event, this.ui());
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- this.resizing = false;
- var o = this.options, self = this;
-
- if(this._helper) {
- var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- self.helper.height(self.size.height);
- self.helper.width(self.size.width);
-
- if (this._helper && !o.animate) this._proportionallyResize();
- }
-
- $('body').css('cursor', 'auto');
-
- this.element.removeClass("ui-resizable-resizing");
-
- this._propagate("stop", event);
-
- if (this._helper) this.helper.remove();
- return false;
-
- },
-
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (isNumber(data.left)) this.position.left = data.left;
- if (isNumber(data.top)) this.position.top = data.top;
- if (isNumber(data.height)) this.size.height = data.height;
- if (isNumber(data.width)) this.size.width = data.width;
- },
-
- _updateRatio: function(data, event) {
-
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height * this.aspectRatio);
- else if (data.width) data.height = (csize.width / this.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
-
- _respectSize: function(data, event) {
-
- var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
-
- _proportionallyResize: function() {
-
- var o = this.options;
- if (!this._proportionallyResizeElements.length) return;
- var element = this.helper || this.element;
-
- for (var i=0; i < this._proportionallyResizeElements.length; i++) {
-
- var prel = this._proportionallyResizeElements[i];
-
- if (!this.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- this.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
-
- if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
- continue;
-
- prel.css({
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
- });
-
- };
-
- },
-
- _renderProxy: function() {
-
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(this._helper) {
-
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset TODO: This seems broken
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(this._helper).css({
- width: this.element.outerWidth() + pxyoffset,
- height: this.element.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex //TODO: Don't modify option
- });
-
- this.helper
- .appendTo("body")
- .disableSelection();
-
- } else {
- this.helper = this.element;
- }
-
- },
-
- _change: {
- e: function(event, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(event, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- sw: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- },
- ne: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- nw: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- }
- },
-
- _propagate: function(n, event) {
- $.ui.plugin.call(this, n, [event, this.ui()]);
- (n != "resize" && this._trigger(n, event, this.ui()));
- },
-
- plugins: {},
-
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- }
-
-}));
-
-$.extend($.ui.resizable, {
- version: "1.7.2",
- eventPrefix: "resize",
- defaults: {
- alsoResize: false,
- animate: false,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: false,
- autoHide: false,
- cancel: ":input,option",
- containment: false,
- delay: 0,
- distance: 1,
- ghost: false,
- grid: false,
- handles: "e,s,se",
- helper: false,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- zIndex: 1000
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options;
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera) {
- self._revertToRelativePosition = true;
- el.css({ position: 'absolute', top: 'auto', left: 'auto' });
- }
-
- el.css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable");
-
- //Opera fixing relative position
- if (self._revertToRelativePosition && $.browser.opera) {
- self._revertToRelativePosition = false;
- el.css({ position: 'relative' });
- }
-
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options;
-
- var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration,
- easing: o.animateEasing,
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self._propagate("resize", event);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
- // i'm a node, so compute top, left, right, bottom
- else {
- var element = $(ce), p = [];
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
-
- self.containerOffset = element.offset();
- self.containerPosition = element.position();
- self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options,
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
-
- if (cp.left < (self._helper ? co.left : 0)) {
- self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width / o.aspectRatio;
- self.position.left = o.helper ? co.left : 0;
- }
-
- if (cp.top < (self._helper ? co.top : 0)) {
- self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height * o.aspectRatio;
- self.position.top = self._helper ? co.top : 0;
- }
-
- self.offset.left = self.parentData.left+self.position.left;
- self.offset.top = self.parentData.top+self.position.top;
-
- var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
- hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
-
- var isParent = self.containerElement.get(0) == self.element.parent().get(0),
- isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
-
- if(isParent && isOffsetRelative) woset -= self.parentData.left;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width / self.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height * self.aspectRatio;
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
-
- if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- if (self._helper && !o.animate && (/static/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options, cs = self.size;
-
- self.ghost = self.originalElement.clone();
- self.ghost
- .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
- .addClass('ui-resizable-ghost')
- .addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-var num = function(v) {
- return parseInt(v, 10) || 0;
-};
-
-var isNumber = function(value) {
- return !isNaN(parseInt(value, 10));
-};
-
-})(jQuery);
diff --git a/content/js/ui.scoreboard.js b/content/js/ui.scoreboard.js
deleted file mode 100755
index 53a930a..0000000
--- a/content/js/ui.scoreboard.js
+++ /dev/null
@@ -1,107 +0,0 @@
-(function($){
- $.widget('ui.scoreboard',
- {
- getScore : function(){
- return this._getData('score');
- },
- setScore : function(newScore){
- this._setData('score', parseInt(newScore));
- this._refresh();
- },
- getTotal : function(){
- return this._getData('total');
- },
- setTotal : function(newTotal){
- this._setData('total', parseInt(newTotal));
- this._refresh();
- },
- reset : function(){
- this._setData('score', this._getData('initialScore'));
- this._setData('total', this._getData('initialTotal'));
- this._refresh();
- },
- inc : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') + incVal);
- this._refresh();
- if(this._getData('winScore') === this._getData('score')){
- this.element.trigger('winGame');
- }
- },
- incTotal : function(val){
- var incVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') + incVal);
- this._refresh();
- },
- dec : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('score', this._getData('score') - decVal);
- this._refresh();
- },
- decTotal : function(val){
- var decVal = parseInt(val) || 1;
- this._setData('total', this._getData('total') - decVal);
- this._refresh();
- },
- _init : function(){
-
- var divDisplay = "inline";
- var score = this.options.score;
- var total = this.options.total;
- var layoutId = "h";
- var self = this;
-
-
- this._setData('initialScore', parseInt(this.options.score));
- this._setData('initialTotal', parseInt(this.options.total));
- this._setData('score', parseInt(this.options.score));
- this._setData('total', parseInt(this.options.total));
- this._setData('winScore', parseInt(this.options.winningScore) || 0);
-
- if(this.options.layout === "vertical"){
- layoutId = "v";
- }
-
- this.evWinGame = document.createEvent('Events');
-
- this.element.addClass('ui-scoreboard-container-' + layoutId +
- ' ui-widget ui-widget-content ui-corner-all');
-
- var clone = $('<div>')
- .addClass('ui-scoreboard-spacing-' + layoutId);
- this._scoreText = $("<div>Score</div>")
- .addClass('ui-scoreboard-spacing-'+ layoutId +
- ' ui-corner-all ui-scoreboard-text')
- .appendTo(this.element);
- this._score = $("<div>" + score + "</div>")
- .addClass('ui-scoreboard-spacing-' + layoutId +
- ' ui-scoreboard-number-' + layoutId)
- .appendTo(this.element);
- $("<div>Total</div>")
- .addClass('ui-scoreboard-spacing-' + layoutId +
- ' ui-corner-all ' +
- 'ui-scoreboard-text')
- .appendTo(this.element);
- this._total = $("<div>" + total + "</div>")
- .addClass('ui-scoreboard-spacing-' + layoutId +
- ' ui-scoreboard-number-' + layoutId)
- .appendTo(this.element);
- },
- _refresh : function(){
- this._score.text(this._getData('score'));
- this._total.text(this._getData('total'));
- },
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.scoreboard.getter = ['getScore', 'getTotal'];
- $.ui.scoreboard.defaults = {
- score: 0, total: 0, layout: "horizontal", winningScore: 0
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/karma/css/kDoc.css b/content/karma/css/kDoc.css
deleted file mode 100755
index 5bf5f0b..0000000
--- a/content/karma/css/kDoc.css
+++ /dev/null
@@ -1,28 +0,0 @@
-#kDoc{
- background-color: white;
- width: 100%;
- height: 100%;
-
-}
-
-.zoom{
- display: inline-block;
- width: 25px;
- height: 25px;
- background-repeat: no-repeat;
-}
-
-.zoom.zoom-in {
- background-image: url(images/btn_plus25x25.png);
-}
-
-.zoom.zoom-out {
- background-image: url(images/btn_minus25x25.png);
-}
-
-
-#iframeLessonPlan{
- width:100%;
- height: 90%;
-
-} \ No newline at end of file
diff --git a/content/karma/css/karma.css b/content/karma/css/karma.css
deleted file mode 100755
index 7481928..0000000
--- a/content/karma/css/karma.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/* import nepal's Themeroller theme */
-@import url(./ui.base.css);
-@import url(./theme/jquery-ui-1.7.2.custom.css);
-@import url(./ui.dialog.css);
-@import url(./ui.resizable.css);
-@import url(./ui.feedback.css);
-
-/* special hack for the current karma-loader notification */
-@media screen {
- #karma-loader{
- position:absolute;
- top:0;
- left:0;
- padding: 2px 2px 1px 5px;
- font-size: 12px;
- background: #0066cc;
- color: #ffffff;
-
- }
- #karma-loader.status{
- left:110px;
- }
-}
-
-body{
- padding: 0px;
- margin: 0 auto 0 auto;
- width: 1200px;
- height: 900px;
- overflow: hidden;
- position: relative;
- background-color: purple;
-}
-
-#kMain {
- width: 1200px;
- height: 760px;
- float: left;
- clear: both;
- background-color: white;
-}
-
-/* for first-time users */
-#kMain #itWorks{
- text-align: center;
- font-size: 4em;
-}
-
-
diff --git a/content/karma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/content/karma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
deleted file mode 100755
index 5b5dab2..0000000
--- a/content/karma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png b/content/karma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
deleted file mode 100755
index 0852ec3..0000000
--- a/content/karma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_flat_75_ffffff_40x100.png b/content/karma/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
deleted file mode 100755
index ac8b229..0000000
--- a/content/karma/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/content/karma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
deleted file mode 100755
index ad3d634..0000000
--- a/content/karma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_glass_65_e774ec_1x400.png b/content/karma/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
deleted file mode 100755
index a47d762..0000000
--- a/content/karma/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_glass_75_f49aec_1x400.png b/content/karma/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
deleted file mode 100755
index 1f8d100..0000000
--- a/content/karma/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png b/content/karma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
deleted file mode 100755
index d3ffeef..0000000
--- a/content/karma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png b/content/karma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
deleted file mode 100755
index 708667b..0000000
--- a/content/karma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/content/karma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
deleted file mode 100755
index 0e05810..0000000
--- a/content/karma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_222222_256x240.png b/content/karma/css/theme/images/ui-icons_222222_256x240.png
deleted file mode 100755
index ee039dc..0000000
--- a/content/karma/css/theme/images/ui-icons_222222_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_222222_768x720.png b/content/karma/css/theme/images/ui-icons_222222_768x720.png
deleted file mode 100755
index 2437773..0000000
--- a/content/karma/css/theme/images/ui-icons_222222_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_2e83ff_256x240.png b/content/karma/css/theme/images/ui-icons_2e83ff_256x240.png
deleted file mode 100755
index 45e8928..0000000
--- a/content/karma/css/theme/images/ui-icons_2e83ff_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_2e83ff_768x720.png b/content/karma/css/theme/images/ui-icons_2e83ff_768x720.png
deleted file mode 100755
index 9727a25..0000000
--- a/content/karma/css/theme/images/ui-icons_2e83ff_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_454545_256x240.png b/content/karma/css/theme/images/ui-icons_454545_256x240.png
deleted file mode 100755
index 7ec70d1..0000000
--- a/content/karma/css/theme/images/ui-icons_454545_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_454545_768x720.png b/content/karma/css/theme/images/ui-icons_454545_768x720.png
deleted file mode 100755
index 761d947..0000000
--- a/content/karma/css/theme/images/ui-icons_454545_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_7811a2_256x240.png b/content/karma/css/theme/images/ui-icons_7811a2_256x240.png
deleted file mode 100755
index d51567c..0000000
--- a/content/karma/css/theme/images/ui-icons_7811a2_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_7811a2_768x720.png b/content/karma/css/theme/images/ui-icons_7811a2_768x720.png
deleted file mode 100755
index cb1d7a2..0000000
--- a/content/karma/css/theme/images/ui-icons_7811a2_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_cd0a0a_256x240.png b/content/karma/css/theme/images/ui-icons_cd0a0a_256x240.png
deleted file mode 100755
index 7930a55..0000000
--- a/content/karma/css/theme/images/ui-icons_cd0a0a_256x240.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/images/ui-icons_cd0a0a_768x720.png b/content/karma/css/theme/images/ui-icons_cd0a0a_768x720.png
deleted file mode 100755
index 788be14..0000000
--- a/content/karma/css/theme/images/ui-icons_cd0a0a_768x720.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/css/theme/jquery-ui-1.7.2.custom.css b/content/karma/css/theme/jquery-ui-1.7.2.custom.css
deleted file mode 100755
index 2a9e5c7..0000000
--- a/content/karma/css/theme/jquery-ui-1.7.2.custom.css
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-*/
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-
-
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.5em&cornerRadius=4px&bgColorHeader=f49aec&bgTextureHeader=02_glass.png&bgImgOpacityHeader=75&borderColorHeader=e774ec&fcHeader=222222&iconColorHeader=7811a2&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=e774ec&fcContent=222222&iconColorContent=222222&bgColorDefault=f8a5f0&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=e774ec&fcDefault=555555&iconColorDefault=7811a2&bgColorHover=fdd9f9&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=e774ec&fcHover=212121&iconColorHover=7811a2&bgColorActive=e774ec&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=e774ec&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=d13db4&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=fbd0f3&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=2px&offsetTopShadow=4px&offsetLeftShadow=4px&cornerRadiusShadow=4px
-*/
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.5em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #e774ec; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #e774ec; background: #f49aec url(images/ui-bg_glass_75_f49aec_1x400.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
-.ui-widget-header a { color: #222222; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #e774ec; background: #f8a5f0 url(images/ui-bg_glass_75_f8a5f0_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #e774ec; background: #fdd9f9 url(images/ui-bg_glass_75_fdd9f9_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; }
-.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #e774ec; background: #e774ec url(images/ui-bg_glass_65_e774ec_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #d13db4; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_inset-soft_95_fef1ec_1x100.png) 50% bottom repeat-x; color: #cd0a0a; }
-.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 48px; height: 48px; background-image: url(images/ui-icons_222222_768x720.png); }
-.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_768x720.png); }
-.ui-widget-header .ui-icon {background-image: url(images/ui-icons_7811a2_768x720.png); }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_7811a2_768x720.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_7811a2_768x720.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_768x720.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_768x720.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_768x720.png); }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -48px 0; }
-.ui-icon-carat-1-e { background-position: -96px 0; }
-.ui-icon-carat-1-se { background-position: -144px 0; }
-.ui-icon-carat-1-s { background-position: -192px 0; }
-.ui-icon-carat-1-sw { background-position: -240px 0; }
-.ui-icon-carat-1-w { background-position: -288px 0; }
-.ui-icon-carat-1-nw { background-position: -336px 0; }
-.ui-icon-carat-2-n-s { background-position: -384px 0; }
-.ui-icon-carat-2-e-w { background-position: -432px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -48px; }
-.ui-icon-triangle-1-ne { background-position: -48px -48px; }
-.ui-icon-triangle-1-e { background-position: -96px -48px; }
-.ui-icon-triangle-1-se { background-position: -144px -48px; }
-.ui-icon-triangle-1-s { background-position: -192px -48px; }
-.ui-icon-triangle-1-sw { background-position: -240px -48px; }
-.ui-icon-triangle-1-w { background-position: -288px -48px; }
-.ui-icon-triangle-1-nw { background-position: -336px -48px; }
-.ui-icon-triangle-2-n-s { background-position: -384px -48px; }
-.ui-icon-triangle-2-e-w { background-position: -432px -48px; }
-.ui-icon-arrow-1-n { background-position: 0 -96px; }
-.ui-icon-arrow-1-ne { background-position: -48px -96px; }
-.ui-icon-arrow-1-e { background-position: -96px -96px; }
-.ui-icon-arrow-1-se { background-position: -144px -96px; }
-.ui-icon-arrow-1-s { background-position: -192px -96px; }
-.ui-icon-arrow-1-sw { background-position: -240px -96px; }
-.ui-icon-arrow-1-w { background-position: -288px -96px; }
-.ui-icon-arrow-1-nw { background-position: -336px -96px; }
-.ui-icon-arrow-2-n-s { background-position: -384px -96px; }
-.ui-icon-arrow-2-ne-sw { background-position: -432px -96px; }
-.ui-icon-arrow-2-e-w { background-position: -480px -96px; }
-.ui-icon-arrow-2-se-nw { background-position: -528px -96px; }
-.ui-icon-arrowstop-1-n { background-position: -576px -96px; }
-.ui-icon-arrowstop-1-e { background-position: -624px -96px; }
-.ui-icon-arrowstop-1-s { background-position: -672px -96px; }
-.ui-icon-arrowstop-1-w { background-position: -720px -96px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -144px; }
-.ui-icon-arrowthick-1-ne { background-position: -48px -144px; }
-.ui-icon-arrowthick-1-e { background-position: -96px -144px; }
-.ui-icon-arrowthick-1-se { background-position: -144px -144px; }
-.ui-icon-arrowthick-1-s { background-position: -192px -144px; }
-.ui-icon-arrowthick-1-sw { background-position: -240px -144px; }
-.ui-icon-arrowthick-1-w { background-position: -288px -144px; }
-.ui-icon-arrowthick-1-nw { background-position: -336px -144px; }
-.ui-icon-arrowthick-2-n-s { background-position: -384px -144px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -432px -144px; }
-.ui-icon-arrowthick-2-e-w { background-position: -480px -144px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -528px -144px; }
-.ui-icon-arrowthickstop-1-n { background-position: -576px -144px; }
-.ui-icon-arrowthickstop-1-e { background-position: -624px -144px; }
-.ui-icon-arrowthickstop-1-s { background-position: -672px -144px; }
-.ui-icon-arrowthickstop-1-w { background-position: -720px -144px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -192px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -48px -192px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -96px -192px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -144px -192px; }
-.ui-icon-arrowreturn-1-w { background-position: -192px -192px; }
-.ui-icon-arrowreturn-1-n { background-position: -240px -192px; }
-.ui-icon-arrowreturn-1-e { background-position: -288px -192px; }
-.ui-icon-arrowreturn-1-s { background-position: -336px -192px; }
-.ui-icon-arrowrefresh-1-w { background-position: -384px -192px; }
-.ui-icon-arrowrefresh-1-n { background-position: -432px -192px; }
-.ui-icon-arrowrefresh-1-e { background-position: -480px -192px; }
-.ui-icon-arrowrefresh-1-s { background-position: -528px -192px; }
-.ui-icon-arrow-4 { background-position: 0 -240px; }
-.ui-icon-arrow-4-diag { background-position: -48px -240px; }
-.ui-icon-extlink { background-position: -96px -240px; }
-.ui-icon-newwin { background-position: -144px -240px; }
-.ui-icon-refresh { background-position: -192px -240px; }
-.ui-icon-shuffle { background-position: -240px -240px; }
-.ui-icon-transfer-e-w { background-position: -288px -240px; }
-.ui-icon-transferthick-e-w { background-position: -336px -240px; }
-.ui-icon-folder-collapsed { background-position: 0 -288px; }
-.ui-icon-folder-open { background-position: -48px -288px; }
-.ui-icon-document { background-position: -96px -288px; }
-.ui-icon-document-b { background-position: -144px -288px; }
-.ui-icon-note { background-position: -192px -288px; }
-.ui-icon-mail-closed { background-position: -240px -288px; }
-.ui-icon-mail-open { background-position: -288px -288px; }
-.ui-icon-suitcase { background-position: -336px -288px; }
-.ui-icon-comment { background-position: -384px -288px; }
-.ui-icon-person { background-position: -432px -288px; }
-.ui-icon-print { background-position: -480px -288px; }
-.ui-icon-trash { background-position: -528px -288px; }
-.ui-icon-locked { background-position: -576px -288px; }
-.ui-icon-unlocked { background-position: -624px -288px; }
-.ui-icon-bookmark { background-position: -672px -288px; }
-.ui-icon-tag { background-position: -720px -288px; }
-.ui-icon-home { background-position: 0 -336px; }
-.ui-icon-flag { background-position: -48px -336px; }
-.ui-icon-calendar { background-position: -96px -336px; }
-.ui-icon-cart { background-position: -144px -336px; }
-.ui-icon-pencil { background-position: -192px -336px; }
-.ui-icon-clock { background-position: -240px -336px; }
-.ui-icon-disk { background-position: -288px -336px; }
-.ui-icon-calculator { background-position: -336px -336px; }
-.ui-icon-zoomin { background-position: -384px -336px; }
-.ui-icon-zoomout { background-position: -432px -336px; }
-.ui-icon-search { background-position: -480px -336px; }
-.ui-icon-wrench { background-position: -528px -336px; }
-.ui-icon-gear { background-position: -576px -336px; }
-.ui-icon-heart { background-position: -624px -336px; }
-.ui-icon-star { background-position: -672px -336px; }
-.ui-icon-link { background-position: -720px -336px; }
-.ui-icon-cancel { background-position: 0 -384px; }
-.ui-icon-plus { background-position: -48px -384px; }
-.ui-icon-plusthick { background-position: -96px -384px; }
-.ui-icon-minus { background-position: -144px -384px; }
-.ui-icon-minusthick { background-position: -192px -384px; }
-.ui-icon-close { background-position: -240px -384px; }
-.ui-icon-closethick { background-position: -288px -384px; }
-.ui-icon-key { background-position: -336px -384px; }
-.ui-icon-lightbulb { background-position: -384px -384px; }
-.ui-icon-scissors { background-position: -432px -384px; }
-.ui-icon-clipboard { background-position: -480px -384px; }
-.ui-icon-copy { background-position: -528px -384px; }
-.ui-icon-contact { background-position: -576px -384px; }
-.ui-icon-image { background-position: -624px -384px; }
-.ui-icon-video { background-position: -672px -384px; }
-.ui-icon-script { background-position: -720px -384px; }
-.ui-icon-alert { background-position: 0 -432px; }
-.ui-icon-info { background-position: -48px -432px; }
-.ui-icon-notice { background-position: -96px -432px; }
-.ui-icon-help { background-position: -144px -432px; }
-.ui-icon-check { background-position: -192px -432px; }
-.ui-icon-bullet { background-position: -240px -432px; }
-.ui-icon-radio-off { background-position: -288px -432px; }
-.ui-icon-radio-on { background-position: -336px -432px; }
-.ui-icon-pin-w { background-position: -384px -432px; }
-.ui-icon-pin-s { background-position: -432px -432px; }
-.ui-icon-play { background-position: 0 -480px; }
-.ui-icon-pause { background-position: -48px -480px; }
-.ui-icon-seek-next { background-position: -96px -480px; }
-.ui-icon-seek-prev { background-position: -144px -480px; }
-.ui-icon-seek-end { background-position: -192px -480px; }
-.ui-icon-seek-first { background-position: -240px -480px; }
-.ui-icon-stop { background-position: -288px -480px; }
-.ui-icon-eject { background-position: -336px -480px; }
-.ui-icon-volume-off { background-position: -384px -480px; }
-.ui-icon-volume-on { background-position: -432px -480px; }
-.ui-icon-power { background-position: 0 -528px; }
-.ui-icon-signal-diag { background-position: -48px -528px; }
-.ui-icon-signal { background-position: -96px -528px; }
-.ui-icon-battery-0 { background-position: -144px -528px; }
-.ui-icon-battery-1 { background-position: -192px -528px; }
-.ui-icon-battery-2 { background-position: -240px -528px; }
-.ui-icon-battery-3 { background-position: -288px -528px; }
-.ui-icon-circle-plus { background-position: 0 -576px; }
-.ui-icon-circle-minus { background-position: -48px -576px; }
-.ui-icon-circle-close { background-position: -96px -576px; }
-.ui-icon-circle-triangle-e { background-position: -144px -576px; }
-.ui-icon-circle-triangle-s { background-position: -192px -576px; }
-.ui-icon-circle-triangle-w { background-position: -240px -576px; }
-.ui-icon-circle-triangle-n { background-position: -288px -576px; }
-.ui-icon-circle-arrow-e { background-position: -336px -576px; }
-.ui-icon-circle-arrow-s { background-position: -384px -576px; }
-.ui-icon-circle-arrow-w { background-position: -432px -576px; }
-.ui-icon-circle-arrow-n { background-position: -480px -576px; }
-.ui-icon-circle-zoomin { background-position: -528px -576px; }
-.ui-icon-circle-zoomout { background-position: -576px -576px; }
-.ui-icon-circle-check { background-position: -624px -576px; }
-.ui-icon-circlesmall-plus { background-position: 0 -624px; }
-.ui-icon-circlesmall-minus { background-position: -48px -624px; }
-.ui-icon-circlesmall-close { background-position: -96px -624px; }
-.ui-icon-squaresmall-plus { background-position: -144px -624px; }
-.ui-icon-squaresmall-minus { background-position: -192px -624px; }
-.ui-icon-squaresmall-close { background-position: -240px -624px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -672px; }
-.ui-icon-grip-dotted-horizontal { background-position: -48px -672px; }
-.ui-icon-grip-solid-vertical { background-position: -96px -672px; }
-.ui-icon-grip-solid-horizontal { background-position: -144px -672px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -192px -672px; }
-.ui-icon-grip-diagonal-se { background-position: -240px -672px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
-.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
-.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
-.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
-.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
-.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
-.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
-.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
-
-/* Overlays */
-.ui-widget-overlay { background: #fbd0f3 url(images/ui-bg_flat_0_fbd0f3_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
-.ui-widget-shadow { margin: 4px 0 0 4px; padding: 2px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 4px; -webkit-border-radius: 4px; }/* Accordion
-----------------------------------*/
-.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
-.ui-accordion .ui-accordion-li-fix { display: inline; }
-.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
-.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
-.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
-.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
-.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker
-----------------------------------*/
-.ui-datepicker { width: 17em; padding: .2em .2em 0; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; }
-
-/* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
- position: absolute; /*must have*/
- z-index: -1; /*must have*/
- filter: mask(); /*must have*/
- top: -4px; /*must have*/
- left: -4px; /*must have*/
- width: 200px; /*must have*/
- height: 200px; /*must have*/
-}/* Dialog
-----------------------------------*/
-.ui-dialog { position: relative; padding: .2em; width: 300px; }
-.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
-/* Progressbar
-----------------------------------*/
-.ui-progressbar { height:2em; text-align: left; }
-.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
-----------------------------------*/
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
-----------------------------------*/
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
-----------------------------------*/
-.ui-tabs { padding: .2em; zoom: 1; }
-.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
-.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
diff --git a/content/karma/image/arrow_down_white.png b/content/karma/image/arrow_down_white.png
deleted file mode 100755
index e2b247a..0000000
--- a/content/karma/image/arrow_down_white.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/back_button_hover.png b/content/karma/image/back_button_hover.png
deleted file mode 100755
index 084f4ea..0000000
--- a/content/karma/image/back_button_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/back_button_start.png b/content/karma/image/back_button_start.png
deleted file mode 100755
index 31ab319..0000000
--- a/content/karma/image/back_button_start.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/bg.png b/content/karma/image/bg.png
deleted file mode 100755
index 7483a94..0000000
--- a/content/karma/image/bg.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/bg_footer.png b/content/karma/image/bg_footer.png
deleted file mode 100644
index 8982264..0000000
--- a/content/karma/image/bg_footer.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/bg_header.png b/content/karma/image/bg_header.png
deleted file mode 100644
index 98213f7..0000000
--- a/content/karma/image/bg_header.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/bg_title_block.png b/content/karma/image/bg_title_block.png
deleted file mode 100644
index 2c9dacf..0000000
--- a/content/karma/image/bg_title_block.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_back.png b/content/karma/image/btn_back.png
deleted file mode 100644
index d9fbf14..0000000
--- a/content/karma/image/btn_back.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_back_hover.png b/content/karma/image/btn_back_hover.png
deleted file mode 100644
index 0911fcc..0000000
--- a/content/karma/image/btn_back_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_help.png b/content/karma/image/btn_help.png
deleted file mode 100644
index 6753e9c..0000000
--- a/content/karma/image/btn_help.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_help_hover.png b/content/karma/image/btn_help_hover.png
deleted file mode 100644
index d3ccd92..0000000
--- a/content/karma/image/btn_help_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_minus.png b/content/karma/image/btn_minus.png
deleted file mode 100755
index 9a7320d..0000000
--- a/content/karma/image/btn_minus.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_next.png b/content/karma/image/btn_next.png
deleted file mode 100644
index 9d70993..0000000
--- a/content/karma/image/btn_next.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_next_hover.png b/content/karma/image/btn_next_hover.png
deleted file mode 100644
index 2cd4d37..0000000
--- a/content/karma/image/btn_next_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_ole.png b/content/karma/image/btn_ole.png
deleted file mode 100644
index 0e775e9..0000000
--- a/content/karma/image/btn_ole.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_ole_hover.png b/content/karma/image/btn_ole_hover.png
deleted file mode 100644
index c43c5f7..0000000
--- a/content/karma/image/btn_ole_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_play_again.png b/content/karma/image/btn_play_again.png
deleted file mode 100644
index 3594d18..0000000
--- a/content/karma/image/btn_play_again.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_play_again_hover.png b/content/karma/image/btn_play_again_hover.png
deleted file mode 100644
index ebb8f8c..0000000
--- a/content/karma/image/btn_play_again_hover.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_play_again_mouse_down.png b/content/karma/image/btn_play_again_mouse_down.png
deleted file mode 100644
index 07d6e45..0000000
--- a/content/karma/image/btn_play_again_mouse_down.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/btn_plus.png b/content/karma/image/btn_plus.png
deleted file mode 100755
index 4600d5d..0000000
--- a/content/karma/image/btn_plus.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/favicon.ico b/content/karma/image/favicon.ico
deleted file mode 100644
index 20bf7f1..0000000
--- a/content/karma/image/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/picClock.png b/content/karma/image/picClock.png
deleted file mode 100644
index 63e50e2..0000000
--- a/content/karma/image/picClock.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/title_block_lt.png b/content/karma/image/title_block_lt.png
deleted file mode 100644
index 4696182..0000000
--- a/content/karma/image/title_block_lt.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/image/title_block_rt.png b/content/karma/image/title_block_rt.png
deleted file mode 100644
index 37cc44a..0000000
--- a/content/karma/image/title_block_rt.png
+++ /dev/null
Binary files differ
diff --git a/content/karma/js/jquery.watermarkinput.js b/content/karma/js/jquery.watermarkinput.js
deleted file mode 100644
index fefa670..0000000
--- a/content/karma/js/jquery.watermarkinput.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2007 Josh Bush (digitalbush.com)
- *
- * 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 above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * 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.
- */
-
-/*
- * Version: Beta 1
- * Release: 2007-06-01
- */
-(function($) {
- var map=new Array();
- $.Watermark = {
- ShowAll:function(){
- for (var i=0;i<map.length;i++){
- if(map[i].obj.val()==""){
- map[i].obj.val(map[i].text);
- map[i].obj.css("color",map[i].WatermarkColor);
- }else{
- map[i].obj.css("color",map[i].DefaultColor);
- }
- }
- },
- HideAll:function(){
- for (var i=0;i<map.length;i++){
- if(map[i].obj.val()==map[i].text)
- map[i].obj.val("");
- }
- }
- }
-
- $.fn.Watermark = function(text,color) {
- if(!color)
- color="#aaa";
- return this.each(
- function(){
- var input=$(this);
- var defaultColor=input.css("color");
- map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
- function clearMessage(){
- if(input.val()==text)
- input.val("");
- input.css("color",defaultColor);
- }
-
- function insertMessage(){
- if(input.val().length==0 || input.val()==text){
- input.val(text);
- input.css("color",color);
- }else
- input.css("color",defaultColor);
- }
-
- input.focus(clearMessage);
- input.blur(insertMessage);
- input.change(insertMessage);
-
- insertMessage();
- }
- );
- };
-})(jQuery); \ No newline at end of file
diff --git a/content/karma/js/ui.kHeader.js b/content/karma/js/ui.kHeader.js
deleted file mode 100755
index 966c85a..0000000
--- a/content/karma/js/ui.kHeader.js
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
-* @fileOverview a Header widget
-* @author Bryan Berry <bryan@olenepal.org>
-* uses MIT License
-*/
-
-
-
-(function($){
-
- // This is a dummy function, just here as placeholder to
- // to make the jsdoc tool happy
- /** @name $.ui.kHeader
- * @namespace kHeader widget
- * @example
- */
- $.ui.kHeader = function(){};
-
- $.widget('ui.kHeader',
- /** @lends $.ui.kHeader.prototype */
- { _c : function(val){
- if($.i18n){
- return $._c('$.ui.kHeader', val);
- }
- return val;
- },
- _n : function(val, loc){
- if ($.i18n){
- return $._n(val, loc);
- }
- return val;
- },
-
- _init : function(){
- var options = $.extend({}, $.ui.kHeader.defaults, this.options);
-
- this.element.addClass('ui-widget ui-widget-content');
-
- var $kHeader = $("<ul></ul>");
-
- var backLink = "#";
- var urlParams = window.location.search.slice(1).split('&');
- if (urlParams){
- backLink = urlParams[0].split('=')[1];
- }
-
- var $backBtn = $("<li class='left'> <a href='" + backLink +
- "' class='kHeader-btn kHeader-back'></a></li>")
- .appendTo($kHeader);
-
- var $lessonTitle = $("<li class='left kHeader-title'>" +
- "<span>" + options.title +
- "</span></li>")
- .appendTo($kHeader);
-
-
-
- if (options.lessonPlan || options.teacherNote){
-
- var $dropDownArrow = $("<span class='kHeader-kDoc right'>" +
- "</span>")
- .appendTo($lessonTitle);
-
- var $dropDownArea = $("<div class='drop-down'></div>");
-
- if (options.lessonPlan){
- $("<div>" +
- "<a href='./kDoc.html?back=index.html&doc=lessonPlan'>" +
- this._c("Lesson Plan") + "</a></div>")
- .appendTo($dropDownArea);
- }
-
- if (options.teachersNote){
- $("<div>" +
- "<a href='./kDoc.html?back=index.html&doc=teachersNote'>" +
- this._c("Teacher's Note") + "</a></div>")
- .appendTo($dropDownArea);
- }
-
- $dropDownArea.appendTo($dropDownArrow);
-
- $dropDownArrow.hover(
- function(){
- $dropDownArea.show();
- },
- function(){
- $dropDownArea.hide();
- }
- );
-
- }
-
- if(options.zoom === true){
-
- var iframeScale = 1.0;
- var translateY = 0;
- var getIframeStyle = function(){
- return window.frames[0].document.body.style;
- };
-
- var zoomIn = function(){
- var iframeStyle = getIframeStyle();
- iframeScale = iframeScale + 0.1;
- translateY = translateY + 50;
- var scale = 'scale(' + iframeScale + ')';
- var translate = "translate(0px, " + translateY + "px)";
-
- iframeStyle.MozTransform = scale + ' ' + translate;
- iframeStyle.WebkitTransform = scale + ' ' + translate;
- };
-
- var zoomOut = function(){
- var iframeStyle = getIframeStyle();
- iframeScale = iframeScale - 0.1;
- translateY = translateY - 50;
-
- var scale = 'scale(' + iframeScale + ')';
- var translate = "translate(0px, " + translateY + "px)";
-
-
- iframeStyle.MozTransform = scale + ' ' + translate;
- iframeStyle.WebkitTransform = scale + ' ' + translate;
-
- };
-
- $("<li class='left kHeader-zoomIn kHeader-btn'>" +
- " </li>")
- .click(zoomIn)
- .appendTo($kHeader);
-
- $("<li class='left kHeader-zoomOut " +
- "kHeader-btn'> </li>")
- .click(zoomOut)
- .appendTo($kHeader);
- }
-
-
-
- if($('#' + options.help).length){
- if($.ui.dialog){
- var $help = $('#'+ options.help)
- .dialog({
- position:[ "right", "top"],
- modal:'true',autoOpen:false,width:500,
- height: 400,
- dialogClass: 'kHeader-help'
- });
- } else {
-
- if(console){
- console.log("You need to add the jQuery UI dialog" +
- " widget in order to use Help feature.");
- }
- }
-
- }
-
- $("<li class='right'> <a href='#'" +
- "' class='kHeader-btn kHeader-help'></a></li>")
- .click(function(){
- if($.ui.dialog && $help){
- $help.dialog('open');
- }
- })
- .appendTo($kHeader);
-
-
- $("<li class='right'> <a href='http://olenepal.org'" +
- "' class='kHeader-btn kHeader-brand'" +
- "title='साà¤à¤¾ शिकà¥à¤·à¤¾ ई-पाटी'></a></li>")
- .appendTo($kHeader);
-
- this.element.append($kHeader);
-
- //0-width divs that hold hover imgs for pre-loading
- var $preloadImgDivs = $("<div class='kHeader-preload-img " +
- "kHeader-preload-back'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-zoom-in'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-zoom-out'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-ole'></div>" +
- "<div class='kHeader-preload-img " +
- "kHeader-preload-help'></div>"
- )
- .appendTo($kHeader);
-
- },
- /** Removes the kHeader widget and all related data from the DOM */
- destroy : function(){
- this.element.remove();
- $.widget.prototype.destroy.apply(this, arguments);
- }
-
-
- });
-
- $.ui.kHeader.getter = [];
-
- $.ui.kHeader.i18n = {};
-
- /** Default settings for the kHeader widget
- * @namespace Default settings for the kHeader widget
- * @extends $.ui.kHeader
- */
- $.ui.kHeader.defaults = {
- /** title
- * @type String
- * @default ""
- */
- title: "",
- /** Turns on zoom buttons
- * @type boolean
- * @default false
- */
- zoom: false,
- /** Creates drop-down with link to lesson plan
- * @type boolean or string file path to lesson plan
- * @default false
- */
- lessonPlan: false,
- /** Creates drop-down with link to teachersNote
- * @type boolean or string file path to teachersNote
- * @default false
- */
- teachersNote: false,
- /** Id of element containing help text
- * @type String
- * @default "kHelp"
- */
- help: "kHelp"
- };
-
- })(jQuery); \ No newline at end of file
diff --git a/content/menu.css b/content/menu.css
deleted file mode 100755
index a2a6de3..0000000
--- a/content/menu.css
+++ /dev/null
@@ -1,99 +0,0 @@
-.ladders{
- float:right;
-}
-
-.main{
- position:absolute;
- top:0px;
- left:0px;
- width:200px;
- height:200px;
-}
-
-#c1t{
- position:absolute;
- top:50px;
- left:50px;
- width:250px;
- height:200px;
-}
-
-#c2t{
- position:absolute;
- top:50px;
- left:600px;
- width:250px;
- height:200px;
-}
-
-#c11{
- position:absolute;
- top:50px;
- left:50px;
- width:200px;
- height:200px;
-}
-
-#c12{
- position:absolute;
- top:50px;
- left:350px;
- width:200px;
- height:200px;
-}
-
-#c13{
- position:absolute;
- top:50px;
- left:650px;
- width:200px;
- height:200px;
-}
-
-#c21{
- position:absolute;
- top:300px;
- left:50px;
- width:200px;
- height:200px;
-}
-
-#c22{
- position:absolute;
- top:300px;
- left:350px;
- width:200px;
- height:200px;
-}
-
-#c23{
- position:absolute;
- top:300px;
- left:650px;
- width:200px;
- height:200px;
-}
-#c1b{
- position:absolute;
- top:550px;
- left:50px;
- width:250px;
- height:200px;
-}
-
-#c2b{
- position:absolute;
- top:550px;
- left:600px;
- width:250px;
- height:200px;
-}
-
-#footer{
- position:absolute;
- top:760px;
- left:0px;
- width:100%;
- height:50px;
-}
-
diff --git a/index.html b/index.html
index 559c749..18d391e 100755
--- a/index.html
+++ b/index.html
@@ -1,30 +1,18 @@
<!DOCTYPE html>
<html>
- <head>
- <title>Activity Ladder </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link type="text/css" rel="stylesheet" href="../../css/global.css" />
- <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" />
- <script type="text/javascript" src="../../js/jquery-1.4.js"></script>
- <script type="text/javascript" src="../../js/jquery-ui-1.js"></script>
- <script type="text/javascript" src="../../js/karma.js"></script>
- <script type="text/javascript" src="../../js/global.js"></script>
- <script type="text/javascript" src="../../js/lesson.js"></script>
- <script type="text/javascript" src="../../js/jquery.svg.js"></script>
- <script type="text/javascript" src="../../js/menu.js"></script>
- <script type="text/javascript" src="activities.js"></script>
- </head>
- <body>
- <div id="header">
- <div id="topbtn_left"><div title="home" id="linkBackTwo" class="linkHome" /></div></div>
- <div id="topbtn_left"><div title="Subject" id="linkBackOne" class="linkSubject" /></div></div>
- <div id="lesson_title">
- <img src="../../assets/image/title_block_lt.png" width="33" height="75" align="absmiddle" />
- Activity Ladder
- <img src="../../assets/image/title_block_rt.png" width="33" height="75" align="absmiddle" />
- </div>
- <div id="topbtn_right"><div title="Help" id="linkHelp"></div></div>
- </div>
- <canvas id="ladder"/>
- </body>
+<head>
+<title>Learn</title>
+<meta charset="UTF-8"/>
+<link rel="stylesheet" href="menu.css" type="text/css"/>
+<script type="text/javascript" src="karma/js/jquery-1.4.js"></script>
+<script type="text/javascript">
+$(function(){
+ $('#content')
+ .load('http://localhost:8008/cgi-bin/fetch_milestone.py')
+});
+</script>
+</head>
+<body>
+<div id="content"/>
+</body>
</html>
diff --git a/content/karma/audio/byebye.ogg b/karma/audio/byebye.ogg
index cc33e16..cc33e16 100644..100755
--- a/content/karma/audio/byebye.ogg
+++ b/karma/audio/byebye.ogg
Binary files differ
diff --git a/content/karma/audio/en_correct.ogg b/karma/audio/en_correct.ogg
index e882ae3..e882ae3 100644..100755
--- a/content/karma/audio/en_correct.ogg
+++ b/karma/audio/en_correct.ogg
Binary files differ
diff --git a/content/karma/audio/en_incorrect.ogg b/karma/audio/en_incorrect.ogg
index bf7969a..bf7969a 100644..100755
--- a/content/karma/audio/en_incorrect.ogg
+++ b/karma/audio/en_incorrect.ogg
Binary files differ
diff --git a/content/karma/audio/ne_correct.ogg b/karma/audio/ne_correct.ogg
index bd224cf..bd224cf 100644..100755
--- a/content/karma/audio/ne_correct.ogg
+++ b/karma/audio/ne_correct.ogg
Binary files differ
diff --git a/content/karma/audio/ne_incorrect.ogg b/karma/audio/ne_incorrect.ogg
index 3865c99..3865c99 100644..100755
--- a/content/karma/audio/ne_incorrect.ogg
+++ b/karma/audio/ne_incorrect.ogg
Binary files differ
diff --git a/content/karma/audio/trigger.ogg b/karma/audio/trigger.ogg
index f89d38d..f89d38d 100644..100755
--- a/content/karma/audio/trigger.ogg
+++ b/karma/audio/trigger.ogg
Binary files differ
diff --git a/content/css/global.css b/karma/css/global.css
index 75dcd65..54da89b 100755
--- a/content/css/global.css
+++ b/karma/css/global.css
@@ -13,7 +13,7 @@ body {
overflow:hidden;
}
#header {
- background-image: url(../assets/image/bg_header.png);
+ background-image: url(../image/bg_header.png);
background-repeat: repeat-x;
height: 75px;
width: 100%;
@@ -66,35 +66,37 @@ body {
.linkHome{
cursor:pointer;
width: 60px; height: 59px;
- background:url(../assets/image/btn_ole.png);
+ background:url(../image/btn_ole.png);
+ background-repeat:no-repeat;
}
.linkEnglish{
cursor:pointer;
width: 60px; height: 59px;
- background:url(../assets/image/btn_back_english.png);
+ background:url(../image/btn_back_english.png);
+ background-repeat:no-repeat;
}
.linkMathematics{
cursor:pointer;
width: 60px; height: 59px;
- background:url(../assets/image/btn_back_mathematics.png);
+ background:url(../image/btn_back_mathematics.png);
+ background-repeat:no-repeat;
}
.linkExplore{
cursor:pointer;
width: 60px; height: 59px;
- background:url(../assets/image/btn_back_explore.png);
+ background:url(../image/btn_back_explore.png);
+ background-repeat:no-repeat;
}
.linkBegin{
cursor:pointer;
width: 60px; height: 59px;
- background:url(../assets/image/btn_start.png);
+ background:url(../image/btn_start.png);
}
.linkBack{
cursor:pointer;
width: 60px; height: 59px;
- background:url(../assets/image/btn_back.png);
- }
- .linkBack:hover{
- background:url(../assets/image/btn_back_hover.png);
+ background:url(../image/btn_back.png);
+ background-repeat:no-repeat;
}
#lesson_title {
@@ -104,7 +106,13 @@ body {
font-weight: bold;
color: #FFFFFF;
margin-left: 10px;
- background-image: url(../assets/image/bg_title_block.png);
+ background-image: url(../image/bg_title_block.png);
+}
+.title_img{
+ width: 33px;
+ height: 75px;
+ text-align:center;
+ vertical-align: middle;
}
.topbtn_right {
float: right;
@@ -115,40 +123,28 @@ body {
}
.linkQuit{
width: 60px; height: 60px;
- background:url(../assets/image/activity-stop.png);
+ background:url(../image/activity-stop.png);
+ background-repeat:no-repeat;
cursor:pointer;
}
.linkApply{
width: 60px; height: 60px;
- background:url(../assets/image/apply.png);
+ background:url(../image/apply.png);
+ background-repeat:no-repeat;
cursor:pointer;
}
.linkEdit{
width: 55px; height: 55px;
- background:url(../assets/image/edit.png);
+ background:url(../image/edit.png);
+ background-repeat:no-repeat;
cursor:pointer;
}
.linkHelp{
width: 60px; height: 60px;
- background:url(../assets/image/btn_help.png);
+ background:url(../image/btn_help.png);
+ background-repeat:no-repeat;
cursor:pointer;
}
- .linkHelp:hover{
- background:url(../assets/image/btn_help_hover.png);
- }
- .linkNext{
- cursor:pointer;
- width: 60px; height: 60px;
- background:url(../assets/image/btn_next.png);
- }
- .linkNext:hover{
- background:url(../assets/image/btn_next_hover.png);
- }
- .linkPrev{
- cursor:pointer;
- width: 60px; height: 60px;
- background:url(../assets/image/btn_help.png);
- }
#hdr {
position:absolute;
height:75px;
@@ -159,7 +155,7 @@ body {
}
#footer {
position:relative;
- background-image: url(../assets/image/bg_footer.png);
+ background-image: url(../image/bg_footer.png);
background-repeat: repeat-x;
height: 75px;
width: 100%;
@@ -178,39 +174,42 @@ body {
.botbtn_right {
float: right;
height: 60px;
+ width:187px;
padding-right: 5px;
padding-top: 10px;
}
.linkCheck{
margin: 1em 3em 0 0;
width: 187px; height: 55px;
- background-image: url(../assets/image/check.png);
+ background-image: url(../image/check.png);
}
.linkStart{
cursor:pointer;
width: 187px; height: 55px;
- background:url(../assets/image/start.png);
+ background:url(../image/start.png);
+ background-repeat:no-repeat;
}
.linkStart:hover{
- background:url(../assets/image/start.png);
+ background:url(../image/start.png);
}
.linkStart:active{
- background:url(../assets/image/start.png);
+ background:url(../image/start.png);
}
.linkPlayAgain{
cursor:pointer;
width: 187px; height: 55px;
- background:url(../assets/image/restart.png);
+ background:url(../image/restart.png);
}
.linkPlayAgain:hover{
- background:url(../assets/image/restart.png);
+ background:url(../image/restart.png);
}
.linkPlayAgain:active{
- background:url(../assets/image/restart.png);
+ background:url(../image/restart.png);
}
.linkNextScreen{
width:64px; height: 55px;
- background:url(../assets/image/btn_next.png);
+ background:url(../image/btn_next.png);
+ background-repeat:no-repeat;
}
.botbtn_left {
@@ -221,11 +220,11 @@ body {
}
.linkPrevScreen{
width: 60px; height: 55px;
- background:url(../assets/image/btn_back.png);
+ background:url(../image/btn_back.png);
}
.linkPlay{
width: 60px; height: 60px;
- background:url(../assets/image/audio-play.png);
+ background:url(../image/audio-play.png);
}
#timerBar {
@@ -243,7 +242,7 @@ body {
float:left;
width:32px;
height: 32px;
- background: url(../assets/image/picClock.png);
+ background: url(../image/picClock.png);
}
.timerBoxes{ /* Show the timer running after the game has began.... */
@@ -264,7 +263,7 @@ body {
top: 75px;
width: 297px;
height: 697px;
- background:url(../assets/image/help.png);
+ background:url(../image/help.png);
z-index:40;
}
diff --git a/content/Explore/css/kDoc.css b/karma/css/kDoc.css
index 5bf5f0b..5bf5f0b 100755
--- a/content/Explore/css/kDoc.css
+++ b/karma/css/kDoc.css
diff --git a/content/karma/css/kStart.css b/karma/css/kStart.css
index 463a217..463a217 100755
--- a/content/karma/css/kStart.css
+++ b/karma/css/kStart.css
diff --git a/content/Explore/css/karma.css b/karma/css/karma.css
index 7481928..7481928 100755
--- a/content/Explore/css/karma.css
+++ b/karma/css/karma.css
diff --git a/content/karma/css/global.css b/karma/css/kglobal.css
index c6875e4..c27c2f0 100644..100755
--- a/content/karma/css/global.css
+++ b/karma/css/kglobal.css
@@ -20,7 +20,7 @@ body {
z-index: 10;
}
-#topbtn_left {
+.topbtn_left {
float: left;
height: 60px;
width: 60px;
diff --git a/karma/css/menu.css b/karma/css/menu.css
new file mode 100755
index 0000000..16061ce
--- /dev/null
+++ b/karma/css/menu.css
@@ -0,0 +1,53 @@
+.c11{
+ position:absolute; top:50px; left:50px; width:200px; height:200px;
+}
+
+.c21{
+ position:absolute; top:50px; left:300px; width:200px; height:200px;
+}
+
+.c31{
+ position:absolute; top:50px; left:550px; width:200px; height:200px;
+}
+
+.c41{
+ position:absolute; top:50px; left:800px; width:200px; height:200px;
+}
+
+.c12{
+ position:absolute; top:300px; left:50px; width:200px; height:200px;
+}
+
+.c22{
+ position:absolute; top:300px; left:300px; width:200px; height:200px;
+}
+
+.c32{
+ position:absolute; top:300px; left:550px; width:200px; height:200px;
+}
+
+.c42{
+ position:absolute; top:300px; left:800px; width:200px; height:200px;
+}
+
+.c13{
+ position:absolute; top:550px; left:50px; width:200px; height:200px;
+}
+
+.c23{
+ position:absolute; top:550px; left:300px; width:200px; height:200px;
+}
+
+.c33{
+ position:absolute; top:500px; left:550px; width:200px; height:200px;
+}
+
+.c43{
+ position:absolute; top:550px; left:800px; width:200px; height:200px;
+}
+
+
+.footer{
+ position:absolute; top:760px; left:0px; width:100%; height:50px;
+}
+
diff --git a/content/Explore/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/karma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
index 5b5dab2..5b5dab2 100755
--- a/content/Explore/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
+++ b/karma/css/theme/images/ui-bg_flat_0_aaaaaa_40x100.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png b/karma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
index 0852ec3..0852ec3 100755
--- a/content/Explore/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
+++ b/karma/css/theme/images/ui-bg_flat_0_fbd0f3_40x100.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_flat_75_ffffff_40x100.png b/karma/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
index ac8b229..ac8b229 100755
--- a/content/Explore/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
+++ b/karma/css/theme/images/ui-bg_flat_75_ffffff_40x100.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/karma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
index ad3d634..ad3d634 100755
--- a/content/Explore/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
+++ b/karma/css/theme/images/ui-bg_glass_55_fbf9ee_1x400.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_glass_65_e774ec_1x400.png b/karma/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
index a47d762..a47d762 100755
--- a/content/Explore/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
+++ b/karma/css/theme/images/ui-bg_glass_65_e774ec_1x400.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_glass_75_f49aec_1x400.png b/karma/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
index 1f8d100..1f8d100 100755
--- a/content/Explore/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
+++ b/karma/css/theme/images/ui-bg_glass_75_f49aec_1x400.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png b/karma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
index d3ffeef..d3ffeef 100755
--- a/content/Explore/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
+++ b/karma/css/theme/images/ui-bg_glass_75_f8a5f0_1x400.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png b/karma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
index 708667b..708667b 100755
--- a/content/Explore/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
+++ b/karma/css/theme/images/ui-bg_glass_75_fdd9f9_1x400.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/karma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
index 0e05810..0e05810 100755
--- a/content/Explore/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
+++ b/karma/css/theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_222222_256x240.png b/karma/css/theme/images/ui-icons_222222_256x240.png
index ee039dc..ee039dc 100755
--- a/content/Explore/css/theme/images/ui-icons_222222_256x240.png
+++ b/karma/css/theme/images/ui-icons_222222_256x240.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_222222_768x720.png b/karma/css/theme/images/ui-icons_222222_768x720.png
index 2437773..2437773 100755
--- a/content/Explore/css/theme/images/ui-icons_222222_768x720.png
+++ b/karma/css/theme/images/ui-icons_222222_768x720.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_2e83ff_256x240.png b/karma/css/theme/images/ui-icons_2e83ff_256x240.png
index 45e8928..45e8928 100755
--- a/content/Explore/css/theme/images/ui-icons_2e83ff_256x240.png
+++ b/karma/css/theme/images/ui-icons_2e83ff_256x240.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_2e83ff_768x720.png b/karma/css/theme/images/ui-icons_2e83ff_768x720.png
index 9727a25..9727a25 100755
--- a/content/Explore/css/theme/images/ui-icons_2e83ff_768x720.png
+++ b/karma/css/theme/images/ui-icons_2e83ff_768x720.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_454545_256x240.png b/karma/css/theme/images/ui-icons_454545_256x240.png
index 7ec70d1..7ec70d1 100755
--- a/content/Explore/css/theme/images/ui-icons_454545_256x240.png
+++ b/karma/css/theme/images/ui-icons_454545_256x240.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_454545_768x720.png b/karma/css/theme/images/ui-icons_454545_768x720.png
index 761d947..761d947 100755
--- a/content/Explore/css/theme/images/ui-icons_454545_768x720.png
+++ b/karma/css/theme/images/ui-icons_454545_768x720.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_7811a2_256x240.png b/karma/css/theme/images/ui-icons_7811a2_256x240.png
index d51567c..d51567c 100755
--- a/content/Explore/css/theme/images/ui-icons_7811a2_256x240.png
+++ b/karma/css/theme/images/ui-icons_7811a2_256x240.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_7811a2_768x720.png b/karma/css/theme/images/ui-icons_7811a2_768x720.png
index cb1d7a2..cb1d7a2 100755
--- a/content/Explore/css/theme/images/ui-icons_7811a2_768x720.png
+++ b/karma/css/theme/images/ui-icons_7811a2_768x720.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_cd0a0a_256x240.png b/karma/css/theme/images/ui-icons_cd0a0a_256x240.png
index 7930a55..7930a55 100755
--- a/content/Explore/css/theme/images/ui-icons_cd0a0a_256x240.png
+++ b/karma/css/theme/images/ui-icons_cd0a0a_256x240.png
Binary files differ
diff --git a/content/Explore/css/theme/images/ui-icons_cd0a0a_768x720.png b/karma/css/theme/images/ui-icons_cd0a0a_768x720.png
index 788be14..788be14 100755
--- a/content/Explore/css/theme/images/ui-icons_cd0a0a_768x720.png
+++ b/karma/css/theme/images/ui-icons_cd0a0a_768x720.png
Binary files differ
diff --git a/content/Explore/css/theme/jquery-ui-1.7.2.custom.css b/karma/css/theme/jquery-ui-1.7.2.custom.css
index 2a9e5c7..2a9e5c7 100755
--- a/content/Explore/css/theme/jquery-ui-1.7.2.custom.css
+++ b/karma/css/theme/jquery-ui-1.7.2.custom.css
diff --git a/content/karma/css/ui.kHeader.css b/karma/css/ui.kHeader.css
index c3a945d..c3a945d 100755
--- a/content/karma/css/ui.kHeader.css
+++ b/karma/css/ui.kHeader.css
diff --git a/content/karma/css/ui.scoreboard.css b/karma/css/ui.scoreboard.css
index dbc4f34..dbc4f34 100644..100755
--- a/content/karma/css/ui.scoreboard.css
+++ b/karma/css/ui.scoreboard.css
diff --git a/karma/image/I_user_a.gif b/karma/image/I_user_a.gif
new file mode 100755
index 0000000..6b365fc
--- /dev/null
+++ b/karma/image/I_user_a.gif
Binary files differ
diff --git a/content/assets/image/activity-stop.png b/karma/image/activity-stop.png
index 4de10f5..4de10f5 100755
--- a/content/assets/image/activity-stop.png
+++ b/karma/image/activity-stop.png
Binary files differ
diff --git a/content/assets/image/apply.png b/karma/image/apply.png
index ff9a8f3..ff9a8f3 100755
--- a/content/assets/image/apply.png
+++ b/karma/image/apply.png
Binary files differ
diff --git a/content/Explore/css/images/arrow_down_white.png b/karma/image/arrow_down_white.png
index e2b247a..e2b247a 100755
--- a/content/Explore/css/images/arrow_down_white.png
+++ b/karma/image/arrow_down_white.png
Binary files differ
diff --git a/content/assets/image/audio-pause.png b/karma/image/audio-pause.png
index 51a8e65..51a8e65 100644..100755
--- a/content/assets/image/audio-pause.png
+++ b/karma/image/audio-pause.png
Binary files differ
diff --git a/content/assets/image/audio-play.png b/karma/image/audio-play.png
index de5b1e6..de5b1e6 100644..100755
--- a/content/assets/image/audio-play.png
+++ b/karma/image/audio-play.png
Binary files differ
diff --git a/content/assets/image/audio-record.png b/karma/image/audio-record.png
index 386f1b7..386f1b7 100644..100755
--- a/content/assets/image/audio-record.png
+++ b/karma/image/audio-record.png
Binary files differ
diff --git a/content/assets/image/audio-stop.png b/karma/image/audio-stop.png
index 273d42a..273d42a 100644..100755
--- a/content/assets/image/audio-stop.png
+++ b/karma/image/audio-stop.png
Binary files differ
diff --git a/content/Explore/css/images/back_button_hover.png b/karma/image/back_button_hover.png
index 084f4ea..084f4ea 100755
--- a/content/Explore/css/images/back_button_hover.png
+++ b/karma/image/back_button_hover.png
Binary files differ
diff --git a/content/Explore/css/images/back_button_start.png b/karma/image/back_button_start.png
index 31ab319..31ab319 100755
--- a/content/Explore/css/images/back_button_start.png
+++ b/karma/image/back_button_start.png
Binary files differ
diff --git a/content/Explore/css/images/bg.png b/karma/image/bg.png
index 7483a94..7483a94 100755
--- a/content/Explore/css/images/bg.png
+++ b/karma/image/bg.png
Binary files differ
diff --git a/content/Explore/assets/image/bg_footer.png b/karma/image/bg_footer.png
index 8982264..8982264 100755
--- a/content/Explore/assets/image/bg_footer.png
+++ b/karma/image/bg_footer.png
Binary files differ
diff --git a/content/Explore/assets/image/bg_header.png b/karma/image/bg_header.png
index 98213f7..98213f7 100755
--- a/content/Explore/assets/image/bg_header.png
+++ b/karma/image/bg_header.png
Binary files differ
diff --git a/content/Explore/assets/image/bg_title_block.png b/karma/image/bg_title_block.png
index 2c9dacf..2c9dacf 100755
--- a/content/Explore/assets/image/bg_title_block.png
+++ b/karma/image/bg_title_block.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_back.png b/karma/image/btn_back.png
index d9fbf14..d9fbf14 100755
--- a/content/Explore/assets/image/btn_back.png
+++ b/karma/image/btn_back.png
Binary files differ
diff --git a/content/assets/image/btn_back_english.png b/karma/image/btn_back_english.png
index b057304..b057304 100755
--- a/content/assets/image/btn_back_english.png
+++ b/karma/image/btn_back_english.png
Binary files differ
diff --git a/content/assets/image/btn_back_explore.png b/karma/image/btn_back_explore.png
index dfc9e38..dfc9e38 100644..100755
--- a/content/assets/image/btn_back_explore.png
+++ b/karma/image/btn_back_explore.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_back_hover.png b/karma/image/btn_back_hover.png
index 0911fcc..0911fcc 100755
--- a/content/Explore/assets/image/btn_back_hover.png
+++ b/karma/image/btn_back_hover.png
Binary files differ
diff --git a/content/assets/image/btn_back_mathematics.png b/karma/image/btn_back_mathematics.png
index 586c86b..586c86b 100755
--- a/content/assets/image/btn_back_mathematics.png
+++ b/karma/image/btn_back_mathematics.png
Binary files differ
diff --git a/content/karma/image/btn_check.png b/karma/image/btn_check.png
index 84fc229..84fc229 100644..100755
--- a/content/karma/image/btn_check.png
+++ b/karma/image/btn_check.png
Binary files differ
diff --git a/content/karma/image/btn_head_over.png b/karma/image/btn_head_over.png
index 7f35153..7f35153 100644..100755
--- a/content/karma/image/btn_head_over.png
+++ b/karma/image/btn_head_over.png
Binary files differ
diff --git a/content/karma/image/btn_head_selected.png b/karma/image/btn_head_selected.png
index 803db2f..803db2f 100644..100755
--- a/content/karma/image/btn_head_selected.png
+++ b/karma/image/btn_head_selected.png
Binary files differ
diff --git a/content/karma/image/btn_head_up.png b/karma/image/btn_head_up.png
index bebd972..bebd972 100644..100755
--- a/content/karma/image/btn_head_up.png
+++ b/karma/image/btn_head_up.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_help.png b/karma/image/btn_help.png
index 6753e9c..6753e9c 100755
--- a/content/Explore/assets/image/btn_help.png
+++ b/karma/image/btn_help.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_help_hover.png b/karma/image/btn_help_hover.png
index d3ccd92..d3ccd92 100755
--- a/content/Explore/assets/image/btn_help_hover.png
+++ b/karma/image/btn_help_hover.png
Binary files differ
diff --git a/content/Explore/css/images/btn_minus.png b/karma/image/btn_minus.png
index 9a7320d..9a7320d 100755
--- a/content/Explore/css/images/btn_minus.png
+++ b/karma/image/btn_minus.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_next.png b/karma/image/btn_next.png
index 9d70993..9d70993 100755
--- a/content/Explore/assets/image/btn_next.png
+++ b/karma/image/btn_next.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_next_hover.png b/karma/image/btn_next_hover.png
index 2cd4d37..2cd4d37 100755
--- a/content/Explore/assets/image/btn_next_hover.png
+++ b/karma/image/btn_next_hover.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_ole.png b/karma/image/btn_ole.png
index 0e775e9..0e775e9 100755
--- a/content/Explore/assets/image/btn_ole.png
+++ b/karma/image/btn_ole.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_ole_hover.png b/karma/image/btn_ole_hover.png
index c43c5f7..c43c5f7 100755
--- a/content/Explore/assets/image/btn_ole_hover.png
+++ b/karma/image/btn_ole_hover.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_play_again.png b/karma/image/btn_play_again.png
index 3594d18..3594d18 100755
--- a/content/Explore/assets/image/btn_play_again.png
+++ b/karma/image/btn_play_again.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_play_again_hover.png b/karma/image/btn_play_again_hover.png
index ebb8f8c..ebb8f8c 100755
--- a/content/Explore/assets/image/btn_play_again_hover.png
+++ b/karma/image/btn_play_again_hover.png
Binary files differ
diff --git a/content/Explore/assets/image/btn_play_again_mouse_down.png b/karma/image/btn_play_again_mouse_down.png
index 07d6e45..07d6e45 100755
--- a/content/Explore/assets/image/btn_play_again_mouse_down.png
+++ b/karma/image/btn_play_again_mouse_down.png
Binary files differ
diff --git a/content/Explore/css/images/btn_plus.png b/karma/image/btn_plus.png
index 4600d5d..4600d5d 100755
--- a/content/Explore/css/images/btn_plus.png
+++ b/karma/image/btn_plus.png
Binary files differ
diff --git a/content/assets/image/btn_prev.png b/karma/image/btn_prev.png
index d9fbf14..d9fbf14 100755
--- a/content/assets/image/btn_prev.png
+++ b/karma/image/btn_prev.png
Binary files differ
diff --git a/content/assets/image/check.png b/karma/image/check.png
index 84fc229..84fc229 100755
--- a/content/assets/image/check.png
+++ b/karma/image/check.png
Binary files differ
diff --git a/content/assets/image/edit.png b/karma/image/edit.png
index e1ecc42..e1ecc42 100755
--- a/content/assets/image/edit.png
+++ b/karma/image/edit.png
Binary files differ
diff --git a/content/Explore/assets/default/image/favicon.ico b/karma/image/favicon.ico
index 20bf7f1..20bf7f1 100755
--- a/content/Explore/assets/default/image/favicon.ico
+++ b/karma/image/favicon.ico
Binary files differ
diff --git a/content/Explore/assets/image/picClock.png b/karma/image/picClock.png
index 63e50e2..63e50e2 100755
--- a/content/Explore/assets/image/picClock.png
+++ b/karma/image/picClock.png
Binary files differ
diff --git a/content/assets/image/restart.png b/karma/image/restart.png
index 7727f68..7727f68 100644..100755
--- a/content/assets/image/restart.png
+++ b/karma/image/restart.png
Binary files differ
diff --git a/content/assets/image/start.png b/karma/image/start.png
index d789f75..d789f75 100644..100755
--- a/content/assets/image/start.png
+++ b/karma/image/start.png
Binary files differ
diff --git a/content/Explore/assets/image/title_block_lt.png b/karma/image/title_block_lt.png
index 4696182..4696182 100755
--- a/content/Explore/assets/image/title_block_lt.png
+++ b/karma/image/title_block_lt.png
Binary files differ
diff --git a/content/Explore/assets/image/title_block_rt.png b/karma/image/title_block_rt.png
index 37cc44a..37cc44a 100755
--- a/content/Explore/assets/image/title_block_rt.png
+++ b/karma/image/title_block_rt.png
Binary files differ
diff --git a/karma/js/base.js b/karma/js/base.js
new file mode 100755
index 0000000..fc95b41
--- /dev/null
+++ b/karma/js/base.js
@@ -0,0 +1,140 @@
+$(function(){
+
+var k = Karma();
+k.ready(function(){
+ subjectid = 'link' + subject;
+ url=''+window.location;
+ temp = url.split('/');
+ page = temp.pop();
+ activity = temp.pop();
+ temp.push(page);
+ back = temp.join('/');
+ /* set title in head */
+ $('head title')
+ .empty()
+ .text(activity);
+ /* set navbar:
+ linkHome
+ link'subject',
+ linkBack,
+ title,
+ linkEdit or linkApply,linkHelp,
+ linkQuit
+ */
+ $('<div>',{
+ class:'linkHome topbtn_left',
+ id:'linkHome',
+ title:'Home',
+ click:function(){
+ window.location = 'http://localhost:8008/content/index.html';
+ }
+ })
+ .appendTo('#header');
+ cls = 'link' + subject + ' ' + 'topbtn_left';
+ $('<div>',{
+ class:cls,
+ id:subjectid,
+ title:subject,
+ click:function(){
+ window.location='http://localhost:8008/content/courses.html'
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ class:'linkBack topbtn_left',
+ id:'linkBack',
+ title:'Back',
+ click:function(){
+ window.location = back;
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ id:'lesson_title'
+ })
+ .text(activity)
+ .appendTo('#header');
+ $('<img>',{
+ src:'../../../karma/image/title_block_lt.png',
+ class:'title_img'
+ })
+ .prependTo('#lesson_title');
+ $('<img>',{
+ src:'../../../karma/image/title_block_rt.png',
+ class:'title_img'
+ })
+ .appendTo('#lesson_title');
+ $('<div>',{
+ class:'linkQuit topbtn_right',
+ id:'linkQuit',
+ title:'Quit',
+ click:function(){
+ window.close();
+ }
+ })
+ .appendTo('#header');
+ if(mode == 'Faculty'){
+ $('<div>',{
+ class:'linkEdit topbtn_right',
+ id:'linkEdit',
+ title:'Edit',
+ click:function(){
+ window.location = 'http://localhost:8008/contentedit.html'
+ }
+ })
+ .appendTo('#header')
+ }else{
+ score = 70;
+ $('<div',{
+ class:'linkApply topbtn_right',
+ id:'linkApply',
+ title:'Apply',
+ click:function(){
+ $(this).load('http://localhost:8008/cgi-bin/results.py',
+ {'score':score,'subject':subject,'milestone':milestone,'activity':activity},
+ function(responseTxt,status,xhr){
+ if(responseTxt == 1){
+ window.location = 'http://localhost:8008/content/'+subject+'/'+milestone;
+ }else if(responseTxt == 2){
+ window.location = 'http://localhost:8008/content/'+subject;
+ }else{
+ window.location = 'http://localhost:8008/content';
+ };
+ })
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ class:'linkHelp topbtn_right',
+ id:'linkHelp',
+ title:'Help',
+ click:function(){
+ window.location = 'http://localhost:8008/cgi-bin/playHelp.py',
+ {'subject':subject,'milestone':milestone,'activity':activity}
+ }
+ })
+ .appendTo('#header');
+ };
+ // now do the '#footer'
+ $('<div>',{
+ class:'linkPrevScreen botbtn_left',
+ id:'linkPrevScreen',
+ title:'Back',
+ })
+ .appendTo('#footer');
+ $('<div>',{
+ class:'linkNextScreen botbtn_right',
+ id:'linkNextScreen',
+ title:'Next',
+ })
+ .appendTo('#footer');
+ $('<div>',{
+ class:'linkStart botbtn_right',
+ id:'linkStart',
+ title:'Start',
+ })
+ .appendTo('#footer');
+
+}); //end karma ready
+
+}); // end document ready
diff --git a/content/karma/js/clock.js b/karma/js/clock.js
index 20a31cc..20a31cc 100644..100755
--- a/content/karma/js/clock.js
+++ b/karma/js/clock.js
diff --git a/content/karma/js/common.js b/karma/js/common.js
index 1da9e8e..8978c82 100644..100755
--- a/content/karma/js/common.js
+++ b/karma/js/common.js
@@ -59,8 +59,8 @@ function setUpPlayAgain(karma, start_game) {
function setUpLesson(initialize, start_game) {
$(function () {
disableSelection($('body').get()[0]);
- $('#linkPrevLesson').hide();
- $('#linkNextLesson').hide();
+ $('#linkPrevScreen').hide();
+ $('#linkNextScreen').hide();
$("#linkCheck").hide();
disableImageDragging("#lesson_title img");
var karma = lesson_karma();
@@ -79,8 +79,8 @@ function setUpLesson(initialize, start_game) {
function setUpMultiScreenLesson(draw_screen_fns) {
$(function () {
disableSelection($('body').get()[0]);
- $('#linkPrevLesson').hide();
- $('#linkNextLesson').hide();
+ $('#linkPrevScreen').hide();
+ $('#linkNextScreen').hide();
$("#linkCheck").hide();
disableImageDragging("#lesson_title img");
@@ -97,19 +97,19 @@ function setUpMultiScreenLesson(draw_screen_fns) {
$content.empty();
if (current_screen == 0) {
- $('#linkPrevLesson').hide();
+ $('#linkPrevScreen').hide();
} else {
- $('#linkPrevLesson').show();
+ $('#linkPrevScreen').show();
}
if (current_screen == draw_screen_fns.length - 1) {
- $('#linkNextLesson').hide();
+ $('#linkNextScreen').hide();
} else {
- $('#linkNextLesson').show();
+ $('#linkNextScreen').show();
}
draw_screen_fns[current_screen](karma, $content);
};
- $('#linkNextLesson')
+ $('#linkNextScreen')
.click(function () {
if (karma.audio.trigger) {
karma.audio.trigger.play();
@@ -117,7 +117,7 @@ function setUpMultiScreenLesson(draw_screen_fns) {
++current_screen;
updateScreen();
});
- $('#linkPrevLesson')
+ $('#linkPrevScreen')
.click(function () {
if (karma.audio.trigger) {
karma.audio.trigger.play();
diff --git a/karma/js/config.js b/karma/js/config.js
new file mode 100755
index 0000000..686b04b
--- /dev/null
+++ b/karma/js/config.js
@@ -0,0 +1,5 @@
+var course = '';
+var milestone = '';
+var subject = 'English';
+var mode = 'Faculty';
+var activity = '';
diff --git a/karma/js/course.js b/karma/js/course.js
new file mode 100755
index 0000000..cc7ef0b
--- /dev/null
+++ b/karma/js/course.js
@@ -0,0 +1,67 @@
+$(function(){
+ /* set title in head */
+ $('head title')
+ .empty()
+ .text(subject);
+ /* set navbar: linkHome, title, linkQuit */
+ $('<div>',{
+ class:'linkHome topbtn_left',
+ id:'linkHome',
+ title:'Home',
+ click:function(){
+ window.location = 'http://localhost:8008/content/index.html';
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ id:'lesson_title'
+ })
+ .text(subject)
+ .appendTo('#header');
+ $('<img>',{
+ src:'../karma/image/title_block_lt.png',
+ class:'title_img'
+ })
+ .prependTo('#lesson_title');
+ $('<img>',{
+ src:'../karma/image/title_block_rt.png',
+ class:'title_img'
+ })
+ .appendTo('#lesson_title');
+ $('<div>',{
+ class:'linkQuit topbtn_right',
+ id:'linkQuit',
+ title:'Quit',
+ click:function(){
+ window.close();
+ }
+ })
+ .appendTo('#header');
+
+ /* for each course, create div */
+ var classes = ['c11','c21','c31','c41','c12','c22','c32','c42','c13','c23','c33','c43'];
+ for(i=0;i<courses.length;i++){
+ cl = classes[i];
+ clid = '#'+cl;
+ a = 'a'+cl;
+ aid = '#a'+cl;
+ $('<div>',{
+ class: cl,
+ id:cl,
+ })
+ .appendTo('#content');
+ $('<a>',{
+ id:a,
+ href:'course_'+courses[i][0]+'.html',
+ width:175,
+ height:175
+ })
+ .appendTo(clid);
+ $('<img>',{
+ src:courses[i][2],
+ alt:courses[i][1]
+ })
+ .appendTo(aid);
+ }
+
+})
diff --git a/content/karma/js/external/jquery-1.4.2.js b/karma/js/external/jquery-1.4.2.js
index fff6776..fff6776 100644..100755
--- a/content/karma/js/external/jquery-1.4.2.js
+++ b/karma/js/external/jquery-1.4.2.js
diff --git a/content/karma/js/external/jquery-ui-1.8.2.js b/karma/js/external/jquery-ui-1.8.2.js
index 03f4828..03f4828 100755
--- a/content/karma/js/external/jquery-ui-1.8.2.js
+++ b/karma/js/external/jquery-ui-1.8.2.js
diff --git a/content/karma/js/external/jquery.effects.blind.js b/karma/js/external/jquery.effects.blind.js
index d9a3b06..d9a3b06 100755
--- a/content/karma/js/external/jquery.effects.blind.js
+++ b/karma/js/external/jquery.effects.blind.js
diff --git a/content/karma/js/external/jquery.effects.bounce.js b/karma/js/external/jquery.effects.bounce.js
index 010585b..010585b 100755
--- a/content/karma/js/external/jquery.effects.bounce.js
+++ b/karma/js/external/jquery.effects.bounce.js
diff --git a/content/karma/js/external/jquery.effects.clip.js b/karma/js/external/jquery.effects.clip.js
index 796ba89..796ba89 100755
--- a/content/karma/js/external/jquery.effects.clip.js
+++ b/karma/js/external/jquery.effects.clip.js
diff --git a/content/karma/js/external/jquery.effects.core.js b/karma/js/external/jquery.effects.core.js
index f3041f5..f3041f5 100755
--- a/content/karma/js/external/jquery.effects.core.js
+++ b/karma/js/external/jquery.effects.core.js
diff --git a/content/karma/js/external/jquery.effects.drop.js b/karma/js/external/jquery.effects.drop.js
index 0059c03..0059c03 100755
--- a/content/karma/js/external/jquery.effects.drop.js
+++ b/karma/js/external/jquery.effects.drop.js
diff --git a/content/karma/js/external/jquery.effects.explode.js b/karma/js/external/jquery.effects.explode.js
index 85ba1dc..85ba1dc 100755
--- a/content/karma/js/external/jquery.effects.explode.js
+++ b/karma/js/external/jquery.effects.explode.js
diff --git a/content/karma/js/external/jquery.effects.fold.js b/karma/js/external/jquery.effects.fold.js
index 946831b..946831b 100755
--- a/content/karma/js/external/jquery.effects.fold.js
+++ b/karma/js/external/jquery.effects.fold.js
diff --git a/content/karma/js/external/jquery.effects.highlight.js b/karma/js/external/jquery.effects.highlight.js
index 5e03e9e..5e03e9e 100755
--- a/content/karma/js/external/jquery.effects.highlight.js
+++ b/karma/js/external/jquery.effects.highlight.js
diff --git a/content/karma/js/external/jquery.effects.pulsate.js b/karma/js/external/jquery.effects.pulsate.js
index 11c5af1..11c5af1 100755
--- a/content/karma/js/external/jquery.effects.pulsate.js
+++ b/karma/js/external/jquery.effects.pulsate.js
diff --git a/content/karma/js/external/jquery.effects.scale.js b/karma/js/external/jquery.effects.scale.js
index 1efb781..1efb781 100755
--- a/content/karma/js/external/jquery.effects.scale.js
+++ b/karma/js/external/jquery.effects.scale.js
diff --git a/content/karma/js/external/jquery.effects.shake.js b/karma/js/external/jquery.effects.shake.js
index 050894b..050894b 100755
--- a/content/karma/js/external/jquery.effects.shake.js
+++ b/karma/js/external/jquery.effects.shake.js
diff --git a/content/karma/js/external/jquery.effects.slide.js b/karma/js/external/jquery.effects.slide.js
index d0719a7..d0719a7 100755
--- a/content/karma/js/external/jquery.effects.slide.js
+++ b/karma/js/external/jquery.effects.slide.js
diff --git a/content/karma/js/external/jquery.effects.transfer.js b/karma/js/external/jquery.effects.transfer.js
index 4c212ca..4c212ca 100755
--- a/content/karma/js/external/jquery.effects.transfer.js
+++ b/karma/js/external/jquery.effects.transfer.js
diff --git a/content/karma/js/external/jquery.ui.accordion.js b/karma/js/external/jquery.ui.accordion.js
index 7d926e0..7d926e0 100755
--- a/content/karma/js/external/jquery.ui.accordion.js
+++ b/karma/js/external/jquery.ui.accordion.js
diff --git a/content/karma/js/external/jquery.ui.autocomplete.js b/karma/js/external/jquery.ui.autocomplete.js
index 9a12a6b..9a12a6b 100755
--- a/content/karma/js/external/jquery.ui.autocomplete.js
+++ b/karma/js/external/jquery.ui.autocomplete.js
diff --git a/content/karma/js/external/jquery.ui.button.js b/karma/js/external/jquery.ui.button.js
index d318e3d..d318e3d 100755
--- a/content/karma/js/external/jquery.ui.button.js
+++ b/karma/js/external/jquery.ui.button.js
diff --git a/content/karma/js/external/jquery.ui.core.js b/karma/js/external/jquery.ui.core.js
index 8044802..8044802 100755
--- a/content/karma/js/external/jquery.ui.core.js
+++ b/karma/js/external/jquery.ui.core.js
diff --git a/content/karma/js/external/jquery.ui.datepicker.js b/karma/js/external/jquery.ui.datepicker.js
index cad1d58..cad1d58 100755
--- a/content/karma/js/external/jquery.ui.datepicker.js
+++ b/karma/js/external/jquery.ui.datepicker.js
diff --git a/content/karma/js/external/jquery.ui.dialog.js b/karma/js/external/jquery.ui.dialog.js
index 5f9b1f8..5f9b1f8 100755
--- a/content/karma/js/external/jquery.ui.dialog.js
+++ b/karma/js/external/jquery.ui.dialog.js
diff --git a/content/karma/js/external/jquery.ui.draggable.js b/karma/js/external/jquery.ui.draggable.js
index b4c1070..b4c1070 100755
--- a/content/karma/js/external/jquery.ui.draggable.js
+++ b/karma/js/external/jquery.ui.draggable.js
diff --git a/content/karma/js/external/jquery.ui.droppable.js b/karma/js/external/jquery.ui.droppable.js
index b6a15fd..b6a15fd 100755
--- a/content/karma/js/external/jquery.ui.droppable.js
+++ b/karma/js/external/jquery.ui.droppable.js
diff --git a/content/karma/js/external/jquery.ui.mouse.js b/karma/js/external/jquery.ui.mouse.js
index 871edd8..871edd8 100755
--- a/content/karma/js/external/jquery.ui.mouse.js
+++ b/karma/js/external/jquery.ui.mouse.js
diff --git a/content/karma/js/external/jquery.ui.position.js b/karma/js/external/jquery.ui.position.js
index 50dd57f..50dd57f 100755
--- a/content/karma/js/external/jquery.ui.position.js
+++ b/karma/js/external/jquery.ui.position.js
diff --git a/content/karma/js/external/jquery.ui.progressbar.js b/karma/js/external/jquery.ui.progressbar.js
index 4bc092d..4bc092d 100755
--- a/content/karma/js/external/jquery.ui.progressbar.js
+++ b/karma/js/external/jquery.ui.progressbar.js
diff --git a/content/karma/js/external/jquery.ui.resizable.js b/karma/js/external/jquery.ui.resizable.js
index 0a782bb..0a782bb 100755
--- a/content/karma/js/external/jquery.ui.resizable.js
+++ b/karma/js/external/jquery.ui.resizable.js
diff --git a/content/karma/js/external/jquery.ui.selectable.js b/karma/js/external/jquery.ui.selectable.js
index bc707d3..bc707d3 100755
--- a/content/karma/js/external/jquery.ui.selectable.js
+++ b/karma/js/external/jquery.ui.selectable.js
diff --git a/content/karma/js/external/jquery.ui.slider.js b/karma/js/external/jquery.ui.slider.js
index 81d854b..81d854b 100755
--- a/content/karma/js/external/jquery.ui.slider.js
+++ b/karma/js/external/jquery.ui.slider.js
diff --git a/content/karma/js/external/jquery.ui.sortable.js b/karma/js/external/jquery.ui.sortable.js
index fe9898e..fe9898e 100755
--- a/content/karma/js/external/jquery.ui.sortable.js
+++ b/karma/js/external/jquery.ui.sortable.js
diff --git a/content/karma/js/external/jquery.ui.tabs.js b/karma/js/external/jquery.ui.tabs.js
index 1f94d52..1f94d52 100755
--- a/content/karma/js/external/jquery.ui.tabs.js
+++ b/karma/js/external/jquery.ui.tabs.js
diff --git a/content/karma/js/external/jquery.ui.widget.js b/karma/js/external/jquery.ui.widget.js
index 6425d08..6425d08 100755
--- a/content/karma/js/external/jquery.ui.widget.js
+++ b/karma/js/external/jquery.ui.widget.js
diff --git a/content/karma/js/external/minified/jquery-1.4.2.min.js b/karma/js/external/minified/jquery-1.4.2.min.js
index 7c24308..7c24308 100644..100755
--- a/content/karma/js/external/minified/jquery-1.4.2.min.js
+++ b/karma/js/external/minified/jquery-1.4.2.min.js
diff --git a/content/karma/js/external/minified/jquery-ui-1.8.2.min.js b/karma/js/external/minified/jquery-ui-1.8.2.min.js
index c11e844..c11e844 100755
--- a/content/karma/js/external/minified/jquery-ui-1.8.2.min.js
+++ b/karma/js/external/minified/jquery-ui-1.8.2.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.blind.min.js b/karma/js/external/minified/jquery.effects.blind.min.js
index e6b6af3..e6b6af3 100755
--- a/content/karma/js/external/minified/jquery.effects.blind.min.js
+++ b/karma/js/external/minified/jquery.effects.blind.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.bounce.min.js b/karma/js/external/minified/jquery.effects.bounce.min.js
index 3a077d0..3a077d0 100755
--- a/content/karma/js/external/minified/jquery.effects.bounce.min.js
+++ b/karma/js/external/minified/jquery.effects.bounce.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.clip.min.js b/karma/js/external/minified/jquery.effects.clip.min.js
index 87ecf75..87ecf75 100755
--- a/content/karma/js/external/minified/jquery.effects.clip.min.js
+++ b/karma/js/external/minified/jquery.effects.clip.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.core.min.js b/karma/js/external/minified/jquery.effects.core.min.js
index bfc332d..bfc332d 100755
--- a/content/karma/js/external/minified/jquery.effects.core.min.js
+++ b/karma/js/external/minified/jquery.effects.core.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.drop.min.js b/karma/js/external/minified/jquery.effects.drop.min.js
index 29da2f0..29da2f0 100755
--- a/content/karma/js/external/minified/jquery.effects.drop.min.js
+++ b/karma/js/external/minified/jquery.effects.drop.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.explode.min.js b/karma/js/external/minified/jquery.effects.explode.min.js
index c5a5acb..c5a5acb 100755
--- a/content/karma/js/external/minified/jquery.effects.explode.min.js
+++ b/karma/js/external/minified/jquery.effects.explode.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.fold.min.js b/karma/js/external/minified/jquery.effects.fold.min.js
index 28b1fe2..28b1fe2 100755
--- a/content/karma/js/external/minified/jquery.effects.fold.min.js
+++ b/karma/js/external/minified/jquery.effects.fold.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.highlight.min.js b/karma/js/external/minified/jquery.effects.highlight.min.js
index 14baa2b..14baa2b 100755
--- a/content/karma/js/external/minified/jquery.effects.highlight.min.js
+++ b/karma/js/external/minified/jquery.effects.highlight.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.pulsate.min.js b/karma/js/external/minified/jquery.effects.pulsate.min.js
index 6b0a9d9..6b0a9d9 100755
--- a/content/karma/js/external/minified/jquery.effects.pulsate.min.js
+++ b/karma/js/external/minified/jquery.effects.pulsate.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.scale.min.js b/karma/js/external/minified/jquery.effects.scale.min.js
index 775137d..775137d 100755
--- a/content/karma/js/external/minified/jquery.effects.scale.min.js
+++ b/karma/js/external/minified/jquery.effects.scale.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.shake.min.js b/karma/js/external/minified/jquery.effects.shake.min.js
index 6e8c812..6e8c812 100755
--- a/content/karma/js/external/minified/jquery.effects.shake.min.js
+++ b/karma/js/external/minified/jquery.effects.shake.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.slide.min.js b/karma/js/external/minified/jquery.effects.slide.min.js
index c7dd62b..c7dd62b 100755
--- a/content/karma/js/external/minified/jquery.effects.slide.min.js
+++ b/karma/js/external/minified/jquery.effects.slide.min.js
diff --git a/content/karma/js/external/minified/jquery.effects.transfer.min.js b/karma/js/external/minified/jquery.effects.transfer.min.js
index ac2f3ae..ac2f3ae 100755
--- a/content/karma/js/external/minified/jquery.effects.transfer.min.js
+++ b/karma/js/external/minified/jquery.effects.transfer.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.accordion.min.js b/karma/js/external/minified/jquery.ui.accordion.min.js
index c934ee5..c934ee5 100755
--- a/content/karma/js/external/minified/jquery.ui.accordion.min.js
+++ b/karma/js/external/minified/jquery.ui.accordion.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.autocomplete.min.js b/karma/js/external/minified/jquery.ui.autocomplete.min.js
index fcb31f6..fcb31f6 100755
--- a/content/karma/js/external/minified/jquery.ui.autocomplete.min.js
+++ b/karma/js/external/minified/jquery.ui.autocomplete.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.button.min.js b/karma/js/external/minified/jquery.ui.button.min.js
index 82cc0db..82cc0db 100755
--- a/content/karma/js/external/minified/jquery.ui.button.min.js
+++ b/karma/js/external/minified/jquery.ui.button.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.core.min.js b/karma/js/external/minified/jquery.ui.core.min.js
index 02489b6..02489b6 100755
--- a/content/karma/js/external/minified/jquery.ui.core.min.js
+++ b/karma/js/external/minified/jquery.ui.core.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.datepicker.min.js b/karma/js/external/minified/jquery.ui.datepicker.min.js
index 8f7c445..8f7c445 100755
--- a/content/karma/js/external/minified/jquery.ui.datepicker.min.js
+++ b/karma/js/external/minified/jquery.ui.datepicker.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.dialog.min.js b/karma/js/external/minified/jquery.ui.dialog.min.js
index ec04655..ec04655 100755
--- a/content/karma/js/external/minified/jquery.ui.dialog.min.js
+++ b/karma/js/external/minified/jquery.ui.dialog.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.draggable.min.js b/karma/js/external/minified/jquery.ui.draggable.min.js
index d334f13..d334f13 100755
--- a/content/karma/js/external/minified/jquery.ui.draggable.min.js
+++ b/karma/js/external/minified/jquery.ui.draggable.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.droppable.min.js b/karma/js/external/minified/jquery.ui.droppable.min.js
index 6e5e9f3..6e5e9f3 100755
--- a/content/karma/js/external/minified/jquery.ui.droppable.min.js
+++ b/karma/js/external/minified/jquery.ui.droppable.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.mouse.min.js b/karma/js/external/minified/jquery.ui.mouse.min.js
index 7aa25c2..7aa25c2 100755
--- a/content/karma/js/external/minified/jquery.ui.mouse.min.js
+++ b/karma/js/external/minified/jquery.ui.mouse.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.position.min.js b/karma/js/external/minified/jquery.ui.position.min.js
index d343d7d..d343d7d 100755
--- a/content/karma/js/external/minified/jquery.ui.position.min.js
+++ b/karma/js/external/minified/jquery.ui.position.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.progressbar.min.js b/karma/js/external/minified/jquery.ui.progressbar.min.js
index a8bb5f1..a8bb5f1 100755
--- a/content/karma/js/external/minified/jquery.ui.progressbar.min.js
+++ b/karma/js/external/minified/jquery.ui.progressbar.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.resizable.min.js b/karma/js/external/minified/jquery.ui.resizable.min.js
index 197781e..197781e 100755
--- a/content/karma/js/external/minified/jquery.ui.resizable.min.js
+++ b/karma/js/external/minified/jquery.ui.resizable.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.selectable.min.js b/karma/js/external/minified/jquery.ui.selectable.min.js
index 571575c..571575c 100755
--- a/content/karma/js/external/minified/jquery.ui.selectable.min.js
+++ b/karma/js/external/minified/jquery.ui.selectable.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.slider.min.js b/karma/js/external/minified/jquery.ui.slider.min.js
index 565fb84..565fb84 100755
--- a/content/karma/js/external/minified/jquery.ui.slider.min.js
+++ b/karma/js/external/minified/jquery.ui.slider.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.sortable.min.js b/karma/js/external/minified/jquery.ui.sortable.min.js
index 32b1c37..32b1c37 100755
--- a/content/karma/js/external/minified/jquery.ui.sortable.min.js
+++ b/karma/js/external/minified/jquery.ui.sortable.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.tabs.min.js b/karma/js/external/minified/jquery.ui.tabs.min.js
index e88728a..e88728a 100755
--- a/content/karma/js/external/minified/jquery.ui.tabs.min.js
+++ b/karma/js/external/minified/jquery.ui.tabs.min.js
diff --git a/content/karma/js/external/minified/jquery.ui.widget.min.js b/karma/js/external/minified/jquery.ui.widget.min.js
index 65cdc9d..65cdc9d 100755
--- a/content/karma/js/external/minified/jquery.ui.widget.min.js
+++ b/karma/js/external/minified/jquery.ui.widget.min.js
diff --git a/content/karma/js/global.js b/karma/js/global.js
index bf0eb28..bf0eb28 100644..100755
--- a/content/karma/js/global.js
+++ b/karma/js/global.js
diff --git a/content/karma/js/jquery.clickable.js b/karma/js/jquery.clickable.js
index 9ff9dac..9ff9dac 100644..100755
--- a/content/karma/js/jquery.clickable.js
+++ b/karma/js/jquery.clickable.js
diff --git a/content/karma/js/jquery.i18n.en.js b/karma/js/jquery.i18n.en.js
index 6ece94a..6ece94a 100644..100755
--- a/content/karma/js/jquery.i18n.en.js
+++ b/karma/js/jquery.i18n.en.js
diff --git a/content/karma/js/jquery.i18n.js b/karma/js/jquery.i18n.js
index bdda533..bdda533 100644..100755
--- a/content/karma/js/jquery.i18n.js
+++ b/karma/js/jquery.i18n.js
diff --git a/content/karma/js/jquery.i18n.ne.js b/karma/js/jquery.i18n.ne.js
index 76862d0..76862d0 100644..100755
--- a/content/karma/js/jquery.i18n.ne.js
+++ b/karma/js/jquery.i18n.ne.js
diff --git a/content/karma/js/jquery.keyfilter.js b/karma/js/jquery.keyfilter.js
index d4d24cb..d4d24cb 100644..100755
--- a/content/karma/js/jquery.keyfilter.js
+++ b/karma/js/jquery.keyfilter.js
diff --git a/content/karma/js/jquery.strings.js b/karma/js/jquery.strings.js
index d02afed..d02afed 100644..100755
--- a/content/karma/js/jquery.strings.js
+++ b/karma/js/jquery.strings.js
diff --git a/content/karma/js/jquery.svg.js b/karma/js/jquery.svg.js
index cf3e811..cf3e811 100644..100755
--- a/content/karma/js/jquery.svg.js
+++ b/karma/js/jquery.svg.js
diff --git a/content/Explore/js/jquery.watermarkinput.js b/karma/js/jquery.watermarkinput.js
index fefa670..fefa670 100755
--- a/content/Explore/js/jquery.watermarkinput.js
+++ b/karma/js/jquery.watermarkinput.js
diff --git a/content/karma/js/kDoc.js b/karma/js/kDoc.js
index 2635fe7..2635fe7 100755
--- a/content/karma/js/kDoc.js
+++ b/karma/js/kDoc.js
diff --git a/content/karma/js/kStart.js b/karma/js/kStart.js
index 51b5f92..51b5f92 100644..100755
--- a/content/karma/js/kStart.js
+++ b/karma/js/kStart.js
diff --git a/content/karma/js/karma.js b/karma/js/karma.js
index ce989aa..ce989aa 100644..100755
--- a/content/karma/js/karma.js
+++ b/karma/js/karma.js
diff --git a/karma/js/lesson.js b/karma/js/lesson.js
new file mode 100755
index 0000000..8a6591c
--- /dev/null
+++ b/karma/js/lesson.js
@@ -0,0 +1,260 @@
+$(function(){
+
+var k = Karma();
+k.ready(function(){
+ var url = ' ' + window.location;
+ var temp = url.split('/')
+ var course = temp.pop().slice(7,9); //course_xx.html
+ var subject = temp.pop();
+ subjectid = 'link' + subject;
+ /* set title in head */
+ $('head title')
+ .empty()
+ .text(subject);
+ /* set navbar: linkHome link'subject', title, linkQuit */
+ $('<div>',{
+ class:'linkHome topbtn_left',
+ id:'linkHome',
+ title:'Home',
+ click:function(){
+ window.location = 'http://localhost:8008/content/index.html';
+ }
+ })
+ .appendTo('#header');
+ cls = 'link' + subjectid + ' ' + 'topbtn_left';
+ $('<div>',{
+ class:cls,
+ id:subjectid,
+ title:subject,
+ click:function(){
+ location='http://localhost:8008/content/courses.html'
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ id:'lesson_title'
+ })
+ .text(subject)
+ .appendTo('#header');
+ $('<img>',{
+ src:'../karma/image/title_block_lt.png',
+ class:'title_img'
+ })
+ .prependTo('#lesson_title');
+ $('<img>',{
+ src:'../karma/image/title_block_rt.png',
+ class:'title_img'
+ })
+ .appendTo('#lesson_title');
+ $('<div>',{
+ class:'linkQuit topbtn_right',
+ id:'linkQuit',
+ title:'Quit',
+ click:function(){
+ window.close();
+ }
+ })
+ .appendTo('#header');
+
+ function setPath(xy){
+ pth = "unavailable.html";
+ if (xy[3] == "EPaath"){
+ pth = "../../../src/FrameWork.html#" + xy[4];
+ };
+ if (xy[3] == "basic"){
+ pth = xy[4] + '/index.html';
+ };
+ if (xy[3] == 'Karma'){
+ pth = xy[4] + '/index.html';
+ };
+ if (xy[3] == 'Sugar'){
+ pth = xy[4] + '/index.html';
+ };
+ window.location = pth;
+ };
+
+ function drawMilestone(ctx, cellsize, x, y, capcolor, number){
+ var capcolor;
+ x = activity[6];
+ y = activity[7];
+ capcolor = activity[5];
+ ctx.fillStyle = 'chartreuse';
+ ctx.fillRect(x,y-cellsize,cellsize,cellsize);
+ ctx.fillStyle = 'black';
+ ctx.fillText(number, x + (cellsize * 0.3), y-(cellsize * 0.4), cellsize);
+ ctx.beginPath();
+ ctx.moveTo(x, y-cellsize);
+ ctx.arc(x+0.5*cellsize,y-cellsize,0.5*cellsize,Math.PI,0,0);
+ ctx.closePath();
+ ctx.fillStyle = capcolor;
+ ctx.fill();
+ ctx.fillStyle = 'yellow';
+ };
+
+ function drawarrow(ctx, x, y, sz) {
+ ctx.fillStyle = 'black'
+ ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
+ ctx.moveTo(x-sz/2,y);
+ ctx.lineTo(x-sz/5,y+sz/8);
+ ctx.moveTo(x-sz/2,y+sz/2);
+ ctx.lineTo(x-sz/5,y+sz/8);
+ ctx.stroke();
+ };
+
+ function draw(){
+ var canvas = document.getElementById('ladder');
+ if (canvas.getContext){
+ var ctx = canvas.getContext('2d');
+ var cells = 6;
+ var rows = 2 + (activities.length / cells);
+ var maxx = 1200;
+ var cellsize = 64;
+ var sz = cellsize;
+ var maxy = rows * 1.5 * cellsize;
+ if (maxy < 673){
+ maxy = 673;;
+ };
+ canvas.setAttribute('width', maxx);
+ canvas.setAttribute('height', maxy);
+ var x = 0;
+ var y = 0;
+ var odd = 1;
+ var xstart = 1.7 * cellsize;
+ var ystart = maxy - cellsize;
+ var row = 0;
+ var cell = 0;
+ var id = -1;
+ var ix = 0;
+ var idm = 0;
+ var activityNumber = 0;
+ var flag = 0;
+ var il = ""
+ var xy;
+ var pth;
+ var count = 0;
+ // set up callback
+ $("canvas").click(function($e) {
+ // find out which activity in activities was clicked
+ x = $e.pageX
+ y = $e.pageY
+ ctx.fillStyle = 'black'
+ $.each(activities, function() {
+ xy = this;
+ //if a hit, download if necessary, go to unit
+ hit = (x > xy[6])
+ && (x < xy[6] + cellsize)
+ && (y < xy[7])
+ && (y > xy[7] - cellsize)
+ if(hit) {
+ if(mode == 'Faculty') {
+ setPath(xy);
+ }else if (xy[5] == 'red'){
+ setPath(xy);
+ };
+ };
+ });
+ });
+ // now draw ladder
+ ctx.font = "14pt Arial";
+ ctx.textAlign = "center";
+ x = xstart;
+ y = ystart;
+ ctx.beginPath();
+ sz = cellsize;
+ drawarrow(ctx, x, y, sz);
+ offset=0;
+ delta = 1;
+ for(row=0;row<rows;row++){
+ if (activityNumber == activities.length) {
+ break;
+ };
+ if (offset == 0){
+ x = xstart;
+ }else{
+ x = xstart+offset-sz*3/2;
+ };
+ for(cell=0;cell<cells;cell++){
+ xsave = x;
+ if (activityNumber < activities.length){
+ ctx.fillStyle = 'yellow';
+ ctx.fillRect(x,y,sz*3/2, sz/4);
+ activity = activities[activityNumber];
+ activity.push(x)
+ activity.push(y)
+ activities[activityNumber] = activity;
+ if(''+activity[0] == '0'){
+ drawMilestone(ctx, cellsize, x, y, activity[5],''+activity[1]);
+ }else{
+ // draw flag
+ ctx.moveTo(x,y);
+ ctx.lineTo(x,y-cellsize);
+ ctx.strokeStyle = 'black';
+ ctx.stroke();
+ ctx.fillStyle = activity[5];
+ ctx.fillRect(x,y-cellsize,cellsize,cellsize/20);
+ ctx.textAlign='center';
+ ctx.font = '20pt Arial';
+ ctx.fillStyle = 'black';
+ ctx.fillText(''+activity[1],x+cellsize/2,y-cellsize/2-10,cellsize);
+ }
+ activityNumber += 1;
+ x = x + 3/2*sz;
+ if (delta > 0) {
+ if (cell+1 < cells) {
+ ctx.fillstyle='yellow';
+ ctx.fillRect(x,y,sz,sz/4);
+ x = xsave + sz*5/2;
+ }else{
+ x = xsave + sz*3/2;
+ };
+ }else{
+ if (cell > 0) {
+ ctx.fillStyle = 'yellow';
+ ctx.fillRect(x,y,sz,sz/4);
+ };
+ if (cell+1<cells){
+ x = xsave - sz*5/2;
+ }else{
+ x = xsave-sz*3/2;
+ };
+ };
+ };
+ };
+ if ((row + 1 < rows) && (activity < activities.length)) {
+ if (row % 2 == 0) {
+ ctx.beginPath();
+ ctx.moveTo(x,y);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
+ ctx.closePath();
+ ctx.fillStyle='yellow'
+ ctx.fill()
+ }else{
+ x = xstart;
+ ctx.beginPath();
+ ctx.moveTo(x,y);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
+ ctx.closePath();
+ ctx.fillStyle='yellow'
+ ctx.fill()
+ }
+ }
+ y = y - 2.25 * cellsize;
+ offset = x - xstart;
+ delta = -delta;
+ }
+ }else{
+ alert('canvas not defined');
+ };
+ };
+
+ draw();
+
+}); //end karma ready
+
+}); // end document ready
diff --git a/karma/js/main.js b/karma/js/main.js
new file mode 100755
index 0000000..66c6bae
--- /dev/null
+++ b/karma/js/main.js
@@ -0,0 +1,17 @@
+$(function(){
+ for(i=0;i<subjects.length;i++){
+ subject = subjects[i][1];
+ divid = '#'+subject
+ if(mode=='Faculty'){
+ $(divid)
+ .attr('href','http://localhost:8008/content/'+subject+'/courses.html')
+ }else{
+ $(divid)
+ .attr('href','http://localhost:8008/content/'+subject+'/course_'+mode+'.html')
+ };
+ };
+ $('<div id="work" />')
+ .load('http://localhost:8008/cgi-bin/setUpSubject.py',
+ {'subject':subject}
+ );
+});
diff --git a/content/karma/js/multiple-choice.js b/karma/js/multiple-choice.js
index b9d3c50..b9d3c50 100644..100755
--- a/content/karma/js/multiple-choice.js
+++ b/karma/js/multiple-choice.js
diff --git a/content/js/lesson.js b/karma/js/oldlesson.js
index 902fefe..902fefe 100755
--- a/content/js/lesson.js
+++ b/karma/js/oldlesson.js
diff --git a/content/Explore/js/ui.kHeader.js b/karma/js/ui.kHeader.js
index 966c85a..966c85a 100755
--- a/content/Explore/js/ui.kHeader.js
+++ b/karma/js/ui.kHeader.js
diff --git a/content/karma/js/ui.scoreboard.js b/karma/js/ui.scoreboard.js
index c3c1d3c..c3c1d3c 100644..100755
--- a/content/karma/js/ui.scoreboard.js
+++ b/karma/js/ui.scoreboard.js
diff --git a/karma/js/unit.js b/karma/js/unit.js
new file mode 100755
index 0000000..c6d8392
--- /dev/null
+++ b/karma/js/unit.js
@@ -0,0 +1,248 @@
+$(function(){
+
+var k = Karma();
+k.ready(function(){
+ url = ''+window.location;
+ temp = url.split('/');
+ course = temp.pop().slice(7,9)
+ subject = temp.pop()
+ subjectid = 'link'+subject;
+ $('<div id="temp">')
+ .load('http://localhost:8008/cgi-bin/setConfig.py',
+ {'key':'subject','value':subject});
+ /* set title in head */
+ $('head title')
+ .empty()
+ .text(subject);
+ /* set navbar: linkHome link'subject', title, linkQuit */
+ $('<div>',{
+ class:'linkHome topbtn_left',
+ id:'linkHome',
+ title:'Home',
+ click:function(){
+ window.location = 'http://localhost:8008/content/index.html';
+ }
+ })
+ .appendTo('#header');
+ cls = 'link' + subjectid + ' ' + 'topbtn_left';
+ $('<div>',{
+ class:cls,
+ id:subjectid,
+ title:subject,
+ click:function(){
+ location='http://localhost:8008/content/courses.html'
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ id:'lesson_title'
+ })
+ .text(subject)
+ .appendTo('#header');
+ $('<img>',{
+ src:'../karma/image/title_block_lt.png',
+ class:'title_img'
+ })
+ .prependTo('#lesson_title');
+ $('<img>',{
+ src:'../karma/image/title_block_rt.png',
+ class:'title_img'
+ })
+ .appendTo('#lesson_title');
+ $('<div>',{
+ class:'linkQuit topbtn_right',
+ id:'linkQuit',
+ title:'Quit',
+ click:function(){
+ window.close();
+ }
+ })
+ .appendTo('#header');
+
+ function chkDownload(xy){
+ if (xy[5].indexOf('cyan')>-1) { //download
+ alert(subject + ' ' + course + ' ' + xy[4]);
+ $('<div id="temp" />').load(
+ 'http://localhost:8008/cgi-bin/fetchMilestone.py',
+ {'subject':subject,'course':course, 'milestone':xy[4]},
+ function(responseText, status, xhr) {
+ pth = xy[4]+'/index.html';
+ window.location = pth;
+ });
+ }else{
+ pth = xy[4]+'/index.html';
+ window.location = pth;
+ };
+ }
+
+ function drawMilestone(ctx, cellsize, x, y, capcolor, number){
+ var capcolor;
+ x = activity[6];
+ y = activity[7];
+ capcolor = activity[5];
+ ctx.fillStyle = 'chartreuse';
+ ctx.fillRect(x,y-cellsize,cellsize,cellsize);
+ ctx.fillStyle = 'black'
+ ctx.fillText(number, x + (cellsize * 0.3), y-(cellsize * 0.4), cellsize);
+ ctx.beginPath();
+ ctx.moveTo(x, y-cellsize);
+ ctx.arc(x+0.5*cellsize,y-cellsize,0.5*cellsize,Math.PI,0,0);
+ ctx.closePath();
+ ctx.fillStyle = capcolor;
+ ctx.fill();
+ ctx.fillStyle = 'yellow';
+ };
+
+ function drawarrow(ctx, x, y, sz) {
+ ctx.fillStyle = 'black'
+ ctx.fillRect(x-sz*4/5,y+sz/8,sz/2,sz/8);
+ ctx.moveTo(x-sz/2,y);
+ ctx.lineTo(x-sz/5,y+sz/8);
+ ctx.moveTo(x-sz/2,y+sz/2);
+ ctx.lineTo(x-sz/5,y+sz/8);
+ ctx.stroke();
+ };
+
+ function draw(mode){
+ var canvas = document.getElementById('ladder');
+ if (canvas.getContext){
+ var ctx = canvas.getContext('2d');
+ var cells = 6;
+ var rows = 2 + (activities.length / cells);
+ var maxx = 1200;
+ var cellsize = 64;
+ var sz = cellsize;
+ var maxy = rows * 1.5 * cellsize;
+ if (maxy < 673){
+ maxy = 673;;
+ };
+ canvas.setAttribute('width', maxx);
+ canvas.setAttribute('height', maxy);
+ var x = 0;
+ var y = 0;
+ var odd = 1;
+ var xstart = 1.7 * cellsize;
+ var ystart = maxy - cellsize;
+ var row = 0;
+ var cell = 0;
+ var id = -1;
+ var ix = 0;
+ var idm = 0;
+ var activityNumber = 0;
+ var flag = 0;
+ var il = ""
+ var xy;
+ var pth;
+ var count = 0;
+ // set up callback
+ $("canvas").click(function($e) {
+ // find out which activity in activities was clicked
+ x = $e.pageX
+ y = $e.pageY
+ ctx.fillStyle = 'black'
+ $.each(activities, function() {
+ xy = this;
+ //if a hit, download if necessary, go to unit
+ hit = (x > xy[6])
+ && (x < xy[6] + cellsize)
+ && (y < xy[7])
+ && (y > xy[7] - cellsize)
+ if(hit) {
+ if(mode == 'Faculty') {
+ chkDownload(xy);
+ }else if (xy[5] == 'red'){
+ chkDownload(xy);
+ };
+ };
+ });
+ });
+ // now draw ladder
+ ctx.font = "14pt Arial";
+ ctx.textAlign = "center";
+ x = xstart;
+ y = ystart;
+ ctx.beginPath();
+ sz = cellsize;
+ drawarrow(ctx, x, y, sz);
+ offset=0;
+ delta = 1;
+ for(row=0;row<rows;row++){
+ if (activityNumber == activities.length) {
+ break;
+ };
+ if (offset == 0){
+ x = xstart;
+ }else{
+ x = xstart+offset-sz*3/2;
+ };
+ for(cell=0;cell<cells;cell++){
+ xsave = x;
+ if (activityNumber < activities.length){
+ ctx.fillStyle = 'yellow';
+ ctx.fillRect(x,y,sz*3/2, sz/4);
+ activity = activities[activityNumber];
+ activity.push(x)
+ activity.push(y)
+ activities[activityNumber] = activity;
+ drawMilestone(ctx, cellsize, x, y, activity[5],''+activity[1]);
+ activityNumber += 1;
+ x = x + 3/2*sz;
+ if (delta > 0) {
+ if (cell+1 < cells) {
+ ctx.fillstyle='yellow';
+ ctx.fillRect(x,y,sz,sz/4);
+ x = xsave + sz*5/2;
+ }else{
+ x = xsave + sz*3/2;
+ };
+ }else{
+ if (cell > 0) {
+ ctx.fillStyle = 'yellow';
+ ctx.fillRect(x,y,sz,sz/4);
+ };
+ if (cell+1<cells){
+ x = xsave - sz*5/2;
+ }else{
+ x = xsave-sz*3/2;
+ };
+ };
+ };
+ };
+ if ((row + 1 < rows) && (activity < activities.length)) {
+ if (row % 2 == 0) {
+ ctx.beginPath();
+ ctx.moveTo(x,y);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI/2, 0, 1);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI*3/2, 1);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, 0, 0);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, 0, Math.PI/2, 0);
+ ctx.closePath();
+ ctx.fillStyle='yellow'
+ ctx.fill()
+ }else{
+ x = xstart;
+ ctx.beginPath();
+ ctx.moveTo(x,y);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI/2, Math.PI, 0);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI*3/2, 0);
+ ctx.arc(x, y-cellsize, cellsize, Math.PI*3/2, Math.PI, 1);
+ ctx.arc(x, y-cellsize, 1.25*cellsize, Math.PI, Math.PI/2, 1);
+ ctx.closePath();
+ ctx.fillStyle='yellow'
+ ctx.fill()
+ }
+ }
+ y = y - 2.25 * cellsize;
+ offset = x - xstart;
+ delta = -delta;
+ }
+ }else{
+ alert('canvas not defined');
+ };
+ };
+
+ draw(mode);
+
+}); //end karma ready
+
+}); // end document ready
diff --git a/launch.py b/launch.py
index 6333382..0e95e30 100755
--- a/launch.py
+++ b/launch.py
@@ -6,6 +6,8 @@ from sugar.datastore import datastore
import subprocess, time, sys
from path import path
+from activities import getSubjects
+from activities import Config
import CGIHTTPServer
import BaseHTTPServer
@@ -22,30 +24,22 @@ except ImportError:
DATAPATH = path(activity.get_activity_root()) / "data"
WORKPATH = DATAPATH / "work"
-SUBJECTS = ['English','Mathematics']
-
log = open('/tmp/loglaunch','w')
-
+print >> log, 'log opened'
class Learn(activity.Activity):
def __init__(self, handle):
activity.Activity.__init__(self, handle)
- self.using_gconf = _using_gconf
- print >> log, 'gconf?', self.using_gconf
- self.nickname = self.get_nick_from_sugar()
- print >> log, 'nick', self.nickname
-
#get serial number and nick
fin = open('/ofw/serial-number','r')
self.serial = fin.read()[:11]
fin.close()
+ self.using_gconf = _using_gconf
self.nickname = self.get_nick_from_sugar()
self.grade = self.nickname[:2]
print >> log, self.serial, self.nickname, self.grade
-
if not path(DATAPATH / self.nickname).exists():
print >> log, 'firstrun'
subprocess.call('cp -rf .mozilla/ .macromedia /home/olpc', shell=True)
- subprocess.call('rm firstrun', shell=True)
#set up student record based on nick
student_record = {'grade':self.grade,
'progress':[],
@@ -54,21 +48,27 @@ class Learn(activity.Activity):
fout = open(DATAPATH / self.nickname,'w')
fout.write(str(student_record))
fout.close()
- #add links for karma folder
- base = path(get_bundle_path()) / 'content'
- karma = base / 'karma'
- for pth in SUBJECTS:
- cwd = base / pth
- subprocess.call('ln -s ' + karma + ' karma',shell=True,cwd=cwd)
- #reset courseware
- for subject in SUBJECTS:
- if subject == 'English':
- sbj = 'en'
- else:
- sbj = 'ma'
- pth = path('content') / subject
- subprocess.call('rm -rf '+pth+'/act*',shell=True)
- subprocess.call('rm -rf '+pth+'/'+sbj+'p*',shell=True)
+ #reset content
+ print >> log,'reset content'
+ subprocess.call('rm -rf content/*',shell=True)
+ pth = path('content') / 'karma'
+ if not pth.exists():
+ subprocess.call('cp -r karma content',shell=True)
+ pth = path('content') / 'subjects.js'
+ if not pth.exists():
+ getSubjects()
+ if not pth.exists():
+ print >> log, 'subject.js not loaded'
+ fin = open(pth,'r')
+ txt = fin.read()
+ fin.close()
+ print >> log, 'subjects.js',txt
+ config = Config()
+ if self.nickname[0] == 'F':
+ config.setConfig('mode','Faculty')
+ else:
+ config.setConfig('mode',self.nickname[:2])
+ config.saveConfig()
#start localserver
#print >> log, 'close any open localserver'
tpid = subprocess.Popen('ps aux |grep CGIHTTPServer', stdout = subprocess.PIPE, shell=True)
@@ -82,9 +82,11 @@ class Learn(activity.Activity):
p= subprocess.Popen(cmd, stdout=subprocess.PIPE,shell=True)
print >> log, 'CGIHTTPServer started', p.pid
#start Firefox
- cmd = './firefox http://localhost:8008/content/index.html'
+ cmd = './firefox http://localhost:8008/content/index.html?'+self.nickname
+ print >> log, 'launch Firefox', cmd
+ log.close()
subprocess.call(cmd, shell=True)
- activity_close()
+ activity.close()
def get_nick_from_sugar(self):
""" Returns nick from Sugar """
@@ -96,17 +98,16 @@ class Learn(activity.Activity):
def write_file(self, file_path):
#we need to read the student record
- fin = open(DATAPATH / self.nickname,'r')
- txt = fin.read()
- fin.close()
- #and save it to the Journal
- fout = open(file_path,'w')
try:
- fout.write(txt)
- finally:
- fout.close()
-
- def activity_close(self):
- log.close()
- self.close(True)
+ fin = open(DATAPATH / self.nickname,'r')
+ txt = fin.read()
+ fin.close()
+ #and save it to the Journal
+ fout = open(file_path,'w')
+ try:
+ fout.write(txt)
+ finally:
+ fout.close()
+ except:
+ pass
diff --git a/content/unavailable.html b/unavailable.html
index 446d1fb..446d1fb 100755
--- a/content/unavailable.html
+++ b/unavailable.html