From 283943248d836822cc792bdfc5e9bedcdf17e9c3 Mon Sep 17 00:00:00 2001 From: hither2forlorn Date: Mon, 01 Mar 2010 09:52:58 +0000 Subject: moving files to the main folder and to make room for new lesso --- diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wav deleted file mode 100755 index f819bdd..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/cheetah.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/correct.ogg b/examples/lessons/6_English_VocabularyAnimals/assets/audio/correct.ogg deleted file mode 100755 index a0d9e3a..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/correct.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wav deleted file mode 100755 index fcc37d4..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/crocodile.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wav deleted file mode 100755 index 06e7834..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/dinosaura.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wav deleted file mode 100755 index 895bfb2..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/giraffe.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.ogg b/examples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.ogg deleted file mode 100755 index 4805e55..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/incorrect.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wav deleted file mode 100755 index 76221ea..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/kangaroo.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wav deleted file mode 100755 index 3b2f590..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/octopus.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wav deleted file mode 100755 index 4dc923d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/panda.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wav deleted file mode 100755 index a08bb5e..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/rhinoceros.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wav deleted file mode 100755 index 3d1fae0..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/whale.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wav b/examples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wav deleted file mode 100755 index 023b627..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/audio/zebra.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.png deleted file mode 100755 index 4bd44fa..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.png deleted file mode 100755 index f421817..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.png deleted file mode 100755 index 7311891..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/check.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/check.png deleted file mode 100755 index 84fc229..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/check.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.png deleted file mode 100755 index 026c35f..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.png deleted file mode 100755 index 46128fc..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.png deleted file mode 100755 index 5d5089b..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.png deleted file mode 100755 index 2a6a6ce..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.png deleted file mode 100755 index ee709fc..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.png deleted file mode 100755 index 66a89ed..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.png deleted file mode 100755 index 2334d3c..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.png deleted file mode 100755 index d4ce4d6..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.png deleted file mode 100755 index e4712f4..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.png deleted file mode 100755 index 45e068b..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/cheetah8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/confirm.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/confirm.png deleted file mode 100755 index cb0b4e2..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/confirm.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/correct.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/correct.png deleted file mode 100755 index ca9b9db..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/correct.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.png deleted file mode 100755 index 17ca28f..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.png deleted file mode 100755 index 88731bc..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.png deleted file mode 100755 index 79d4742..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.png deleted file mode 100755 index 7a3f53b..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.png deleted file mode 100755 index 8bcf1b7..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.png deleted file mode 100755 index 3db2003..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.png deleted file mode 100755 index 498b6d9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.png deleted file mode 100755 index 5b2ff52..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.png deleted file mode 100755 index 8808022..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.png deleted file mode 100755 index ef2bae6..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/crocodile8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.png deleted file mode 100755 index 127e29d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.png deleted file mode 100755 index e9b572b..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.png deleted file mode 100755 index 8b4f731..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.png deleted file mode 100755 index 226d23e..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.png deleted file mode 100755 index 4a94545..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.png deleted file mode 100755 index 4e13670..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.png deleted file mode 100755 index d9e2539..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.png deleted file mode 100755 index f0fd886..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.png deleted file mode 100755 index d18652c..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.png deleted file mode 100755 index 3a69842..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/dinosaur8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.png deleted file mode 100755 index 2ff8d6d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.png deleted file mode 100755 index cdd0c2d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.png deleted file mode 100755 index 7dc2405..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.png deleted file mode 100755 index e947271..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.png deleted file mode 100755 index f881320..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.png deleted file mode 100755 index 484214e..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.png deleted file mode 100755 index 49e26fc..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.png deleted file mode 100755 index ffc8cd1..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.png deleted file mode 100755 index d505a14..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.png deleted file mode 100755 index 1fb13eb..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/giraffe8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/help.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/help.png deleted file mode 100755 index e7faca5..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.png deleted file mode 100755 index 49ee2a2..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/incorrect.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.png deleted file mode 100755 index 22da95d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.png deleted file mode 100755 index c315490..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.png deleted file mode 100755 index a3439d8..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.png deleted file mode 100755 index 439cb5d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.png deleted file mode 100755 index 3a69842..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.png deleted file mode 100755 index 21cf9d3..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.png deleted file mode 100755 index 274c132..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.png deleted file mode 100755 index 6d498a4..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.png deleted file mode 100755 index 58c9350..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.png deleted file mode 100755 index 6061eaa..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/kangaroo8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus.png deleted file mode 100755 index 16576b9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.png deleted file mode 100755 index 3479f45..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.png deleted file mode 100755 index 076ed8d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.png deleted file mode 100755 index 076ed8d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.png deleted file mode 100755 index de27174..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.png deleted file mode 100755 index cf5de59..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.png deleted file mode 100755 index 356abaf..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.png deleted file mode 100755 index 4917d16..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.png deleted file mode 100755 index b8b22e3..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.png deleted file mode 100755 index 986e600..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/octopus8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda.png deleted file mode 100755 index 2c4c9b9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda0.png deleted file mode 100755 index 0beb71f..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda1.png deleted file mode 100755 index fa250a6..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda2.png deleted file mode 100755 index de5efbb..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda3.png deleted file mode 100755 index bfc0878..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda4.png deleted file mode 100755 index 545d8ce..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda5.png deleted file mode 100755 index 5a744c7..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda6.png deleted file mode 100755 index 3a9a5d7..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda7.png deleted file mode 100755 index 77866e9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/panda8.png deleted file mode 100755 index bf1f2be..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/panda8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.png deleted file mode 100755 index 2ccd3b8..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.png deleted file mode 100755 index 64aa29e..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.png deleted file mode 100755 index 1ec1192..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.png deleted file mode 100755 index e2e5d02..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.png deleted file mode 100755 index db94e99..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.png deleted file mode 100755 index fb65f0c..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.png deleted file mode 100755 index e3a6fe3..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.png deleted file mode 100755 index 4de7c10..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.png deleted file mode 100755 index 1b959f3..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.png deleted file mode 100755 index c5d3ec9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/rhinoceros8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.png deleted file mode 100755 index b1c0e90..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.png deleted file mode 100755 index 275daaf..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/volImage.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/volImage.png deleted file mode 100755 index 04ec789..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/volImage.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale.png deleted file mode 100755 index 44f547b..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale0.png deleted file mode 100755 index 4ce8c53..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale1.png deleted file mode 100755 index cf3ac85..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale2.png deleted file mode 100755 index c929bd2..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale3.png deleted file mode 100755 index cc88497..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale4.png deleted file mode 100755 index ce1c5a8..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale5.png deleted file mode 100755 index d81882e..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale6.png deleted file mode 100755 index 68b7e39..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale7.png deleted file mode 100755 index 72697a1..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/whale8.png deleted file mode 100755 index fe072af..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/whale8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra.png deleted file mode 100755 index 0a1ef68..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.png deleted file mode 100755 index 95a838d..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.png deleted file mode 100755 index 369f561..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.png deleted file mode 100755 index c813d08..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.png deleted file mode 100755 index 6c719c9..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.png deleted file mode 100755 index 7b4a4cc..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.png deleted file mode 100755 index cda7488..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.png deleted file mode 100755 index 7fb5451..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.png deleted file mode 100755 index 7f90469..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.png b/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.png deleted file mode 100755 index b4a117f..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/assets/image/zebra8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_VocabularyAnimals/css/lesson.css b/examples/lessons/6_English_VocabularyAnimals/css/lesson.css deleted file mode 100755 index 0a38c18..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/css/lesson.css +++ /dev/null @@ -1,306 +0,0 @@ -@CHARSET "UTF-8"; -/****** Page Styles ****/ - -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: 89px; - width: 100%; - position: absolute; - left: 0px; - top: 0px; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 13px; - padding-left: 5px; -} - - - #linkBack{ - 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: 13px; - padding-right: 5px; -} - #linkHelp{ - width: 60px; height: 60px; - background:url(../assets/image/btn_help.png); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - #linkNext{ - width: 60px; height: 60px; - background:url(../assets/image/btn_next.png); - } - #linkNext:hover{ - background:url(../assets/image/btn_next_hover.png); - } -#footer { - background-image: url(../assets/image/bg_footer.png); - background-repeat: repeat-x; - position: absolute; - height: 69px; - width: 100%; - left: 0px; - bottom: 0px; -} -#score_box { - float: left; - padding-left: 5px; - padding-top: 10px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; -} -#botbtn_right { - float: right; - height: 55px; - /*width: 251px;*/ - padding-right: 5px; - padding-top: 5px; -} - - #linkStart{ - 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{ - 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); - } - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -a img{ - border: 0; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0px auto; - margin-top: 85px; - width: 100%; - height: 400px; - -} - #section{ - width: 1000px; - height: 390px; - margin: 5px auto; - } - - #topText{ - margin: 1px auto; - height: 25px; - font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #0000FF; - text-align:center; - } - #imgAnimalsDisplay{ - margin: 5px auto; - width: 300px; - height: 300px; - text-align:center; - } - #animalText{ - margin: 5px auto; - width: 175px; - height: 25px; - font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #000000; - text-align:center; - - } - - /*** 2nd section ****/ - #infoText{ - padding: 5px; - width: 500px; - height: 30px; - font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #000000; - text-align:center; - - } - .imgVol{ - float:left; - width: 48px; - height: 48px; - background-image: url(../assets/image/volImage.png); - } - #imgPuzzleArea{ - margin-left: 100px; - margin-top: 15px; - width: 306px; - height: 306px; - border:1px solid #A8F42D; - } - .imgPuzzle{ - float: left; - width: 100px; - height: 100px; - border:1px solid #A8F42D; - } - .default{ - background-color: #C8FFC2; - } - - #dragImgSection{ - position:absolute; - top: 25%; - right: 5%; - width: 510px; - height: 306px; - border:1px solid #A8F42D; - } - .imgAnim{ - margin-top: 75px; - } - - .drophover{ - background: #FF9900; - } - - - .backOpaque{ - background-color: #A4A4A4; - opacity: 0.2; - } - - #confirmSection{ - position: absolute; - top: 20%; - left: 42%; - width: 580px; - height: 350px; - - } - #checkAnswer{ - float:left; - margin-top: 50px; - width: 100px; - height: 92px; - } - - #confirmBox{ - margin-top: 50px; - margin-left:30px; - width: 300px; - height: 250px; - border: 2px solid #E2D97F; - background-color: #000; - opacity: 0.8; - -moz-border-radius : 20px; - -webkit-border-radius : 20px; - border-radius : 20px; - - } - - #confimBtn{ - margin: 1em auto; - width: 120px; - height: 35px; - background: url(../assets/image/confirm.png); - } - #dragTxtSection{ - position: absolute; - margin: 0.5em auto; - top: 8%; - right: 10%; - width: 100px; - height: 303px; - border: 2px solid #FF9900; - text-align:center; - } - - #help{ - position:absolute; - right: 20%; - top: 1%; - width: 224px; - height: 525px; - background:url(../assets/image/help.png); - z-index:40; - } - #gameOver{ - position:absolute; - top: 40%; - left: 25%; - width: 500px; - text-align:center; - font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight:bold; - color:red; - } - #gameOverInfo{ - margin-top: 35px; - text-align:center; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#06D946; - - } - .specialText{ - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF9900; - border-bottom: 2px dotted #CCC; - } \ No newline at end of file diff --git a/examples/lessons/6_English_VocabularyAnimals/index.html b/examples/lessons/6_English_VocabularyAnimals/index.html deleted file mode 100755 index a3a5553..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - Class 6 English Vocabulary Animals - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_English_VocabularyAnimals/js/jquery-1.4.js b/examples/lessons/6_English_VocabularyAnimals/js/jquery-1.4.js deleted file mode 100755 index a448490..0000000 --- a/examples/lessons/6_English_VocabularyAnimals/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 = "
a"; - - 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 = ""; - - // 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 = ""; - 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 = "

"; - - // 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 = "
"; - - // 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 = /"; - }, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - - - - - - - - - -
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_English_VocabularyBirds/js/jquery-1.4.js b/examples/lessons/6_English_VocabularyBirds/js/jquery-1.4.js deleted file mode 100755 index a448490..0000000 --- a/examples/lessons/6_English_VocabularyBirds/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 = "
a"; - - 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 = ""; - - // 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 = ""; - 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 = "

