Skip to content
Browse files

initial commit

  • Loading branch information...
0 parents commit b46c90c4e34ae0bd6f35c09a3f1764aec0144e19 @smuppava smuppava committed Jun 5, 2012
Showing with 1,939 additions and 0 deletions.
  1. +202 −0 LICENSE
  2. 0 README
  3. +48 −0 README.txt
  4. +27 −0 _locales/en/messages.json
  5. +10 −0 _locales/locales.json
  6. +28 −0 _locales/zh_CN/messages.json
  7. BIN annex-icon-16.png
  8. BIN annex-icon-48.png
  9. BIN annex-icon.png
  10. +9 −0 config.xml
  11. +512 −0 css/annex.css
  12. +84 −0 css/license.css
  13. BIN fonts/JimNightshade-Regular.ttf
  14. +94 −0 fonts/OFL.txt
  15. BIN fonts/wqy-microhei.ttc
  16. BIN images/game_001_boardbg.jpg
  17. BIN images/game_002_blackpc.png
  18. BIN images/game_003_whitepc.png
  19. BIN images/game_004_pcleftside.png
  20. BIN images/game_005_pcrightside.png
  21. BIN images/game_006_settingsbtn.png
  22. BIN images/game_007_settingsbtnrollover.png
  23. BIN images/game_008_settingsstartover.png
  24. BIN images/game_008_settingsstartover_img.png
  25. BIN images/game_009_settingsrules.png
  26. BIN images/game_009_settingsrules_img.png
  27. BIN images/game_010_settings2p.png
  28. BIN images/game_010_settings2p_img.png
  29. BIN images/game_011_settings1p.png
  30. BIN images/game_011_settings1p_img.png
  31. BIN images/game_012_settingsexit.png
  32. BIN images/game_012_settingsexit_img.png
  33. BIN images/game_013_settingsarrow.png
  34. BIN images/game_014_board.png
  35. BIN images/game_015_pcside.png
  36. BIN images/opening_001_bg.jpg
  37. BIN images/opening_002_title.png
  38. BIN images/opening_003_rollover.png
  39. BIN images/result_quit.png
  40. BIN images/rules_001_bg.jpg
  41. BIN images/rules_002_rollover.png
  42. BIN images/winner_001_wood.jpg
  43. BIN images/winner_002_p1win.jpg
  44. BIN images/winner_003_p2win.jpg
  45. BIN images/winner_004_rollover.png
  46. BIN images/winner_005_exitrollover.png
  47. +144 −0 index.html
  48. +682 −0 js/annex.js
  49. +64 −0 js/license.js
  50. +18 −0 lib/jquery-1.6.2.min.js
  51. +17 −0 manifest.json
  52. BIN sounds/Hint.ogg
  53. BIN sounds/NavClick.ogg
  54. BIN sounds/NavMove.ogg
  55. BIN sounds/SettingsClick.ogg
  56. BIN sounds/Theme.ogg
  57. BIN sounds/TileFlip.ogg
  58. BIN sounds/TilePlace.ogg
  59. BIN sounds/VictoryHorns.ogg
