Browse Source

Fix:Coding style

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
ddb5311c9f
  1. 3
      export/html/snakes/css/game.css
  2. 2
      export/html/snakes/css/modal.css
  3. 3
      export/html/snakes/css/snakes.css
  4. 78
      export/html/snakes/js/common.js
  5. 18
      export/html/snakes/js/jquery-1.6.1.min.js
  6. 298
      export/html/snakes/js/jquery-ui-1.7.2.custom.min.js
  7. BIN
      export/html/snakes/js/js.zip
  8. 296
      export/html/snakes/js/snakes-mod.js
  9. 295
      export/html/snakes/js/subModal.js
  10. 6
      export/html/snakes/modalContent.html
  11. 1
      export/javame/hangman/simple/lang/en_utf8/language.txt
  12. 1
      export/javame/hangman/simple/lang/es_utf8/language.txt
  13. 1
      export/javame/hangmanp/simple/lang/en_utf8/language.txt
  14. 1
      export/javame/hangmanp/simple/lang/es_utf8/language.txt
  15. 4
      exporthtml.php

3
export/html/snakes/css/game.css

@ -15,11 +15,9 @@
{ {
position:absolute; position:absolute;
display:none; display:none;
} }
#dicecont #dicecont
{ {
float:right; float:right;
@ -37,4 +35,3 @@
font-size: 14px; font-size: 14px;
padding: 10px; padding: 10px;
} }

2
export/html/snakes/css/modal.css

@ -37,5 +37,3 @@ img.btn_close {
*html .popup_block { *html .popup_block {
position: absolute; position: absolute;
} }

3
export/html/snakes/css/snakes.css

@ -3,7 +3,6 @@ Husain Limdiyawala(MSc IT DA-IICT)
Any Duplication of this code should be avoided*/ Any Duplication of this code should be avoided*/
.blocks .blocks
{ {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
@ -36,14 +35,12 @@ Any Duplication of this code should be avoided*/
display:none; display:none;
width:45px; width:45px;
height:44px; height:44px;
} }
.img1 .img1
{ {
position:absolute; position:absolute;
display:none; display:none;
} }
body body

78
export/html/snakes/js/common.js

@ -1,78 +0,0 @@
function addEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, false);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
} else {
return false;
}
}
function removeEvent(obj, evType, fn, useCapture){
if (obj.removeEventListener){
obj.removeEventListener(evType, fn, useCapture);
return true;
} else if (obj.detachEvent){
var r = obj.detachEvent("on"+evType, fn);
return r;
} else {
alert("Handler could not be removed");
}
}
/**
* Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
*
* Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com)
*
* Gets the full width/height because it's different for most browsers.
*/
function getViewportHeight() {
if (window.innerHeight!=window.undefined) return window.innerHeight;
if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
if (document.body) return document.body.clientHeight;
return window.undefined;
}
function getViewportWidth() {
var offset = 17;
var width = null;
if (window.innerWidth!=window.undefined) return window.innerWidth;
if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth;
if (document.body) return document.body.clientWidth;
}
/**
* Gets the real scroll top
*/
function getScrollTop() {
if (self.pageYOffset) // all except Explorer
{
return self.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop)
// Explorer 6 Strict
{
return document.documentElement.scrollTop;
}
else if (document.body) // all other Explorers
{
return document.body.scrollTop;
}
}
function getScrollLeft() {
if (self.pageXOffset) // all except Explorer
{
return self.pageXOffset;
}
else if (document.documentElement && document.documentElement.scrollLeft)
// Explorer 6 Strict
{
return document.documentElement.scrollLeft;
}
else if (document.body) // all other Explorers
{
return document.body.scrollLeft;
}
}

18
export/html/snakes/js/jquery-1.6.1.min.js

File diff suppressed because one or more lines are too long

298
export/html/snakes/js/jquery-ui-1.7.2.custom.min.js

File diff suppressed because one or more lines are too long

BIN
export/html/snakes/js/js.zip

Binary file not shown.

296
export/html/snakes/js/snakes-mod.js

@ -1,11 +1,8 @@
/*This code was originally based on code by /*This code was originally based on code by
Husain Limdiyawala(MSc IT DA-IICT)*/ Husain Limdiyawala(MSc IT DA-IICT)*/
$(document).ready(function () { $(document).ready(function () {
}); });
@ -26,15 +23,8 @@ var laddest = new Array(3);
var quest = new Array(); //available questions along with multiple answers var quest = new Array(); //available questions along with multiple answers
var COR_answered = new Array(); //record all questions (along with answers) the user responded CORRECTLY var COR_answered = new Array(); //record all questions (along with answers) the user responded CORRECTLY
var WRO_answered = new Array(); //record all questions (along with answers) the user responded WRONGLY var WRO_answered = new Array(); //record all questions (along with answers) the user responded WRONGLY
//var door = new Array(1)
var user = new Array(); var user = new Array();
//var pythons = new Array(1);
//Constract table with questions and answers and pick question to display //Constract table with questions and answers and pick question to display
quest[0] = "Spell 1"; quest[0] = "Spell 1";
@ -54,23 +44,20 @@ quest[13]="four";
quest[14] = "three"; quest[14] = "three";
quest[15] = "one"; quest[15] = "one";
z = 0; z = 0;
for (z=0;quest[z]!=null;z++); for (z = 0; quest[z] != null; z++) {
// Do nothing
}
allQuest = z / 4; allQuest = z / 4;
function selectQuest(all) function selectQuest(all)
{ {
pickOne = Math.floor((Math.random() * all)); pickOne = Math.floor((Math.random() * all));
return pickOne; return pickOne;
} }
//The Below Function will hide all the snakes //The Below Function will hide all the snakes
function hideAll() function hideAll() {
{
document.getElementById("img1").style.display = "none"; document.getElementById("img1").style.display = "none";
document.getElementById("img2").style.display = "none"; document.getElementById("img2").style.display = "none";
document.getElementById("img3").style.display = "none"; document.getElementById("img3").style.display = "none";
@ -81,54 +68,40 @@ function hideAll()
document.getElementById("lad3").style.display = "none"; document.getElementById("lad3").style.display = "none";
} }
//The Below Function will Render The Main Board //The Below Function will Render The Main Board
function paintBoard(a) function paintBoard(a) {
{
totblocks = (a * a); totblocks = (a * a);
if((a*a) % 2 == 0) if ((a * a) % 2 == 0) {
{
currentblock = (a * a) - a + 1; currentblock = (a * a) - a + 1;
for(j=0;j<(a/2);j++) for (j = 0; j < (a / 2); j++) {
{ for (i = 0; i < a; i++) {
for(i=0;i<a;i++)
{
data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>"; data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>";
currentblock++; currentblock++;
} }
currentblock -= (a + 1); currentblock -= (a + 1);
for(i=0;i<a;i++) for (i = 0; i < a; i++) {
{
data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>"; data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>";
currentblock--; currentblock--;
} }
currentblock -= (a - 1); currentblock -= (a - 1);
} }
} } else {
else
{
currentblock = (a * a); currentblock = (a * a);
for(j=0;j<(a/2);j++) for (j = 0; j < (a / 2); j++) {
{ for (i = 0; i < a; i++) {
for(i=0;i<a;i++)
{
data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>"; data += "<div class='blocks' id='" + currentblock + "'>" + currentblock + "</div>";
currentblock--; currentblock--;
} }
currentblock -= (a - 1); currentblock -= (a - 1);
if(currentblock < 2) if (currentblock < 2) {
break; break;
}
for(i=0;i<a;i++) for (i = 0; i < a; i++) {
{
data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>"; data += "<div id='" + currentblock + "' class ='blocks'>" + currentblock + "</div>";
currentblock++; currentblock++;
} }
@ -137,16 +110,12 @@ function paintBoard(a)
} }
document.getElementById("cont").style.width = (a * 52 + 52) + "px" document.getElementById("cont").style.width = (a * 52 + 52) + "px"
document.getElementById("cont").innerHTML = data; document.getElementById("cont").innerHTML = data;
$("#cont").slideDown("slow"); $("#cont").slideDown("slow");
$("#cont").effect("shake",3000); $("#cont").effect("shake",3000);
$("img:hidden").fadeIn(5000); $("img:hidden").fadeIn(5000);
if(a == 6) if (a == 6) {
{
registerSnake(158, 196, "img1", 14, 3, 0); registerSnake(158, 196, "img1", 14, 3, 0);
registerSnake(62, 183, "img2", 27, 24, 1); registerSnake(62, 183, "img2", 27, 24, 1);
registerSnake(175, 18, "img3", 18, 4, 2); registerSnake(175, 18, "img3", 18, 4, 2);
@ -155,18 +124,7 @@ function paintBoard(a)
registerLadder(27, 132, "lad1", 28, 34, 0); registerLadder(27, 132, "lad1", 28, 34, 0);
registerLadder(90, 22, "lad2", 19, 30, 1); registerLadder(90, 22, "lad2", 19, 30, 1);
registerLadder(179, 137, "lad3", 2, 16, 2); registerLadder(179, 137, "lad3", 2, 16, 2);
} else if (a == 8) {
//registerDoor("5",5,0);
//registerDoor("21",21,1)
//registerPython("15",15,0)
}
else if(a == 8)
{
registerSnake(300, 380, "img1", 44, 29, 0); registerSnake(300, 380, "img1", 44, 29, 0);
registerSnake(180, 550, "img2", 51, 46, 1); registerSnake(180, 550, "img2", 51, 46, 1);
registerSnake(290, 50, "img3", 41, 40, 2); registerSnake(290, 50, "img3", 41, 40, 2);
@ -175,57 +133,34 @@ function paintBoard(a)
registerLadder(350, 515, "lad1", 19, 35, 0); registerLadder(350, 515, "lad1", 19, 35, 0);
registerLadder(180, 230, "lad2", 43, 54, 1); registerLadder(180, 230, "lad2", 43, 54, 1);
registerLadder(80, 350, "lad3", 53, 60, 2); registerLadder(80, 350, "lad3", 53, 60, 2);
//registerDoor("14",14,0);
//registerDoor("26",26,1)
//registerPython("32",32,0)
} }
} }
//The below Function will simulate throwing of a dice //The below Function will simulate throwing of a dice
function throwDice(i) {
function throwDice(i)
{
randomno = Math.floor((Math.random() * 6)) + 1; randomno = Math.floor((Math.random() * 6)) + 1;
document.getElementById("diceimg").src = "images/dice_" + randomno + ".PNG"; document.getElementById("diceimg").src = "images/dice_" + randomno + ".PNG";
document.getElementById("diceimg").style.display = "block"; document.getElementById("diceimg").style.display = "block";
if(lastposition[i]>0) if (lastposition[i] > 0) {
{
document.getElementById(lastposition[i]).style.background = "url(images/square52.png)"; document.getElementById(lastposition[i]).style.background = "url(images/square52.png)";
} }
tots[i] += randomno; tots[i] += randomno;
if(totblocks - tots[i] >= 0) if (totblocks - tots[i] >= 0) {
{
lastposition[i] = tots[i]; lastposition[i] = tots[i];
document.getElementById(tots[i]).style.background = "url(images/pawn1.png)"; document.getElementById(tots[i]).style.background = "url(images/pawn1.png)";
} } else {
else
{
tots[i] -= randomno; tots[i] -= randomno;
document.getElementById(tots[i]).style.background = "url(images/pawn1.png)"; document.getElementById(tots[i]).style.background = "url(images/pawn1.png)";
} }
} }
//The below Function Checks The Snake Biting for a user // The below Function Checks The Snake Biting for a user.
function snakescheck(k) {
function snakescheck(k)
{
i = 0; i = 0;
for(i=0;i<=srcsnake.length;i++) for(i = 0; i <= srcsnake.length; i++) {
{ if (srcsnake[i] == tots[k]) {
if(srcsnake[i] == tots[k])
{
alert("Ωχ! Σε τσίμπησε φίδι στο τετράγωνο " + srcsnake[i] + " και θα πρέπει να γυρίσεις στο τετράγωνο " + destsnake[i] + ", εκτός κι αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); alert("Ωχ! Σε τσίμπησε φίδι στο τετράγωνο " + srcsnake[i] + " και θα πρέπει να γυρίσεις στο τετράγωνο " + destsnake[i] + ", εκτός κι αν απαντήσεις σωστά στην ερώτηση που ακολουθεί.");
document.getElementById(destsnake[i]).style.background = "url(images/pawn1.png)"; document.getElementById(destsnake[i]).style.background = "url(images/pawn1.png)";
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; document.getElementById(tots[k]).style.background = "url(images/square52.png)";
@ -235,21 +170,17 @@ function snakescheck(k)
} }
} }
if(!checkWin(k)) if (!checkWin(k)) {
alert("???d?se?!S???a??t???a!"); alert("???d?se?!S???a??t???a!");
} }
}
//The below function checks the ladders for a user //The below function checks the ladders for a user
function laddercheck(k) {
function laddercheck(k)
{
i = 0; i = 0;
for(i=0;i<=ladsrc.length;i++) for(i = 0; i <= ladsrc.length; i++) {
{ if (ladsrc[i] == tots[k]) {
if(ladsrc[i] == tots[k])
{
alert("Υπάρχει μια σκάλα στο τετράγωνο " + ladsrc[i] + " και θα σας οδηγήσει κατευθείαν στο τετράγωνο " + laddest[i] + "αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); alert("Υπάρχει μια σκάλα στο τετράγωνο " + ladsrc[i] + " και θα σας οδηγήσει κατευθείαν στο τετράγωνο " + laddest[i] + "αν απαντήσεις σωστά στην ερώτηση που ακολουθεί.");
document.getElementById(laddest[i]).style.background = "url(images/pawn1.png)"; document.getElementById(laddest[i]).style.background = "url(images/pawn1.png)";
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; document.getElementById(tots[k]).style.background = "url(images/square52.png)";
@ -258,49 +189,19 @@ function snakescheck(k)
break; break;
} }
} }
if(!checkWin(k)) if(!checkWin(k)) {
alert("You have won!"); alert("You have won!");
} }
//The below function checks the existence of doors
/*function doorcheck(k)
{
i=0;
for(i=0;i<=door.length;i++)
{
if(door[i] == tots[k])
{
var randomdoor = Math.floor((Math.random() * totblocks)) + 1;
alert("Magic Door Entered!! You are redirected to " + randomdoor);
document.getElementById(randomdoor).style.background = "url(images/pawn.png) #000000";
document.getElementById(tots[k]).style.background = "url(images/door.png) #000000";
lastposition[k] = randomdoor;
tots[k] = randomdoor;
}
} }
if(!checkWin(k))
alert("You Have Won!!");
} */
//The below Function checks for pythons //The below Function checks for pythons
function pythoncheck(k) function pythoncheck(k) {
{
i = 0; i = 0;
for(i=0;i<pythons.length;i++) for (i = 0; i < pythons.length; i++) {
{
if(pythons[i] == tots[k])
{
if (pythons[i] == tots[k]) {
alert("You have been eaten up by a python.Your game is over"); alert("You have been eaten up by a python.Your game is over");
document.getElementById(tots[k]).style.background = "url(images/csnake.gif) #000000"; document.getElementById(tots[k]).style.background = "url(images/csnake.gif) #000000";
lastposition[k] = null; lastposition[k] = null;
@ -308,166 +209,109 @@ function pythoncheck(k)
break; break;
} }
} }
} }
//The below function will register a snake // The below function will register a snake.
function registerSnake(tp, lft, dv, src, dest, i) {
function registerSnake(tp,lft,dv,src,dest,i)
{
document.getElementById(dv).style.top = tp + "px"; document.getElementById(dv).style.top = tp + "px";
document.getElementById(dv).style.left = lft + "px"; document.getElementById(dv).style.left = lft + "px";
srcsnake[i] = src; srcsnake[i] = src;
destsnake[i] = dest; destsnake[i] = dest;
} }
//The below function will register a ladder. // The below function will register a ladder..
function registerLadder(tp, lft, dv, src, dest, i) {
function registerLadder(tp,lft,dv,src,dest,i)
{
document.getElementById(dv).style.top = tp + "px"; document.getElementById(dv).style.top = tp + "px";
document.getElementById(dv).style.left = lft + "px"; document.getElementById(dv).style.left = lft + "px";
ladsrc[i] = src; ladsrc[i] = src;
laddest[i] = dest; laddest[i] = dest;
} }
//The below function will register a door.
/*function registerDoor(dv,srcc,i)
{
document.getElementById(dv).style.background = "url(images/door.png) #000000";
door[i] = srcc;
}
//The below function will register a python.
function registerPython(dv,srcc,i)
{
document.getElementById(dv).style.background = "url(images/csnake.gif) #000000";
pythons[i] = srcc;
}
*/
//The below function checks the change in the boardtype selection combobox //The below function checks the change in the boardtype selection combobox
function selectBoard() {
function selectBoard()
{
totblocks = 0; totblocks = 0;
data = ""; data = "";
currentblock = 0; currentblock = 0;
position = 0; position = 0;
hideAll(); hideAll();
if(document.getElementById("boardtype").value != null) if (document.getElementById("boardtype").value != null) {
{
paintBoard(parseInt(document.getElementById("boardtype").value)); paintBoard(parseInt(document.getElementById("boardtype").value));
} }
} }
//The below function checks the change in the player selection combobox // The below function checks the change in the player selection combobox.
function selectPlayer() {
function selectPlayer() if (document.getElementById("players").value != null) {
{
if(document.getElementById("players").value != null)
{
user[document.getElementById("players").value - 1] = 0; user[document.getElementById("players").value - 1] = 0;
tots[document.getElementById("players").value - 1] = 0; tots[document.getElementById("players").value - 1] = 0;
lastposition[document.getElementById("players").value - 1] = 0; lastposition[document.getElementById("players").value - 1] = 0;
for(var j=0;j < lastposition.length;j++) for(var j = 0; j < lastposition.length; j++) {
{
lastposition[j] = 0; lastposition[j] = 0;
tots[j] = 0; tots[j] = 0;
} }
} }
} }
//The below function starts the play // The below function starts the play.
function play() {
function play() if (tots[l] != null) {
{
if(tots[l] != null)
{
//...&&(quest[0]!=NULL)
disableField(); disableField();
document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l + 1) + " </li><li>brisketai sto tetragwno " + tots[l] + "</li><li></li></ul>"; document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l + 1) + " </li><li>brisketai sto tetragwno " + tots[l] + "</li><li></li></ul>";
//
Question(); Question();
document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l + 1) + " </li><li>vrisketai sto tetragwno " + tots[l] + "</li></ul>"; document.getElementById("status").innerHTML = "<ul class='nodis'><li>O Paiktis " + (l + 1) + " </li><li>vrisketai sto tetragwno " + tots[l] + "</li></ul>";
} } else {
else
document.getElementById("status").innerHTML = "<ul class='nodis'><li>Molis exases...</li></ul>"; document.getElementById("status").innerHTML = "<ul class='nodis'><li>Molis exases...</li></ul>";
}
if(l == lastposition.length-1) if( l == lastposition.length - 1) {
l = 0; l = 0;
else } else {
l++; l++;
}
} }
//The below function regulates the play // The below function regulates the play.
function doit(i) {
function doit(i)
{
throwDice(i); throwDice(i);
if (checkWin(i)) {
if(checkWin(i))
{
//doorcheck(i);
snakescheck(i); snakescheck(i);
laddercheck(i); laddercheck(i);
//pythoncheck(i); } else {
}
else
alert("ÏëïêëÞñùóåò ôçí ðßóôá, óõã÷áñçôÞñéá!!!"); alert("ÏëïêëÞñùóåò ôçí ðßóôá, óõã÷áñçôÞñéá!!!");
} }
}
//The below function checks whether the player has won or not // The below function checks whether the player has won or not.
function checkWin(i) {
function checkWin(i) if( tots[i] == totblocks) {
{
if(tots[i] == totblocks)
return false; return false;
else } else {
return true; return true;
}
} }
//The below function will disable both the combobox // The below function will disable both the combobox .
function disableField() {
function disableField()
{
document.getElementById("players").disabled = "disabled"; document.getElementById("players").disabled = "disabled";
document.getElementById("boardtype").disabled = "disabled"; document.getElementById("boardtype").disabled = "disabled";
} }
function Question() function Question() {
{
picked = selectQuest(allQuest); picked = selectQuest(allQuest);
alert("Randomly selected number:" + picked); alert("Randomly selected number:" + picked);
Q1 = prompt(quest[picked * 4], "Απάντηση"); Q1 = prompt(quest[picked * 4], "Απάντηση");
if (Q1==quest[picked*4+1]) if (Q1 == quest[picked * 4 + 1]) {
{
alert("Σωστά!") alert("Σωστά!")
doit(l); doit(l);
COR_answered.concat(quest.splice(picked * 4, 4)); COR_answered.concat(quest.splice(picked * 4, 4));
} } else {
else
{
alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!") alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!")
//document.getElementById("playbtn").disabled = "disabled";
WRO_answered.concat(quest.splice(picked * 4, 4)); WRO_answered.concat(quest.splice(picked * 4, 4));
} }
//remove question and answers from available questions - (thus not allowing to have a Repeated question) ---XOXOXO
// Remove question and answers from available questions - (thus not allowing to have a Repeated question) ---XOXOXO
allQuest--; allQuest--;
} }

295
export/html/snakes/js/subModal.js

@ -1,295 +0,0 @@
var gPopupMask = null;
var gPopupContainer = null;
var gPopFrame = null;
var gReturnFunc;
var gPopupIsShown = false;
var gDefaultPage = "/loading.html";
var gHideSelects = false;
var gReturnVal = null;
var gTabIndexes = new Array();
// Pre-defined list of tags we want to disable/enable tabbing into
var gTabbableTags = new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");
// If using Mozilla or Firefox, use Tab-key trap.
if (!document.all) {
document.onkeypress = keyDownHandler;
}
/**
* Initializes popup code on load.
*/
function initPopUp() {
// Add the HTML to the body
theBody = document.getElementsByTagName('BODY')[0];
popmask = document.createElement('div');
popmask.id = 'popupMask';
popcont = document.createElement('div');
popcont.id = 'popupContainer';
popcont.innerHTML = '' +
'<div id="popupInner">' +
'<div id="popupTitleBar">' +
'<div id="popupTitle"></div>' +
'<div id="popupControls">' +
'<img src="close.gif" onclick="hidePopWin(false);" id="popCloseBox" />' +
'</div>' +
'</div>' +
'<iframe src="'+ gDefaultPage +'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>' +
'</div>';
theBody.appendChild(popmask);
theBody.appendChild(popcont);
gPopupMask = document.getElementById("popupMask");
gPopupContainer = document.getElementById("popupContainer");
gPopFrame = document.getElementById("popupFrame");
// check to see if this is IE version 6 or lower. hide select boxes if so
// maybe they'll fix this in version 7?
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) {
gHideSelects = true;
}
// Add onclick handlers to 'a' elements of class submodal or submodal-width-height
var elms = document.getElementsByTagName('a');
for (i = 0; i < elms.length; i++) {
if (elms[i].className.indexOf("submodal") == 0) {
// var onclick = 'function (){showPopWin(\''+elms[i].href+'\','+width+', '+height+', null);return false;};';
// elms[i].onclick = eval(onclick);
elms[i].onclick = function(){
// default width and height
var width = 400;
var height = 200;
// Parse out optional width and height from className
params = this.className.split('-');
if (params.length == 3) {
width = parseInt(params[1]);
height = parseInt(params[2]);
}
showPopWin(this.href,width,height,null); return false;
}
}
}
}
addEvent(window, "load", initPopUp);
/**
* @argument width - int in pixels
* @argument height - int in pixels
* @argument url - url to display
* @argument returnFunc - function to call when returning true from the window.
* @argument showCloseBox - show the close box - default true
*/
function showPopWin(url, width, height, returnFunc, showCloseBox) {
// show or hide the window close widget
if (showCloseBox == null || showCloseBox == true) {
document.getElementById("popCloseBox").style.display = "block";
} else {
document.getElementById("popCloseBox").style.display = "none";
}
gPopupIsShown = true;
disableTabIndexes();
gPopupMask.style.display = "block";
gPopupContainer.style.display = "block";
// calculate where to place the window on screen
centerPopWin(width, height);
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10);
gPopupContainer.style.width = width + "px";
gPopupContainer.style.height = (height+titleBarHeight) + "px";
setMaskSize();
// need to set the width of the iframe to the title bar width because of the dropshadow
// some oddness was occuring and causing the frame to poke outside the border in IE6
gPopFrame.style.width = parseInt(document.getElementById("popupTitleBar").offsetWidth, 10) + "px";
gPopFrame.style.height = (height) + "px";
// set the url
gPopFrame.src = url;
gReturnFunc = returnFunc;
// for IE
if (gHideSelects == true) {
hideSelectBoxes();
}
window.setTimeout("setPopTitle();", 600);
}
//
var gi = 0;
function centerPopWin(width, height) {
if (gPopupIsShown == true) {
if (width == null || isNaN(width)) {
width = gPopupContainer.offsetWidth;
}
if (height == null) {
height = gPopupContainer.offsetHeight;
}
//var theBody = document.documentElement;
var theBody = document.getElementsByTagName("BODY")[0];
//theBody.style.overflow = "hidden";
var scTop = parseInt(getScrollTop(),10);
var scLeft = parseInt(theBody.scrollLeft,10);
setMaskSize();
//window.status = gPopupMask.style.top + " " + gPopupMask.style.left + " " + gi++;
var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10);
var fullHeight = getViewportHeight();
var fullWidth = getViewportWidth();
gPopupContainer.style.top = (scTop + ((fullHeight - (height+titleBarHeight)) / 2)) + "px";
gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px";
//alert(fullWidth + " " + width + " " + gPopupContainer.style.left);
}
}
addEvent(window, "resize", centerPopWin);
addEvent(window, "scroll", centerPopWin);
window.onscroll = centerPopWin;
/**
* Sets the size of the popup mask.
*
*/
function setMaskSize() {
var theBody = document.getElementsByTagName("BODY")[0];
var fullHeight = getViewportHeight();
var fullWidth = getViewportWidth();
// Determine what's bigger, scrollHeight or fullHeight / width
if (fullHeight > theBody.scrollHeight) {
popHeight = fullHeight;
} else {
popHeight = theBody.scrollHeight;
}
if (fullWidth > theBody.scrollWidth) {
popWidth = fullWidth;
} else {
popWidth = theBody.scrollWidth;
}
gPopupMask.style.height = popHeight + "px";
gPopupMask.style.width = popWidth + "px";
}
/**
* @argument callReturnFunc - bool - determines if we call the return function specified
* @argument returnVal - anything - return value
*/
function hidePopWin(callReturnFunc) {
gPopupIsShown = false;
var theBody = document.getElementsByTagName("BODY")[0];
theBody.style.overflow = "";
restoreTabIndexes();
if (gPopupMask == null) {
return;
}
gPopupMask.style.display = "none";
gPopupContainer.style.display = "none";
if (callReturnFunc == true && gReturnFunc != null) {
// Set the return code to run in a timeout.
// Was having issues using with an Ajax.Request();
gReturnVal = window.frames["popupFrame"].returnVal;
window.setTimeout('gReturnFunc(gReturnVal);', 1);
}
gPopFrame.src = gDefaultPage;
// display all select boxes
if (gHideSelects == true) {
displaySelectBoxes();
}
}
/**
* Sets the popup title based on the title of the html document it contains.
* Uses a timeout to keep checking until the title is valid.
*/
function setPopTitle() {
return;
if (window.frames["popupFrame"].document.title == null) {
window.setTimeout("setPopTitle();", 10);
} else {
document.getElementById("popupTitle").innerHTML = window.frames["popupFrame"].document.title;
}
}
// Tab key trap. iff popup is shown and key was [TAB], suppress it.
// @argument e - event - keyboard event that caused this function to be called.
function keyDownHandler(e) {
if (gPopupIsShown && e.keyCode == 9) return false;
}
// For IE. Go through predefined tags and disable tabbing into them.
function disableTabIndexes() {
if (document.all) {
var i = 0;
for (var j = 0; j < gTabbableTags.length; j++) {
var tagElements = document.getElementsByTagName(gTabbableTags[j]);
for (var k = 0 ; k < tagElements.length; k++) {
gTabIndexes[i] = tagElements[k].tabIndex;
tagElements[k].tabIndex="-1";
i++;
}
}
}
}
function returnRefresh()
{
//alert("I am active!");
window.location.reload();
}
// For IE. Restore tab-indexes.
function restoreTabIndexes() {
if (document.all) {
var i = 0;
for (var j = 0; j < gTabbableTags.length; j++) {
var tagElements = document.getElementsByTagName(gTabbableTags[j]);
for (var k = 0 ; k < tagElements.length; k++) {
tagElements[k].tabIndex = gTabIndexes[i];
tagElements[k].tabEnabled = true;
i++;
}
}
}
}
/**
* Hides all drop down form select boxes on the screen so they do not appear above the mask layer.
* IE has a problem with wanted select form tags to always be the topmost z-index or layer
*
* Thanks for the code Scott!
*/
function hideSelectBoxes() {
var x = document.getElementsByTagName("SELECT");
for (i=0;x && i < x.length; i++) {
x[i].style.visibility = "hidden";
}
}
/**
* Makes all drop down form select boxes on the screen visible so they do not
* reappear after the dialog is closed.
*
* IE has a problem with wanting select form tags to always be the
* topmost z-index or layer.
*/
function displaySelectBoxes() {
var x = document.getElementsByTagName("SELECT");
for (i=0;x && i < x.length; i++){
x[i].style.visibility = "visible";
}
}

6
export/html/snakes/modalContent.html

@ -8,7 +8,11 @@
</head> </head>
<body bgcolor="#CCFF66" style="font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size:13px;"> <body bgcolor="#CCFF66" style="font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size:13px;">
<h2>Συγχαρητήρια! </h2>Μόλις ολοκλήρωσες με επιτυχία το παιχνίδι.<p>Το σκορ σου δείχνει το <strong>ποσοστό % των σωστών απαντήσεων</strong>, στο σύνολο των ερωτήσεων που σου έγιναν.</p><p>Θα ήθελες να ξαναδοκιμάσεις;</p> <button onclick="window.top.hidePopWin(true)">Ναι, θα παίξω ξανά!</button> <button onclick="window.top.hidePopWin()">Όχι, ευχαριστώ</button> <h2>Συγχαρητήρια! </h2>Μόλις ολοκλήρωσες με επιτυχία το παιχνίδι.
<p>Το σκορ σου δείχνει το <strong>ποσοστό % των σωστών απαντήσεων</strong>, στο σύνολο των ερωτήσεων που σου έγιναν.</p>
<p>Θα ήθελες να ξαναδοκιμάσεις;</p>
<button onclick="window.top.hidePopWin(true)">Ναι, θα παίξω ξανά!</button>
<button onclick="window.top.hidePopWin()">Όχι, ευχαριστώ</button>
</body> </body>
</html> </html>

1
export/javame/hangman/simple/lang/en_utf8/language.txt

@ -1,4 +1,3 @@
encoding=en_utf8 encoding=en_utf8
exit=Exit exit=Exit
keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ# keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ#

1
export/javame/hangman/simple/lang/es_utf8/language.txt

@ -1,4 +1,3 @@
encoding=es_utf8 encoding=es_utf8
exit=Salir exit=Salir
keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9# keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9#

1
export/javame/hangmanp/simple/lang/en_utf8/language.txt

@ -1,4 +1,3 @@
encoding=en_utf8 encoding=en_utf8
exit=Exit exit=Exit
keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ# keyboardletters=2:ABC#3:DEF#4:GHI#5:JKL#6:MNO#7:PQRS#8:TUV#9:WXYZ#

1
export/javame/hangmanp/simple/lang/es_utf8/language.txt

@ -1,4 +1,3 @@
encoding=es_utf8 encoding=es_utf8
exit=Salir exit=Salir
keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9# keyboardletters=2:ABC2ÁªÀÇ#3:DEF3ÉÈ#4:GHI4ÍÌ#5:JKL5#6:MNÑO6ÓÒº#7:PQRS7#8:TUV8ÚÜÙ#9:WXYZ9#

4
exporthtml.php

@ -361,7 +361,7 @@ function game_onexporthtml_snakes( $game, $html, $destdir, $context) {
ob_start(); ob_start();
// Here is the code of hangman. // Here is the code of Snakes and Ladders.
require( "exporthtml_snakes.php"); require( "exporthtml_snakes.php");
$outputstring = ob_get_contents(); $outputstring = ob_get_contents();
@ -384,6 +384,8 @@ function game_onexporthtml_snakes( $game, $html, $destdir, $context) {
mkdir( $destdir .'/js'); mkdir( $destdir .'/js');
$src = $CFG->dirroot.'/mod/game/export/html/snakes/js'; $src = $CFG->dirroot.'/mod/game/export/html/snakes/js';
game_copyfiles( $src, $destdir.'/js'); game_copyfiles( $src, $destdir.'/js');
unzip_file($destdir.'/js/js.zip', $destdir.'/js', false);
unlink( $destdir.'/js/js.zip');
mkdir( $destdir .'/images'); mkdir( $destdir .'/images');
$destfile = $destdir.'/images/'.$board->fileboard; $destfile = $destdir.'/images/'.$board->fileboard;

Loading…
Cancel
Save