"; - - // 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 = "
"; - - // 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 = /"; - }, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - - - - - - - - - - -
-
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_English_alphabeticalOrder/js/jquery-1.3.2.min.js b/examples/lessons/6_English_alphabeticalOrder/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_English_alphabeticalOrder/js/karma.js b/examples/lessons/6_English_alphabeticalOrder/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_English_alphabeticalOrder/js/lesson.js b/examples/lessons/6_English_alphabeticalOrder/js/lesson.js deleted file mode 100755 index c128d56..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/js/lesson.js +++ /dev/null @@ -1,213 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.ogg'}, - {'name':'incorrect','file':'incorrect.ogg'} - ]}); - - k.ready(function(){ - var i,j,flag; - var TOTAL_QUES = 6; - var TOTAL_LEVEL = 3; - var currentDragObject; - var randPositions = []; - var arrangedAns = []; - var sectionNum; //store the three levels values 0,1,2 - var currentAlphaNum; //store the current questions num - var checked; //store the current checked value - var num; - var currentAnsArray = []; //store the current array set of alphabets - var flag_checked; //status flag for one time correct alpahbetical order - var imgCounter; - // six alphabets given to be ordered 6 steps needed to complete the picture 3 levels too complex - var alphabets = new Array('aeroplane','apple','ant','arrow','audio','axe', - 'eagle','ear','east','egg','elephant','engine', - 'fan','fall','fat','first','fog','fun', - 'egg','goat','ladder','leaf','net','tiger', - 'crocodile','deer','elephant','lion','rhinosorous','tiger', - 'bus','flag','glass','nose','pencil','table', - 'bag','ball','banana','bat','bed','bone', - 'cat','camera','class','color','country','cream', - 'cat','cow','dog','donkey','hen','rabbit', - 'dam','dark','den','dog','drink','duck', - 'glass','nail','picture','radio','star','watch', - 'bus','flag','glass','nose','pencil','table', - 'magic','man','many','master','miracle','mouse', - 'pan','pencil','pig','pot','practice','pumpkin', - 'salte','school','short','smile','snake','stick', - 'axe','mountain','plate','umbrella','volley-ball','x-ray', - 'television','temple','toggle','trap','trust','turn', - 'bottle','fish','house','pan','tree','window' - ); - var imageDisplay = new Array('ele0','ele1','ele2','ele3','ele4','ele5','house0','house1','house2','house3','house4','house5', - 'ship0','ship1','ship2','ship3','ship4','ship5'); - var scoreboard = $('#score_box').scoreboard({'layout':'horizontal', - 'winningScore': alphabets.length}); - - var genRandPosition=function (){ - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i2){ - alphaCloudId = 2; - } - var alphaCurId = alphaId + (currentAlphaNum*TOTAL_QUES); - $('#alphaCloud'+alphaCloudId).append('
'+alphabets[alphaCurId]+'
'); - var dragObjCss = { - 'position':'relative','float': 'left','cursor': 'move', - 'width':'100px','height':'30px','padding-left': '20px', - 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica' - }; - $('.dragObjects').css(dragObjCss); - - $('#alphaArrange').append('
'); - var dropObjCss = { - 'width':'222px','height': '33px','margin': '0.65em 0.5em' - }; - $('.dropObjects').css(dropObjCss); - num++; - }; - - function drag_drop(){ - $('.dragObjects').draggable({ containment: '#content'}); - $('.dragObjects').bind('dragstart', function(event, ui) { - currentDragObject = event.target.id; - var currentMonth = parseInt(currentDragObject.substring(4)); - - }); - - $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover' }); - $('.dropObjects').bind('drop', function(event, ui) { - var currentDropObject = event.target.id; - var droppedWord = parseInt(currentDropObject.substring(4)); - arrangedAns[droppedWord] = $('#'+currentDragObject).text(); - }); - } - var display_control = function(){ - if(checked === 1){ - $('#disImg'+imgCounter).show(); - imgCounter++; - next_alphabets(); - } - - }; - var delay_correctShow = function(){ - document.delayForm.delayval.value = 1; - $('#checkAnswer').hide(); - if(currentAlphaNum%6 === 0 && currentAlphaNum != 0){ //next level - $('#section').html(''); - $('#linkNext').show(); - } - else{ - display_control(); - } - }; - - var check_alphabets_order = function(){ - var correct = 0; - for(i=0; i'); - scoreboard.scoreboard('incTotal'); - } - else{ - k.audio.incorrect.play(); - $('#checkAnswer').html(''); - checked = 0; - flag_checked = 1; - } - - t=setTimeout(function(){delay_correctShow();},1000); - - - - - }; - var display_game_over = function(){ - - $('#section').hide(); - $('#gameOver').show(); - $('#gameOver').html(''); - $('#gameOver').append('GAME OVER
Congratulations!!!'); - }; - var next_alphabets = function(){ - if(currentAlphaNum === alphabets.length){ //show all - display_game_over(); - } - else{ - $('#section').html('').append('
'); - $('#section').append('
'); - $('#section').append('
Rearrange the above words in alphabetical order.
'); - $('#section').append('
'); - genRandPosition(); - num = 0; - flag_checked = 0; - for(i = 0; i< TOTAL_QUES ; i++){ - assignAlphabets(randPositions[i]); - } - for(i = 0;i'); - $('#disImg'+i).hide(); - } - next_alphabets(); - } - $('#linkNext').hide(); - $('#linkCheck').click(function(){ - check_alphabets_order(); - }); - $('#linkNext').click(function(){ - $('#linkNext').hide(); - sectionNum += 1; - game_start(); - }); - $('#linkStart').click(function(){ - sectionNum = 0; - currentAlphaNum = 0; - game_start(); - }); - - $('#linkPlayAgain').click(function(){ - scoreboard.scoreboard('reset'); - currentAlphaNum = sectionNum*currentAlphaNum; - game_start(); - }); - }); //end of k.ready -}); //end of document.ready \ No newline at end of file diff --git a/examples/lessons/6_English_alphabeticalOrder/js/ui.core.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.core.js deleted file mode 100755 index 5493e0a..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/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/examples/lessons/6_English_alphabeticalOrder/js/ui.draggable.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.draggable.js deleted file mode 100755 index 0402f0e..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/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() { - $('
') - .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/examples/lessons/6_English_alphabeticalOrder/js/ui.droppable.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.droppable.js deleted file mode 100755 index 8e7be33..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/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/examples/lessons/6_English_alphabeticalOrder/js/ui.scoreboard.js b/examples/lessons/6_English_alphabeticalOrder/js/ui.scoreboard.js deleted file mode 100755 index 53a930a..0000000 --- a/examples/lessons/6_English_alphabeticalOrder/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 = $('
') - .addClass('ui-scoreboard-spacing-' + layoutId); - this._scoreText = $("
Score
") - .addClass('ui-scoreboard-spacing-'+ layoutId + - ' ui-corner-all ui-scoreboard-text') - .appendTo(this.element); - this._score = $("
" + score + "
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-scoreboard-number-' + layoutId) - .appendTo(this.element); - $("
Total
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-corner-all ' + - 'ui-scoreboard-text') - .appendTo(this.element); - this._total = $("
" + total + "
") - .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/examples/lessons/6_English_months/assets/audio/April.wav b/examples/lessons/6_English_months/assets/audio/April.wav deleted file mode 100755 index a6ced1b..0000000 --- a/examples/lessons/6_English_months/assets/audio/April.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/August.wav b/examples/lessons/6_English_months/assets/audio/August.wav deleted file mode 100755 index 8ba28d0..0000000 --- a/examples/lessons/6_English_months/assets/audio/August.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/December.wav b/examples/lessons/6_English_months/assets/audio/December.wav deleted file mode 100755 index 42ee4bb..0000000 --- a/examples/lessons/6_English_months/assets/audio/December.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/February.wav b/examples/lessons/6_English_months/assets/audio/February.wav deleted file mode 100755 index 08da715..0000000 --- a/examples/lessons/6_English_months/assets/audio/February.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/January.wav b/examples/lessons/6_English_months/assets/audio/January.wav deleted file mode 100755 index 7a2d370..0000000 --- a/examples/lessons/6_English_months/assets/audio/January.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/July.wav b/examples/lessons/6_English_months/assets/audio/July.wav deleted file mode 100755 index eb73098..0000000 --- a/examples/lessons/6_English_months/assets/audio/July.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/June.wav b/examples/lessons/6_English_months/assets/audio/June.wav deleted file mode 100755 index ec2ce83..0000000 --- a/examples/lessons/6_English_months/assets/audio/June.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/March.wav b/examples/lessons/6_English_months/assets/audio/March.wav deleted file mode 100755 index 93d4885..0000000 --- a/examples/lessons/6_English_months/assets/audio/March.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/May.wav b/examples/lessons/6_English_months/assets/audio/May.wav deleted file mode 100755 index 09d3f47..0000000 --- a/examples/lessons/6_English_months/assets/audio/May.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/November.wav b/examples/lessons/6_English_months/assets/audio/November.wav deleted file mode 100755 index 24b265b..0000000 --- a/examples/lessons/6_English_months/assets/audio/November.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/October.wav b/examples/lessons/6_English_months/assets/audio/October.wav deleted file mode 100755 index 431b9c7..0000000 --- a/examples/lessons/6_English_months/assets/audio/October.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/September.wav b/examples/lessons/6_English_months/assets/audio/September.wav deleted file mode 100755 index b079f7c..0000000 --- a/examples/lessons/6_English_months/assets/audio/September.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/correct.ogg b/examples/lessons/6_English_months/assets/audio/correct.ogg deleted file mode 100755 index a0d9e3a..0000000 --- a/examples/lessons/6_English_months/assets/audio/correct.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/audio/incorrect.ogg b/examples/lessons/6_English_months/assets/audio/incorrect.ogg deleted file mode 100755 index 4805e55..0000000 --- a/examples/lessons/6_English_months/assets/audio/incorrect.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/April.png b/examples/lessons/6_English_months/assets/image/April.png deleted file mode 100755 index eb87cbe..0000000 --- a/examples/lessons/6_English_months/assets/image/April.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/August.png b/examples/lessons/6_English_months/assets/image/August.png deleted file mode 100755 index 96d59f1..0000000 --- a/examples/lessons/6_English_months/assets/image/August.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/December.png b/examples/lessons/6_English_months/assets/image/December.png deleted file mode 100755 index c060b1c..0000000 --- a/examples/lessons/6_English_months/assets/image/December.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/February.png b/examples/lessons/6_English_months/assets/image/February.png deleted file mode 100755 index d108a2a..0000000 --- a/examples/lessons/6_English_months/assets/image/February.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/January.png b/examples/lessons/6_English_months/assets/image/January.png deleted file mode 100755 index 67d3919..0000000 --- a/examples/lessons/6_English_months/assets/image/January.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/July.png b/examples/lessons/6_English_months/assets/image/July.png deleted file mode 100755 index 67e675c..0000000 --- a/examples/lessons/6_English_months/assets/image/July.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/June.png b/examples/lessons/6_English_months/assets/image/June.png deleted file mode 100755 index 1163da9..0000000 --- a/examples/lessons/6_English_months/assets/image/June.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/March.png b/examples/lessons/6_English_months/assets/image/March.png deleted file mode 100755 index ec189e8..0000000 --- a/examples/lessons/6_English_months/assets/image/March.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/May.png b/examples/lessons/6_English_months/assets/image/May.png deleted file mode 100755 index 4d47b1b..0000000 --- a/examples/lessons/6_English_months/assets/image/May.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/November.png b/examples/lessons/6_English_months/assets/image/November.png deleted file mode 100755 index b259ae2..0000000 --- a/examples/lessons/6_English_months/assets/image/November.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/October.png b/examples/lessons/6_English_months/assets/image/October.png deleted file mode 100755 index e7ad250..0000000 --- a/examples/lessons/6_English_months/assets/image/October.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/September.png b/examples/lessons/6_English_months/assets/image/September.png deleted file mode 100755 index 3b074ee..0000000 --- a/examples/lessons/6_English_months/assets/image/September.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/bg_footer.png b/examples/lessons/6_English_months/assets/image/bg_footer.png deleted file mode 100755 index 4bd44fa..0000000 --- a/examples/lessons/6_English_months/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/bg_header.png b/examples/lessons/6_English_months/assets/image/bg_header.png deleted file mode 100755 index f421817..0000000 --- a/examples/lessons/6_English_months/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/bg_title_block.png b/examples/lessons/6_English_months/assets/image/bg_title_block.png deleted file mode 100755 index 7311891..0000000 --- a/examples/lessons/6_English_months/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_back.png b/examples/lessons/6_English_months/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_back_hover.png b/examples/lessons/6_English_months/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_help.png b/examples/lessons/6_English_months/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_help_hover.png b/examples/lessons/6_English_months/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_next.png b/examples/lessons/6_English_months/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_next_hover.png b/examples/lessons/6_English_months/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_ole.png b/examples/lessons/6_English_months/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_ole_hover.png b/examples/lessons/6_English_months/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_play_again.png b/examples/lessons/6_English_months/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_months/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_start.png b/examples/lessons/6_English_months/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_start_hover.png b/examples/lessons/6_English_months/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_months/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_English_months/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/check.png b/examples/lessons/6_English_months/assets/image/check.png deleted file mode 100755 index 84fc229..0000000 --- a/examples/lessons/6_English_months/assets/image/check.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/correct.png b/examples/lessons/6_English_months/assets/image/correct.png deleted file mode 100755 index 603700d..0000000 --- a/examples/lessons/6_English_months/assets/image/correct.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/incorrect.png b/examples/lessons/6_English_months/assets/image/incorrect.png deleted file mode 100755 index cccf59b..0000000 --- a/examples/lessons/6_English_months/assets/image/incorrect.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_April.png b/examples/lessons/6_English_months/assets/image/small_April.png deleted file mode 100755 index caa4366..0000000 --- a/examples/lessons/6_English_months/assets/image/small_April.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_August.png b/examples/lessons/6_English_months/assets/image/small_August.png deleted file mode 100755 index dca9649..0000000 --- a/examples/lessons/6_English_months/assets/image/small_August.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_December.png b/examples/lessons/6_English_months/assets/image/small_December.png deleted file mode 100755 index ec60fab..0000000 --- a/examples/lessons/6_English_months/assets/image/small_December.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_February.png b/examples/lessons/6_English_months/assets/image/small_February.png deleted file mode 100755 index 733b1fd..0000000 --- a/examples/lessons/6_English_months/assets/image/small_February.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_January.png b/examples/lessons/6_English_months/assets/image/small_January.png deleted file mode 100755 index 3dbfee6..0000000 --- a/examples/lessons/6_English_months/assets/image/small_January.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_July.png b/examples/lessons/6_English_months/assets/image/small_July.png deleted file mode 100755 index e30027a..0000000 --- a/examples/lessons/6_English_months/assets/image/small_July.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_June.png b/examples/lessons/6_English_months/assets/image/small_June.png deleted file mode 100755 index eb4fcdf..0000000 --- a/examples/lessons/6_English_months/assets/image/small_June.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_March.png b/examples/lessons/6_English_months/assets/image/small_March.png deleted file mode 100755 index f35bbd2..0000000 --- a/examples/lessons/6_English_months/assets/image/small_March.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_May.png b/examples/lessons/6_English_months/assets/image/small_May.png deleted file mode 100755 index 6f111b5..0000000 --- a/examples/lessons/6_English_months/assets/image/small_May.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_November.png b/examples/lessons/6_English_months/assets/image/small_November.png deleted file mode 100755 index 8b9e34e..0000000 --- a/examples/lessons/6_English_months/assets/image/small_November.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_October.png b/examples/lessons/6_English_months/assets/image/small_October.png deleted file mode 100755 index 740e302..0000000 --- a/examples/lessons/6_English_months/assets/image/small_October.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/small_September.png b/examples/lessons/6_English_months/assets/image/small_September.png deleted file mode 100755 index 0425852..0000000 --- a/examples/lessons/6_English_months/assets/image/small_September.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/title_block_lt.png b/examples/lessons/6_English_months/assets/image/title_block_lt.png deleted file mode 100755 index b1c0e90..0000000 --- a/examples/lessons/6_English_months/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/assets/image/title_block_rt.png b/examples/lessons/6_English_months/assets/image/title_block_rt.png deleted file mode 100755 index 275daaf..0000000 --- a/examples/lessons/6_English_months/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_months/css/lesson.css b/examples/lessons/6_English_months/css/lesson.css deleted file mode 100755 index 1660e95..0000000 --- a/examples/lessons/6_English_months/css/lesson.css +++ /dev/null @@ -1,246 +0,0 @@ -@CHARSET "UTF-8"; -/****** Page Styles ****/ - -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: 89px; - width: 100%; - position: absolute; - left: 0px; - top: 0px; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 13px; - padding-left: 5px; -} - - - #linkBack{ - 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: 13px; - padding-right: 5px; -} - #linkHelp{ - width: 60px; height: 60px; - background:url(../assets/image/btn_help.png); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - #linkNext{ - width: 60px; height: 60px; - background:url(../assets/image/btn_next.png); - } - #linkNext:hover{ - background:url(../assets/image/btn_next_hover.png); - } -#footer { - background-image: url(../assets/image/bg_footer.png); - background-repeat: repeat-x; - position: absolute; - height: 69px; - width: 100%; - left: 0px; - bottom: 0px; -} -#score_box { - float: left; - padding-left: 5px; - padding-top: 10px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; -} -#botbtn_right { - float: right; - height: 55px; - /*width: 251px;*/ - padding-right: 5px; - padding-top: 5px; -} - #linkCheck{ - width: 187px; height: 55px; - background-image: url(../assets/image/check.png); - } - - #linkStart{ - 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{ - width: 251px; height: 55px; - background:url(../assets/image/btn_play_again.png); - } - #linkPlayAgain:hover{ - background:url(../assets/image/btn_play_again_hover.png); - } - #linkPlayfile:///usr/share/ubuntu-artwork/home/index.htmlAgain:active{ - background:url(../assets/image/btn_play_again_mouse_down.png); - } - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0px auto; - margin-top: 85px; - height: 400px; - -} - #section{ - margin: 5px auto; - width: 100%; - height: 400px; - text-align:center; - } - #topText{ - margin: 20px auto; - width: 500px; - height: 25px; - color: blue; - font: 20px/25px Arial, Verdana, Geneva, Arial, Helvetica, sans-serif; - } - .drophover{ - background-color: #FF9900; - } - .imgArea{ - float:left; - margin-right: 15px; - margin-bottom: 20px; - padding: 2px; - width: 150px; - height: 135px; - text-align:center; - } - .monthsName{ - cursor: pointer; - text-align:center; - font: 20px/25px Arial, Helvetica, sans-serif; - - } - .imgBox{ - margin-top:0.1em; - text-align:center; - } - - .dropMonthArea{ - float:left; - margin-right: 25px; - margin-bottom: 20px; - padding: 2px; - width: 225px; - height: 50px; - text-align:center; - } - - - #dragMonthArea{ - position:absolute; - left: 10%; - bottom: 16%; - width: 80%; - height: 90px; - border: 1px solid #D0F692; - } - - input.blankBox{ - font: 15px Verdana, Geneva, Arial, Helvetica, sans-serif; - height:20px; - width: 20px; - color:red; - text-align:center; - } - .imgSmall{ - float:left; - } - .orderTxt{ - float: left; - margin-right: 10px; - width: 50px; - height: 30px; - font: 16px/20px Arial, Verdana, Geneva, Helvetica, sans-serif; - } - - .imgDisplay{ - float:left; - margin: 0em; - } - - .check{ - float:right; - width: 20px; - height: 20px; - } -#gameOver{ - display:none; - position:absolute; - width: 300px; - text-align:center; - top: 40%; - left: 40%; - font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight:bold; - color:red; -} -#gameOverInfo{ - margin-top: 35px; - text-align:center; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#06D946; - -} \ No newline at end of file diff --git a/examples/lessons/6_English_months/index.html b/examples/lessons/6_English_months/index.html deleted file mode 100755 index b22d119..0000000 --- a/examples/lessons/6_English_months/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - Class 6 English Months - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_English_months/js/jquery-1.3.2.min.js b/examples/lessons/6_English_months/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_English_months/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_English_months/js/jquery.watermarkinput.js b/examples/lessons/6_English_months/js/jquery.watermarkinput.js deleted file mode 100755 index fefa670..0000000 --- a/examples/lessons/6_English_months/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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_English_months/js/lesson.js b/examples/lessons/6_English_months/js/lesson.js deleted file mode 100755 index 5919474..0000000 --- a/examples/lessons/6_English_months/js/lesson.js +++ /dev/null @@ -1,227 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.ogg'}, - {'name':'incorrect','file':'incorrect.ogg'}, - {'name':'January','file':'January.wav'}, - {'name':'February','file':'February.wav'}, - {'name':'March','file':'March.wav'}, - {'name':'April','file':'April.wav'}, - {'name':'May','file':'May.wav'}, - {'name':'June','file':'June.wav'}, - {'name':'July','file':'July.wav'}, - {'name':'August','file':'August.wav'}, - {'name':'September','file':'September.wav'}, - {'name':'October','file':'October.wav'}, - {'name':'November','file':'November.wav'}, - {'name':'December','file':'December.wav'} - ]}); - - k.ready(function(){ - var i,j,flag; - var TOTAL_QUES = 12; - var currentDragObject; - var randPositions = []; - var arrangedAns = []; - var sectionNum; //store the three levels values 0,1,2 - var currentAlphaNum; //store the current questions num - var checked; //store the current checked value - var num; - var flag_checked; //status flag for one time correct alpahbetical order - var currentMonth; - var currentDragObject; - var arrangedAns = []; - var randBoxes = []; //store the random boxes value to check - // six alphabets given to be ordered 6 steps needed to complete the picture 3 levels too complex - var months = new Array('January','February','March','April','May','June','July','August', - 'September','October','November','December'); - var monthOrder = new Array('1st','2nd','3rd','4th','5th','6th','7th','8th','9th','10th','11th','12th'); - - var genRandPosition=function (){ - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i
'); - $('#imageArea'+monthId).append('
'+months[monthId]+'
'); - $('#imageArea'+monthId).append(''); - $('#imageArea'+monthId).click(function(){ - k.audio[months[monthId]].play(); - }); - }; - - var assignMonths = function (monthId){ - $('#section').append('
'); - $('#monthArea'+monthId).append(''); - $('#monthArea'+monthId).append('
'+monthOrder[monthId]+'
'); - $('#monthArea'+monthId).append('
'); - $('#monthArea'+monthId).append('
'); - var dropObjCss = { - 'width':'100px','height': '33px','margin': '10px 0px 10px 100px','border-bottom':'2px solid black' - }; - $('.dropObjects').css(dropObjCss); - - }; - - var assignDragMonths = function(monthId){ - var currentMonth = months[monthId]; - $('#dragMonthArea').append('
'); - var dragObjCss = { - 'float': 'left','cursor': 'move','width':'120px','height':'30px', - 'margin':'0.3em', - 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica' - }; - $('.dragObjects').css(dragObjCss); - var z; - var monthLength = currentMonth.length; - var randNum = k.rand(0,monthLength-1); - randBoxes[monthId] = randNum; - for(z = 0; z < monthLength; z++){ - if(z === (randNum)){ - $('#drag'+monthId).append('') - $('#box'+monthId).Watermark("?"); - //insert text box - } - else{ - $('#drag'+monthId).append(currentMonth[z]); - } - - } - }; - - function drag_drop(){ - $('.dragObjects').draggable({ containment: '#content'}); - $('.dragObjects').bind('dragstart', function(event, ui) { - currentDragObject = event.target.id; - currentMonth = parseInt(currentDragObject.substring(4)); - - }); - - $(".dropObjects").droppable({ tolerence: 'intersect' ,hoverClass: 'drophover'}); - $('.dropObjects').bind('drop', function(event, ui) { - var currentDropObject = event.target.id; - var droppedWord = parseInt(currentDropObject.substring(4)); - arrangedAns[droppedWord] = $('#'+currentDragObject).text(); - - /*if(arrangedAns[droppedWord] === months[droppedWord]){ - $('#'+currentDragObject).draggable('disable'); - }*/ - }); - } - - - var check_months = function(){ - var correct = 0; - var d = 0; - var arrangedMonths = []; - for(i=0; i'); - correct++; - } - else{ - $('#checkMonth'+i).html(''); - } - - } - if(correct === 12){ - display_game_over(); - } - - }; - - - var display_game_over = function(){ - $('#section').hide(); - $('#gameOver').show(); - $('#gameOver').html(''); - $('#gameOver').append('GAME OVER
Congratulations!!!'); - }; - - - - function game_start(){ - $('#linkCheck').show(); - $('#gameOver').hide(); - $('#linkNext').hide(); - $('#section').html(''); - for(var i = 0;iFill in the blanks and place month in right order.
'); - for(i=0; i'); - genRandPosition(); - for(i=0; iLearn the spelling of each month.'); - for( i = 0; i 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/examples/lessons/6_English_months/js/ui.draggable.js b/examples/lessons/6_English_months/js/ui.draggable.js deleted file mode 100755 index 0402f0e..0000000 --- a/examples/lessons/6_English_months/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() { - $('
') - .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/examples/lessons/6_English_months/js/ui.droppable.js b/examples/lessons/6_English_months/js/ui.droppable.js deleted file mode 100755 index 8e7be33..0000000 --- a/examples/lessons/6_English_months/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/examples/lessons/6_English_syllables/assets/audio/correct.ogg b/examples/lessons/6_English_syllables/assets/audio/correct.ogg deleted file mode 100755 index a0d9e3a..0000000 --- a/examples/lessons/6_English_syllables/assets/audio/correct.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/audio/incorrect.ogg b/examples/lessons/6_English_syllables/assets/audio/incorrect.ogg deleted file mode 100755 index 4805e55..0000000 --- a/examples/lessons/6_English_syllables/assets/audio/incorrect.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/bgContainer.png b/examples/lessons/6_English_syllables/assets/image/bgContainer.png deleted file mode 100755 index a81304e..0000000 --- a/examples/lessons/6_English_syllables/assets/image/bgContainer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/bg_footer.png b/examples/lessons/6_English_syllables/assets/image/bg_footer.png deleted file mode 100755 index 8982264..0000000 --- a/examples/lessons/6_English_syllables/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/bg_header.png b/examples/lessons/6_English_syllables/assets/image/bg_header.png deleted file mode 100755 index 98213f7..0000000 --- a/examples/lessons/6_English_syllables/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/bg_title_block.png b/examples/lessons/6_English_syllables/assets/image/bg_title_block.png deleted file mode 100755 index 2c9dacf..0000000 --- a/examples/lessons/6_English_syllables/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_back.png b/examples/lessons/6_English_syllables/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_back_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_help.png b/examples/lessons/6_English_syllables/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_help_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_next.png b/examples/lessons/6_English_syllables/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_next_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_ole.png b/examples/lessons/6_English_syllables/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_ole_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_play_again.png b/examples/lessons/6_English_syllables/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_start.png b/examples/lessons/6_English_syllables/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_start_hover.png b/examples/lessons/6_English_syllables/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_English_syllables/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/computer_base.png b/examples/lessons/6_English_syllables/assets/image/computer_base.png deleted file mode 100755 index b18175d..0000000 --- a/examples/lessons/6_English_syllables/assets/image/computer_base.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/computer_body.png b/examples/lessons/6_English_syllables/assets/image/computer_body.png deleted file mode 100755 index a083144..0000000 --- a/examples/lessons/6_English_syllables/assets/image/computer_body.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/computer_top.png b/examples/lessons/6_English_syllables/assets/image/computer_top.png deleted file mode 100755 index 0ea98fa..0000000 --- a/examples/lessons/6_English_syllables/assets/image/computer_top.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/help.png b/examples/lessons/6_English_syllables/assets/image/help.png deleted file mode 100755 index 4cde516..0000000 --- a/examples/lessons/6_English_syllables/assets/image/help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/player_base.png b/examples/lessons/6_English_syllables/assets/image/player_base.png deleted file mode 100755 index 4b25b30..0000000 --- a/examples/lessons/6_English_syllables/assets/image/player_base.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/player_body.png b/examples/lessons/6_English_syllables/assets/image/player_body.png deleted file mode 100755 index e1d1bb7..0000000 --- a/examples/lessons/6_English_syllables/assets/image/player_body.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/player_top.png b/examples/lessons/6_English_syllables/assets/image/player_top.png deleted file mode 100755 index 9d95c18..0000000 --- a/examples/lessons/6_English_syllables/assets/image/player_top.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/title_block_lt.png b/examples/lessons/6_English_syllables/assets/image/title_block_lt.png deleted file mode 100755 index 4696182..0000000 --- a/examples/lessons/6_English_syllables/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/assets/image/title_block_rt.png b/examples/lessons/6_English_syllables/assets/image/title_block_rt.png deleted file mode 100755 index 37cc44a..0000000 --- a/examples/lessons/6_English_syllables/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_syllables/css/lesson.css b/examples/lessons/6_English_syllables/css/lesson.css deleted file mode 100755 index 94e9e24..0000000 --- a/examples/lessons/6_English_syllables/css/lesson.css +++ /dev/null @@ -1,295 +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; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 6px; - padding-left: 15px; -} - - - .linkBack{ - 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); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - .linkNext{ - 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: 10px; - 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{ - 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{ - 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); - } -#linkNextExercise{ - position:absolute; - bottom: 75px; - right: 10px; -} -#linkPrevExercise{ - position:absolute; - bottom: 75px; - left: 10px; -} -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0 auto; - margin-top: 75px; - width: 1180px; - height: 550px; - padding: 0.5em; -} - #left-side{ - position:relative; - margin: 40px auto; - margin-bottom:0; - padding-top:50px; - float:left; - width: 170px; - height: 450px; - border: 4px solid #000; - } - #leftText{ - position:absolute; - top: -30px; - left: 0px; - text-align:center; - height: 40px; - font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman; - color: #FF0000; - } - .default{ - float:left; - margin: 0px auto; - text-align:center; - width: 170px; - height: 44px; - } - #right-side{ - position:relative; - margin: 40px auto; - margin-bottom:0; - padding-top: 50px; - float:right; - width: 170px; - height: 450px; - border: 4px solid #000; - } - #rightText{ - position:absolute; - top: -30px; - left: 10px; - text-align:center; - height: 40px; - font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman; - color: #FF0000; - } - #main-content{ - margin-top: 10px; - float:left; - margin-left: 90px; - width: 650px; - height: 525px; - } - #topText{ - text-align:center; - height: 40px; - font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman; - } - #container{ - position:relative; - margin: 5px auto; - width : 598px; - height: 390px; - border: 4px solid #000; - background:url(../assets/image/bgContainer.png); - } - #joinSyllable{ - margin: 10px auto; - width : 525px; - height: 60px; - border: 4px solid #000; - } - .sign{ - float:left; - width: 20px; - height: 30px; - padding: 5px; - text-align:center; - font : 30px/35px Verdana,Helvetica,Arial Black, Times New Roman; - } - .drophover{ - background-color: #FF9900; - } - - .correctWord{ - border:none - color: #FF00FF; - } - - - - #help{ - display:none; - position:absolute; - right: 60px; - top: 75px;; - width: 256px; - height: 600px; - background:url(../assets/image/help.png); - z-index:40; - } - .backOpaque{ - background-color: #A4A4A4; - opacity: 0.2; - } - #timerBar { - float: left; - margin-left:50px; - width: 200px; - height:35px; - padding-left: 10px; - padding-top: 7px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; - } - - .timerBoxes{ /* Show the timer running after the game has began.... */ - float:left; - margin: 0.5em 0 0 0.1em; - width: 50px; - height: 30px; - border: 2px dotted green; - padding: 3px; - color: blue; - text-align:center; - font : bold 25px Arial Black, Times New Roman; - background: #ACC; - } - - #gameOver{ - opacity: 1; - display:none; - position:absolute; - top:5%; - left: 40%; - color: blue; - text-align:center; - font : bold 25px/35px Arial Black, Times New Roman; -} diff --git a/examples/lessons/6_English_syllables/index.html b/examples/lessons/6_English_syllables/index.html deleted file mode 100755 index 74d1095..0000000 --- a/examples/lessons/6_English_syllables/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - Class 6 English Syllabus - - - - - - - - - - - -
-
-
Game Over!!!
-
- -
- - - - diff --git a/examples/lessons/6_English_syllables/js/jquery-1.3.2.min.js b/examples/lessons/6_English_syllables/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_English_syllables/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_English_syllables/js/karma.js b/examples/lessons/6_English_syllables/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_English_syllables/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_English_syllables/js/lesson.js b/examples/lessons/6_English_syllables/js/lesson.js deleted file mode 100755 index ca45a59..0000000 --- a/examples/lessons/6_English_syllables/js/lesson.js +++ /dev/null @@ -1,359 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.ogg'}, - {'name':'incorrect','file':'incorrect.ogg'} - ]}); - - k.ready(function(){ - var i,j; - var totalCounter; - var currentQuestion; - var TOTAL_QUES = 10; - var currentDragObject; - var prevDragObject; - var dropNum; - var sectionNum; - var randPositions = []; - var compCounter; - var playerCounter; - var fstSyllableId; - var fstSyllableId; - var checked; - var gamePlay; - var s,m,h,play; - var currentBlock; //flag for which side increases the score 1-player 0-computer - var completedWords = []; - var syllableWord1= new Array('be','en','ti','tues','stu','chil','eng','hap','sun','in', - 'sen','com','pro','prac','talk','pic','num','tea','mar','comp' - ); - var syllableWord2 = new Array('lieve','gine','ger','key','dent','ly','lish','py','day','sect', - 'tence','plete','noun','tice','ing','nic','ber','cher','ket','uter' - ); - - - var genRandPosition=function (){ - randPositions[0] = k.rand(0,19); - for(i=1; i<20; i++){ - do{ - flag = 0; - randPositions[i] = k.rand(0,19); - for(j=0; j'); - } - else{ - $('#compBuild'+(9-compCounter)).append(''); - } - - }; - - var delay_correct = function(){ - document.delayForm.delayval.value = 1; - if(checked ===1 ){ - $('#drag'+completedWords[totalCounter-2]).hide(); - $('#drag'+completedWords[totalCounter-1]).hide(); - } - $('#drop0').html('----------'); - $('#drop1').html('----------'); - $('#drop2').html('------------'); - }; - var check_answers = function(){ - var flag_correct = 0; - var secStart = sectionNum * 10; - var secStop = (sectionNum+1) * 10; - for( i = secStart ; i'+syllableWord1[sysId]+'
'); - } - else{ - sysId = ((10*(sectionNum+2)) - 1)-sId; - $('#container').append('
'+syllableWord2[sysId]+'
'); - } - - var dragObjCss = { - 'float':'left','position':'relative','cursor': 'move','margin': '1em', - 'width':'100px','height':'30px','border': '2px solid black', - 'font':'20px/25px bold Arial,Verdana,Geneva,Helvetica', - 'text-align':'center' - }; - $('#drag'+sId).css(dragObjCss); - $('#drag'+sId).click(function(){ - currentSyllable = $(this).text(); - if(dropNum === 0){ - fstSyllableId = $(this).attr('id'); - fstSyllableId = parseInt(fstSyllableId.substring(4)); - startTimer(); - - } - else{ - secondSyllableId = $(this).attr('id'); - secondSyllableId = parseInt(secondSyllableId.substring(4)); - } - $('#drop'+dropNum).html(currentSyllable); - dropNum++; - if(dropNum === 2){ - dropNum = 0; - resetTimer(); - check_answers(); - } - check_game_over(); - }); - - }; - - var assignDropPlaces = function(drpId){ - $('#joinSyllable').append('
'); - var dropObjCss = { - 'float':'left','width':'100px','height': '45px','margin': '0.5em 0.5em', - 'font':'20px/35px bold Arial,Verdana,Geneva,Helvetica', - 'text-align':'center','color':'#FF00FF' - }; - - if(drpId === 2){ - $('#drop'+drpId).css(dropObjCss).css({'width':'200px'}).html('------------'); - } - else{ - $('#drop'+drpId).css(dropObjCss).html('----------'); - } - }; - - - var next_syllables = function(){ - resetTimer(); - $('#content').removeClass('backOpaque').html(''); - $('#content').append('
'); - $('#content').append('
'); - $('#content').append('
'); - $('#left-side').append('
'); - $('#leftText').html('Computer Building'); - $('#right-side').append('
'); - $('#rightText').html('Player Building'); - - - $('#main-content').append('
Join two syllables to make one word
'); - $('#main-content').append('
'); - $('#main-content').append('
'); - genRandPosition(); - playerCounter = 0; - compCounter = 0; - for(i = 0; i< 20; i++){ - var randNum = randPositions[i]; - assignSyllableWords(randNum); - } - $('#joinSyllable').html(''); - for(i = 0; i< 3;i++){ - assignDropPlaces(i); - if(i === 0){ - $('#joinSyllable').append('
+
'); - } - else if(i === 1){ - $('#joinSyllable').append('
=
'); - } - } - for(var i = 0; i< TOTAL_QUES; i++){ - $('#left-side').append('
'); - $('#playerBuild'+i).addClass('default'); - } - - }; - - function game_start(){ - gamePlay = 0; - - - $('#linkNextExercise').hide(); - $('#linkPrevExercise').hide(); - $('#gameOver').hide(); - dropNum = 0; - correctCounter = 0; - totalCounter = 0; - sectionNum = k.rand(0,1); - next_syllables(); - } - - function game(){ - - - $('#linkNextExercise').hide(); - $('#linkPrevExercise').hide(); - $('#gameOver').hide(); - - } - - game(); - - $('#linkNextExercise').click(function(){ - $('#linkNextExercise').hide(); - if(sectionNum === 0){ - sectionNum += 1; - } - else{ - sectionNum -= 1; - } - gamePlay++; - next_syllables(); - }); - $('#linkPrevExercise').click(function(){ - $('#linkPrevExercise').hide(); - if(sectionNum === 0){ - sectionNum += 1; - } - else{ - sectionNum -= 1; - } - gamePlay--; - next_syllables(); - }); - $('#linkStart').click(function(){ - game_start(); - }); - - $('#linkPlayAgain').click(function(){ - game_start(); - }); - $('#linkHelp').mouseover(function(){ - $('#help').slideDown(2000); - }) - .mouseout(function(){ - $('#help').slideUp(2000); - }); - }); //end of k.ready - }); //end of document.read - diff --git a/examples/lessons/6_English_yesNoQuestions/assets/audio/correct.ogg b/examples/lessons/6_English_yesNoQuestions/assets/audio/correct.ogg deleted file mode 100755 index a0d9e3a..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/audio/correct.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.ogg b/examples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.ogg deleted file mode 100755 index 4805e55..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/audio/incorrect.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/backImage.png b/examples/lessons/6_English_yesNoQuestions/assets/image/backImage.png deleted file mode 100755 index 395650b..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/backImage.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bear.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bear.png deleted file mode 100755 index b8c29e4..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/bear.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.png deleted file mode 100755 index 4bd44fa..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_header.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_header.png deleted file mode 100755 index f421817..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.png deleted file mode 100755 index 7311891..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/bird.png b/examples/lessons/6_English_yesNoQuestions/assets/image/bird.png deleted file mode 100755 index ab1e994..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/bird.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.png b/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/check.png b/examples/lessons/6_English_yesNoQuestions/assets/image/check.png deleted file mode 100755 index 84fc229..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/check.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/cock.png b/examples/lessons/6_English_yesNoQuestions/assets/image/cock.png deleted file mode 100755 index 998c31c..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/cock.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/comma.png b/examples/lessons/6_English_yesNoQuestions/assets/image/comma.png deleted file mode 100755 index aa0474e..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/comma.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/correct.png b/examples/lessons/6_English_yesNoQuestions/assets/image/correct.png deleted file mode 100755 index ca9b9db..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/correct.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/cow.png b/examples/lessons/6_English_yesNoQuestions/assets/image/cow.png deleted file mode 100755 index 205fd8e..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/cow.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/crow.png b/examples/lessons/6_English_yesNoQuestions/assets/image/crow.png deleted file mode 100755 index 33c1366..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/crow.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/domestic.png b/examples/lessons/6_English_yesNoQuestions/assets/image/domestic.png deleted file mode 100755 index 3b5d099..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/domestic.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/dot.png b/examples/lessons/6_English_yesNoQuestions/assets/image/dot.png deleted file mode 100755 index 74ac1ff..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/dot.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/duck.png b/examples/lessons/6_English_yesNoQuestions/assets/image/duck.png deleted file mode 100755 index 59ed78e..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/duck.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/eagle.png b/examples/lessons/6_English_yesNoQuestions/assets/image/eagle.png deleted file mode 100755 index 23d7c3f..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/eagle.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/egret.png b/examples/lessons/6_English_yesNoQuestions/assets/image/egret.png deleted file mode 100755 index 8d2c253..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/egret.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/elephant.png b/examples/lessons/6_English_yesNoQuestions/assets/image/elephant.png deleted file mode 100755 index 8d862f6..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/elephant.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/goat.png b/examples/lessons/6_English_yesNoQuestions/assets/image/goat.png deleted file mode 100755 index 48b2726..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/goat.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/horse.png b/examples/lessons/6_English_yesNoQuestions/assets/image/horse.png deleted file mode 100755 index 132b7b3..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/horse.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/incorrect.png b/examples/lessons/6_English_yesNoQuestions/assets/image/incorrect.png deleted file mode 100755 index 49ee2a2..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/incorrect.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/jackel.png b/examples/lessons/6_English_yesNoQuestions/assets/image/jackel.png deleted file mode 100755 index 31eb0c5..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/jackel.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/monkey.png b/examples/lessons/6_English_yesNoQuestions/assets/image/monkey.png deleted file mode 100755 index 94e31de..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/monkey.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/mynah.png b/examples/lessons/6_English_yesNoQuestions/assets/image/mynah.png deleted file mode 100755 index 0818f20..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/mynah.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/owl.png b/examples/lessons/6_English_yesNoQuestions/assets/image/owl.png deleted file mode 100755 index be45b5e..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/owl.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/parrot.png b/examples/lessons/6_English_yesNoQuestions/assets/image/parrot.png deleted file mode 100755 index 5eacfd7..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/parrot.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/pig.png b/examples/lessons/6_English_yesNoQuestions/assets/image/pig.png deleted file mode 100755 index c523e35..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/pig.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/pigeon.png b/examples/lessons/6_English_yesNoQuestions/assets/image/pigeon.png deleted file mode 100755 index 6c0edd7..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/pigeon.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/rabbit.png b/examples/lessons/6_English_yesNoQuestions/assets/image/rabbit.png deleted file mode 100755 index 4aa302d..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/rabbit.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/rhino.png b/examples/lessons/6_English_yesNoQuestions/assets/image/rhino.png deleted file mode 100755 index d853865..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/rhino.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/sheep.png b/examples/lessons/6_English_yesNoQuestions/assets/image/sheep.png deleted file mode 100755 index de61ac8..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/sheep.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/snake.png b/examples/lessons/6_English_yesNoQuestions/assets/image/snake.png deleted file mode 100755 index 472295b..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/snake.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/sparrow.png b/examples/lessons/6_English_yesNoQuestions/assets/image/sparrow.png deleted file mode 100755 index 547645b..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/sparrow.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/tiger.png b/examples/lessons/6_English_yesNoQuestions/assets/image/tiger.png deleted file mode 100755 index 4b6e708..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/tiger.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.png b/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.png deleted file mode 100755 index b1c0e90..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.png b/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.png deleted file mode 100755 index 275daaf..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/turtle.png b/examples/lessons/6_English_yesNoQuestions/assets/image/turtle.png deleted file mode 100755 index d08bbdc..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/turtle.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/assets/image/wild.png b/examples/lessons/6_English_yesNoQuestions/assets/image/wild.png deleted file mode 100755 index a8cc09e..0000000 --- a/examples/lessons/6_English_yesNoQuestions/assets/image/wild.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_English_yesNoQuestions/css/lesson.css b/examples/lessons/6_English_yesNoQuestions/css/lesson.css deleted file mode 100755 index 4b89d22..0000000 --- a/examples/lessons/6_English_yesNoQuestions/css/lesson.css +++ /dev/null @@ -1,252 +0,0 @@ -@CHARSET "UTF-8"; -/****** Page Styles ****/ - -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: 89px; - width: 100%; - position: absolute; - left: 0px; - top: 0px; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 13px; - padding-left: 5px; -} - - - #linkBack{ - 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: 13px; - padding-right: 5px; -} - #linkHelp{ - width: 60px; height: 60px; - background:url(../assets/image/btn_help.png); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - #linkNext{ - width: 60px; height: 60px; - background:url(../assets/image/btn_next.png); - } - #linkNext:hover{ - background:url(../assets/image/btn_next_hover.png); - } -#footer { - background-image: url(../assets/image/bg_footer.png); - background-repeat: repeat-x; - position: absolute; - height: 69px; - width: 100%; - left: 0px; - bottom: 0px; -} -#score_box { - float: left; - padding-left: 5px; - padding-top: 10px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; -} -#botbtn_right { - float: right; - height: 55px; - /*width: 251px;*/ - padding-right: 5px; - padding-top: 5px; -} - #linkCheck{ - width: 187px; height: 55px; - background-image: url(../assets/image/check.png); - } - - #linkStart{ - 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{ - 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); - } - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0px auto; - margin-top: 85px; - width: 100%; - height: 400px; - -} - #tabs{ - margin-left: 0.5em; - width: 650px; - height: 60px; - } - .tabBox{ - float:left; - margin: 0.5em; - } - .tabSelected{ - background-color: #00FF00; - } - - #section{ - width: 900px; - height: 300px; - margin: 5px auto; - } - - #questionSection{ - margin-top: 50px; - margin-left: 300px; - } - .questions{ - margin-top: 5px; - margin-left: 20px; - height: 30px; - font: 25px/30px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #000000; - } - #answerSection{ - margin-left: 50px; - margin-top: 10px; - width: 600px; - height: 70px; - } - #comma{ - width: 36px; - height: 60px; - margin-left: 118px; - background-image: url(../assets/image/comma.png); - } - #dot{ - position:absolute; - top: 44%; - right: 17%; - width: 36px; - height: 60px; - background-image: url(../assets/image/dot.png); - } - #dragAnswers{ - padding: 10px; - margin-top: 40px; - margin-left: 85px; - width: 350px; - height: 30px; - border: 2px solid #ABF549; - - } - #imgAnimals{ - position:absolute; - left: 10%; - top: 30%; - width: 222px; - height: 300px; - background: url(../assets/image/backImage.png); - text-align:center; - } - .imgAnim{ - margin-top: 75px; - } - - .drophover{ - background-color: #FF9900; - } - #checkAnswer{ - position:absolute; - right: 5%; - bottom: 45%; - width: 100px; - height: 92px; - } - - - -#gameOver{ - margin: 10px auto; - width: 500px; - text-align:center; - font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight:bold; - color:red; -} -#gameOverInfo{ - margin-top: 35px; - text-align:center; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#06D946; - -} -.specialText{ - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF9900; - border-bottom: 2px dotted #CCC; - -} \ No newline at end of file diff --git a/examples/lessons/6_English_yesNoQuestions/css/ui.scoreboard.css b/examples/lessons/6_English_yesNoQuestions/css/ui.scoreboard.css deleted file mode 100755 index 11cdbb5..0000000 --- a/examples/lessons/6_English_yesNoQuestions/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/examples/lessons/6_English_yesNoQuestions/index.html b/examples/lessons/6_English_yesNoQuestions/index.html deleted file mode 100755 index c359651..0000000 --- a/examples/lessons/6_English_yesNoQuestions/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - Class 6 English Yes No Questions - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_English_yesNoQuestions/js/jquery-1.4.js b/examples/lessons/6_English_yesNoQuestions/js/jquery-1.4.js deleted file mode 100755 index a448490..0000000 --- a/examples/lessons/6_English_yesNoQuestions/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 = "
a"; - - 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 = ""; - - // 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 = ""; - 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 = "

"; - - // 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 = "
"; - - // 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 = /"; - }, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - - - - - - - - - - -
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js deleted file mode 100755 index 22e8099..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/lesson.js +++ /dev/null @@ -1,212 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var i,j; - var totalCounter; - var correctCounter; - var currentQuestion; - var TOTAL_QUES = 8; - var flag_correct; - var randPositions = []; - var check_num; - var infoQues1 = new Array('рдПрдЙрдЯрд╛ рдмрдЯреНрдЯрд╛рдорд╛ y рдУрдЯрд╛ рд▓рдбрдбреБрд╣рд░реБ рдЫрди ', - 'рдПрдЙрдЯрд╛ рд╕реАрд╕рд╛рдХрд▓рдордХреЛ рдмрдЯреНрдЯрд╛рдорд╛ p рдУрдЯрд╛ рд╕реАрд╕рд╛рдХрд▓рдорд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдмреЛрд░рд╛рдорд╛ r рдХреЗрдЬреА рдЪрд╛рдорд▓ рдЫ ', - 'рдПрдЙрдЯрд╛ рд╕рд┐рд╕реАрдорд╛ z рд▓рд┐рдЯрд░ рддреЗрд▓ рдЫ ', - 'рдПрдЙрдЯрд╛ рдХрд╛рд░реНрдЯреБрдирдорд╛ x рдкреНрдпрд╛рдХреЗрдЯ рдЪрд╛рдЙрдЪрд╛рдЙ рдЫрди ', - 'рдПрдЙрдЯрд╛ рдбрд╛рд▓реЛрдорд╛ n рдУрдЯрд╛ рдирд░рд┐рд╡рд▓рд╣рд░реБ рдЫрди ', - 'рдПрдЙрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ m рдХреЗрдЬреА рдЖрдкрд╣рд░реБ рдЫрди', - 'рдпреЛ рдПрдЙрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрдХреЛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ x рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рдЫрди ' - ); - - var infoQues2 = new Array('рдпрджрд┐ рдПрдЙрдЯрд╛ рдмрдЯреНрдЯрд╛рдорд╛ 20 рдУрдЯрд╛ рд▓рдбрдбреБрд╣рд░реБ рдЫрди рднрдиреЗ 5 рдУрдЯрд╛ рдмрдЯреНрдЯрд╛рдорд╛', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рдмрдЯреНрдЯрд╛рдорд╛ 10 рдУрдЯрд╛ рд╕реАрд╕рд╛рдХрд▓рдорд╣рд░реБ рдЫрди рднрдиреЗ 4 рдУрдЯрд╛ рдмрдЯреНрдЯрд╛рдорд╛', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рдмреЛрд░рд╛рдорд╛ 50 рдХреЗрдЬреА рдЪрд╛рдорд▓ рдЫ рднрдиреЗ 4 рдУрдЯрд╛ рдмреЛрд░рд╛рдорд╛ рдЬрдореНрдорд╛ ', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рд╕рд┐рд╕реАрдорд╛ 2 рд▓рд┐рдЯрд░ рддреЗрд▓ рдЫ рднрдиреЗ 4 рдУрдЯрд╛ рд╕рд┐рд╕реАрдорд╛ рдЬрдореНрдорд╛ ', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рдХрд╛рд░реНрдЯреБрдирдорд╛ 30 рдкреНрдпрд╛рдХреЗрдЯ рдЪрд╛рдЙрдЪрд╛рдЙ рдЫрди рднрдиреЗ 3 рдУрдЯрд╛ рдХрд╛рд░реНрдЯреБрдирдорд╛ рдЬрдореНрдорд╛ ', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рдбрд╛рд▓реЛрдорд╛ 25 рдУрдЯрд╛ рдирд░рд┐рд╡рд▓рд╣рд░реБ рдЫрди рднрдиреЗ 3 рдУрдЯрд╛ рдбрд╛рд▓реЛрдорд╛ рдЬрдореНрдорд╛ ', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ 7 рдХреЗрдЬреА рдЖрдкрд╣рд░реБ рдЫрди рднрдиреЗ 2 рдУрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ рдЬрдореНрдорд╛ ', - 'рдпрджрд┐ рдПрдЙрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ 15 рдмрд┐рд╕реНрдХреБрдЯ рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯ рдЫрди рднрдиреЗ 3 рдУрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ рдЬрдореНрдорд╛ ' - ); - - var infoQues3 = new Array('рдУрдЯрд╛ рд▓рдбрдбреБрд╣рд░реБ рдЫрди','рд╕реАрд╕рд╛рдХрд▓рдорд╣рд░реБ рдЫрди','рдХреЗрдЬреА рдЪрд╛рдорд▓ рдЫ','рд▓рд┐рдЯрд░ рддреЗрд▓ рдЫ', - 'рдкреНрдпрд╛рдХреЗрдЯ рдЪрд╛рдЙрдЪрд╛рдЙ рдЫрди','рдУрдЯрд╛ рдирд░рд┐рд╡рд▓рд╣рд░реБ рдЫрди','рдХреЗрдЬреА рдЖрдкрд╣рд░реБ рдЫрди','рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рдЫрди' - ); - var variableName = new Array('y','p','r','z','x','n','m','x'); - var perPack = new Array('20','10','50','2','30','25','7','15'); - var quantity = new Array('5','4','4','4','3','3','2','3'); - var answers = new Array('100','40','200','8','90','75','14','45'); - - var scoreboard = $('#score_box').scoreboard({'layout':'horizontal', - 'winningScore': TOTAL_QUES}); - - var genRandPosition=function (){ - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i'); - $('.bgQuesAns').html(''); - $('.bgQuestion').addClass('quesText').html(infoQues1[currentQuestion]+' ред'); - $('.bgCalculation').addClass('quesText').html(infoQues2[currentQuestion]); - $('.bgCalculation').append('
'); - $('.bgCalculation').append('
'); - for( i = 0; i< quantity[currentQuestion]; i++){ - $('#textQues1').append(variableName[currentQuestion]); - $('#textQues2').append(''); - if(i != quantity[currentQuestion]-1){ - $('#textQues1').append('+'); - $('#textQues2').append('+'); - } - else{ - $('#textQues1').append(' = ').append(quantity[currentQuestion]+' * '+variableName[currentQuestion]); - $('#textQues2').append(' = ').append(quantity[currentQuestion]+' *'+''); - } - $("input#text1").focus(); - } - - - foucs_blur(); - } - - }; - - function game_start(){ - $('#gameOver').hide(); - $('#linkCheck').show(); - $('#section').removeClass('backOpaque'); - genRandPosition(); - next_question(); - } - - function game() { - totalCounter = 0; - correctCounter = 0; - $('#section').html('').append('
'); - $('#left-side').append('
'); - $('#left-side').append('
'); - $('#section').append('
'); - $('#right-side').append('
'); - $('#right-side').append('
'); - $('#help').hide(); - $('.bgAns').hide(); - $('#linkCheck').hide(); - $('#gameOver').hide(); - - } - - game(); - - var delay_nextQues = function(){ - document.delayForm.delayval.value = 1; - next_question(); - }; - - var delay_gameOver = function(){ - document.delayForm.delayval.value = 1; - $('#section').addClass('backOpaque'); - $('#linkCheck').hide(); - $('#gameOver').show(); - }; - - var check_answer = function(){ - if(check_num === 0){ - var textVal = $('#text1').val(); - if(textVal === perPack[currentQuestion]){ // first one is correct - k.audio.correct.play(); - $('.bgCalculation').append('
'); - $('.bgCalculation').append('
'); - $('#textQues3').append(' =         ').append(''); - $('#textQues4').append(infoQues3[currentQuestion]+' ред'); - $('#text1').attr("disabled", true); - $('.blankBoxes').css({'padding':'0'}).html(perPack[currentQuestion]); - check_num++; - $("input#text2").focus(); - foucs_blur(); - } - else{ - k.audio.incorrect.play(); - flag_correct = 0; - } - } - else{ - textVal = $('#text2').val(); - //if(textVal === perPack[currentQuestion] * quantity[currentQuestion]){ - if(textVal === answers[currentQuestion]){ - k.audio.correct.play(); - if(flag_correct === 1){ - scoreboard.scoreboard('inc'); - correctCounter++; - } - scoreboard.scoreboard('incTotal'); - totalCounter++; - t=setTimeout(function(){delay_nextQues();},1000); - } - else{ - flag_correct = 0; - k.audio.incorrect.play(); - } - } - }; - - function foucs_blur(){ - - $('input[type="text"]') - .focus(function() { - $(this).removeClass('incorrect').addClass("focus"); - }) - .blur(function() { - $(this).removeClass("focus"); - }) - .keypress(function(event) { - if(event.which === 13){ - check_answer(); - } - - }); - - $('#linkCheck').click(function(){ - check_answer(); - }); - } - - $('#linkStart').click(function(){ - game_start(); - }); - - $('#linkPlayAgain').click(function(){ - scoreboard.scoreboard('reset'); - game_start(); - }); - $('#linkHelp').click(function(){ - $('#help').slideDown(2000); - }) - .mouseout(function(){ - $('#help').slideUp(2000); - }); - }); //end of k.ready -}); //end of document.ready \ No newline at end of file diff --git a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.core.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.core.js deleted file mode 100755 index 5493e0a..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/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/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.draggable.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.draggable.js deleted file mode 100755 index 0402f0e..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/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() { - $('
') - .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/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.droppable.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.droppable.js deleted file mode 100755 index 8e7be33..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/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/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.scoreboard.js b/examples/lessons/6_Maths_AddingAndMultiplyingVariable/js/ui.scoreboard.js deleted file mode 100755 index 53a930a..0000000 --- a/examples/lessons/6_Maths_AddingAndMultiplyingVariable/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 = $('
') - .addClass('ui-scoreboard-spacing-' + layoutId); - this._scoreText = $("
Score
") - .addClass('ui-scoreboard-spacing-'+ layoutId + - ' ui-corner-all ui-scoreboard-text') - .appendTo(this.element); - this._score = $("
" + score + "
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-scoreboard-number-' + layoutId) - .appendTo(this.element); - $("
Total
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-corner-all ' + - 'ui-scoreboard-text') - .appendTo(this.element); - this._total = $("
" + total + "
") - .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/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wav b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wav deleted file mode 100755 index a49ba33..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/correct.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wav b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wav deleted file mode 100755 index 906c6a3..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/audio/incorrect.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.png deleted file mode 100755 index 18fc2e1..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bgLeft.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.png deleted file mode 100755 index 4bd44fa..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.png deleted file mode 100755 index f421817..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.png deleted file mode 100755 index 7311891..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.png deleted file mode 100755 index bd0afcb..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/check.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.png deleted file mode 100755 index 81c403b..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/gameOver.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.png deleted file mode 100755 index f3505e7..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.png deleted file mode 100755 index ed86909..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.png deleted file mode 100755 index b87cab4..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.png deleted file mode 100755 index 15de5ef..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.png deleted file mode 100755 index 915e20a..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.png deleted file mode 100755 index d172dac..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.png deleted file mode 100755 index 011aea5..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/img5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.png deleted file mode 100755 index c35776e..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.png deleted file mode 100755 index cec454c..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.png deleted file mode 100755 index eba02bd..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.png deleted file mode 100755 index 6008fa0..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.png deleted file mode 100755 index 8b5397f..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.png deleted file mode 100755 index ee8d142..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/ques5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.png deleted file mode 100755 index b1c0e90..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.png b/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.png deleted file mode 100755 index 275daaf..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css b/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css deleted file mode 100755 index 283bf25..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/lesson.css +++ /dev/null @@ -1,273 +0,0 @@ -@CHARSET "UTF-8"; -/****** Page Styles ****/ - -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: 89px; - width: 100%; - position: absolute; - left: 0px; - top: 0px; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 13px; - padding-left: 5px; -} - - - #linkBack{ - 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: 13px; - padding-right: 5px; -} - #linkHelp{ - width: 60px; height: 60px; - background:url(../assets/image/btn_help.png); - }bgCalculation - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - #linkNext{ - width: 60px; height: 60px; - background:url(../assets/image/btn_next.png); - } - #linkNext:hover{ - background:url(../assets/image/btn_next_hover.png); - } -#footer { - background-image: url(../assets/image/bg_footer.png); - background-repeat: repeat-x; - position: abbgCalculationsolute; - height: 69px; - width: 100%; - left: 0px; - bottom: 0px; -} -#score_box { - float: left; - padding-left: 5px; - padding-top: 10px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; -} -#botbtn_right { - float: right; - height: 55px; - /*width: 25bgCalculation1px;*/ - padding-right: 5px; - padding-top: 5px; -} - #linkCheck{ - margin: 1em 3em 0 0; - width: 101px; height: 30px; - background-image: url(../assets/image/check.png); - } - - #linkStart{ - 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{ - 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); - } - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0 auto; - margin-top: 85px; - width: 95%; - padding: 0.5em; - height: 375px; -} - #section{ - width: 900px; - height: 400px; - margin: 0 auto; - } - - #left-side{ - padding-top: 80px; - margin: 0em auto; - float:left; - width: 360px; - height: 285px; - border: 2px solid black; - text-align:center; - background: url(../assets/image/bgLeft.png); - -moz-border-radius : 20px; - -webkit-border-radius : 20px; - border-radius : 20px; - } - - #right-side{ - float:right; - width: 383px; - height: 365px; - border: 2px solid black; - -moz-border-radius : 20px; - -webkit-border-radius : 20px; - border-radius : 20px; - background-color: #7FFFC9; - - } - - #rightBack{ - background-repeat: no-repeat; - width: 383px; - height: 365px; - } - - .bgCalculation{ - position:absolute; - top: 58%; - right: 8%; - padding-top: 5px; - width: 360px; - height: 90px; - text-align:center; - - } - - #textQues1{ - float:right; - width: 300px; - height:30px; - letter-spacing: 5px; - font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif; - padding-right: 20px; - - text-align:right; - } - #textQues2{ - float:right; - width: 350px; - height:30px; - letter-spacing: 5px; - text-align:right; - font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif; - padding-right: 15px; - } - #textQues3{ - margin-top: 5px; - float:right; - text-align:right; - width: 300px; - height: 30px; - padding-right: 15px; - } - .blankBoxes{ - padding-left: 15px; - width: 35px; - height: 40px; - border-bottom : 2px solid black; - font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif; - } - .quesText{ - font: 20px/25px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #000000; - } - input.textBox{ - size:3; - font: 15px/20px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight: bold; - height:20px; - width: 30px; - text-align:center; - } - .focus { - background-color: #FFEEAA; - } - .correct{ - background-color: #C0F9F3; - } - .incorrect{ - background-color: #FFFF00; - } - - #help{ - display:none; - position:absolute; - right: 20%; - top: 1%; - width: 224px; - height: 525px; - background:url(../assets/image/help.png); - z-index:40; - } - .backOpaque{ - background-color: #A4A4A4; - opacity: 0.2; - } - #gameOver{ - display:none; - position:absolute; - top: 40%; - left: 25%; - width: 432px; - height: 68px; - background: url('../assets/image/gameOver.png'); - } \ No newline at end of file diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/ui.scoreboard.css b/examples/lessons/6_Maths_AddingAndSubtractingVariables/css/ui.scoreboard.css deleted file mode 100755 index 11cdbb5..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/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/examples/lessons/6_Maths_AddingAndSubtractingVariables/index.html b/examples/lessons/6_Maths_AddingAndSubtractingVariables/index.html deleted file mode 100755 index 736b381..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - Class 6 Maths Adding and Subtracting Variables - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js deleted file mode 100755 index 9f094ca..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/lesson.js +++ /dev/null @@ -1,215 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var i,j; - var totalCounter; - var correctCounter; - var currentQuestion; - var TOTAL_QUES = 6; - var flag_correct; - var randPositions = []; - var check_num; - - var variableName = new Array('x','p','y','x','x','r'); - var perPack = new Array('16','80','25','30','15','70'); - var quantity = new Array('4','1','2','3','2','1'); - var finishedQty = new Array('8','30','16','7','7','22'); - - var answers = new Array('58','50','34','97','37','48'); - - - var scoreboard = $('#score_box').scoreboard({'layout':'horizontal', - 'winningScore': TOTAL_QUES}); - - var genRandPosition=function (){ - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i'); - //$('#left-side').html(''); - - $('#rightBack').css({'background':'url(assets/image/ques'+currentQuestion+'.png)'}); - $('.bgCalculation').html('').append('
'); - $('.bgCalculation').append('
'); - - if(currentQuestion ===3 || currentQuestion === 4){ - sign = '+'; - } - else{ - sign = '-'; - - } - for( i = 0; i< quantity[currentQuestion]; i++){ - $('#textQues1').append(variableName[currentQuestion]); - $('#textQues2').append(''); - if(i != quantity[currentQuestion]-1){ - $('#textQues1').append('+'); - $('#textQues2').append('+'); - } - else{ - - if(parseInt(quantity[currentQuestion]) === 1){ - $('#textQues1').append(sign+''+finishedQty[currentQuestion]); - $('#textQues1').append(' = ').append(variableName[currentQuestion]); - $('#textQues1').append(sign+''+finishedQty[currentQuestion]); - $('#textQues2').append(sign+''+finishedQty[currentQuestion]); - $('#textQues2').append(' = ').append(''); - $('#textQues2').append(sign+''+finishedQty[currentQuestion]); - } - else{ - $('#textQues1').append(sign+''+finishedQty[currentQuestion]); - $('#textQues1').append(' = ').append(quantity[currentQuestion]+' * '+variableName[currentQuestion]); - $('#textQues1').append(sign+''+finishedQty[currentQuestion]); - $('#textQues2').append(sign+''+finishedQty[currentQuestion]); - $('#textQues2').append(' = ').append(quantity[currentQuestion]+' *'+''); - $('#textQues2').append(sign+''+finishedQty[currentQuestion]); - } - - - } - $("input#text1").focus(); - } - - - foucs_blur(); - - } - - }; - - function game_start(){ - $('#gameOver').hide(); - $('#linkCheck').show(); - $('#section').removeClass('backOpaque'); - genRandPosition(); - next_question(); - } - - function game() { - totalCounter = 0; - correctCounter = 0; - $('#section').html('').append('
'); - $('#section').append('
'); - $('#right-side').append('
'); - $('#right-side').append('
'); - $('#help').hide(); - $('#linkCheck').hide(); - $('#gameOver').hide(); - } - - game(); - - var delay_nextQues = function(){ - document.delayForm.delayval.value = 1; - next_question(); - }; - - var delay_gameOver = function(){ - document.delayForm.delayval.value = 1; - $('#section').addClass('backOpaque'); - $('#linkCheck').hide(); - $('#gameOver').show(); - }; - - var check_answer = function(){ - if(check_num === 0){ - var textVal = $('#text1').val(); - if(textVal === perPack[currentQuestion]){ // first one is correct - k.audio.correct.play(); - $('.bgCalculation').append('
'); - $('.bgCalculation').append('
'); - $('#textQues3').append(' =         ').append(''); - $('#text1').attr("disabled", true); - $('.blankBoxes').css({'padding':'0'}).html(perPack[currentQuestion]); - check_num++; - $("input#text2").focus(); - foucs_blur(); - } - else{ - k.audio.incorrect.play(); - flag_correct = 0; - } - } - else{ - textVal = $('#text2').val(); - //if(textVal === perPack[currentQuestion] * quantity[currentQuestion]){ - if(textVal === answers[currentQuestion]){ - k.audio.correct.play(); - if(flag_correct === 1){ - scoreboard.scoreboard('inc'); - correctCounter++; - } - scoreboard.scoreboard('incTotal'); - totalCounter++; - t=setTimeout(function(){delay_nextQues();},1000); - } - else{ - flag_correct = 0; - k.audio.incorrect.play(); - } - } - }; - - function foucs_blur(){ - - $('input[type="text"]') - .focus(function() { - $(this).removeClass('incorrect').addClass("focus"); - }) - .blur(function() { - $(this).removeClass("focus"); - }) - .keypress(function(event) { - if(event.which === 13){ - check_answer(); - } - - }); - - $('#linkCheck').click(function(){ - check_answer(); - }); - } - - $('#linkStart').click(function(){ - game_start(); - }); - - $('#linkPlayAgain').click(function(){ - scoreboard.scoreboard('reset'); - game_start(); - }); - $('#linkHelp').click(function(){ - $('#help').slideDown(2000); - }) - .mouseout(function(){ - $('#help').slideUp(2000); - }); - }); //end of k.ready -}); //end of document.ready \ No newline at end of file diff --git a/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.core.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.core.js deleted file mode 100755 index 5493e0a..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/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/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.draggable.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.draggable.js deleted file mode 100755 index 0402f0e..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/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() { - $('
') - .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/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.droppable.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.droppable.js deleted file mode 100755 index 8e7be33..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/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/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.scoreboard.js b/examples/lessons/6_Maths_AddingAndSubtractingVariables/js/ui.scoreboard.js deleted file mode 100755 index 53a930a..0000000 --- a/examples/lessons/6_Maths_AddingAndSubtractingVariables/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 = $('
') - .addClass('ui-scoreboard-spacing-' + layoutId); - this._scoreText = $("
Score
") - .addClass('ui-scoreboard-spacing-'+ layoutId + - ' ui-corner-all ui-scoreboard-text') - .appendTo(this.element); - this._score = $("
" + score + "
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-scoreboard-number-' + layoutId) - .appendTo(this.element); - $("
Total
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-corner-all ' + - 'ui-scoreboard-text') - .appendTo(this.element); - this._total = $("
" + total + "
") - .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/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.ogg b/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.ogg deleted file mode 100755 index a0d9e3a..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/correct.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.ogg b/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.ogg deleted file mode 100755 index 4805e55..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/audio/incorrect.ogg +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/a.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/a.png deleted file mode 100755 index 635ffa4..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/a.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/b.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/b.png deleted file mode 100755 index a03655e..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/b.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.png deleted file mode 100755 index 4bd44fa..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.png deleted file mode 100755 index f421817..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.png deleted file mode 100755 index 7311891..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/c.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/c.png deleted file mode 100755 index cad4fc1..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/c.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.png deleted file mode 100755 index f2dbc5a..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/correct.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/d.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/d.png deleted file mode 100755 index 709a8ee..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/d.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.png deleted file mode 100755 index 721e969..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques1def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.png deleted file mode 100755 index e5ebb6e..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques2def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.png deleted file mode 100755 index 044e758..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques3def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.png deleted file mode 100755 index 87e4e5c..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques4def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.png deleted file mode 100755 index b9f8f0c..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques5def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.png deleted file mode 100755 index 6e50a4b..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques6def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.png deleted file mode 100755 index b065e27..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques7def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.png deleted file mode 100755 index 280f318..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/ques8def.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.png deleted file mode 100755 index b1c0e90..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.png deleted file mode 100755 index 275daaf..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.png deleted file mode 100755 index 4cf5397..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/volume.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.png b/examples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.png deleted file mode 100755 index edfe9c5..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/assets/image/wrong.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_SetMultipleChoice/css/lesson.css b/examples/lessons/6_Maths_SetMultipleChoice/css/lesson.css deleted file mode 100755 index 3c784d3..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/css/lesson.css +++ /dev/null @@ -1,224 +0,0 @@ -@CHARSET "UTF-8"; -/****** Page Styles ****/ - -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: 89px; - width: 100%; - position: absolute; - left: 0px; - top: 0px; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 13px; - padding-left: 5px; -} - - - #linkBack{ - 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: 13px; - padding-right: 5px; -} - #linkHelp{ - width: 60px; height: 60px; - background:url(../assets/image/btn_help.png); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - #linkNext{ - width: 60px; height: 60px; - background:url(../assets/image/btn_next.png); - } - #linkNext:hover{ - background:url(../assets/image/btn_next_hover.png); - } -#footer { - background-image: url(../assets/image/bg_footer.png); - background-repeat: repeat-x; - position: absolute; - height: 69px; - width: 100%; - left: 0px; - bottom: 0px; -} -#score_box { - float: left; - padding-left: 10px; - padding-top: 10px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; -} -#botbtn_right { - float: right; - height: 55px; - width: 251px; - padding-right: 5px; - padding-top: 5px;рд╕рдВрдЦреНрдпрд╛рдорд╛ рддрд░ -} - #linkStart{ - 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{ - 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); - } - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0px auto; - margin-top: 90px; - width: 95%; - height: 375px; - -} -#section{ - margin: 0px auto; -} - - #topText{ - width: 350px; - height:25px; - font: 15px/20px Arial, Helvetica, sans-serif; - color: #FF9900; - } - #question{ - text-align:center; - margin: 2px auto; - padding:5px; - width: 700px; - height:30px; - font: 20px/25px Arial, Helvetica, sans-serif; - color: #0000FF; - } - #answer{ - margin: 2px auto; - padding:2px; - width: 600px; - height: 80px; - text-align:center; - font: 20px/25px Arial, Helvetica, sans-serif; - color: #000000; - border: 5px groove #FF9900; - } - - - #optionSection{ - margin: 5px auto; - margin-bottom: 2px; - width: 550px; - height: 210px; - } - .options{ - float:left; - width: 44px; - height: 46px; - } - .check{ - margin-top: 10px; - float:left; - width: 36px; - height: 32px; - } - .optionText{ - float:left; - margin-left:0.7em; - width: 450px; - height: 50px; - font: 18px/50px Arial, Helvetica, sans-serif; - color: #000000; - } - - -#gameOver{ - display:none; - position:absolute; - top: 40%; - left: 20%; - text-align:center; - font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight:bold; - color:red; -} -#gameOverInfo{ - margin-top: 35px; - text-align:center; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#000000; - -} -.specialText{ - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF9900; - border-bottom: 2px dotted #CCC; - -} - - diff --git a/examples/lessons/6_Maths_SetMultipleChoice/index.html b/examples/lessons/6_Maths_SetMultipleChoice/index.html deleted file mode 100755 index d7f1249..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - - Class 6 Math Set Multiple Choice - - - - - - - - - - -
-
-
- Click on the answer you think is correct. -
-
-
-
-
-
-
-
-
- -
- - - - - diff --git a/examples/lessons/6_Maths_SetMultipleChoice/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_SetMultipleChoice/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_SetMultipleChoice/js/lesson.js b/examples/lessons/6_Maths_SetMultipleChoice/js/lesson.js deleted file mode 100755 index 1d33caa..0000000 --- a/examples/lessons/6_Maths_SetMultipleChoice/js/lesson.js +++ /dev/null @@ -1,193 +0,0 @@ -$(document).ready(function() { - var i,j,flag; - var clickedObject; //store the clicked image id - var correctCounter = 0; - var totalCounter = 0; - var objrand = []; - var randQues = []; - var currentObj; //store the current object clicked - var currentQuestion; - var NUM_OBJECTS = 4; //no of options - var TOTAL_QUES = 8; - var flag_correct; - - var questions = new Array('рд╕рдореВрд╣ V = {a,e,i,o,u}рд▓рд╛рдИ рдХрд╕рд░реА рд▓реЗрдЦреНрджрд╛ рдард┐рдХ рд╣реБрджреИрди ', - 'MISSISSIPPI (рдирджреАрдХреЛ) рдирд╛рдордорд╛ рднрдПрдХрд╛ рдЕрдЩреНрдЧреНрд░реЗрдЬреА рд╡рд░реНрдгрдорд╛рд▓рд╛рдХрд╛ рдЕрдХреНрд╖рд░ рд╣рд░реБрдХреЛ M рд╕рдореБрд╣ рдмрдирд╛рдЙрджрд╛ рдХрд╕рд░реА рд▓реЗрдЦреНрдиреБрдкрд░реНрдЫ ', - 'рдЪрд┐рдиреНрд╣ ∈ рд▓реЗ рдХреЗ рдЬрдирд╛рдЙрдЫ ', - 'рдЪрд┐рдиреНрд╣ ∉ рд▓реЗ рдХреЗ рдЬрдирд╛рдЙрдЫ', - 'рд╕рдореБрд╣рдХреЛ рдЧрдгрдирд╛рддреНрдордХрддрд╛ (cardinal numbers) рднрдиреНрдирд╛рд▓реЗ рдХреЗ рдмреБрдЭрд┐рдиреНрдЫ ', - 'рдмрд░рд╛рдмрд░ рд╕рдореБрд╣ (equal sets) рднрдиреНрдирд╛рд▓реЗ рдХреЗ рдмреБрдЭрд┐рдиреНрдЫ' , - 'рд╕рдорддреБрд▓реНрдп рд╕рдореБрд╣ (equivalent sets) рднрдиреНрдирд╛рд▓реЗ рдХреЗ рдмреБрдЭрд┐рдиреНрдЫ', - 'рдЪрд┐рдиреНрд╣ ∅ рд▓реЗ рдХрд╕реНрддреЛ рд╕рдореБрд╣ рдЬрдирд╛рдЙрдЫ' - ); - - - //current answer among four stored at first 4 options for each questions - var answers = new Array( - 'V = {e,a,i,a,u}','V = {e,a,o,i,u}','V = {i,u,a,o,e}','V = {a,e,o,i,u}', - 'M = {M,I,S,I,P,I}','M = {M,I,S,S,I,S,S,I,P,P,I}','M = {M,I,S,P}','M = {M,I,S,S,P}', - 'рд╕рдореБрд╣рдХреЛ рд╕рджрд╕реНрдп рд╣реЛ','рд╕рдореБрд╣рдХреЛ рд╕рджрд╕реНрдп рд╣реЛрдЗрди','рдЙрдк-рд╕рдореБрд╣ рд╣реЛ','рдЙрдк-рд╕рдореБрд╣ рд╣реЛрдЗрди ', - 'рд╕рдореБрд╣рдХреЛ рд╕рджрд╕реНрдп рд╣реЛрдЗрди','рд╕рдореБрд╣рдХреЛ рд╕рджрд╕реНрдп рд╣реЛ','рдЙрдк-рд╕рдореБрд╣ рд╣реЛ','рдЙрдк-рд╕рдореБрд╣ рд╣реЛрдЗрди ', - 'рд╕рдореБрд╣рдорд╛ рднрдПрдХрд╛ рд╕рджрд╕реНрдпрд╣рд░реБрдХреЛ рд╕рдЩреНрдЦреНрдпрд╛','рд╕рдЩреНрдЦреНрдпрд╛рд╣рд░реБ рдорд┐рд▓реЗрд░ рдмрдиреЗрдХреЛ рд╕рдореБрд╣','рд╕рдореБрд╣рд╣рд░реБрдХреЛ рд╕рдЩреНрдЦреНрдпрд╛','рд╕рдореБрд╣рд▓рд╛рдИ рдЧрдиреНрдиреЗ', - 'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рд░ рдЙрд╣реА рд╕рджрд╕реНрдпрд╣рд░реБ рдЫрдиреН ', 'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рд╕рдВрдЦреНрдпрд╛рдорд╛ рд╕рджрд╕реНрдпрд╣рд░реБ рдЫрдиреН', - 'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рдХреЗрд╣рд┐ рд╕рджрд╕реНрдпрд╣рд░реБ рдПрдХрдЕрд░реНрдХрд╛рд╕рдВрдЧ рдорд┐рд▓реНрдЫрди' ,'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рд╕рдВрдЦреНрдпрд╛рдорд╛ рддрд░ рд╕рджрд╕реНрдпрд╣рд░реБ рд╕рдмреИ рдлрд░рдХ рд╣реБрдиреБрдкрд░реНрдЫ ', - 'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рд╕рдВрдЦреНрдпрд╛рдорд╛ рд╕рджрд╕реНрдпрд╣рд░реБ рдЫрдиреН','рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рд░ рдЙрд╣реА рд╕рджрд╕реНрдпрд╣рд░реБ рдЫрдиреН ', - 'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рдХреЗрд╣рд┐ рд╕рджрд╕реНрдпрд╣рд░реБ рдПрдХрдЕрд░реНрдХрд╛рд╕рдВрдЧ рдорд┐рд▓реНрдЫрди' ,'рджреБрдИрдУрдЯрд╛ рд╕рдореБрд╣рдорд╛ рдЙрддрд┐рдХреИ рд╕рдВрдЦреНрдпрд╛рдорд╛ рддрд░ рд╕рджрд╕реНрдпрд╣рд░реБ рд╕рдмреИ рдлрд░рдХ рд╣реБрдиреБрдкрд░реНрдЫ ', - 'рдПрдЙрдЯрд╛ рдкрдирд┐ рд╕рджрд╕реНрдп рдирднрдПрдХреЛ рд╕рдореБрд╣ ',' 0 (рд╢реВрдиреНрдп) рд╕рдВрдЦреНрдпрд╛ рд╕рджрд╕реНрдп рднрдПрдХреЛ рд╕рдореБрд╣','рд╕рдмреИрднрдиреНрджрд╛ рдареБрд▓реЛ рд╕рдореБрд╣ ','рдЙрдк-рд╕рдореБрд╣' - ); - - - var nepaliNumbers = new Array('реж','рез','реи','рей','рек','рел','рем'); - var optionImg = new Array('a','b','c','d'); - - var randNumber = function(limit){ //generate random number between any two ranges - var rand_no = Math.floor(limit*Math.random()); - return rand_no; - }; - - var generate_random_questions = function(){ - randQues[0] = randNumber(TOTAL_QUES); - for(i=1; iрдмрдзрд╛рдИ рдЫ !!! рд╕рдмреИ рдЙрддреНрддрд░ рд╕рд╣рд┐ рднрдП !!!
'); - } - else{ - $('#gameOver').append('
рдХрд┐рди рдЧрд▓рдд рднрдпреЛ рдкрддреНрддрд╛ рд▓рдЧрд╛рдЙ рд░ рдЕрд░реНрдХреЛ рдкрдЯрдХ рд╕рд╣рд┐ рдмрдирд╛рдЙрдиреЗ рдХреЛрд╢рд┐рд╢ рдЧрд░ ред
You Got '+correctCounter+ - ' correct out of '+totalCounter+' questions .
'); - } - }; - - var delay = function(){ - document.delayForm.delayval.value = 1; - display_game_over(); - }; - var check_game_over = function(){ - if(totalCounter === TOTAL_QUES){ //show all - t=setTimeout(function(){delay();},1000); - } - }; - - var store_clicked_object = function(objectClicked){ - var checked; - if(objrand[objectClicked] ===0){ - if(flag_correct == 1){ //correct at first attempt - checked = "correct"; - correctCounter++; - } - } - else{ - - flag_correct = 0; - checked = "wrong"; - } - - flag_correct = 0; - $('#checkans'+objectClicked).html(''); - $('#checkans'+objectClicked).append(''); - $('#answer').show(''); - $('#answer').html(''); - var quesNo =currentQuestion+1; - $('#answer').append(''); - $('#linkNext').show(); - totalCounter++; - display_score(); - check_game_over(); - }; - - - var assignOptions = function (square){ - var a = currentQuestion*4; - var randOption = objrand[square]+a; - $('#optionSection').append('
'); - $('#optionSection').append(''); - $('#optionSection a:last-of-type').append('
'+ - '
'); - $('#optionSection a:last-of-type').append('
'+answers[randOption]+'
'); - $('#optionSection a:last-of-type').click(function(){ - if(flag_correct === 1){ - store_clicked_object(square); - } - }); - }; - - var next_sentence = function(){ - flag_correct = 1; - var imgName,topPos; - generate_random_options_no(); - currentQuestion = randQues[totalCounter]; - $('#question').html(''); - $('#question').append(nepaliNumbers[totalCounter+1]).append(' .'); - $('#question').append(questions[currentQuestion]).append(' ?'); - for(var i = 0; i < 4; i++){ - assignOptions(i); - } - }; - function game(){ - $('#gameOver').hide(); - $('#section').show(); - $('#answer').hide(); - correctCounter = 0; - totalCounter = 0; - $('#linkNext').hide(); - $('#optionSection').html(''); - display_score(); - generate_random_questions(); - next_sentence(); - } - $('#linkNext').click(function(){ - $('#linkNext').hide(); - $('#optionSection').html(''); - $('#answer').hide(''); - next_sentence(); - }); - - $('#linkStart').click(function(){ - game(); - }); - - $('#linkPlayAgain').click(function(){ - game(); - }); - $('#answer').hide(); - display_score(); - $('#linkNext').hide(); - -});//end of DOM diff --git a/examples/lessons/6_Maths_goShopping/assets/audio/correct.wav b/examples/lessons/6_Maths_goShopping/assets/audio/correct.wav deleted file mode 100755 index a49ba33..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/audio/correct.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/audio/incorrect.wav b/examples/lessons/6_Maths_goShopping/assets/audio/incorrect.wav deleted file mode 100755 index 906c6a3..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/audio/incorrect.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/apple.png b/examples/lessons/6_Maths_goShopping/assets/image/apple.png deleted file mode 100755 index 8a982bd..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/apple.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bag.png b/examples/lessons/6_Maths_goShopping/assets/image/bag.png deleted file mode 100755 index e41fd52..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/bag.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/balloon.png b/examples/lessons/6_Maths_goShopping/assets/image/balloon.png deleted file mode 100755 index 21a5236..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/balloon.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bg_footer.png b/examples/lessons/6_Maths_goShopping/assets/image/bg_footer.png deleted file mode 100755 index 8982264..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bg_header.png b/examples/lessons/6_Maths_goShopping/assets/image/bg_header.png deleted file mode 100755 index 98213f7..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bg_title_block.png b/examples/lessons/6_Maths_goShopping/assets/image/bg_title_block.png deleted file mode 100755 index 2c9dacf..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/book.png b/examples/lessons/6_Maths_goShopping/assets/image/book.png deleted file mode 100755 index 0648da7..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/book.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/bread.png b/examples/lessons/6_Maths_goShopping/assets/image/bread.png deleted file mode 100755 index eed6297..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/bread.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_back.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_help.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_next.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_ole.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_start.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/cake.png b/examples/lessons/6_Maths_goShopping/assets/image/cake.png deleted file mode 100755 index 075571f..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/cake.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/cap.png b/examples/lessons/6_Maths_goShopping/assets/image/cap.png deleted file mode 100755 index 0507d8f..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/cap.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/correct.png b/examples/lessons/6_Maths_goShopping/assets/image/correct.png deleted file mode 100755 index fff0b0f..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/correct.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/doll.png b/examples/lessons/6_Maths_goShopping/assets/image/doll.png deleted file mode 100755 index 282260e..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/doll.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/food.png b/examples/lessons/6_Maths_goShopping/assets/image/food.png deleted file mode 100755 index e584852..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/food.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/grapes.png b/examples/lessons/6_Maths_goShopping/assets/image/grapes.png deleted file mode 100755 index 7398874..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/grapes.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/help.png b/examples/lessons/6_Maths_goShopping/assets/image/help.png deleted file mode 100755 index a59e1d9..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.png b/examples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.png deleted file mode 100755 index 9d39a6b..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/howMuchLeft.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.png b/examples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.png deleted file mode 100755 index 52afff3..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/howMuchNeeded.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/ice.png b/examples/lessons/6_Maths_goShopping/assets/image/ice.png deleted file mode 100755 index 7248f45..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/ice.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/incorrect.png b/examples/lessons/6_Maths_goShopping/assets/image/incorrect.png deleted file mode 100755 index 4a38e07..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/incorrect.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/lays.png b/examples/lessons/6_Maths_goShopping/assets/image/lays.png deleted file mode 100755 index 1384186..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/lays.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/leftText.png b/examples/lessons/6_Maths_goShopping/assets/image/leftText.png deleted file mode 100755 index 39eaa72..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/leftText.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/mango.png b/examples/lessons/6_Maths_goShopping/assets/image/mango.png deleted file mode 100755 index 94ec9b7..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/mango.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.png b/examples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.png deleted file mode 100755 index aeedb7d..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/moneyNeeded.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/moneyOk.png b/examples/lessons/6_Maths_goShopping/assets/image/moneyOk.png deleted file mode 100755 index 4fc12f2..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/moneyOk.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/orange.png b/examples/lessons/6_Maths_goShopping/assets/image/orange.png deleted file mode 100755 index 847f9c0..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/orange.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/papaya.png b/examples/lessons/6_Maths_goShopping/assets/image/papaya.png deleted file mode 100755 index ba6c598..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/papaya.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/pear.png b/examples/lessons/6_Maths_goShopping/assets/image/pear.png deleted file mode 100755 index 958649c..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/pear.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/pen.png b/examples/lessons/6_Maths_goShopping/assets/image/pen.png deleted file mode 100755 index 43f4f96..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/pen.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/pomogranate.png b/examples/lessons/6_Maths_goShopping/assets/image/pomogranate.png deleted file mode 100755 index 84183ab..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/pomogranate.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rightText.png b/examples/lessons/6_Maths_goShopping/assets/image/rightText.png deleted file mode 100755 index 0092ae6..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/rightText.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/roti.png b/examples/lessons/6_Maths_goShopping/assets/image/roti.png deleted file mode 100755 index 3a62fc7..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/roti.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs10.png b/examples/lessons/6_Maths_goShopping/assets/image/rs10.png deleted file mode 100755 index 1ce7088..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/rs10.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs100.png b/examples/lessons/6_Maths_goShopping/assets/image/rs100.png deleted file mode 100755 index 156a236..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/rs100.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs25.png b/examples/lessons/6_Maths_goShopping/assets/image/rs25.png deleted file mode 100755 index ff11e54..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/rs25.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs5.png b/examples/lessons/6_Maths_goShopping/assets/image/rs5.png deleted file mode 100755 index 4d9b758..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/rs5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/rs50.png b/examples/lessons/6_Maths_goShopping/assets/image/rs50.png deleted file mode 100755 index 9b949f0..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/rs50.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/title_block_lt.png b/examples/lessons/6_Maths_goShopping/assets/image/title_block_lt.png deleted file mode 100755 index 4696182..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/assets/image/title_block_rt.png b/examples/lessons/6_Maths_goShopping/assets/image/title_block_rt.png deleted file mode 100755 index 37cc44a..0000000 --- a/examples/lessons/6_Maths_goShopping/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_goShopping/css/lesson.css b/examples/lessons/6_Maths_goShopping/css/lesson.css deleted file mode 100755 index 4fc67bc..0000000 --- a/examples/lessons/6_Maths_goShopping/css/lesson.css +++ /dev/null @@ -1,299 +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; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 6px; - padding-left: 15px; -} - - - .linkBack{ - 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); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - .linkNext{ - 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{ - 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{ - 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); - } -#linkNextExercise{ - position:absolute; - bottom: 75px; - right: 10px; -} -#linkPrevExercise{ - position:absolute; - bottom: 75px; - left: 10px; -} - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0 auto; - margin-top: 75px; - width: 95%; - height: 550px; - padding: 0.5em; -} - #left-side{ - position:relative; - margin: 60px auto; - margin-bottom:0; - padding-top:50px; - float:left; - width: 60%; - height: 350px; - border: 4px solid #000; - } - #leftText{ - position:absolute; - top: -60px; - left: 100px; - text-align:center; - height: 40px; - font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman; - color: #FF0000; - } - .default{ - float:left; - margin: 0px auto; - text-align:center; - width: 170px; - height: 44px; - } - .moneyPositions{ - position:absolute; - width: 489px; - height: 199px; - } - - #right-side{ - position:relative; - margin: 60px auto; - margin-bottom:0; - padding-top: 50px; - float:right; - width: 35%; - height: 350px; - border: 4px solid #000; - } - #rightText{ - position:absolute; - top: -60px; - left: 20px; - text-align:center; - height: 40px; - font : 20px/25px Verdana,Helvetica,Arial Black, Times New Roman; - color: #FF0000; - } - .thingsPositions{ - position:absolute; - width: 150px; - height: 150px; - } - #checkSection{ - position: static; - bottom: -25px; - left: 50%; - width: 40%; - height: 65px; - text-align:center; - } - .checkMoney{ - float:left; - margin: 0.8em; - } - #howmuchText{ - float:left; - margin: 0.5em 0 0.9em 1em ; - width: auto; - height: 35px; - } - #textDiv{ - float:left; - width: 75px; - margin:0.5em 0 0 1em; - height: 35px; - } - - input.textBox{ - size:3; - font: 25px/30px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight: bold; - height:35px; - width: 75px; - text-align:center; - } - - - .focus { - background-color: #FF9900; - } - - #checkDisplay{ - float:right; - width: 64px; - height: 64px; - margin: 0 0 0 1em; - } - - .backOpaque{ - background-color: #A4A4A4; - opacity: 0.2; - } - #help{ - display:none; - position:absolute; - right: 60px; - top: 75px;; - width: 256px; - height: 600px; - background:url(../assets/image/help.png); - z-index:40; - } - - #gameOver{ - opacity: 1; - display:none; - position:absolute; - top:45%; - left: 30%; - color: blue; - text-align:center; - font : bold 45px/65px Arial Black, Times New Roman; - } - #gameOverInfo{ - margin-top: 35px; - text-align:center; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF0000; - - } - .specialText{ - margin-top: 1em; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF9900; - border-bottom: 2px dotted #CCC; - - } diff --git a/examples/lessons/6_Maths_goShopping/css/ui.scoreboard.css b/examples/lessons/6_Maths_goShopping/css/ui.scoreboard.css deleted file mode 100755 index 11cdbb5..0000000 --- a/examples/lessons/6_Maths_goShopping/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/examples/lessons/6_Maths_goShopping/index.html b/examples/lessons/6_Maths_goShopping/index.html deleted file mode 100755 index b88c678..0000000 --- a/examples/lessons/6_Maths_goShopping/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - - Class 6 Maths Go Shopping - - - - - - - - - - - - - - -
-
-
-
-
- - -
-
-
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_goShopping/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_goShopping/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_goShopping/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_goShopping/js/karma.js b/examples/lessons/6_Maths_goShopping/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_goShopping/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_goShopping/js/lesson.js b/examples/lessons/6_Maths_goShopping/js/lesson.js deleted file mode 100755 index 5236876..0000000 --- a/examples/lessons/6_Maths_goShopping/js/lesson.js +++ /dev/null @@ -1,259 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var i,j; - var checkId; - var correctCounter; - var totalCounter; - var TOTAL_THINGS = 19; - var TOTAL_MONEYS = 5; - var TOTAL_QUES = 10; - var flag_correct; - var flag_checked; - var checked; - var randThings = []; - var randMoneys = []; - var totalMoney; - var totalPrice; - - var money = new Array(5,10,25,50,100); - var things = new Array('roti','pomogranate','pen','pear','papaya','orange','mango','lays','ice', - 'grapes','food','doll','cap','cake','bread','book','balloon','bag','apple' - ); - var priceThings = new Array(15,5,41,3,7,5,9,19,13,11,45,89,65,33,23,65,25,87,15); - - var scoreboard = $('#score_box').scoreboard({'layout':'horizontal', - 'winningScore': TOTAL_QUES}); - - var genRandomThings = function(){ - randThings[0] = k.rand(0,TOTAL_THINGS-1); - for(i=1; i
'); - $('#moneyPos'+posId).css({'top':topPos+'px','left':leftPos+'px','z-index':zindexVal}); - } - else{ - $('#right-side').append('
'); - $('#thingPos'+posId).css({'top':topPos+'px','left':leftPos+'px'}); - } - }; - - var checkAnswer = function(){ - if(flag_checked != 0){ - if(checkId == "moneyOk" && totalMoney >= totalPrice){ - flag_checked = 0; - $('#howmuchText').html(''); - } - else if(checkId == "moneyNeeded" && totalMoney < totalPrice){ - flag_checked = 0; - $('#howmuchText').html(''); - } - else{ //try again ur score wont increase - flag_correct = 0; - } - } - if(flag_checked === 0){ - $('#textDiv').html(''); - $('.textBox').val(''); - foucs_blur(); $('.textBox').focus(); - } - }; - - var nextQuestions = function(){ - $('#howmuchText').html(''); - $('#textDiv').html(''); - - totalMoney = 0; - totalPrice = 0; - flag_correct = 1; - flag_checked = 1; - $('#left-side').html('').append(''); - $('#right-side').html('').append(''); - - generatePositions('left',0,25,25); - generatePositions('left',1,75,325); - generatePositions('left',2,150,50); - generatePositions('left',3,180,350); - - generatePositions('right',0,50,25); - generatePositions('right',1,25,220); - generatePositions('right',2,225,50); - generatePositions('right',3,200,275); - - genRandomMoneys(); - var currentMoneys = k.rand(1,4); - for(i = 0; i< currentMoneys ;i++){ - var randMoney = randMoneys[i]; - $('#moneyPos'+i).append(''); - totalMoney += money[randMoney]; - } - genRandomThings(); - var currentThings = k.rand(1,4); - for(i = 0; i< currentThings ;i++){ - var randThing = randThings[i]; - $('#thingPos'+i).append(''); - totalPrice += priceThings[randThing]; - } - - $('.checkMoney').click(function(){ - checkId = $(this).attr('id'); - checkAnswer(); - }); - }; - - - - function gameStart(){ - $('#content').removeClass('backOpaque'); - $('#gameOver').hide(); - totalCounter = 0; - correctCounter = 0; - nextQuestions(); - - } - - var displayGameOver = function(){ - $('#content').addClass('backOpaque'); - $('#gameOver').show(); - if(correctCounter === totalCounter){ - $('#gameOver').html('рдмрдзрд╛рдИ рдЫ !!! рд╕рдмреИ рдЙрддреНрддрд░ рд╕рд╣рд┐ рднрдП !!! '); - } - else{ - $('#gameOver').html('
рдХрд┐рди рдЧрд▓рдд рднрдпреЛ рдкрддреНрддрд╛ рд▓рдЧрд╛рдЙ рд░ рдЕрд░реНрдХреЛ рдкрдЯрдХ рд╕рд╣рд┐ рдмрдирд╛рдЙрдиреЗ рдХреЛрд╢рд┐рд╢ рдЧрд░ ред
You Got '+correctCounter+ - ' correct out of '+totalCounter+' questions .
'); - } - }; - - var delayCorrectShow = function(){ - document.delayForm.delayval.value = 1; - if(checked === 1){ - if(totalCounter === 10){ - displayGameOver(); - } - else{ - nextQuestions(); - } - } - $('#checkDisplay').html(''); - - - }; - - var checkMoney = function(){ - var flag_correctAns = 1; - var textVal = $('.textBox').val(); - if( checkId === "moneyOk" && textVal == (totalMoney - totalPrice) ){ - flag_correctAns = 1; - } - else if(checkId === "moneyNeeded" && textVal == (totalPrice - totalMoney)){ - flag_correctAns = 1; - } - else{ - flag_correctAns = 0; - } - - if(flag_correctAns === 1){ - checked = 1; - k.audio.correct.play(); - if(flag_correct === 1){ - correctCounter++; - scoreboard.scoreboard('inc'); - } - totalCounter++; - scoreboard.scoreboard('incTotal'); - $('#checkDisplay').html(''); - - } - else{ - flag_correct = 0; - checked = 0; - k.audio.incorrect.play(); - $('#checkDisplay').html(''); - t=setTimeout(function(){delayCorrectShow();},1000); - } - t=setTimeout(function(){delayCorrectShow();},1000); - - }; - - function foucs_blur(){ - $('input[type="text"]') - .focus(function() { - $(this).addClass("focus"); - }) - .blur(function() { - $(this).removeClass("focus"); - }) - .keypress(function(event) { - if(event.which === 13){ - checkMoney(); - } - - }); - - } - - $('#linkStart').click(function(){ - gameStart(); - }); - - $('#linkPlayAgain').click(function(){ - gameStart(); - }); - $('#linkHelp').mouseover(function(){ - $('#help').slideDown(2000); - }) - .mouseout(function(){ - $('#help').slideUp(2000); - - }); - }); //end of k.ready - }); //end of document.read - diff --git a/examples/lessons/6_Maths_goShopping/js/ui.core.js b/examples/lessons/6_Maths_goShopping/js/ui.core.js deleted file mode 100755 index 5493e0a..0000000 --- a/examples/lessons/6_Maths_goShopping/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/examples/lessons/6_Maths_goShopping/js/ui.scoreboard.js b/examples/lessons/6_Maths_goShopping/js/ui.scoreboard.js deleted file mode 100755 index 53a930a..0000000 --- a/examples/lessons/6_Maths_goShopping/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 = $('
') - .addClass('ui-scoreboard-spacing-' + layoutId); - this._scoreText = $("
Score
") - .addClass('ui-scoreboard-spacing-'+ layoutId + - ' ui-corner-all ui-scoreboard-text') - .appendTo(this.element); - this._score = $("
" + score + "
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-scoreboard-number-' + layoutId) - .appendTo(this.element); - $("
Total
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-corner-all ' + - 'ui-scoreboard-text') - .appendTo(this.element); - this._total = $("
" + total + "
") - .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/examples/lessons/6_Maths_parallelLines/assets/audio/correct.wav b/examples/lessons/6_Maths_parallelLines/assets/audio/correct.wav deleted file mode 100755 index a49ba33..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/audio/correct.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wav b/examples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wav deleted file mode 100755 index 906c6a3..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/audio/incorrect.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.png b/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.png deleted file mode 100755 index b42c1a5..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-003-660@141.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.png b/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.png deleted file mode 100755 index 0765909..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/6_Maths_parallelLines_9-012-500@152.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/bg_footer.png b/examples/lessons/6_Maths_parallelLines/assets/image/bg_footer.png deleted file mode 100755 index 8982264..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/bg_header.png b/examples/lessons/6_Maths_parallelLines/assets/image/bg_header.png deleted file mode 100755 index 98213f7..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.png b/examples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.png deleted file mode 100755 index 2c9dacf..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_back.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_help.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_next.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/correct.png b/examples/lessons/6_Maths_parallelLines/assets/image/correct.png deleted file mode 100755 index fff0b0f..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/correct.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.png deleted file mode 100755 index 679507d..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/defIntersectLines.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.png deleted file mode 100755 index 7509883..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelLines.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.png b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.png deleted file mode 100755 index 2192e39..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelNo.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.png b/examples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.png deleted file mode 100755 index 789c0c2..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/defParallelYes.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/help.png b/examples/lessons/6_Maths_parallelLines/assets/image/help.png deleted file mode 100755 index 5bbec09..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.png deleted file mode 100755 index 663bded..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/imgIntersectLines.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgNo.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgNo.png deleted file mode 100755 index 1aa8be9..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/imgNo.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.png deleted file mode 100755 index 1aee838..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/imgParallelLines.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/imgYes.png b/examples/lessons/6_Maths_parallelLines/assets/image/imgYes.png deleted file mode 100755 index 800f3bc..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/imgYes.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/incorrect.png b/examples/lessons/6_Maths_parallelLines/assets/image/incorrect.png deleted file mode 100755 index 4a38e07..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/incorrect.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.png deleted file mode 100755 index a2c4224..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/infoIntersectLines.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.png b/examples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.png deleted file mode 100755 index 15616d7..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/infoParallelLines.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques0.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques0.png deleted file mode 100755 index d248d93..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques0.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques1.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques1.png deleted file mode 100755 index a6cb77b..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques1.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques2.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques2.png deleted file mode 100755 index 61ec2da..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques2.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques3.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques3.png deleted file mode 100755 index b7a93a7..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques3.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques4.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques4.png deleted file mode 100755 index e036aeb..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques4.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques5.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques5.png deleted file mode 100755 index e1f0e08..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques5.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques6.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques6.png deleted file mode 100755 index 3d53e8b..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques6.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques7.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques7.png deleted file mode 100755 index d58a860..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques7.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques8.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques8.png deleted file mode 100755 index aefe417..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques8.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/ques9.png b/examples/lessons/6_Maths_parallelLines/assets/image/ques9.png deleted file mode 100755 index e554090..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/ques9.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.png b/examples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.png deleted file mode 100755 index 4696182..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.png b/examples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.png deleted file mode 100755 index 37cc44a..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/assets/image/topText.png b/examples/lessons/6_Maths_parallelLines/assets/image/topText.png deleted file mode 100755 index 7428709..0000000 --- a/examples/lessons/6_Maths_parallelLines/assets/image/topText.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_parallelLines/css/lesson.css b/examples/lessons/6_Maths_parallelLines/css/lesson.css deleted file mode 100755 index 92d8a18..0000000 --- a/examples/lessons/6_Maths_parallelLines/css/lesson.css +++ /dev/null @@ -1,262 +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; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 6px; - padding-left: 15px; -} - - - .linkBack{ - 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); - } - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - .linkNext{ - 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{ - 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{ - 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; -} - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0 auto; - margin-top: 75px; - width: 95%; - height: 550px; - padding: 0.5em; -} - #lesson{ - margin: 5px auto; - width: 650px; - height: 600px; - text-align:center; - - } - #lessonHeader{ - margin-top:10px; - } - #lessonImage{ - margin-top: 50px; - } - #lessonInfo{ - margin-top: 50px; - } - - #quesDisplay{ - margin: 10% 2% 1% 10% ; - float:left; - width: 150px; - height: 250px; - text-align:center; - } - #questionSection{ - margin: 2% 30% 1% 2% ; - float:right; - width: 350px; - height: 260px; - } - #question{ - margin: 0.5em; - float:right; - width: 250px; - height: 30px; - font: 20px/25px Arial, Helvetica, sans-serif; - font-weight: bold; - } - #optionSection{ - margin-top: 4em; - width: 300px; - height: 200px; - text-align:center; - } - .imgOption{ - float:right; - widht:157px; - height:49px; - margin: 1em; - } - .checkDisplay{ - float:left; - width: 64px; - height: 64px; - margin: 0 0 0 1em; - } - #defSection{ - position:absolute; - bottom: 0; - left: 25%; - width: 526px; - height: 87px; - } - - - .backOpaque{ - background-color: #A4A4A4; - opacity: 0.2; - } - #help{ - display:none; - position:absolute; - right: 60px; - top: 75px;; - width: 256px; - height: 600px; - background:url(../assets/image/help.png); - z-index:40; - } - - #gameOver{ - opacity: 1; - display:none; - position:absolute; - top:45%; - left: 30%; - color: blue; - text-align:center; - font : bold 45px/65px Arial Black, Times New Roman; - } - #gameOverInfo{ - margin-top: 35px; - text-align:center; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF0000; - - } - .specialText{ - margin-top: 1em; - font: 20px/25px Helvetica, Geneva, Arial, Verdana, sans-serif; - font-weight:bold; - color:#FF9900; - border-bottom: 2px dotted #CCC; - - } diff --git a/examples/lessons/6_Maths_parallelLines/css/ui.scoreboard.css b/examples/lessons/6_Maths_parallelLines/css/ui.scoreboard.css deleted file mode 100755 index 11cdbb5..0000000 --- a/examples/lessons/6_Maths_parallelLines/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/examples/lessons/6_Maths_parallelLines/index.html b/examples/lessons/6_Maths_parallelLines/index.html deleted file mode 100755 index 8ec61b6..0000000 --- a/examples/lessons/6_Maths_parallelLines/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - Class 6 Maths Parallel Lines - - - - - - - - - - - - - - -
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_parallelLines/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_parallelLines/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_parallelLines/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_parallelLines/js/karma.js b/examples/lessons/6_Maths_parallelLines/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_parallelLines/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_parallelLines/js/lesson.js b/examples/lessons/6_Maths_parallelLines/js/lesson.js deleted file mode 100755 index a0c4a9f..0000000 --- a/examples/lessons/6_Maths_parallelLines/js/lesson.js +++ /dev/null @@ -1,163 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var currentLesson; - var i,j; - var flag_correct; - var TOTAL_QUES = 10; - var currentQuestion; - var correctCounter; - var totalCounter; - var imgVal; - var checked; - var question = new Array('AB рд░ CB рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','MN рд░ PQ рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','XY рд░ RS рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛', - 'AB рд░ CD рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','AB рд░ CD рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','AB рд░ BC рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','AB рд░ CD рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛', - 'XAY рд░ BC рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','AB рд░ BC рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛','ABC рд░ DE рдПрдХ рдЖрдкрд╕рдорд╛ рд╕рдорд╛рдирд╛рдиреНрддрд░ рд░реЗрдЦрд╛' - ); - var answers = new Array(1,0,0,0,1,1,0,0,1,1); //0 for yes and 1 for 1 - var definitions = new Array('Yes','No'); - var scoreboard = $('#score_box').scoreboard({'layout':'horizontal', - 'winningScore': TOTAL_QUES}); - - var displayLessons = function(){ - $('#content').html('').append('
'); - if(currentLesson === 0){ - var imgDef = "defParallelLines"; - var imgLesson = "imgParallelLines"; - var imgInfo = "infoParallelLines"; - } - else{ - var imgDef = "defIntersectLines"; - var imgLesson = "imgIntersectLines"; - var imgInfo = "infoIntersectLines"; - } - $('#lesson').append(''); - $('#lesson').append(''); - $('#lesson').append(''); - }; - - var assignOptions = function(imgId){ - $('#optionSection').append('
'); - $('#opt'+imgId).click(function(){ - checkAnswer(imgId); - }); - }; - - var nextQuestions = function(){ - currentQuestion = totalCounter; - flag_correct = 1; - $('#content').html('').append(''); - $('#content').append('
'); - $('#content').append('
'); - $('#questionSection').append('
'); - $('#questionSection').append('
'); - $('#content').append('
'); - - $('#quesDisplay').html('рдХрд┐рди рдЧрд▓рдд рднрдпреЛ рдкрддреНрддрд╛ рд▓рдЧрд╛рдЙ рд░ рдЕрд░реНрдХреЛ рдкрдЯрдХ рд╕рд╣рд┐ рдмрдирд╛рдЙрдиреЗ рдХреЛрд╢рд┐рд╢ рдЧрд░ ред
You Got '+correctCounter+ - ' correct out of '+totalCounter+' questions .
'); - } - }; - - var delayCorrectShow = function(){ - document.delayForm.delayval.value = 1; - if(checked === 1){ - if(totalCounter === 10){ - displayGameOver(); - } - else{ - nextQuestions(); - } - } - $('.checkDisplay').html(''); - }; - - var checkAnswer = function(optId){ - if(optId == answers[currentQuestion]){ - checked = 1; - k.audio.correct.play(); - if(flag_correct === 1){ - correctCounter++; - scoreboard.scoreboard('inc'); - } - totalCounter++; - scoreboard.scoreboard('incTotal'); - $('#check'+optId).html(''); - - } - else{ - flag_correct = 0; - checked = 0; - k.audio.incorrect.play(); - $('#check'+optId).html(''); - $('#defSection').html(''); - } - t=setTimeout(function(){delayCorrectShow();},1000); - }; - - function gameStart(){ - $('#linkNextLesson').hide(); - $('#linkPrevLesson').hide(); - totalCounter = 0; - correctCounter = 0; - nextQuestions(); - } - - function game(){ - $('#linkPrevLesson').hide(); - $('#content').removeClass('backOpaque'); - $('#gameOver').hide(); - currentLesson = 0; - displayLessons(); - } - - game(); - - $('#linkNextLesson').click(function(){ - $('#linkNextLesson').hide(); - $('#linkPrevLesson').show(); - currentLesson = 1; - displayLessons(); - }); - $('#linkPrevLesson').click(function(){ - $('#linkNextLesson').show(); - $('#linkPrevLesson').hide(); - currentLesson = 0; - displayLessons(); - }); - $('#linkStart').click(function(){ - gameStart(); - }); - - $('#linkPlayAgain').click(function(){ - game(); - }); - $('#linkHelp').mouseover(function(){ - $('#help').slideDown(2000); - }) - .mouseout(function(){ - $('#help').slideUp(2000); - - }); - }); //end of k.ready - }); //end of document.read - - diff --git a/examples/lessons/6_Maths_parallelLines/js/ui.core.js b/examples/lessons/6_Maths_parallelLines/js/ui.core.js deleted file mode 100755 index 5493e0a..0000000 --- a/examples/lessons/6_Maths_parallelLines/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/examples/lessons/6_Maths_parallelLines/js/ui.scoreboard.js b/examples/lessons/6_Maths_parallelLines/js/ui.scoreboard.js deleted file mode 100755 index 53a930a..0000000 --- a/examples/lessons/6_Maths_parallelLines/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 = $('
') - .addClass('ui-scoreboard-spacing-' + layoutId); - this._scoreText = $("
Score
") - .addClass('ui-scoreboard-spacing-'+ layoutId + - ' ui-corner-all ui-scoreboard-text') - .appendTo(this.element); - this._score = $("
" + score + "
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-scoreboard-number-' + layoutId) - .appendTo(this.element); - $("
Total
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-corner-all ' + - 'ui-scoreboard-text') - .appendTo(this.element); - this._total = $("
" + total + "
") - .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/examples/lessons/6_Maths_quickAddition/assets/audio/correct.wav b/examples/lessons/6_Maths_quickAddition/assets/audio/correct.wav deleted file mode 100755 index a49ba33..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/audio/correct.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wav b/examples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wav deleted file mode 100755 index 906c6a3..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/audio/incorrect.wav +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/bg_footer.png b/examples/lessons/6_Maths_quickAddition/assets/image/bg_footer.png deleted file mode 100755 index 4bd44fa..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/bg_footer.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/bg_header.png b/examples/lessons/6_Maths_quickAddition/assets/image/bg_header.png deleted file mode 100755 index f421817..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/bg_header.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.png b/examples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.png deleted file mode 100755 index 7311891..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/bg_title_block.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/borderWall.png b/examples/lessons/6_Maths_quickAddition/assets/image/borderWall.png deleted file mode 100755 index adbacdc..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/borderWall.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_back.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_back.png deleted file mode 100755 index d9fbf14..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_back.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.png deleted file mode 100755 index 0911fcc..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_back_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_help.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_help.png deleted file mode 100755 index 6753e9c..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.png deleted file mode 100755 index d3ccd92..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_help_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_next.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_next.png deleted file mode 100755 index 9d70993..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_next.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.png deleted file mode 100755 index 2cd4d37..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_next_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole.png deleted file mode 100755 index 0e775e9..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.png deleted file mode 100755 index c43c5f7..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_ole_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.png deleted file mode 100755 index 3594d18..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.png deleted file mode 100755 index ebb8f8c..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.png deleted file mode 100755 index 07d6e45..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_play_again_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start.png deleted file mode 100755 index 32e5f20..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.png deleted file mode 100755 index 811ce78..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_hover.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.png b/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.png deleted file mode 100755 index 5acd43b..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/btn_start_mouse_down.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/cupBoard.png b/examples/lessons/6_Maths_quickAddition/assets/image/cupBoard.png deleted file mode 100755 index 98e9985..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/cupBoard.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/help.png b/examples/lessons/6_Maths_quickAddition/assets/image/help.png deleted file mode 100755 index 769ee27..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/help.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.png b/examples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.png deleted file mode 100755 index b1c0e90..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/title_block_lt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.png b/examples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.png deleted file mode 100755 index 275daaf..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/title_block_rt.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/assets/image/tv.png b/examples/lessons/6_Maths_quickAddition/assets/image/tv.png deleted file mode 100755 index cbaa755..0000000 --- a/examples/lessons/6_Maths_quickAddition/assets/image/tv.png +++ /dev/null Binary files differ diff --git a/examples/lessons/6_Maths_quickAddition/css/lesson.css b/examples/lessons/6_Maths_quickAddition/css/lesson.css deleted file mode 100755 index e649943..0000000 --- a/examples/lessons/6_Maths_quickAddition/css/lesson.css +++ /dev/null @@ -1,300 +0,0 @@ -@CHARSET "UTF-8"; -/****** Page Styles ****/ - -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: 89px; - width: 100%; - position: absolute; - left: 0px; - top: 0px; -} -#topbtn_left { - float: left; - height: 60px; - width: 60px; - padding-top: 13px; - padding-left: 5px; -} - - - #linkBack{ - 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: 13px; - padding-right: 5px; -} - #linkHelp{ - width: 60px; height: 60px; - background:url(../assets/image/btn_help.png); - }bgCalculation - #linkHelp:hover{ - background:url(../assets/image/btn_help_hover.png); - } - #linkOle{ - width: 60px; height: 60px; - background:url(../assets/image/btn_ole.png); - } - #linkOle:hover{ - background:url(../assets/image/btn_ole_hover.png); - } - #linkNext{ - width: 60px; height: 60px; - background:url(../assets/image/btn_next.png); - } - #linkNext:hover{ - background:url(../assets/image/btn_next_hover.png); - } -#footer { - background-image: url(../assets/image/bg_footer.png); - background-repeat: repeat-x; - position: abbgCalculationsolute; - height: 69px; - width: 100%; - left: 0px; - bottom: 0px; -} -#score_box { - float: left; - padding-left: 5px; - padding-top: 10px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; -} -#botbtn_right { - float: right; - height: 55px; - /*width: 25bgCalculation1px;*/ - padding-right: 5px; - padding-top: 5px; -} - #linkCheck{ - margin: 1em 3em 0 0; - width: 101px; height: 30px; - background-image: url(../assets/image/check.png); - } - - #linkStart{ - 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{ - 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); - } - -/**** End of the page style ****/ - -/**** Game Styles ****/ - -a{ - color:#FFFFCC; -} -#currentTitle{ - width: 150px; - height: 80xp; - font:25px/30px "Courier New", Courier, monospace; - font-weight: bold; - color: red; -} -#content{ - margin: 0 auto; - margin-top: 85px; - width: 98%; - padding: 0.5em; - height: 375px; - background-color: #FCFFA4; -} - #section{ - width: 900px; - height: 375px; - margin: 0 auto; - z-index: 1; - } - - #left-side{ - float:left; - width: 360px; - height: 360px; - z-index: 2; - } - #tv{ - position:relative; - margin-left: 12px; - width: 215px; - height: 191px; - background-image: url(../assets/image/tv.png); - z-index:5; - } - #tvLayer{ - position:absolute; - top: 17px; - left: 16px; - width: 179px; - height: 128px; - font: 40px/60px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #FFF; - text-align:center; - font-weight:bold; - -moz-border-radius : 10px; - -webkit-border-radius : 10px; - border-radius : 10px; - z-index: 1; - } - .tvOff{ - background-color: #78040E; - border: 2px solid #78040E; - - } - .tvOn{ - background-color: #0000FF; - border: 2px solid #0000FF; - } - - #cupBoard{ - width: 280px; - height: 259px; - background: url(../assets/image/cupBoard.png) no-repeat; - } - - #right-side{ - float:right; - width: 420px; - height: 365px; - } - #borderWall{ - position:relative; - width: 420px; - height: 320px; - background: url(../assets/image/borderWall.png) no-repeat; - } - #imgDisplay{ - position:absolute; - top: 53px; - left: 62px; - width: 294px; - height:210px; - } - .default{ - float:left; - width: 69px; - height: 48px; - background-color:#FCFFA4; - border: 2px solid #FCFFA4; - } - .correct{ - float:left; - width: 69px; - height: 48px; - background-color:#A6E4FE; - border: 2px solid #F9F900; - } - #calcSection{ - margin-top: 10px; - width: 420px; - height: 35px; - text-align:center; - font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif; - color: #000; - font-weight: bold; - } - - input.textBox{ - size:3; - font: 30px/35px Verdana, Geneva, Arial, Helvetica, sans-serif; - font-weight: bold; - height:35px; - width: 60px; - text-align:center; - } - .focus { - background-color: #FF9900; - } - .incorrect{ - background-color: #FFFF00; - } - - #help{ - display:none; - position:absolute; - right: 20%; - top: 1%; - width: 224px; - height: 525px; - background:url(../assets/image/help.png); - z-index:40; - } - .backOpaque{ - background-color: #A4A4A4; - opacity: 0.2; - } - #timerBar { - float: left; - margin-left: 300px; - width: 150px; - height:35px; - padding-left: 10px; - padding-top: 0px; - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #FFFF00; - font-size: 16pt; - font-weight: bold; - } - #timerTitle{ - float: left; - margin-top: 20px; - width: 50px; - height: 35px; - } - - .timerBoxes{ /* Show the timer running after the game has began.... */ - float:right; - margin: 0.5em 0 0 0.1em; - width: 80px; - height: 30px; - border: 2px dotted green; - padding: 3px; - color: blue; - text-align:center; - font : bold 25px Arial Black, Times New Roman; - background: #ACC; - } diff --git a/examples/lessons/6_Maths_quickAddition/index.html b/examples/lessons/6_Maths_quickAddition/index.html deleted file mode 100755 index f5f5afc..0000000 --- a/examples/lessons/6_Maths_quickAddition/index.html +++ /dev/null @@ -1,41 +0,0 @@ - - - Class 6 Maths Quick Addition - - - - - - - - - - - -
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_quickAddition/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_quickAddition/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_quickAddition/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_quickAddition/js/karma.js b/examples/lessons/6_Maths_quickAddition/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_quickAddition/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_quickAddition/js/lesson.js b/examples/lessons/6_Maths_quickAddition/js/lesson.js deleted file mode 100755 index 84fe327..0000000 --- a/examples/lessons/6_Maths_quickAddition/js/lesson.js +++ /dev/null @@ -1,162 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var i,j; - var totalCounter; - var currentQuestion; - var TOTAL_QUES = 16; - var randPositions = []; - var numFst; - var num2nd; - var s = 0; var play = 0; var restart = 0; - - var checkTime = function(timePara){ - if (timePara<10 ) - { - timePara="0" + timePara; - } - return timePara; - }; - - - var startTimer = function(){ - s=checkTime(s); - $('#timerBox1').html(s); - increaseTime(); - }; - - var increaseTime = function(){ - if(play == 1){ - if(restart == 1){ - s = 0; - } - s++; - s=checkTime(s); - $('#timerBox1').html(s); - var t=setTimeout(function(){increaseTime();},1000); - } - }; - - var genRandPosition=function (){correctCounter = 0; - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i'); - foucs_blur(); - $('.textBox').focus(); correctCounter = 0; - }; - correctCounter = 0; - function game_start(){ - genRandPosition(); - play = 1; - startTimer(); - next_question(); - } - - function game() { - totalCounter = 0; - s = 0; play = 0; restart = 0; - $('#section').html('').append('
'); - $('#left-side').append('
'); - $('#tv').append('
'); - $('#tvLayer').addClass('tvOff'); - $('#left-side').append('
'); - $('#section').append('
'); - $('#right-side').append('
'); - $('#borderWall').append('
'); - for(var i = 0; i< TOTAL_QUES; i++){ - $('#imgDisplay').append('
'); - - $('#help').hide(); - - } - game(); - var delay_nextQues = function(){ - document.delayForm.delayval.value = 1; - next_question(); - }; - - var delay_gameOver = function(){ - document.delayForm.delayval.value = 1; - $('#calcSection').html(''); - play = 0; - for(var i = 0; i< TOTAL_QUES; i++){ - $('#imgDisplay').append('
- - Class 6 Maths Quick Division - - - - - - - - - - - -
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_quickDivision/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_quickDivision/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_quickDivision/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_quickDivision/js/karma.js b/examples/lessons/6_Maths_quickDivision/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_quickDivision/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_quickDivision/js/lesson.js b/examples/lessons/6_Maths_quickDivision/js/lesson.js deleted file mode 100755 index 6bbc937..0000000 --- a/examples/lessons/6_Maths_quickDivision/js/lesson.js +++ /dev/null @@ -1,185 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var i,j; - var totalCounter; - var currentQuestion; - var TOTAL_QUES = 16; - var randPositions = []; - var numFst; - var num2nd; - var s = 0; var play = 0; var restart = 0; - - var checkTime = function(timePara){ - if (timePara<10 ) - { - timePara="0" + timePara; - } - return timePara; - }; - - var startTimer = function(){ - s=checkTime(s); - $('#timerBox1').html(s); - increaseTime(); - }; - - var increaseTime = function(){ - if(play == 1){ - if(restart == 1){ - s = 0; - } - s++; - s=checkTime(s); - $('#timerBox1').html(s); - var t=setTimeout(function(){increaseTime();},1000); - } - }; - - var genRandPosition=function (){correctCounter = 0; - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i'); - foucs_blur(); - $('.textBox').focus(); - - }; - - function game_start(){ - genRandPosition(); - play = 1; - startTimer(); - next_question(); - } - - function game() { - totalCounter = 0; - s = 0; play = 0; restart = 0; - $('#section').html('').append('
'); - $('#left-side').append('
'); - $('#tv').append('
'); - $('#tvLayer').addClass('tvOff'); - $('#left-side').append('
'); - $('#section').append('
'); - $('#right-side').append('
'); - $('#borderWall').append('
'); - for(var i = 0; i< TOTAL_QUES; i++){ - $('#imgDisplay').append('
'); - - $('#help').hide(); - - } - game(); - var delay_nextQues = function(){ - document.delayForm.delayval.value = 1; - next_question(); - }; - - var delay_gameOver = function(){ - document.delayForm.delayval.value = 1; - $('#calcSection').html(''); - play = 0; - for(var i = 0; i< TOTAL_QUES; i++){ - $('#imgDisplay').append('
- - Class 6 Maths Roman Numerals - - - - - - - - - - - -
-
- -
-
-
-
-
-
-
-
-
-
- -
- - - - - diff --git a/examples/lessons/6_Maths_romanNumerals/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_romanNumerals/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_romanNumerals/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_romanNumerals/js/jquery-1.4.js b/examples/lessons/6_Maths_romanNumerals/js/jquery-1.4.js deleted file mode 100755 index a448490..0000000 --- a/examples/lessons/6_Maths_romanNumerals/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 = "
a"; - - 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 = ""; - - // 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 = ""; - 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 = "

"; - - // 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 = "
"; - - // 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 = /"; - }, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - - - - - - - - - - -
-
-
-
-
-
-
-
- -
- - - - diff --git a/examples/lessons/6_Maths_variables/js/jquery-1.3.2.min.js b/examples/lessons/6_Maths_variables/js/jquery-1.3.2.min.js deleted file mode 100755 index b1ae21d..0000000 --- a/examples/lessons/6_Maths_variables/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=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;G1||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-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+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!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;E0?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":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=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 UT[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=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";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="";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="

";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="
";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;W0){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;Z0||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=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("
").append(M.responseText.replace(//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").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=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=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='
';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/examples/lessons/6_Maths_variables/js/karma.js b/examples/lessons/6_Maths_variables/js/karma.js deleted file mode 100755 index 03f027b..0000000 --- a/examples/lessons/6_Maths_variables/js/karma.js +++ /dev/null @@ -1,1018 +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 -* @author Felipe Lopez Toledo -*/ - - -//common.js modules use exports object -if(!this.exports) { - exports = {}; -} - - - -/** Checks if the current document type is set to HTML 5, throws - * an error otherwise, then initializes the karma object and returns - * a reference to that object. - * @namespace Global namespace for Karma library - * @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=[]] 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. - * - * @throws {Error} If any of the initialization parameters are invalid values - * @returns {Object} Karma.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: [ - * {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.karma._initialized === true ) { - return Karma.karma; - } else { - return Karma.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 - * This has the same functionality as Crockford's beget method - * and this primary building block for prototypal inheritance in - * this library - * @param {Object} target that the new object's prototype should point to - * @returns {Object} object whose prototype points to target - * @example - * - * var ninja = { weapon : "sword" }; - * var ninja1 = Karma.create(ninja); - * ninja1.sword === "sword" - */ -Karma.create = function (target){ - function F () {}; - F.prototype = target; - 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; -}; - -/** 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); -}; - -//Enables function chaining for a specified list of function names -//IMPORTANT: use of closures here with "this" and "that" is __very__ -//complicated here -Karma._makeChain = function (chainingFunctions) { - var that = this; - var _chainFunction = function ( name ){ - that[ name ] = function ( ){ - var type = typeof this.ctx[name]; - if ( type === "function") { - this.ctx[ name ].apply( this.ctx, arguments ); - }else if ( type === "string" ){ - this.ctx[ name ] = arguments[0]; - }else { - throw ("wtf?!: impossible to chain " + name + "!"); - } - return this; - }; - }; - - for (var i = 0; i < chainingFunctions.length; i++){ - _chainFunction( chainingFunctions[ i ] ); - } -}; - -//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 " + - "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); - } -}; - - -/** Stores global settings for the Karma library - * @class This object stores the global settings for the Karma library - */ -Karma.karma = { - /** This is the global locale as passed to Karma(), - * such as "en", "es_SP" - * @type string - * @default undefined - */ - locale : undefined, - /** Collection of images with special helper - * methods added to each reference - * @type object - * @default empty object - */ - image : {}, - /** Collection of audio with special helper - * methods added to each reference - * @type object - * @default empty object - */ - audio : {}, - /** Collection of canvas with special helper - * methods added to each reference - * @type object - * @default empty object - */ - canvas : {}, - /** Collection of svgs with special helper - * methods added to each reference - * @type object - * @default empty object - */ - svg : {}, - /** Collection of videos with special helper - * methods added to each reference - * @type object - * @default empty object - */ - video : {}, - _localized : false, - _assetPath : "assets/", - _localePath : "", - _initialized : false, - _statusDiv: undefined, - _loaderDiv : undefined, - _counters : { total : 0, errors : 0, loaded : 0}, - - //init initializes all the assets passed to Karma, that's it - //it returns 'this' so it can be used for function chaining - _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); - - - //chain the functions for kCanvas and kSvg - Karma._makeChain.call(Karma.kCanvas, - Karma.kCanvas._chainingFunctions); - //Karma._makeChain.apply(Karma.kSvg, Karma.kSvg._chainingFunctions); - - - - //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._makeImages(options[option]); - break; - case "audio": - options[option]._type = 'audio'; - Karma._makeAudio(options[option]); - break; - case "video": - options[option]._type = 'video'; - Karma._makeVideos(options[option]); - break; - case "svg": - options[option]._type = 'svg'; - Karma._makeSvgs(options[option]); - break; - case "canvas": - options[option]._type = 'canvas'; - Karma._makeCanvases(options[option]); - break; - } - } - } - - - - return this; - }, - - /** Waits until all assets loaded, i.e. ready, then calls callback - * @param {Function} [cb] callback function - * @returns this - * @throws {Error} if Karma.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 - * - */ - ready : function( cb ) { - var that = this; - if (Karma.karma._initialized !== true){ - throw new Error("Karma.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 = "

It Works

"; - 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; - }, - - // 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 - */ - 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); - * - */ - 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.
- * Warning: 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); - * - */ - 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 - * - */ - rand : function ( lower, upper ){ - return Math.round( Math.random() * (upper - lower) + lower ); - } - -}; - -/** Prototypal object for images, videos, and audio files but - * does not include svg or canvas elements - * @class This object is the prototype for images, videos, and audio files but - * does not include svg or canvas elements - * @ throws {Error} if the individual asset is set to be localized but - * the globale locale is not set on the Karma.karma object - * @ throws {Error} if the name and file properties are not supplied - * @example - * kMedia is the prototype object for images, audio, and videos. - * These 'media' assets are loaded in a distinctly different way - * from the canvas or svg assets. They also have distinctly different - * helper methods - * - * You initialize the kMedia assets by passing an array of objects - */ -Karma.kMedia = { - /** file location of asset - * @type String - * @default "" - */ - file : "", - /** media object - * @type Audio|Image|Video - * @default undefined - */ - media : undefined, - //actual path to the file - _path : "", - //if using localized version of this asset - _localized : false, - //audio, image, or video - _type : "", - //initializes kMedia instance with values provided by user - _init : function (asset) { - asset._localized = asset._localized || false; - Karma.karma._counters.total++; - - if (asset.name === undefined || asset.file === undefined){ - throw new Error("properties name and file have to be defined"); - } else { - this.name = asset.name; - this.file = asset.file; - } - - //_type is a private variable used internally - if (asset._type === undefined){ - throw new Error("the _type property must be set. " + - "Blame the karma library authors as this is an internal value"); - } else { - if (Karma._isValidType(asset._type)){ - this._type = asset._type; - switch ( this._type ) { - case "image": this.media = new Image(); - break; - case "audio": this.media = new Audio(); - break; - //case "video": - //NYI - //this.media = new Video(); - break; - default: throw new Error("Media type not supported"); - } - - } else { - throw new Error("the _type property supplied is invalid. " + - "Blame the karma library authors as this is an internal value"); - } - } - - if(Karma._isLocalized(asset._localized)){ - this._localized = asset._localized; - this._path = Karma.karma._localePath + - this._type + "/"; - } else { - this._path = Karma.karma._assetPath + - this._type + "/"; - } - - - //IMPORTANT: This one magic line loads the file - this.media.src = this.src = this._path + this.file; - - //add event handlers - this._addEventHandlers(); - - if (this._type === "audio"){ - 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; - var loadEvent = "load"; - //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 - if (this._type === "audio" || this._type === "video"){ - loadEvent = "canplaythrough"; - } - - that.media.addEventListener( - loadEvent, - function (e) { - Karma.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded";}, false); - - that.media.addEventListener( - "error", - function (e) { - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.karma._updateStatus(errorMsg); - }, - false); - that.media.addEventListener( - "abort", - function (e) { - Karma.karma._counters.total++; - that.status = "aborted"; - var errorMsg = "ABORT: " + that._type.toUpperCase() + - " " + that.name + " loading was aborted."; - Karma.karma._updateStatus(errorMsg); - - }, false); - - } - -}; - -//determine if it is a valid type of asset -Karma._isValidType = function (type){ - return type === "image" || - type === "svg" || - type === "audio" || - type === "video" || - type === "canvas"; -}; - -Karma._isLocalized = function (boolLocalized) { - if (typeof boolLocalized === "boolean" ) { - if(boolLocalized === true && - Karma.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.karma._assetPath + locale + "/"; -}; - -Karma._makeImages = function (imgConfigs){ - var makeImage = function (imgConfig){ - var image = undefined; - imgConfig._type = "image"; - image = Karma.create(Karma.kMedia)._init(imgConfig); - Karma.karma.image[imgConfig.name] = image; - }; - - imgConfigs.forEach(function(imgConfig){ makeImage(imgConfig);}); - -}; - -Karma._makeAudio = function (audioConfigs){ - var makeAudio = function (audioConfig){ - var audio = undefined; - audioConfig._type = "audio"; - audio = Karma.create(Karma.kMedia)._init(audioConfig); - audio.play = function () { - //hack to fix the audio "stuttering" problem - //more info: https://bugs.launchpad.net/karma/+bug/426108 - this.media.currentTime = 0.1; - this.media.play(); - }; - Karma.karma.audio[audioConfig.name] = audio; - }; - - audioConfigs.forEach(function(audioConfig){ makeAudio(audioConfig);}); - -}; - - -Karma._makeCanvases = function (canvasConfigs){ - var makeCanvas = function (canvasConfig){ - var canvas = undefined; - canvas = Karma.create(Karma.kCanvas)._init(canvasConfig); - Karma.karma.canvas[canvasConfig.name] = canvas; - }; - - canvasConfigs.forEach(function(canvasConfig){ makeCanvas(canvasConfig);}); - -}; - -/** Prototypal 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 - * @type String - * @default undefined - */ - domId: undefined, - /** Reference to the DOM element - * @type DOMElement - * @default undefined - */ - node: undefined, - /** The 2 Dimensional Rendering context property for this canvas - * @type 2DRenderingContext - * @default undefined - */ - ctx: undefined, - /** Frames Per Second, I don't know what the purpose of this is, - * Felipe made it up - * @type Number - * @default 24 - */ - fps: 24, - - //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; - }, - - //These are all properties or methods of the canvas element's - //2 dimensional context - _chainingFunctions : [ - "globalAlpha", "globalCompositeOperation", "lineWidth", "lineCap", - "lineJoin", "miterLimit", "font", "textAlign", "textBaseline", "save", - "restore", "scale", "rotate", "translate", "transform", "setTransform", - "clearRect", "fillRect", "strokeRect", "beginPath", "closePath", - "moveTo", "lineTo", "quadraticCurveTo", "bezierCurveTo", "arcTo", - "arc", "rect", "fill", "stroke", "clip", "fillText", "strokeText", - "measureText", "isPointInPath", "strokeStyle", "fillStyle", - "createLinearGradient", "createRadialGradient", "createPattern", - "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", - //"mozTextStyle", "mozDrawText", "mozMeasureText", "mozPathText", - "mozTextAlongPath", "drawImage", "getImageData", "putImageData", - "createImageData", "drawWindow" - ] -}; - - - -Karma._makeSvgs = function (svgConfigs){ - var makeSvg = function (svgConfig){ - var svg = undefined; - svg = Karma.create(Karma.kSvg)._init(svgConfig); - Karma.karma.svg[svgConfig.name] = svg; - }; - - svgConfigs.forEach(function(svgConfig){ makeSvg(svgConfig);}); - -}; - -/** Prototypal 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 - * @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 - */ - node: undefined, - /** Reference to the SVGDocument - * @type SVGDocument - * @default undefined - */ - doc: undefined, - /** Reference to the root element of the SVG Document - * @type DocumentElement - * @default undefined - */ - root: undefined, - _localized : undefined, - _chainingFunctions: [], - _init: function (config) { - Karma.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; - case "fps": - this.fps = 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.karma._counters.loaded++; - Karma.karma._updateStatus(); - that.status = "loaded"; - }, false); - - that.node.addEventListener( - "error", - function (e) { - Karma.karma._counters.loaded--; - Karma.karma._counters.errors++; - that.status = "error"; - var errorMsg = "Error: " + that._type.toUpperCase() + - " " + that.name + " cannot be loaded."; - Karma.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.karma._updateStatus(errorMsg); - - }, false); - - } -}; - -Karma._makeVideos = function (video){ - -}; diff --git a/examples/lessons/6_Maths_variables/js/lesson.js b/examples/lessons/6_Maths_variables/js/lesson.js deleted file mode 100755 index dd84b83..0000000 --- a/examples/lessons/6_Maths_variables/js/lesson.js +++ /dev/null @@ -1,191 +0,0 @@ -$(document).ready(function(){ - var k = Karma({ - audio: [{'name':'correct','file':'correct.wav'}, - {'name':'incorrect','file':'incorrect.wav'} - ]}); - - k.ready(function(){ - var i,j; - var totalCounter; - var correctCounter; - var currentQuestion; - var TOTAL_QUES = 8; - var flag_correct; - var randPositions = []; - - var question1 = new Array('рдПрдЙрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ x рдУрдЯрд╛ рдЖрдкрд╣рд░реБ рдЫрди ', - 'рдПрдЙрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрдХреЛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ x рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ z рдУрдЯрд╛ рдХрд▓рдорд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ y рдУрдЯрд╛ рдЖрдкрд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдбрд╛рд▓реЛрдорд╛ y рдУрдЯрд╛ рдЖрдкрд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрдХреЛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ x рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрдХреЛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ x рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рдЫрди', - 'рдПрдЙрдЯрд╛ рдмрдЯреНрдЯрд╛рдорд╛ z рдУрдЯрд╛ рдХрд▓рдорд╣рд░реБ рдЫрди' - ); - var question2 = new Array('x рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдЦрдирд╛рдПрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'x рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реЗрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'z рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реЗрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'y рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдЦрдирд╛рдПрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'y рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдЦрдирд╛рдПрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'x рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реЗрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'x рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реЗрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ', - 'z рднрдиреЗрдХреЛ рдХрддрд┐ рд╣реЛ рдмрдЯреНрдЯрд╛ рдЦреЛрд▓реЗрд░ рд╣реЗрд░реНрджрд╛ рдерд╛рд╣рд╛ рд╣реБрдиреНрдЫ' - ); - var infoQues = new Array('рдЖрдк рдЦрдиреНрдпрд╛рдЙрди рдЭреЛрд▓рд╛рдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реНрди рдкреНрдпрд╛рдХреЗрдЯрдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реНрди рдкреНрдпрд╛рдХреЗрдЯрдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдЖрдк рдЦрдиреНрдпрд╛рдЙрди рдЭреЛрд▓рд╛рдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдЖрдк рдЦрдиреНрдпрд╛рдЙрди рдбрд╛рд▓реЛрдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реНрди рдкреНрдпрд╛рдХреЗрдЯрдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдкреНрдпрд╛рдХреЗрдЯ рдЦреЛрд▓реНрди рдкреНрдпрд╛рдХреЗрдЯрдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕', - 'рдмрдЯреНрдЯрд╛ рдЦреЛрд▓реНрди рдмрдЯреНрдЯрд╛рдорд╛ рдХреНрд▓рд┐рдХ рдЧрд░реНрдиреБрд╣реЛрд╕' - ); - var infoQuesClicked = new Array('рдПрдЙрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ 12 рдУрдЯрд╛ рдЖрдкрд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдЙрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ 10 рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдЙрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ 10 рдУрдЯрд╛ рдХрд▓рдорд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдЙрдЯрд╛ рдЭреЛрд▓рд╛рдорд╛ 9 рдУрдЯрд╛ рдЖрдкрд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдЙрдЯрд╛ рдбрд╛рд▓реЛрдорд╛ 10 рдУрдЯрд╛ рдЖрдкрд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдЙрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ 15 рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдЙрдЯрд╛ рдкреНрдпрд╛рдХреЗрдЯрдорд╛ 20 рдУрдЯрд╛ рдмрд┐рд╕реНрдХреБрдЯрд╣рд░реБ рд░рд╣реЗрдЫрди', - 'рдПрдХ рдмрдЯреНрдЯрд╛рдорд╛ 4 рдУрдЯрд╛ рдХрд▓рдорд╣рд░реБ рдЫрди' - ); - - var answers = new Array('12','10','10','9','10','15','20','4'); - - var scoreboard = $('#score_box').scoreboard({'layout':'horizontal', - 'winningScore': TOTAL_QUES}); - - var genRandPosition=function (){ - randPositions[0] = k.rand(0,TOTAL_QUES-1); - for(i=1; i'); - $('#question1').addClass('quesText').html(question1[currentQuestion]+' ред'); - $('#question2').addClass('quesText').html(question2[currentQuestion]+' ред'); - $('.bgInfo').addClass('quesText').html(infoQues[currentQuestion]+' ред'); - - $('#img'+currentQuestion).click(function(){ - $('#linkCheck').show(); - $('.bgQues').html(''); - $('.bgAns').show(); - $('.bgAns').html('').append('
рддреЗрд╕реЛ рднрдП рдпрд╣рд╛ x =
'); - $('#ans'+currentQuestion).append(''); - $('#ans'+currentQuestion).append(' рд╣реБрдиреНрдЫ ред'); - $('.bgInfo').addClass('quesText').html(infoQuesClicked[currentQuestion]+' ред'); - foucs_blur(); - }); - - }; - - function game_start(){ - $('#gameOver').hide(); - $('#linkCheck').show(); - $('#section').removeClass('backOpaque'); - genRandPosition(); - next_question(); - } - - function game() { - totalCounter = 0; - $('#section').html('').append('
'); - $('#left-side').append('
рдЪрд▓рдХреЛ рдорд╛рди рдкрддреНрддрд╛ рд▓рдЧрд╛рдЙ
'); - $('#left-side').append('
'); - $('#left-side').append('
'); - $('#section').append('
'); - $('#right-side').append('
'); - $('#right-side').append('
'); - $('#right-side').append('
'); - $('#help').hide(); - $('.bgAns').hide(); - $('#linkCheck').hide(); - $('#gameOver').hide(); - } - - game(); - - var delay_nextQues = function(){ - document.delayForm.delayval.value = 1; - next_question(); - } - - var delay_gameOver = function(){ - document.delayForm.delayval.value = 1; - $('#section').addClass('backOpaque'); - $('#linkCheck').hide(); - $('#gameOver').show(); - - }; - var check_answer = function(){ - var textVal = $('.textBox').val(); - if(answers[currentQuestion] === textVal){ - if(flag_correct === 1){ - correctCounter++; - scoreboard.scoreboard('inc'); - } - k.audio.correct.play(); - totalCounter++; - scoreboard.scoreboard('incTotal'); - if(totalCounter != TOTAL_QUES){ - t=setTimeout(function(){delay_nextQues();},1000); - } - else{ - t=setTimeout(function(){delay_gameOver();},1000); - } - } - else{ - flag_correct = 0; - k.audio.incorrect.play(); - } - }; - - function foucs_blur(){ - $('input[type="text"]') - .focus(function() { - $(this).removeClass('incorrect').addClass("focus"); - }) - .blur(function() { - $(this).removeClass("focus"); - }) - .keypress(function(event) { - if(event.which === 13){ - check_answer(); - } - }); - - $('#linkCheck').click(function(){ - check_answer(); - }); - } - - $('#linkStart').click(function(){ - game_start(); - }); - - $('#linkPlayAgain').click(function(){ - scoreboard.scoreboard('reset'); - game_start(); - }); - $('#linkHelp').click(function(){ - $('#help').slideDown(2000); - }) - .mouseout(function(){ - $('#help').slideUp(2000); - }); - }); //end of k.ready -}); //end of document.ready \ No newline at end of file diff --git a/examples/lessons/6_Maths_variables/js/ui.core.js b/examples/lessons/6_Maths_variables/js/ui.core.js deleted file mode 100755 index 5493e0a..0000000 --- a/examples/lessons/6_Maths_variables/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/examples/lessons/6_Maths_variables/js/ui.draggable.js b/examples/lessons/6_Maths_variables/js/ui.draggable.js deleted file mode 100755 index 0402f0e..0000000 --- a/examples/lessons/6_Maths_variables/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() { - $('
') - .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/examples/lessons/6_Maths_variables/js/ui.droppable.js b/examples/lessons/6_Maths_variables/js/ui.droppable.js deleted file mode 100755 index 8e7be33..0000000 --- a/examples/lessons/6_Maths_variables/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/examples/lessons/6_Maths_variables/js/ui.scoreboard.js b/examples/lessons/6_Maths_variables/js/ui.scoreboard.js deleted file mode 100755 index 53a930a..0000000 --- a/examples/lessons/6_Maths_variables/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 = $('
') - .addClass('ui-scoreboard-spacing-' + layoutId); - this._scoreText = $("
Score
") - .addClass('ui-scoreboard-spacing-'+ layoutId + - ' ui-corner-all ui-scoreboard-text') - .appendTo(this.element); - this._score = $("
" + score + "
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-scoreboard-number-' + layoutId) - .appendTo(this.element); - $("
Total
") - .addClass('ui-scoreboard-spacing-' + layoutId + - ' ui-corner-all ' + - 'ui-scoreboard-text') - .appendTo(this.element); - this._total = $("
" + total + "
") - .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 -- cgit v0.9.1