202 LICENSE
@@ -0,0 +1,202 @@
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
0 README
No changes.
48 README.txt
@@ -0,0 +1,48 @@
+Annex is a Reversi/Othello game implemented with HTML5/Javascript technology.
+
+Author: Xinchao He <xinchao.he@intel.com>
+
+This application is written using HTML5/css3/jquery javascript library and is
+distributed under Apache2.0 license.
+
+jQuery JavaScript Library v1.6.2
+Copyright 2011, John Resig
+Dual licensed under the MIT or GPL Version 2 licenses.
+http://jquery.org/license
+
+FONTS
+-----------------------------------------------------------------------------
+Google web font - JimNightshade
+http://www.google.com/webfonts/specimen/Jim+Nightshade
+SIL Open Font License (OFL) License, version 1.1
+
+Wen Quan Yi Micro Hei
+http://wenq.org/index.cgi?MicroHei
+License: Licensed under Apache2.0 or GPLv3 with font embedding exceptions
+ http://wenq.org/index.cgi?MicroHei_BigBang_README
+
+SOUNDS
+-----------------------------------------------------------------------------
+Hint.ogg, Theme.ogg, TileFlip.ogg, TilePlace.ogg, VictoryHorns.ogg
+These files were created by Intel Corp. and are licensed under
+the Creative Commons Attribution 3.0 license
+http://creativecommons.org/licenses/by/3.0/us/
+
+NavClick.ogg
+Origin: http://www.freesound.org/people/lukyluke/sounds/32268/
+License: http://creativecommons.org/licenses/sampling+/1.0/
+
+NavMove.ogg
+Origin: http://www.freesound.org/people/junggle/sounds/29304/
+License: http://creativecommons.org/licenses/by/3.0/
+
+SettingsClick.ogg
+Origin: http://www.freesound.org/people/junggle/sounds/29301/
+License: http://creativecommons.org/licenses/by/3.0/
+
+IMAGES
+-----------------------------------------------------------------------------
+All images are created by Intel Corp.
+they are licensed under the Creative Commons Attribution 3.0 license
+http://creativecommons.org/licenses/by/3.0/us/
+
27 _locales/en/messages.json
@@ -0,0 +1,27 @@
+{
+ "alphabet": {
+ "message": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ "description": "Single concatination of all alphabet characters, no spaces"
+ },
+ "name": {"message": "Annex"},
+ "description": {"message": "A Reversi/Othello game"},
+ "license": {"message": "License"},
+ "readme": {"message": "Readme"},
+ "player": {"message": "player"},
+ "startover": {"message": "Start over"},
+ "rules": {"message": "Rules"},
+ "computer": {"message": "comp."},
+ "exit": {"message": "Exit"},
+ "1PlayerGame": {"message": "1 Player Game"},
+ "2PlayerGame": {"message": "2 Player Game"},
+ "howtoPlay": {"message": "How to Play"},
+ "turn": {"message": "'s Turn"},
+ "pieces": {"message": "pieces"},
+ "winDraw": {"message": "Draw!"},
+ "winComputer": {"message": "Computer Wins!"},
+ "win": {"message": "Wins"},
+ "newOneGame": {"message": "New 1P Game"},
+ "newTwoGame": {"message": "New 2P Game"},
+ "help": {"message": "Play a piece on the board so that one or more of your opponent’s pieces are between two of your pieces. All of the opponent’s pieces between your own turn over and become your color.<br>The player with the most pieces on the board at the end of the game wins!"},
+ "goBack": {"message": "Go Back"}
+}
10 _locales/locales.json
@@ -0,0 +1,10 @@
+{
+ "en": {
+ "display": "English (North American)",
+ "strings": {}
+ },
+ "zh_CN": {
+ "display": "Chinese",
+ "strings": {}
+ }
+}
28 _locales/zh_CN/messages.json
@@ -0,0 +1,28 @@
+{
+ "alphabet": {
+ "message": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ "description": "除去空格之外的所有字符集合"
+ },
+ "name": {"message": "Annex黑白棋"},
+ "description": {"message": "一个黑白棋游戏"},
+ "license": {"message": "授权"},
+ "readme": {"message": "自述"},
+ "player": {"message": "选手"},
+ "computer": {"message": "电脑"},
+ "startover": {"message": "重来"},
+ "rules": {"message": "规则"},
+ "exit": {"message": "退出"},
+ "1PlayerGame": {"message": "单人游戏"},
+ "2PlayerGame": {"message": "双人游戏"},
+ "howtoPlay": {"message": "游戏规则"},
+ "turn": {"message": "方下"},
+ "pieces": {"message": ""},
+ "winDraw": {"message": "平局!"},
+ "winComputer": {"message": "电脑赢!"},
+ "win": {"message": ""},
+ "newOneGame": {"message": "单人游戏"},
+ "newTwoGame": {"message": "双人游戏"},
+ "help": {"message": "在棋盘空位上下子,并保证至少有一个对方的棋子被夹在你的两颗棋子中间。然后将这些夹在中间的对方的棋子翻转为你的棋子。<br>
+ 最终棋子多的一方获胜!"},
+ "goBack": {"message": "返回"}
+}
BIN annex-icon-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN annex-icon-48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN annex-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" version="1.0" viewmodes="fullscreen" id="http://tizen.org/annex" defaultlocale="en">
+ <icon src="annex-icon.png"/>
+ <content src="index.html"/>
+ <name>Annex</name>
+ <author/>
+ <license/>
+</widget>
512 css/annex.css
@@ -0,0 +1,512 @@
+/*
+ * Copyright (c) 2012, Intel Corporation.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+@CHARSET "UTF-8";
+
+.img_board_select{
+ padding:0px;
+ border:1px solid #021a40;
+}
+
+.img_board{
+ padding:1px;
+}
+
+.img_style{
+ margin: 0px;
+}
+
+#board{
+ line-height:0px;
+ position:absolute;
+ top:36px;
+ left:247px;
+}
+
+.play1_lable{
+ position:absolute;
+ top:60px;
+ left:18px;
+ width:110px;
+ font-family: default_font;
+ font-size: 30pt;
+ color: #000000;
+ text-align:center;
+}
+
+.play1_score{
+ position:absolute;
+ top:130px;
+ left:17px;
+ width:110px;
+ font-family: default_font;
+ font-size: 100pt;
+ color: #000000;
+ text-align:center;
+}
+
+.play1_pieces_lable{
+ position:absolute;
+ top:260px;
+ left:18px;
+ width:110px;
+ font-family: default_font;
+ font-size: 42pt;
+ color: #000000;
+ text-align:center;
+}
+
+.play2_lable{
+ position:absolute;
+ top:60px;
+ right:19px;
+ width:113px;
+ font-family: default_font;
+ font-size: 30pt;
+ color: #ffffff;
+ text-align:center;
+}
+
+.play2_score{
+ position:absolute;
+ top:130px;
+ right:18px;
+ width:110px;
+ font-family: default_font;
+ font-size: 100pt;
+ color: #ffffff;
+ text-align:center;
+}
+
+.play2_pieces_lable{
+ position:absolute;
+ top:260px;
+ right:18px;
+ width:110px;
+ font-family: default_font;
+ font-size: 42pt;
+ color: #ffffff;
+ text-align:center;
+}
+
+.stone_selected{
+ position:absolute;
+ top:516px;
+ left:805px;
+ font-family: default_font;
+ font-size: 48pt;
+ color: #ffffff;
+}
+
+.left_pieces{
+ position:absolute;
+ top:94px;
+ left:167px;
+ width:56px;
+ line-height:0px;
+}
+
+.right_pieces{
+ position:absolute;
+ top:94px;
+ right:170px;
+ width:56px;
+ line-height:0px;
+}
+
+
+.pieces{
+ line-height:0px;
+ margin:0px;
+ padding:0px;
+}
+
+.configure{
+ position:absolute;
+ top:27px;
+ left:810px;
+}
+
+.configure_panel{
+ position:absolute;
+ right:230px;
+ top:11px;
+ height:72px;
+ margin:0px;
+ padding:0px;
+}
+
+.configure_panel_func{
+ position:relative;
+ top:0px;
+ left:0px;
+ height:72px;
+ width:366px;
+ z-index:2;
+ margin:0px;
+ padding:0px;
+ cursor:pointer;
+ cursor:hand;
+}
+
+.configure_panel_arrow{
+ position:absolute;
+ right:-14px;
+ top:0px;
+ height:72px;
+}
+
+.configure_panel_img{
+ height:72px;
+}
+
+.configure_panel_selected{
+ background-color:#222222;
+}
+
+.configure_panel_backcolor{
+ position:absolute;
+ top:0px;
+ left:0px;
+ margin:0px;
+ padding:0px;
+ width:100%;
+ height:100%;
+}
+
+.configure_panel_startover{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:98px;
+ height:72px;
+ background:url('../images/game_008_settingsstartover_img.png') top center no-repeat;
+ background-color:#000000;
+ opacity:0.8;
+}
+
+.configure_panel_newgame{
+ position:absolute;
+ top:0px;
+ left:98px;
+ width:137px;
+ height:72px;
+}
+
+.configure_panel_new1game{
+ background:url('../images/game_011_settings1p_img.png') top center no-repeat;
+ background-color:#000000;
+ opacity:0.8;
+}
+
+.configure_panel_new2game{
+ background:url('../images/game_010_settings2p_img.png') top center no-repeat;
+ background-color:#000000;
+ opacity:0.8;
+}
+
+.configure_panel_help{
+ position:absolute;
+ top:0px;
+ left:235px;
+ width:64px;
+ height:72px;
+ background:url('../images/game_009_settingsrules_img.png') top center no-repeat;
+ background-color:#000000;
+ opacity:0.8;
+}
+
+.configure_panel_exit{
+ position:absolute;
+ top:0px;
+ left:299px;
+ width:67px;
+ height:72px;
+ background:url('../images/game_012_settingsexit_img.png') top center no-repeat;
+ background-color:#000000;
+ opacity:0.8;
+}
+
+.configure_panel_text{
+ position:absolute;
+ width:100%;
+ bottom:0px;
+ font-family:default_font;
+ font-size: 21pt;
+ color:#ffffff;
+ text-align:center;
+}
+
+.display_none{
+ display:none;
+ z-index:-1;
+}
+
+.result{
+ position:absolute;
+ top:175px;
+ left:113px;
+ width:825px;
+ height:277px;
+ font-family: default_font;
+ font-size: 38pt;
+ color: #49342d;
+ opacity: 0.9;
+}
+
+.result_p1win{
+ background:url('../images/__MSG_@@ui_locale__/winner_002_p1win.jpg') no-repeat;
+}
+
+.result_p2win{
+ background:url('../images/__MSG_@@ui_locale__/winner_003_p2win.jpg') no-repeat;
+}
+
+.result_wood{
+ background:url('../images/winner_001_wood.jpg') no-repeat;
+}
+
+.result_draw_text{
+ position:absolute;
+ top:37px;
+ left:330px;
+ font-size: 60pt;
+}
+
+.result_win_text{
+ position:absolute;
+ top:37px;
+ width:825px;
+ font-size: 60pt;
+}
+
+.result_new_p1{
+ position:absolute;
+ top:162px;
+ left:52px;
+ color: #49342d;
+}
+
+.result_new_p2{
+ position:absolute;
+ top:162px;
+ left:340px;
+ color: #49342d;
+}
+
+.result_exit{
+ position:absolute;
+ top:162px;
+ right:109px;
+ color: #49342d;
+}
+
+.result_new_p1_rollover{
+ position:absolute;
+ bottom:55px;
+ left:36px;
+ width:265px;
+ height:51px;
+}
+
+.result_new_p2_rollover{
+ position:absolute;
+ bottom:55px;
+ left:318px;
+ width:265px;
+ height:51px;
+}
+
+.result_exit_rollover{
+ position:absolute;
+ bottom:55px;
+ right:55px;
+ width:175px;
+ height:51px;
+}
+
+.result_quit{
+ position:absolute;
+ right:20px;
+ top:20px;
+ width:24px;
+ height:24px;
+ background:url('../images/result_quit.png') no-repeat;
+}
+
+.help{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:1024px;
+ height:600px;
+ background:url('../images/rules_001_bg.jpg');
+ font-family: default_font;
+ z-index:5;
+}
+
+.help_text{
+ position:absolute;
+ top:100px;
+ left:0px;
+ width:1024px;
+}
+
+.help_title{
+ font-size:78pt;
+ color:#49342d;
+}
+
+.help_contain{
+ font-size:32pt;
+ color:#f2cfb1;
+ line-height: 125%;
+}
+
+.help_exit{
+ position:absolute;
+ bottom:35px;
+ right:30px;
+ font-family: default_font;
+ font-size:50pt;
+ color:#49342d;
+}
+
+.help_exit_img{
+ position:absolute;
+ bottom:57px;
+ right:21px;
+}
+
+.open{
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:1024px;
+ height:600px;
+ background:url('../images/opening_001_bg.jpg');
+ font-family: default_font;
+ font-size:42pt;
+ color:#49342d;
+ z-index:4;
+}
+
+.open_title{
+ position:absolute;
+ top:91px;
+ left:157px;
+}
+
+.open_text{
+ position:absolute;
+ bottom:95px;
+ left:390px;
+ line-height:120%;
+ font-family:default_font;
+ font-size:32pt;
+}
+
+.open_text_bg{
+ position:absolute;
+ left:360px;
+ width:267px;
+ height:52px;
+}
+
+.open_text_bg1{
+ bottom:93px;
+}
+
+.open_text_bg2{
+ bottom:145px;
+}
+
+.open_text_bg3{
+ bottom:198px;
+}
+
+.open_text_bg4{
+ bottom:250px;
+}
+
+.tip {
+ /* background-color:#000000; */
+ opacity:0.6;
+}
+
+@font-face{
+ font-family: default_font;
+ src: url('../fonts/JimNightshade-Regular.ttf'),
+ url('../fonts/wqy-microhei.ttc');
+}
+
+.world {
+ position:absolute;
+ top:0px;
+ left:0px;
+ height:600px;
+ width:1024px;
+ background:url('../images/game_001_boardbg.jpg') no-repeat;
+}
+
+body {
+ background-positon: left top;
+ display: -webkit-box;
+ -webkit-box-align: center;
+ -webkit-box-pack: center;
+ -webkit-box-orient: vertical;
+ position:absolute;
+ top:50%;
+ left:50%;
+ cursor: default;
+ width:1024px;
+ height:600px;
+ padding:0px;
+ margin:0px;
+ box-shadow: 5px 5px 20px black;
+ -webkit-transform: translate(-50%, -50%);
+}
+
+/* 800 x 480 */
+@media (orientation: landscape) {
+ body { top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%) scale(0.78125, 0.8); }
+}
+/* 1024 x 600 */
+@media (min-width: 1024px) and (min-height: 600px) and (orientation: landscape) {
+ body { top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); }
+}
+/* 1280 x 720 */
+@media (min-width: 1280px) and (min-height: 720px) and (orientation: landscape) {
+ body { top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%) scale(1.25, 1.199); }
+}
+
+/* 480 x 800 */
+@media (orientation: portrait) {
+ body { top: 0%; left: 0%; -webkit-transform: translate(-50%, -50%) rotate(90deg) scale(0.8, 0.78125); }
+}
+/* 600 x 1024 */
+@media (min-width: 600px) and (min-height: 1024px) and (orientation: portrait) {
+ body { top: 0%; left: 0%; -webkit-transform: translate(-50%, -50%) rotate(90deg) translate(50%, -50%); }
+}
+/* 720 x 1230 */
+@media (min-width: 720px) and (min-height: 1230px) and (orientation: portrait) {
+ body { top: 0%; left: 0%; -webkit-transform: translate(-50%, -50%) rotate(90deg) scale(1.2, 1.199) translate(50%, -50%); }
+}
+/* 720 x 1280 */
+@media (min-width: 720px) and (min-height: 1280px) and (orientation: portrait) {
+ body { top: 0%; left: 0%; -webkit-transform: translate(-50%, -50%) rotate(90deg) scale(1.25, 1.199) translate(50%, -50%); }
+}
+
+
+a{
+ outline:none;
+ text-decoration:none;
+ cursor:hand;
+ cursor:pointer;
+}
84 css/license.css
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2012, Intel Corporation.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+#licensebtnl {
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ font: 16px standard;
+ line-height: 20px;
+ cursor: pointer;
+ -webkit-border-radius: 20px;
+ border: solid 1px #000000;
+ opacity: 0.3;
+ color: black;
+}
+
+#licensebtnl:hover {
+ opacity: 1.0;
+}
+
+#licensepage {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ background: -webkit-gradient(linear, left top, right top, from(#237745), to(#105a2d));
+}
+
+#licensetext {
+ width: 99.8%;
+ height: 89%;
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #FFFFFF), color-stop(1, #b06228));
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ box-shadow: inset 1px 1px 2px 1px black;
+ margin-bottom: 2px;
+}
+
+.licensebtn {
+ position: absolute;
+ color: #d7d7d7;
+ border: solid 1px #333;
+ text-align: center;
+ text-decoration: none;
+ font: 30px/100% Arial, Helvetica, sans-serif;
+ text-shadow: 0 1px 1px rgba(0,0,0,.3);
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
+ height: 52px;
+ line-height: 48px;
+ cursor: pointer;
+ box-shadow: 2px 2px 14px #000;
+}
+
+.licensebtn:hover {
+ background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
+}
+
+.licensebtn:active {
+ color: #666;
+ background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
+}
+
+#licensebtnu {
+ left: 630px;
+ width: 50px;
+}
+
+#licensebtnd {
+ left: 344px;
+ width: 50px;
+}
+
+#licensebtnq {
+ left: 412px;
+ width: 200px;
+}
BIN fonts/JimNightshade-Regular.ttf
Binary file not shown.
94 fonts/OFL.txt
@@ -0,0 +1,94 @@
+Copyright (c) 2011 by Brian J. Bonislawsky DBA Astigmatic (AOETI)
+(astigma@astigmatic.com), with Reserved Font Names "Jim Nightshade"
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
BIN fonts/wqy-microhei.ttc
Binary file not shown.
BIN images/game_001_boardbg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_002_blackpc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_003_whitepc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_004_pcleftside.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_005_pcrightside.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_006_settingsbtn.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_007_settingsbtnrollover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_008_settingsstartover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_008_settingsstartover_img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_009_settingsrules.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_009_settingsrules_img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_010_settings2p.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_010_settings2p_img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_011_settings1p.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_011_settings1p_img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_012_settingsexit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_012_settingsexit_img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_013_settingsarrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_014_board.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/game_015_pcside.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/opening_001_bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/opening_002_title.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN images/opening_003_rollover.png
Diff not rendered.
BIN images/result_quit.png
Diff not rendered.
BIN images/rules_001_bg.jpg
Diff not rendered.
BIN images/rules_002_rollover.png
Diff not rendered.
BIN images/winner_001_wood.jpg
Diff not rendered.
BIN images/winner_002_p1win.jpg
Diff not rendered.
BIN images/winner_003_p2win.jpg
Diff not rendered.
BIN images/winner_004_rollover.png
Diff not rendered.
BIN images/winner_005_exitrollover.png
Diff not rendered.
144 index.html
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<!--
+ * Copyright (c) 2012, Intel Corporation.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title></title>
+ <meta name="viewport" content="width=device-width target-densitydpi=device-dpi initial-scale=1 maximum-scale=1 user-scalable=0" />
+ <meta name="author" content="Xinchao He">
+ <link rel="stylesheet" href="css/annex.css"/>
+ <link rel="stylesheet" type="text/css" href="css/license.css"></link>
+ <script src="js/license.js"></script>
+ <script type="text/javascript" src="lib/jquery-1.6.2.min.js"></script>
+ <script type="text/javascript" src="js/annex.js"></script>
+</head>
+<body onselectstart="return false" ondragstart="return false" style="overflow:hidden;">
+ <div id="licensepage" style="display: none">
+ <iframe id="licensetext" src="README.txt"></iframe>
+ <div id="licensebtnu" class="licensebtn">&uarr;</div>
+ <div id="licensebtnd" class="licensebtn">&darr;</div>
+ <div id="licensebtnq" class="licensebtn">Back</div>
+ </div>
+ <div id="open" class="open" >
+ <img class="open_title" src="images/opening_002_title.png" />
+ <img id="open_text_bg_1" class="open_text_bg open_text_bg1 display_none" src="images/opening_003_rollover.png" />
+ <img id="open_text_bg_2" class="open_text_bg open_text_bg2 display_none" src="images/opening_003_rollover.png" />
+ <img id="open_text_bg_3" class="open_text_bg open_text_bg3 display_none" src="images/opening_003_rollover.png" />
+ <img id="open_text_bg_4" class="open_text_bg open_text_bg4 display_none" src="images/opening_003_rollover.png" />
+ <div class="open_text" align="center">
+ <a onClick="World.playSound('snd_navclick');World.init(1);"
+ onMouseOver="$('#open_text_bg_4').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('#open_text_bg_4').addClass('display_none');"
+ id="open1"
+ style="color:#49342d;"></a><br>
+ <a onClick="javascript:World.playSound('snd_navclick');World.init(2);"
+ onMouseOver="$('#open_text_bg_3').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('#open_text_bg_3').addClass('display_none');"
+ id="open2"
+ style="color:#49342d;"></a><br>
+ <a onClick="javascript:World.showHelp();"
+ onMouseOver="$('#open_text_bg_2').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('#open_text_bg_2').addClass('display_none');"
+ id="open_help"
+ style="color:#49342d;"></a><br>
+ <a onClick="javascript:window.close();"
+ onMouseOver="$('#open_text_bg_1').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('#open_text_bg_1').addClass('display_none');"
+ id="open_exit"
+ style="color:#49342d;"></a>
+ </div>
+ <div id="licensebtnl" style="top: 520px; left: 984px;"> i </div>
+ </div>
+ <div id="view" class="world display_none">
+ <div class="play1_lable"></div>
+ <div class="play1_score" id="black_result" align="center">0</div>
+ <div class="play1_pieces_lable"></div>
+ <div class="play2_lable"></div>
+ <div class="play2_score" id="white_result" align="center">0</div>
+ <div class="play2_pieces_lable"></div>
+ <div class="stone_selected"><img id="message" /><span id="turn"></span></div>
+ <div class="left_pieces" id="left_pieces"></div>
+ <div class="right_pieces" id="right_pieces"></div>
+ <a onClick="javascript:World.configure();" class="configure"><img src="images/game_006_settingsbtn.png" /></a>
+ <div class="configure_panel display_none">
+ <div class="configure_panel_func">
+ <div class="configure_panel_startover">
+ <div class="configure_panel_text"></div>
+ </div>
+ <div class="configure_panel_newgame">
+ <div class="configure_panel_text"></div>
+ </div>
+ <div class="configure_panel_help">
+ <div class="configure_panel_text"></div>
+ </div>
+ <div class="configure_panel_exit">
+ <div class="configure_panel_text"></div>
+ </div>
+ </div>
+ <img class="configure_panel_arrow" src="images/game_013_settingsarrow.png" />
+ </div>
+ <div id="board"></div>
+ <div id="result" class="result result_wood display_none">
+ <div class="result_win_text" align="center"></div>
+ <img class="result_new_p1_rollover display_none" src="images/winner_004_rollover.png" />
+ <img class="result_new_p2_rollover display_none" src="images/winner_004_rollover.png" />
+ <img class="result_exit_rollover display_none" src="images/winner_005_exitrollover.png" />
+ <a onClick="javascript:World.playSound('snd_navclick');World.init(1);"
+ onMouseOver="$('img.result_new_p1_rollover').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('img.result_new_p1_rollover').addClass('display_none')"
+ class="result_new_p1"></a>
+ <a onClick="javascript:World.playSound('snd_navclick');World.init(2);"
+ onMouseOver="$('img.result_new_p2_rollover').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('img.result_new_p2_rollover').addClass('display_none')"
+ class="result_new_p2"></a>
+ <a onClick="javascript:window.close();"
+ onMouseOver="$('img.result_exit_rollover').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('img.result_exit_rollover').addClass('display_none')"
+ class="result_exit"></a>
+ <div class="result_quit" onClick="javascript:World.closeResult();"></div>
+ </div>
+ </div>
+ <div id="help" class="help display_none">
+ <div class="help_text" align="center">
+ <div class="help_title"></div>
+ <div class="help_contain"></div>
+ </div>
+ <img class="help_exit_img display_none" src="images/rules_002_rollover.png" />
+ <a onClick="javascript:World.exitHelp();"
+ onMouseOver="$('img.help_exit_img').removeClass('display_none');World.playSound('snd_navmove');"
+ onMouseOut="$('img.help_exit_img').addClass('display_none')"
+ class="help_exit"></a>
+ </div>
+ <audio preload="auto" id="snd_hint">
+ <source src="sounds/Hint.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_navclick">
+ <source src="sounds/NavClick.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_navmove">
+ <source src="sounds/NavMove.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_settingsclick">
+ <source src="sounds/SettingsClick.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_theme">
+ <source src="sounds/Theme.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_tileflip">
+ <source src="sounds/TileFlip.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_tileplace">
+ <source src="sounds/TilePlace.ogg" />
+ </audio>
+ <audio preload="auto" id="snd_victoryhorns">
+ <source src="sounds/VictoryHorns.ogg" />
+ </audio>
+</body>
+</html>
682 js/annex.js
@@ -0,0 +1,682 @@
+/*
+ * Copyright (c) 2012, Intel Corporation.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+var World = (function(){
+ var w = {
+ boardTexture:{board: 'images/game_014_board.png', black: 'images/game_002_blackpc.png', white: 'images/game_003_whitepc.png', leftPieces: 'images/game_004_pcleftside.png', rightPieces: 'images/game_005_pcrightside.png', hidePieces: 'images/game_015_pcside.png', p1Image: 'images/game_011_settings1p.png', p2Image: 'images/game_010_settings2p.png',},
+ board: [[],[],[],[],[],[],[],[],],
+ bounder: 8,
+ boardview: 'board',
+ blackResultView: 'black_result',
+ whiteResultView: 'white_result',
+ leftPiecesView: 'left_pieces',
+ rightPiecesView: 'right_pieces',
+ messageview: 'message',
+ result: 'result',
+ isEnd: false,
+ endMessage: '',
+ isUserTurn: true,
+ isDrawing: false,
+ isLock: false,
+ isInit: false,
+ isConfigure: false,
+ isResult: false,
+ level: 3,
+ playerNum: 1,
+ currentColor: 'black',
+ step: 4,
+ point: [],
+ directs: [[1,0],[1,1],[1,-1],[0,1],[0,-1],[-1,0],[-1,1],[-1,-1]],
+ heap: {'nextLevel':{}},
+ soundSource: {
+ 'snd_hint':{'src':'sounds/Hint.ogg'},
+ 'snd_navclick':{'src':'sounds/NavClick.ogg'},
+ 'snd_navmove':{ 'src':'sounds/NavMove.ogg'},
+ 'snd_settingsclick':{ 'src':'sounds/SettingsClick.ogg'},
+ 'snd_theme':{ 'src':'sounds/Theme.ogg'},
+ 'snd_tileflip':{ 'src':'sounds/TileFlip.ogg'},
+ 'snd_tileplace':{ 'src':'sounds/TilePlace.ogg'},
+ 'snd_victoryhorns':{ 'src':'sounds/VictoryHorns.ogg'},
+ },
+ init: function(play){
+ this.playerNum = play || 1;
+ for (var i in this.board){
+ for (var j=0; j<this.bounder; j++){
+ this.board[i][j] = 'board';
+ }
+ }
+ this.board[3][3] = 'black';
+ this.board[4][4] = 'black';
+ this.board[3][4] = 'white';
+ this.board[4][3] = 'white';
+
+ this.isUserTurn = true;
+ this.isLock = false;
+ this.isConfigure = false;
+ this.isResult = false;
+ this.currentColor = 'white';
+ this.step = 4;
+ this.level = 3;
+ this.poing = [];
+ this.heap = {'nextLevel':{}};
+ var strLeft = '';
+ var strRight = '';
+ for (var i=0; i<32; i++) {
+ strLeft += '<img src="'+this.boardTexture['leftPieces']+'" class="pieces" id="pc0'+i+'" />';
+ strRight += '<img src="'+this.boardTexture['rightPieces']+'" class="pieces" id="pc1'+i+'" />';
+ }
+ $('#'+this.leftPiecesView).html(strLeft);
+ $('#'+this.rightPiecesView).html(strRight);
+ $('#pc00').attr('src', this.boardTexture['hidePieces']);
+ $('#pc01').attr('src', this.boardTexture['hidePieces']);
+ $('#pc10').attr('src', this.boardTexture['hidePieces']);
+ $('#pc11').attr('src', this.boardTexture['hidePieces']);
+ $('#'+this.result).addClass('display_none');
+ $('div.configure_panel').addClass('display_none');
+ var n = (this.playerNum == 1)?2:1;
+ $('.configure_panel_newgame').removeClass('configure_panel_new'+this.playerNum+'game')
+ .addClass('configure_panel_new'+n+'game').find('.configure_panel_text')
+ .html(getMessage(n+'PlayerGame',n+' Player Game'));
+
+ $('.play1_lable').html(getMessage('player', 'player')+'<span style="font-size:48pt;">1</span>');
+ if (this.playerNum == 2) {
+ $('.play2_lable').html(getMessage('player', 'player')+'<span style="font-size:48pt;">2</span>');
+ } else {
+ $('.play2_lable').html(getMessage('computer', 'comp.'));
+ }
+ this.isInit = true;
+ $('#open').addClass('display_none');
+ $('#view').removeClass('display_none');
+ this.endConfigure();
+ this.drawBoard();
+ },
+ configure: function(){
+ if (!this.isLock || (this.isEnd && this.isLock && !this.isResult)) {
+ this.playSound('snd_settingsclick');
+ if (!this.isConfigure) {
+ this.isConfigure = true;
+ $('a.configure img').attr('src', 'images/game_007_settingsbtnrollover.png');
+ $('div.configure_panel').removeClass('display_none');
+ } else {
+ this.endConfigure();
+ }
+ }
+ },
+ endConfigure: function(){
+ this.isConfigure = false;
+ $('div.configure_panel').addClass('display_none');
+ $('a.configure img').attr('src', 'images/game_006_settingsbtn.png');
+ },
+ startOver: function(){
+ this.playSound('snd_navclick');
+ this.init(this.playerNum);
+ this.endConfigure();
+ },
+ showHelp: function(){
+ this.playSound('snd_navclick');
+ this.endConfigure();
+ $('#help').removeClass('display_none');
+ },
+ exitHelp: function(){
+ this.playSound('snd_navclick');
+ $('#help').addClass('display_none');
+ },
+ getSoundSource: function(snd){
+ var ret;
+ if (typeof this.soundSource[snd] != 'undefined' && typeof this.soundSource[snd]['audio'] != 'undefined') {
+ var source = this.soundSource[snd];
+ var p = parseInt(source['point']);
+ var step = parseInt(source['audio'].length);
+ ret = source['audio'][p];
+ this.soundSource[snd]['point'] = (p+1)%step;
+ } else {
+ var src = this.soundSource[snd]['src'];
+ ret = document.getElementById(snd);
+ this.soundSource[snd]['audio'] = [ret, new Audio(src)];
+ this.soundSource[snd]['point'] = 0;
+ }
+ return ret;
+ },
+ playSound: function(snd){
+ var audio = this.getSoundSource(snd);
+ if (audio.paused == false) {
+ audio.pause();
+ //audio.currentTime = 0;
+ }
+ audio.play();
+ },
+ actionAtPoint: function(place, color){
+ var path = [];
+ this.heap = this.heap['nextLevel'][String(place[0])+String(place[1])] || {};
+ if (typeof this.heap['value'] != 'undefined' && this.heap['color'] == color){
+ path = this.heap['path'];
+ } else {
+ var act = this.getRevertPath(place, color);
+ path = act['path'];
+ this.heap = {'color':color, 'path':path, 'place':place, 'nextLevel':{}};
+ }
+ this.clearTips();
+ $('#pc'+this.step%2+Math.floor(this.step/2)).attr('src', this.boardTexture['hidePieces']);
+ this.step += 1;
+ if (this.step >= 50)
+ this.level += 1;
+ else if (this.setp >= 53)
+ this.level += 1;
+ else if (this.step >= 55)
+ this.level += 2;
+ this.playSound('snd_tileplace');
+ this.setPoint(place, color);
+ this.setBorder(place);
+ this.drawPath(path, color);
+ },
+ setPoint: function(place, color){
+ this.board[place[0]][place[1]] = color;
+ this.drawPoint(place, color);
+ },
+ drawPoint: function(place, color){
+ $('img#a'+place[0]+place[1]).attr('src', this.boardTexture[color]).removeClass('tip');
+ $('a#l'+place[0]+place[1]).attr('onMouseOver','').attr('onMouseOut','');
+ },
+ drawPath: function(path, color){
+ this.isDrawing = true;
+ for (var n=0; n < path.length; n++){
+ this.board[path[n][0]][path[n][1]] = color;
+ var str = 'World.drawPoint(['+path[n][0]+','+path[n][1]+'],\''+color+'\')';
+ setTimeout(str, 100*(n+1));
+ }
+ setTimeout('World.drawMessage()', 100*(path.length+1));
+ },
+ setBorder: function(place){
+ if (this.point.length > 0){
+ $('img#a'+this.point[0]+this.point[1]).removeClass('img_board_select');
+ $('img#a'+this.point[0]+this.point[1]).addClass('img_board');
+ }
+ $('img#a'+place[0]+place[1]).removeClass('img_board');
+ $('img#a'+place[0]+place[1]).addClass('img_board_select');
+ this.point = place;
+ },
+ drawMessage: function(){
+ var bc = 0;
+ var wc = 0;
+ if (typeof this.heap['value'] != 'undefined'){
+ bc = parseInt(this.heap['black']);
+ wc = parseInt(this.heap['white']);
+ } else {
+ var count = {black:0, white:0};
+ for (var i=0; i<this.bounder; i++){
+ for (var j=0; j<this.bounder; j++){
+ count[this.board[i][j]] += parseInt(1);
+ }
+ }
+ bc = count['black'];
+ wc = count['white'];
+ }
+ $('#'+this.blackResultView).html(bc);
+ $('#'+this.whiteResultView).html(wc);
+
+ var bpossible;
+ var wpossible;
+
+ if (typeof this.heap['value'] != 'undefined' && this.heap['color'] == this.currentColor){
+ if (this.heap['color'] == 'white') {
+ bpossible = this.heap['upossible'];
+ wpossible = this.heap['cpossible'];
+ } else {
+ wpossible = this.heap['upossible'];
+ bpossible = this.heap['cpossible'];
+ }
+ } else {
+ wpossible = this.possiblePlace('white');
+ bpossible = this.possiblePlace('black');
+ }
+ this.isEnd = ((bpossible.length == 0 && wpossible.length == 0) || (this.step == 64));
+ if (!this.isEnd) {
+ var tpossible = bpossible;
+ if (this.currentColor == 'black') {
+ if (wpossible.length > 0) {
+ this.currentColor = 'white';
+ tpossible = wpossible;
+ }
+ } else {
+ if (bpossible.length > 0) {
+ this.currentColor = 'black';
+ } else {
+ tpossilbe = wpossible;
+ }
+ }
+ $('#'+this.messageview).attr('src', this.boardTexture[this.currentColor]);
+ this.possible = tpossible;
+ this.setTips(this.currentColor);
+ if (this.playerNum == 1 && this.currentColor == 'white') {
+ this.isUserTurn = false;
+ this.computerTurn();
+ } else {
+ this.isUserTurn = true;
+ }
+ } else {
+ var p = getMessage('player', 'player');
+ var w = getMessage('win', 'Wins');
+ if (bc > wc) {
+ $('.result_win_text').html(p+' 1 '+w+'!');
+ } else if (bc == wc) {
+ $('.result_win_text').html(getMessage('winDraw', 'Draw!'));
+ } else {
+ if (this.playerNum == 2) {
+ $('.result_win_text').html(p+' 2 '+w+'!');
+ } else {
+ $('.result_win_text').html(getMessage('winComputer', 'Computer Wins!'));
+ }
+ }
+ this.playSound('snd_victoryhorns');
+ $('#'+this.result).removeClass('display_none');
+ this.isLock = true;
+ this.isResult = true;
+ }
+ this.isDrawing = false;
+ },
+ closeResult: function() {
+ $('#'+this.result).addClass('display_none');
+ this.isResult = false;
+ },
+ setTips: function(color) {
+ var stone = this.boardTexture[color];
+ var spare = this.boardTexture['board'];
+ for (var n in this.possible) {
+ var p = this.possible[n];
+ if (this.board[p[0]][p[1]] == 'board') {
+ var id = 'l'+p[0]+p[1];
+ $('#'+id).attr('onMouseOver',"$('#"+id+" img').attr('src','"+stone+"').addClass('tip');")
+ .attr('onMouseOut',"$('#"+id+" img').attr('src','"+spare+"').removeClass('tip');");
+ }
+ }
+ },
+ clearTips: function() {
+ var possible = this.possible;
+ for (var n in possible) {
+ var p = possible[n];
+ var spare = this.boardTexture[this.board[p[0]][p[1]]];
+ var id = 'l'+p[0]+p[1];
+ $('#'+id).attr('onMouseOver','').attr('onMouseOut','').find('img').attr('src', spare).removeClass('tip');
+ }
+ },
+ drawBoard: function(){
+
+ var str = '';
+ for (var i=0; i<this.bounder; i++){
+ str += '<div>';
+ for (var j=0; j<this.bounder; j++){
+ str += '<span><a onClick="javascript:World.click('+i+','+j+');" id="l'+i+j+'" class="img_style" onMouseOver="" onMouseOut="" ><img src="'+this.boardTexture[this.board[i][j]]+'" id="a'+i+j+'" class="img_board" /></a></span>';
+ }
+ str += '</div>';
+ }
+ $('#'+this.boardview).html(str);
+ this.drawMessage();
+ },
+
+ click: function(i, j){
+ if (this.board[i][j] === 'board' && !this.isEnd && this.isUserTurn && !this.isDrawing && !this.isLock && !this.isConfigure) {
+ if (this.canRevert([i, j], this.currentColor)){
+ this.actionAtPoint([i,j], this.currentColor);
+ if (this.playerNum == 1) this.isUserTurn = false;
+ } else {
+ this.playSound('snd_hint');
+ }
+ } else if ((this.isConfigure && !this.isEnd && !this.isDrawing && !this.isLock)
+ || (this.isConfigure && this.isEnd && !this.isDrawing && this.isLock && !this.isResult)) {
+ this.endConfigure();
+ }
+ },
+ computerTurn: function(){
+ if (this.isDrawing) {
+ setTimeout('World.computerTurn()', 500);
+ return;
+ }
+ var possible;
+
+ if (typeof this.heap['value'] != 'undefined'){
+ if (this.heap['color'] == 'white') {
+ possible = this.heap['cpossible'];
+ } else {
+ possible = this.heap['upossible'];
+ }
+ } else {
+ possible = this.possiblePlace('white');
+ }
+ var place = this.bestPlace(possible);
+ if (possible.length > 0 && place.length > 0) {
+ this.actionAtPoint(place, 'white');
+ }
+ },
+
+ isContain: function(place, _array) {
+ var heat = _array || [];
+ for (var i in heat){
+ if (heat[i][0] == place[0] && heat[i][1] == place[1]) {
+ return true;
+ }
+ }
+ return false;
+
+ },
+ possiblePlace: function(color, _board){
+ var ret = [];
+ var tmp = {};
+ var revColor = ((color == 'white')?'black':'white');
+ var board = _board || this.board;
+ for (var i=0; i<this.bounder; i++){
+ for (var j=0; j<this.bounder; j++){
+ if (board[i][j] === revColor) {
+ for (var n in this.directs) {
+ var ni = i+parseInt(this.directs[n][0]);
+ var nj = j+parseInt(this.directs[n][1]);
+ if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === 'board'){
+ if (this.canRevert([ni, nj], color, board) && !this.isContain([ni, nj], ret)){
+ ret.push([parseInt(ni), parseInt(nj)]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+ canRevert: function(place, color, _board){
+ var i = parseInt(place[0]);
+ var j = parseInt(place[1]);
+ var revColor = ((color == 'white')?'black':'white');
+ var board = _board || this.board;
+ for (var n in this.directs) {
+ var di = parseInt(this.directs[n][0]);
+ var dj = parseInt(this.directs[n][1]);
+ var ni = i+di;
+ var nj = j+dj;
+ while (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === revColor){
+ ni += di;
+ nj += dj;
+ if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === color) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ getClone: function(obj){
+ var ret = [[],[],[],[],[],[],[],[]];
+
+ for(var i = 0; i < this.bounder; i++) {
+ for(var j = 0; j < this.bounder; j++) {
+ ret[i][j] = obj[i][j];
+ }
+ }
+ return ret;
+ },
+
+ getRevertPath: function(place, color, _board){
+ var i = parseInt(place[0]);
+ var j = parseInt(place[1]);
+ var revColor = ((color == 'white')?'black':'white');
+ var board = _board || this.board;
+ var path = [];
+ for (var n in this.directs) {
+ var ni = i+parseInt(this.directs[n][0]);
+ var nj = j+parseInt(this.directs[n][1]);
+ var tpath = [];
+ while (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === revColor){
+ tpath.push([ni, nj]);
+ ni += parseInt(this.directs[n][0]);
+ nj += parseInt(this.directs[n][1]);
+ if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === color) {
+ path = $.merge(path, tpath);
+ }
+ }
+ }
+ return {place: place, path: path, color: color,};
+ },
+
+ doRevert: function(action, _board){
+ var color = action['color'];
+ var board = _board || this.board;
+ var path = action['path'];
+ for (var p in path){
+ board[path[p][0]][path[p][1]] = color;
+ }
+ return board;
+ },
+ getValue: function(place, _board){
+ var ret = 0;
+ var board = _board || this.board;
+ var i = parseInt(place[0]);
+ var j = parseInt(place[1]);
+ var mtable = {
+ 0:{ 0:100, 1:-50, 2:40, 3:30, 4:30, 5:40, 6:-50, 7:100,},
+ 1:{ 0:-50, 1:-30, 2:5, 3:1, 4:1, 5:5, 6:-30, 7:-50,},
+ 2:{ 0:40, 1:5, 2:20, 3:10, 4:10, 5:20, 6:5, 7:40,},
+ 3:{ 0:30, 1:1, 2:10, 3:0, 4:0, 5:10, 6:1, 7:30,},
+ 4:{ 0:30, 1:1, 2:10, 3:0, 4:0, 5:10, 6:1, 7:30,},
+ 5:{ 0:40, 1:5, 2:20, 3:10, 4:10, 5:20, 6:5, 7:40,},
+ 6:{ 0:-50, 1:-30, 2:5, 3:1, 4:1, 5:5, 6:-30, 7:-50,},
+ 7:{ 0:100, 1:-50, 2:40, 3:30, 4:30, 5:40, 6:-50, 7:100,},
+ };
+ return parseInt(mtable[i][j]);
+ },
+ evaluate: function(place, _color, _board, _level, _heap){
+ var ret = -100000;
+ var level = _level || this.level;
+ var heap = _heap || this.heap;
+ if (typeof heap['nextLevel'][String(place[0])+String(place[1])] == 'undefined'){
+ heap['nextLevel'][String(place[0])+String(place[1])] = {};
+ }
+ heap = heap['nextLevel'][String(place[0])+String(place[1])];
+ level = parseInt(level);
+ var toEndLevel = 64-parseInt(this.step);
+ level = (level>toEndLevel?toEndLevel:level);
+ var nextValue = 0;
+/*
+ var i = parseInt(place[0]);
+ var j = parseInt(place[1]);*/
+
+ var color = _color || 'white';
+ var board = _board || this.board;
+ board = this.getClone(board);
+ var revColor = ((color == 'white')?'black':'white');
+ var sym = ((color == 'white')?1:-1);
+
+ board[place[0]][place[1]] = color;
+
+ var path;
+ var cp;
+ var up;
+ if (typeof heap['value'] != 'undefined'){
+ path = heap['path'];
+ ret = heap['value'];
+ cp = heap['cpossible'];
+ up = heap['upossible'];
+ board = this.doRevert(heap, board);
+ } else {
+ var act = this.getRevertPath(place, color, board);
+ heap['path'] = act['path'];
+ heap['color'] = color;
+ heap['place'] = place;
+ board = this.doRevert(heap, board);
+ cp = this.possiblePlace(color, board);
+ up = this.possiblePlace(revColor, board);
+
+ var cv = 0;
+ var uv = 0;
+ var cc = 0;
+ var uc = 0;
+
+ for (var i=0; i<this.bounder; i++){
+ for (var j=0; j<this.bounder; j++){
+ if (board[i][j] === color) {
+ cv += this.getValue([i, j], board);
+ cc++;
+ } else if (board[i][j] === revColor){
+ uv += this.getValue([i, j], board);
+ uc++;
+ }
+ }
+ }
+
+ ret = (cp.length-up.length)*10;
+ ret += (cv-uv)*2;
+ if (up.length == 0 && cp.length > 0) ret = 100000;
+ heap['value'] = ret;
+ heap['nextLevel'] = {};
+ heap['cpossible'] = cp;
+ heap['upossible'] = up;
+ heap[color] = cc;
+ heap[revColor] = uc;
+ }
+
+ if (level > 1 && (up.length > 0 || cp.length > 0)){
+ if (up.length == 0){
+ up = cp;
+ revColor = color;
+ }
+ up = this.getBestPlaceSet(up);
+ for (var p in up) {
+ nextValue += this.evaluate(up[p], revColor, board, level-1, heap);
+ }
+ if (up.length > 0){
+ nextValue = nextValue/up.length;
+ ret = Math.round(ret*0.5+nextValue*0.5);
+ }
+ }
+
+ return ret*sym;
+ },
+ getBestPlaceSet: function(possible){
+ var best = [];
+ var middle = [];
+ var ret = [];
+ for (var i in possible){
+ var t = this.getValue(possible[i]);
+ if (t == 100) {
+ best.push(possible[i]);
+ } else if (t >= 0) {
+ middle.push(possible[i]);
+ }
+ }
+
+ if (best.length > 0){
+ ret = best;
+ } else if (middle.length > 0){
+ ret = middle;
+ } else {
+ ret = possible;
+ }
+ return ret;
+ },
+ bestPlace: function(possible){
+ if (possible.length == 0)
+ console.log('Error: No possible places?!!!');
+ possible = this.getBestPlaceSet(possible);
+
+ var ret = [];
+ if (possible.length > 0) {
+ ret = possible[0];
+ var value = this.evaluate(ret);
+ for (var p=1; p<possible.length; p++) {
+ var v = this.evaluate(possible[p]);
+ if (v > value){
+ value = v;
+ ret = possible[p];
+ }
+ }
+ } else {
+ console.log('Error: No Setting place for Computer');
+ }
+ return ret;
+ },
+ };
+ return w;
+})();
+
+function getMessage(key, alter) {
+ var ret = alter || '';
+ if (window.chrome && window.chrome.i18n && window.chrome.i18n.getMessage) {
+ ret = chrome.i18n.getMessage(key);
+ } else {
+ if (typeof this.messages == 'undefined') {
+ $.getJSON("_locales/en/messages.json", function(data){
+ this.messages = data;
+ }).error(function(){
+ return ret;
+ });
+ }
+ if (this.messages && (this.messages.hasOwnProperty(key)) && (this.messages[key].hasOwnProperty('message'))) {
+ ret = this.messages[key].message;
+ }
+ }
+ return ret;
+}
+
+$(document).ready(function(){
+ license_init("license", "open");
+ $('title').html(getMessage('name', 'Annex'));
+ $('#open1').html(getMessage('1PlayerGame', '1 Player Game'));
+ $('#open2').html(getMessage('2PlayerGame', '2 Player Game'))
+ $('#open_help').html(getMessage('howtoPlay', 'How to Play'));
+ $('#open_exit').html(getMessage('exit', 'Exit'));
+ $('.play1_pieces_lable').html(getMessage('pieces', 'pieces'));
+ $('.play2_pieces_lable').html(getMessage('pieces', 'pieces'));
+ $('#turn').html(getMessage('turn', "'s Turn"));
+ $('.result_new_p1').html(getMessage('newOneGame', 'New 1P Game'));
+ $('.result_new_p2').html(getMessage('newTwoGame', 'New 2P Game'));
+ $('.result_exit').html(getMessage('exit', 'Exit'));
+ $('.help_title').html(getMessage('howtoPlay', 'How to Play'));
+ $('.help_contain').html(getMessage('help', "Play a piece on the board so that one or more of your opponent’s pieces are between two of your pieces. All of the opponent’s pieces between your own turn over and become your color.<br>The player with the most pieces on the board at the end of the game wins!"));
+ $('.help_exit').html(getMessage('goBack', 'Go Back'));
+ $('#license').html(getMessage('license', 'License'));
+ $('#readme').html(getMessage('readme', 'Readme'));
+ $('.configure_panel_startover').click(function(){
+ World.startOver();
+ }).hover(function(){
+ $(this).css('background-color','#222222');
+ World.playSound('snd_navmove');
+ },function(){
+ $(this).css('background-color','#000000');
+ }).find('.configure_panel_text').html(getMessage('startover','Start over'));
+
+ $('.configure_panel_newgame').hover(function(evt){
+ $(this).css('background-color','#222222');
+ World.playSound('snd_navmove');
+ },function(evt){
+ $(this).css('background-color','#000000');
+ }).click(function(){
+ var n = 1;
+ if ($(this).hasClass('configure_panel_new2game')){
+ n = 2;
+ }
+ World.playSound('snd_navclick');
+ World.init(n);
+ });
+
+ $('.configure_panel_help').click(function(){
+ World.showHelp();
+ }).hover(function(){
+ $(this).css('background-color','#222222');
+ World.playSound('snd_navmove');
+ },function(){
+ $(this).css('background-color','#000000');
+ }).find('.configure_panel_text').html(getMessage('rules','Rules'));
+
+ $('.configure_panel_exit').click(function(){
+ window.close();
+ }).hover(function(){
+ $(this).css('background-color','#222222');
+ World.playSound('snd_navmove');
+ },function(){
+ $(this).css('background-color','#000000');
+ }).find('.configure_panel_text').html(getMessage('exit','Exit'));
+
+ World.playSound('snd_theme');
+});
64 js/license.js
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2012, Intel Corporation.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+function license_init(id, hpageid)
+{
+ var lbtn = document.getElementById(id+"btnl");
+ var ubtn = document.getElementById(id+"btnu");
+ var dbtn = document.getElementById(id+"btnd");
+ var qbtn = document.getElementById(id+"btnq");
+ var lpage = document.getElementById(id+"page");
+ var ltext = document.getElementById(id+"text").contentWindow;
+ var hpage = document.getElementById(hpageid);
+ var frame = window.frames[id+"text"];
+ var scroll_y = 0;
+ var click_y = 0;
+ var isdrag = false;
+
+ ltext.ontouchstart = function(e) {};
+ ltext.ontouchend = function(e) {};
+ ltext.ontouchmove = function(e) {};
+
+ ltext.onmousedown = function(e) {
+ isdrag = true;
+ click_y = e.y;
+ scroll_y = frame.scrollY;
+ };
+
+ ltext.onmouseup = function(e) {
+ isdrag = false;
+ };
+
+ ltext.onmousemove = function(e) {
+ if(isdrag)
+ {
+ frame.scrollTo(0, scroll_y + click_y - e.y);
+ }
+ };
+
+ lbtn.addEventListener('click', function() {
+ hpage.style.visibility="hidden";
+ lpage.style.display="block";
+ });
+
+ ubtn.onmousedown = function() {
+ var val = frame.scrollY - 400
+ frame.scrollTo(0, (val < 0)?0:val);
+ };
+
+ dbtn.onmousedown = function() {
+ var val = frame.scrollY + 400
+ frame.scrollTo(0, val);
+ };
+
+ qbtn.addEventListener('click', function() {
+ hpage.style.visibility="visible";
+ lpage.style.display="none";
+ });
+}
18 lib/jquery-1.6.2.min.js
@@ -0,0 +1,18 @@
+/*!
+ * jQuery JavaScript Library v1.6.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *