Merge remote-tracking branch 'origin/develop' into claudio-dev

preferencesAboutTextFull
Claudio Valerio 12 years ago
commit 8182c39bf8
  1. 8
      resources/library/interactivities/Ass images.wgt/js/script.js
  2. 8
      resources/library/interactivities/Ass sons.wgt/js/script.js
  3. 22
      resources/library/interactivities/Ass sons.wgt/locales/fr/js/script.js
  4. 8
      resources/library/interactivities/Cat images.wgt/js/script.js
  5. 2
      resources/library/interactivities/Cat images.wgt/locales/fr/js/script.js
  6. 8
      resources/library/interactivities/Cat text.wgt/js/script.js
  7. 2
      resources/library/interactivities/Choisir.wgt/locales/fr/scripts/selQuestionApp.js
  8. 8
      resources/library/interactivities/Choisir.wgt/scripts/selQuestionApp.js
  9. 157
      resources/library/interactivities/Contraste.wgt/css/basic.css
  10. BIN
      resources/library/interactivities/Contraste.wgt/images/ar_down.png
  11. BIN
      resources/library/interactivities/Contraste.wgt/images/ar_down_white.png
  12. BIN
      resources/library/interactivities/Contraste.wgt/images/parameters-bg.png
  13. BIN
      resources/library/interactivities/Contraste.wgt/images/plus-white.png
  14. BIN
      resources/library/interactivities/Contraste.wgt/images/plus.png
  15. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-display.png
  16. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-edit.png
  17. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-help-white.png
  18. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-help.png
  19. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-toolbar-help.png
  20. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-toolbar-reload-white.png
  21. BIN
      resources/library/interactivities/Contraste.wgt/images/slate-toolbar-reload.png
  22. BIN
      resources/library/interactivities/Contraste.wgt/images/toolbar-edit.png
  23. BIN
      resources/library/interactivities/Contraste.wgt/images/toolbar-help.png
  24. BIN
      resources/library/interactivities/Contraste.wgt/images/toolbar-reload.png
  25. 26
      resources/library/interactivities/Contraste.wgt/index.html
  26. 26
      resources/library/interactivities/Contraste.wgt/locales/fr/index.html
  27. 149
      resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js
  28. 18
      resources/library/interactivities/Contraste.wgt/locales/ru/index.html
  29. 127
      resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js
  30. 129
      resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js
  31. 52
      src/domain/UBGraphicsWidgetItem.cpp
  32. 5
      src/domain/UBGraphicsWidgetItem.h

@ -1,14 +1,14 @@
var sankoreLang = { var sankoreLang = {
display: "Close", display: "Display",
edit: "Edit", edit: "Edit",
short_desc: "Select the number \"three\".", short_desc: "Select the number \"three\".",
add: "Add new block", add: "Add new block",
enter: "Enter your instruction here ...", enter: "Enter your instruction here ...",
wgt_name: "Associate images", wgt_name: "Associate images",
reload: "Reload", reload: "Reload",
slate: "Wood", slate: "slate",
pad: "Pad", pad: "pad",
none: "None", none: "none",
help: "Help", help: "Help",
help_content: "This is an example of help content ...", help_content: "This is an example of help content ...",
theme: "Theme" theme: "Theme"

@ -1,14 +1,14 @@
var sankoreLang = { var sankoreLang = {
display: "Close", display: "Display",
edit: "Edit", edit: "Edit",
short_desc: "How many signals do you hear?", short_desc: "How many signals do you hear?",
add: "Add new block", add: "Add new block",
enter: "Enter your instruction here ...", enter: "Enter your instruction here ...",
wgt_name: "Associate to the audio", wgt_name: "Associate to the audio",
reload: "Reload", reload: "Reload",
slate: "Wood", slate: "slate",
pad: "Pad", pad: "pad",
none: "None", none: "none",
help: "Help", help: "Help",
help_content: "This is an example of help content ...", help_content: "This is an example of help content ...",
theme: "Theme" theme: "Theme"

@ -1,14 +1,14 @@
var sankoreLang = { var sankoreLang = {
display: "Fermer", display: "Afficher",
edit: "Modifier", edit: "Modifier",
short_desc: "Combien de signaux entendez-vous?", short_desc: "Combien de signaux entendez-vous?",
add: "Nouveau bloc", add: "Nouveau bloc",
enter: "Saisir votre description ici ...", enter: "Saisir votre description ici ...",
wgt_name: "Associer aux sons", wgt_name: "Associer aux sons",
reload: "Recharger", reload: "Recharger",
slate: "Bois", slate: "ardoise",
pad: "Pad", pad: "tablette",
none: "Aucun", none: "aucun",
help: "Aide", help: "Aide",
help_content: "<p><h2>Associer aux sons</h2></p>"+ help_content: "<p><h2>Associer aux sons</h2></p>"+
"<p><h3>Faire correspondre une image à un son.</h3></p>"+ "<p><h3>Faire correspondre une image à un son.</h3></p>"+
@ -21,7 +21,7 @@ var sankoreLang = {
"<ul><li>de choisir le thème de l’interactivité : tablette, ardoise ou aucun (par défaut aucun),</li>"+ "<ul><li>de choisir le thème de l’interactivité : tablette, ardoise ou aucun (par défaut aucun),</li>"+
"<li>de modifier un exercice ou d’en créer de nouveaux dans la même activité.</li></ul>"+ "<li>de modifier un exercice ou d’en créer de nouveaux dans la même activité.</li></ul>"+
<<<<<<< HEAD
"<p>En mode édition, pour créer un nouvel exercice, cliquez sur “Nouveau bloc” en bas, puis </p>"+ "<p>En mode édition, pour créer un nouvel exercice, cliquez sur “Nouveau bloc” en bas, puis </p>"+
"<ul><li>insérez une consigne en cliquant sur le champ de texte “Saisir votre description ici ...”,"+ "<ul><li>insérez une consigne en cliquant sur le champ de texte “Saisir votre description ici ...”,"+
"<li>insérez un son dans la zone à gauche de la consigne par glisser-déposer d’un son à partir de votre bibliothèque,</li>"+ "<li>insérez un son dans la zone à gauche de la consigne par glisser-déposer d’un son à partir de votre bibliothèque,</li>"+
@ -30,16 +30,8 @@ var sankoreLang = {
"<li>définissez l’image correcte de l’interactivité en cliquant sur le bouton valider “v” situé en bas à droite de l’image concernée.</li></ul>"+ "<li>définissez l’image correcte de l’interactivité en cliquant sur le bouton valider “v” situé en bas à droite de l’image concernée.</li></ul>"+
"<p>Pour supprimer une zone image, cliquez sur la croix située dans le coin supérieur droit de l’image.</p>"+ "<p>Pour supprimer une zone image, cliquez sur la croix située dans le coin supérieur droit de l’image.</p>"+
"<p>Pour remplacer un son, glissez-déposez simplement un nouveau son.</p>"+ "<p>Pour remplacer un son, glissez-déposez simplement un nouveau son.</p>"+
=======
"<p>En mode édition, pour créer un nouvel exercice, cliquez sur “Nouveau bloc” en bas, puis </p>"+
"<ul><li>insérez une consigne en cliquant sur le champ de texte “Saisir votre description ici ...”,"+
"<li>insérez un son dans la zone à gauche de la consigne par glisser-déposer d’un son à partir de votre bibliothèque,</li>"+
"<li>ajoutez des zones image en cliquant sur le gros signe + en dessous,</li>"+
"<li>insérez des images par glisser-déposer des images à partir de votre bibliothèque,</li>"+
"<li>définissez l’image correcte de l’interactivité en cliquant sur le bouton valider “v” situé en bas à droite de l’image concernée.</li></ul>"+
"<p>Pour supprimer une zone image, cliquez sur la croix située dans le coin supérieur droit de l’image.</p>"+
"<p>Pour remplacer un son, glissez-déposez simplement un nouveau son.</p>"+
>>>>>>> 986e8e8f3435c5208d294c97db33e0cf54790514
"<p>Pour supprimer un exercice, cliquez sur la croix à gauche du numéro de l’exercice.</p>"+ "<p>Pour supprimer un exercice, cliquez sur la croix à gauche du numéro de l’exercice.</p>"+

@ -1,5 +1,5 @@
var sankoreLang = { var sankoreLang = {
display: "Close", display: "Display",
edit: "Edit", edit: "Edit",
first_desc: "Odd numbers", first_desc: "Odd numbers",
second_desc: "Even numbers", second_desc: "Even numbers",
@ -7,9 +7,9 @@ var sankoreLang = {
add: "Add new block", add: "Add new block",
wgt_name: "Categorize images", wgt_name: "Categorize images",
reload: "Reload", reload: "Reload",
slate: "Wood", slate: "slate",
pad: "Pad", pad: "pad",
none: "None", none: "none",
help: "Help", help: "Help",
help_content: "This is an example of help content ...", help_content: "This is an example of help content ...",
theme: "Theme" theme: "Theme"

@ -1,5 +1,5 @@
var sankoreLang = { var sankoreLang = {
display: "Fermer", display: "Afficher",
edit: "Modifier", edit: "Modifier",
first_desc: "Les nombres impairs", first_desc: "Les nombres impairs",
second_desc: "Les nombres pairs", second_desc: "Les nombres pairs",

@ -1,5 +1,5 @@
var sankoreLang = { var sankoreLang = {
display: "Close", display: "Display",
edit: "Edit", edit: "Edit",
first_desc: "Fruits", first_desc: "Fruits",
second_desc: "Vegetables", second_desc: "Vegetables",
@ -13,9 +13,9 @@ var sankoreLang = {
text: "Some text", text: "Some text",
wgt_name: "Categorize text", wgt_name: "Categorize text",
reload: "Reload", reload: "Reload",
slate: "Wood", slate: "slate",
pad: "Pad", pad: "pad",
none: "None", none: "none",
help: "Help", help: "Help",
help_content: "This is an example of help content ...", help_content: "This is an example of help content ...",
theme: "Theme" theme: "Theme"

@ -15,7 +15,7 @@
var sankoreLang = { var sankoreLang = {
edit: "Modifier", edit: "Modifier",
display:"Fermer", display:"Afficher",
question:"La question", question:"La question",
example_question:"Ceci est un exemple de question", example_question:"Ceci est un exemple de question",
answer:"Ceci est une réponse possible", answer:"Ceci est une réponse possible",

@ -15,7 +15,7 @@
var sankoreLang = { var sankoreLang = {
edit: "Edit", edit: "Edit",
display:"Close", display:"Display",
question:"Question", question:"Question",
example_question:"This is an example of the question", example_question:"This is an example of the question",
answer:"This is one possible answer", answer:"This is one possible answer",
@ -37,9 +37,9 @@ var sankoreLang = {
a:"A", a:"A",
wgt_name: "Choose the right answer", wgt_name: "Choose the right answer",
reload: "Reload", reload: "Reload",
slate: "Wood", slate: "slate",
pad: "Pad", pad: "pad",
none: "None", none: "none",
help: "Help", help: "Help",
help_content: "This is an example of help content ...", help_content: "This is an example of help content ...",
theme: "Theme" theme: "Theme"

@ -3,7 +3,7 @@ html, body{
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
border-radius: 50px; border-radius: 35px;
overflow: hidden; overflow: hidden;
} }
@ -41,8 +41,6 @@ body{
height: 100%; height: 100%;
float: left; float: left;
background-color: black; background-color: black;
-webkit-border-top-left-radius: 7px;
-webkit-border-bottom-left-radius: 7px;
border-top-left-radius: 7px; border-top-left-radius: 7px;
border-bottom-left-radius: 7px; border-bottom-left-radius: 7px;
} }
@ -52,8 +50,6 @@ body{
height: 100%; height: 100%;
float: right; float: right;
background-color: yellow; background-color: yellow;
-webkit-border-top-right-radius: 7px;
-webkit-border-bottom-right-radius: 7px;
border-top-right-radius: 7px; border-top-right-radius: 7px;
border-bottom-right-radius: 7px; border-bottom-right-radius: 7px;
} }
@ -269,65 +265,55 @@ body{
margin: 10px 10px 0 10px; margin: 10px 10px 0 10px;
padding: 0; padding: 0;
float: left; float: left;
/*font-family: "Lobster13Regular";*/ font-family: Arial,Helvetica,sans-serif;
font-size: 24px; font-size: 24px;
color: #8c5730; color: #7F613F;
text-shadow: #FFDCA9 0 1px 0;
} }
#wgt_reload, #wgt_edit, #wgt_display,#wgt_add, #wgt_help{ #wgt_reload, #wgt_edit, #wgt_display, #wgt_help{
cursor: pointer; cursor: pointer;
height: 44px;
margin: 10px 10px 0 0; margin: 10px 10px 0 0;
float: right; float: right;
/*font-family: "Lobster13Regular";*/ font-family: Arial,Helvetica,sans-serif;
font-size: 24px; font-size: 24px;
color: #8c5730; line-height: 32px;
} }
#wgt_display{ #wgt_display{
padding-left: 40px; padding-left: 35px;
background-image: url(../images/slate-edit.png); background: url(../images/toolbar-edit.png) left -32px no-repeat;
background-repeat: no-repeat; color: white;
background-position: top 0;
display: none; display: none;
} }
#wgt_edit{ #wgt_edit{
padding-left: 40px; padding-left: 35px;
background-image: url(../images/slate-edit.png); background: url(../images/slate-toolbar-edit.png) left top no-repeat;
background-repeat: no-repeat; color: #7F613F;
background-position: top 0; text-shadow: #FFDCA9 0 1px 0;
} }
#wgt_reload{ #wgt_reload{
padding-left: 40px; padding-left: 35px;
background-image: url(../images/slate-toolbar-reload.png); background: url(../images/slate-toolbar-reload.png) left top no-repeat;
background-repeat: no-repeat; color: #7F613F;
background-position: top 0; text-shadow: #FFDCA9 0 1px 0;
} }
#wgt_add{ #wgt_add{
padding-left: 40px; margin-left: 10px;
background-image: url(../images/plus.png); padding-right: 10px;
background-repeat: no-repeat; border: 1px solid #666;
background-position: top 0; border-radius: 15px;
display: none; padding-left: 30px;
background: url(../images/plus.png) -2px -2px no-repeat;
display: inline-block;
} }
.style_select{ #wgt_add:hover{
width: 120px; border-color: black;
/*font-family: "Lobster13Regular";*/ cursor: pointer;
font-size: 24px;
float: right;
margin: 10px 20px 0 0;
border-radius: 10px;
background-image: url(../images/ar_down.png);
background-color: #d4aa79;
color: #8c5730;
background-position: 105px 11px;
background-repeat: no-repeat;
-webkit-appearance: menulist-text;
display: none;
} }
.btl_pad{ .btl_pad{
@ -362,55 +348,50 @@ body{
background-image: url(../images/pad-bottom-right.png) !important; background-image: url(../images/pad-bottom-right.png) !important;
} }
.pad_color{ .without_radius{
color: white !important; border-radius: 0 !important;
}
.pad_reload{
background-image: url(../images/slate-toolbar-reload-white.png) !important;
} }
.pad_edit{ .without_back{
background-image: url(../images/slate-display.png) !important; background: none !important;
} }
.pad_add{ .pad_color{
background-image: url(../images/plus-white.png) !important; color: #FC9 !important;
text-shadow: none !important;
} }
.pad_select{ .pad_reload{
background-color: black !important; background: url(../images/toolbar-reload.png) left top no-repeat !important;
color: white !important;
background-image: url(../images/ar_down_white.png) !important;
} }
.without_radius{ .pad_edit{
border-radius: 0 !important; background: url(../images/toolbar-edit.png) left top no-repeat !important;
} }
.without_back{ .pad_help{
background: none !important; background: url(../images/toolbar-help.png) left top no-repeat !important;
} }
.none_select{ .help_wood{
background-color: #333 !important; background: url(../images/slate-toolbar-help.png) left -32px no-repeat !important;
color: white !important; color: white !important;
background-image: url(../images/ar_down_white.png) !important; text-shadow: #7F613F 0 -1px 0 !important;
} }
.pad_help{ .help_pad{
background-image: url(../images/slate-help-white.png) !important; background: url(../images/toolbar-help.png) left -32px no-repeat !important;
color: white !important;
} }
#wgt_help{ #wgt_help{
padding-left: 32px; padding-left: 35px;
background-image: url(../images/slate-help.png); background: url(../images/slate-toolbar-help.png) left top no-repeat;
background-repeat: no-repeat; color: #7F613F;
background-position: top 0; text-shadow: #FFDCA9 0 1px 0;
} }
#help{ #help{
width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
display: none; display: none;
@ -419,5 +400,37 @@ body{
} }
.open{ .open{
}
#parameters{
display: none;
margin: 40px 0 0 0;
padding: 10px 20px;
background: url("../images/parameters-bg.png");
border-radius: 4px 4px 0 0;
}
.inline{
display: inline-block;
font-family: "helvetica neue";
font-size: 14px;
color: #666;
}
#parameters label {
font-style: italic;
}
#style_select{
margin-left: 10px;
}
.display_wood{
background: url(../images/slate-toolbar-edit.png) left -32px no-repeat !important;
text-shadow: #7F613F 0 -1px 0;
}
.radius_ft{
border-radius: 45px !important;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/basic.css"/> <link rel="stylesheet" type="text/css" href="css/basic.css"/>
<link rel="stylesheet" href="css/fonts/Lobster/stylesheet.css"> <link rel="stylesheet" href="css/fonts/Lobster/stylesheet.css">
<link rel="stylesheet" href="css/fonts/SF-Toontime/stylesheet.css"> <link rel="stylesheet" href="css/fonts/SF-Toontime/stylesheet.css">
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script> <script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/blackYellow.js"></script> <script type="text/javascript" src="scripts/blackYellow.js"></script>
@ -51,27 +51,33 @@
<div id="wgt_reload"></div> <div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
<div id="wgt_add"></div>
<select class="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</td> </td>
<td class="b_top_right">&nbsp;</td> <td class="b_top_right">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td class="b_center_left">&nbsp;</td> <td class="b_center_left">&nbsp;</td>
<td> <td>
<div id="help"></div> <div id="help"></div>
<div id="parameters">
<div class="inline">
<label>
<select id="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</label>
<div id="wgt_add"></div>
</div>
</div>
<div id="data"> <div id="data">
</div> </div>
</td> </td>
<td class="b_center_right">&nbsp;</td> <td class="b_center_right">&nbsp;</td>
</tr> </tr>
<tr style="height: 54px;"> <tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td> <td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td> <td class="b_bottom_center">&nbsp;</td>

@ -9,7 +9,7 @@ and open the template in the editor.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../css/basic.css"/> <link rel="stylesheet" type="text/css" href="../../css/basic.css"/>
<link rel="stylesheet" href="../../css/fonts/Lobster/stylesheet.css"> <link rel="stylesheet" href="../../css/fonts/Lobster/stylesheet.css">
<link rel="stylesheet" href="../../css/fonts/SF-Toontime/stylesheet.css"> <link rel="stylesheet" href="../../css/fonts/SF-Toontime/stylesheet.css">
<script type="text/javascript" src="../../scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="../../scripts/jquery-1.6.2.min.js"></script>
<script src="../../scripts/jquery.disable.text.select.js" type="text/javascript"></script> <script src="../../scripts/jquery.disable.text.select.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/blackYellow.js"></script> <script type="text/javascript" src="scripts/blackYellow.js"></script>
@ -31,27 +31,33 @@ and open the template in the editor.
<div id="wgt_reload"></div> <div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
<div id="wgt_add"></div>
<select class="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</td> </td>
<td class="b_top_right">&nbsp;</td> <td class="b_top_right">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td class="b_center_left">&nbsp;</td> <td class="b_center_left">&nbsp;</td>
<td> <td>
<div id="help"></div> <div id="help"></div>
<div id="parameters">
<div class="inline">
<label>
<select id="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</label>
<div id="wgt_add"></div>
</div>
</div>
<div id="data"> <div id="data">
</div> </div>
</td> </td>
<td class="b_center_right">&nbsp;</td> <td class="b_center_right">&nbsp;</td>
</tr> </tr>
<tr style="height: 54px;"> <tr style="height: 54px;">
<td class="b_bottom_left">&nbsp;</td> <td class="b_bottom_left">&nbsp;</td>
<td class="b_bottom_center">&nbsp;</td> <td class="b_bottom_center">&nbsp;</td>

@ -14,7 +14,7 @@
*/ */
var sankoreLang = { var sankoreLang = {
display: "Afficher", display: "Fermer",
edit: "Modifier", edit: "Modifier",
add: "Ajouter", add: "Ajouter",
enter_data: "Saisir la donnée:", enter_data: "Saisir la donnée:",
@ -28,24 +28,25 @@ var sankoreLang = {
none: "aucun", none: "aucun",
help: "Aide", help: "Aide",
help_content: "<p><h2>Contraste</h2></p>"+ help_content: "<p><h2>Contraste</h2></p>"+
"<p><h3>Jeu de couleurs.</h3></p>"+ "<p><h3>Jeu de couleurs.</h3></p>"+
"<p>Cette activité permet de masquer et d’afficher du texte en jouant sur la couleur de fond (jaune ou noir). Le but est de pouvoir faire apparaître des données en passant d’une couleur à l’autre.</p>"+ "<p>Cette activité permet de masquer et d’afficher du texte en jouant sur la couleur de fond (jaune ou noir). Le but est de pouvoir faire apparaître des données en passant d’une couleur à l’autre.</p>"+
"<p>Le bouton “Recharger” réinitialise les exercices.</p>"+ "<p>Le bouton “Recharger” réinitialise les exercices.</p>"+
"<p>Le bouton “Modifier” vous permet :</p>"+ "<p>Le bouton “Modifier” vous permet :</p>"+
"<ul><li>de choisir le thème de l’interactivité : tablette, ardoise ou aucun (par défaut aucun),</li>"+ "<ul><li>de choisir le thème de l’interactivité : tablette, ardoise ou aucun (par défaut aucun),</li>"+
"<li>de modifier un exercice ou d’en créer de nouveaux dans la même activité.</li></ul>"+ "<li>de modifier un exercice ou d’en créer de nouveaux dans la même activité.</li></ul>"+
"<p>En mode édition, pour créer un nouvel exercice, cliquez sur “+ Ajouter” en haut, puis</p>"+ "<p>En mode édition, pour créer un nouvel exercice, cliquez sur “+ Ajouter” en haut, puis</p>"+
"<ul><li>saisissez la donnée par exemple “3x15”,</li>"+ "<ul><li>saisissez la donnée par exemple “3x15”,</li>"+
"<li>saisissez le résultat, par exemple “15” et cliquez sur “OK”.</li></ul>"+ "<li>saisissez le résultat, par exemple “15” et cliquez sur “OK”.</li></ul>"+
"<p>Pour modifier les données ou les résultats, cliquez directement sur l’exercice.</p>"+ "<p>Pour modifier les données ou les résultats, cliquez directement sur l’exercice.</p>"+
"<p>Pour supprimer un exercice, cliquez sur la croix en haut à droite de l’exercice.</p>"+ "<p>Pour supprimer un exercice, cliquez sur la croix en haut à droite de l’exercice.</p>"+
"<p>Le bouton “Afficher” vous permet d’utiliser l’activité.</p>" "<p>Le bouton “Afficher” vous permet d’utiliser l’activité.</p>",
theme: "Thème"
}; };
function init(){ function init(){
@ -61,6 +62,8 @@ function init(){
var flagForSelect = false; var flagForSelect = false;
var dragElement = null; //the element that must be dragging var dragElement = null; //the element that must be dragging
var lang = ""; //locale language var lang = ""; //locale language
var resizeFlag = true;
var coords = { var coords = {
left:0, left:0,
top:0 top:0
@ -82,9 +85,11 @@ function init(){
$("#wgt_reload").text(sankoreLang.reload); $("#wgt_reload").text(sankoreLang.reload);
$("#wgt_help").text(sankoreLang.help); $("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content); $("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none); $("#style_select option[value='3']").text(sankoreLang.none);
var tmpl = $("div.inline label").html();
$("div.inline label").html(sankoreLang.theme + tmpl)
if(window.sankore){ if(window.sankore){
if(sankore.preference("blackYellowData","")){ if(sankore.preference("blackYellowData","")){
@ -109,7 +114,7 @@ function init(){
if(window.sankore){ if(window.sankore){
if(sankore.preference("by_style","")){ if(sankore.preference("by_style","")){
changeStyle(sankore.preference("by_style","")); changeStyle(sankore.preference("by_style",""));
$(".style_select").val(sankore.preference("by_style","")); $("#style_select").val(sankore.preference("by_style",""));
} else } else
changeStyle("3") changeStyle("3")
} else } else
@ -120,9 +125,15 @@ function init(){
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
$(this).addClass("selected"); $(this).addClass("selected");
$("#wgt_edit").removeClass("selected"); $("#wgt_edit").removeClass("selected");
$(".style_select").css("display","none"); $("#parameters").css("display","none");
var tmpwh = $(window).height();
var tmpww = $(window).width();
resizeFlag = true;
window.resizeTo(tmpww, tmpwh - 44)
$("#data").css("padding-bottom","");
$("#leftDiv").css("border-top-left-radius","7px");
$("#rightDiv").css("border-top-right-radius","7px");
$(this).css("display", "none"); $(this).css("display", "none");
$("#wgt_add").css("display", "none");
$("#wgt_edit").css("display", "block"); $("#wgt_edit").css("display", "block");
mode = false; mode = false;
$(".leftDiv, .rightDiv").animate({ $(".leftDiv, .rightDiv").animate({
@ -135,7 +146,7 @@ function init(){
tmpReadyTask.width($(domElem).width()) tmpReadyTask.width($(domElem).width())
.height($(domElem).height()) .height($(domElem).height())
.css("position","absolute") .css("position","absolute")
.css("top",$(domElem).position().top) .css("top",$(domElem).position().top - 40)
.css("left",$(domElem).position().left) .css("left",$(domElem).position().left)
.find(".taskContainer").removeAttr("contenteditable"); .find(".taskContainer").removeAttr("contenteditable");
@ -146,15 +157,22 @@ function init(){
opacityChanged = false; opacityChanged = false;
} }
}); });
$(document).disableTextSelect(); $(document).disableTextSelect();
} }
} else { } else {
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
$(this).addClass("selected"); $(this).addClass("selected");
$("#wgt_display").removeClass("selected"); $("#wgt_display").removeClass("selected");
$(".style_select").css("display","block"); $("#parameters").css("display","block");
tmpwh = $(window).height();
tmpww = $(window).width();
resizeFlag = true;
window.resizeTo(tmpww, tmpwh + 44)
$("#data").css("padding-bottom","42px");
$("#leftDiv").css("border-top-left-radius","0px");
$("#rightDiv").css("border-top-right-radius","0px");
$(this).css("display", "none"); $(this).css("display", "none");
$("#wgt_add").css("display", "block");
$("#wgt_display").css("display", "block"); $("#wgt_display").css("display", "block");
mode = true; mode = true;
$(document).enableTextSelect(); $(document).enableTextSelect();
@ -189,12 +207,15 @@ function init(){
$("#wgt_help").click(function(){ $("#wgt_help").click(function(){
var tmp = $(this); var tmp = $(this);
if($(this).hasClass("open")){ if($(this).hasClass("open")){
$(this).removeClass("help_pad").removeClass("help_wood")
$("#help").slideUp("100", function(){ $("#help").slideUp("100", function(){
tmp.removeClass("open"); tmp.removeClass("open");
$("#data").show(); $("#data").show();
($("#wgt_edit").hasClass("selected"))?$("#parameters").show():'';
}); });
} else { } else {
$("#data").hide(); ($("#style_select").val() == 1)?$(this).removeClass("help_pad").addClass("help_wood"):$(this).removeClass("help_wood").addClass("help_pad");
$("#data, #parameters").hide();
$("#help").slideDown("100", function(){ $("#help").slideDown("100", function(){
tmp.addClass("open"); tmp.addClass("open");
}); });
@ -218,10 +239,10 @@ function init(){
$(document).disableTextSelect(); $(document).disableTextSelect();
}); });
$(".style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='2']").text(sankoreLang.pad);
$(".style_select").change(function (event){ $("#style_select").change(function (event){
changeStyle($(this).find("option:selected").val()); changeStyle($(this).find("option:selected").val());
}) })
@ -372,12 +393,12 @@ function init(){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px"); curr.css("top", prevBottom + 15 + "px");
else else
curr.css("top", "60px").css("left", prevLeft + 255 + "px"); curr.css("top", "100px").css("left", prevLeft + 255 + "px");
} else { } else {
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");
else else
curr.css("top", "60px").css("left", prevLeft + 255 + "px"); curr.css("top", "100px").css("left", prevLeft + 255 + "px");
} }
prevBottom = curr.position().top + curr.height(), prevBottom = curr.position().top + curr.height(),
prevLeft = curr.position().left; prevLeft = curr.position().left;
@ -390,28 +411,31 @@ function init(){
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){ $(window).resize(function(){
if($("#wgt_edit").hasClass("selected")){ if(!resizeFlag){
if($(".editContainer").size() > 1){ if($("#wgt_edit").hasClass("selected")){
var prev = $(".editContainer:first"), if($(".editContainer").size() > 1){
prevBottom = prev.position().top + prev.height(), var prev = $(".editContainer:first"),
prevLeft = prev.position().left; prevBottom = prev.position().top + prev.height(),
recursionCall(prevBottom, prevLeft, prev.next()); prevLeft = prev.position().left;
recursionCall(prevBottom, prevLeft, prev.next());
}
} else {
var tmp_array = [];
$(".readyTask").each(function(){
tmp_array.push($(this));
});
orderItems(tmp_array);
} }
} else { popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
var tmp_array = []; popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(".readyTask").each(function(){ } else
tmp_array.push($(this)); resizeFlag = false;
});
orderItems(tmp_array);
}
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
}); });
if (window.widget) { if (window.widget) {
window.widget.onleave = function(){ window.widget.onleave = function(){
exportToSankore(); exportToSankore();
sankore.setPreference("by_style", $(".style_select").find("option:selected").val()); sankore.setPreference("by_style", $("#style_select").find("option:selected").val());
} }
} }
@ -434,7 +458,7 @@ function init(){
objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text(); objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text();
objToExport.width = $(domElem).width(); objToExport.width = $(domElem).width();
objToExport.height = $(domElem).height(); objToExport.height = $(domElem).height();
objToExport.top = $(domElem).position().top; objToExport.top = $(domElem).position().top - 40;
objToExport.left = $(domElem).position().left; objToExport.left = $(domElem).position().left;
arrayToExport.push(objToExport); arrayToExport.push(objToExport);
}); });
@ -493,14 +517,14 @@ function reloadItems(){
//order items //order items
function orderItems(items){ function orderItems(items){
var bottom = 45, var bottom = ($("#wgt_edit").hasClass("selected"))?85:45,
lastItemLeft = 54; lastItemLeft = 54;
for (var i in items){ for (var i in items){
if((bottom + items[i].height()) < ($(window).height() - 54)){ if((bottom + items[i].height()) < ($(window).height() - 54)){
items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data"); items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
bottom += items[i].height() + 15; bottom += items[i].height() + 15;
} else { } else {
bottom = 60; bottom = 100;
lastItemLeft += 255; lastItemLeft += 255;
items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data"); items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data");
bottom += items[i].height(); bottom += items[i].height();
@ -525,7 +549,7 @@ function shuffle( arr )
//adding a new task to the page //adding a new task to the page
function addTask(expression, result){ function addTask(expression, result){
var lastItem = $(".editContainer:last"), var lastItem = $(".editContainer:last"),
lastItemPos = lastItem.length ? lastItem.position().top : 45, lastItemPos = lastItem.length ? lastItem.position().top : 85,
lastItemHeight = lastItem.length ? lastItem.height() : 0, lastItemHeight = lastItem.length ? lastItem.height() : 0,
lastItemLeft = lastItem.length ? lastItem.position().left : 54; lastItemLeft = lastItem.length ? lastItem.position().left : 54;
var bottom = lastItemPos + lastItemHeight + 85; var bottom = lastItemPos + lastItemHeight + 85;
@ -537,7 +561,7 @@ function addTask(expression, result){
if(bottom < ($(window).height() - 54)){ if(bottom < ($(window).height() - 54)){
editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data"); editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
} else { } else {
lastItemPos = 45; lastItemPos = 85;
editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data"); editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data");
} }
main.appendTo(editContent); main.appendTo(editContent);
@ -556,13 +580,12 @@ function changeStyle(val){
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); $("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_help").removeClass("pad_color").removeClass("pad_help"); $("#wgt_help").removeClass("pad_color").removeClass("pad_help");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_add").removeClass("pad_color").removeClass("pad_add");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
$(".style_select").removeClass("pad_select").removeClass("none_select").val(val); $("#wgt_display").addClass("display_wood");
$("body, html").removeClass("without_radius"); $("#style_select").val(val);
$("body, html").removeClass("without_radius").addClass("radius_ft");
break; break;
case "2": case "2":
$(".b_top_left").addClass("btl_pad").removeClass("without_back"); $(".b_top_left").addClass("btl_pad").removeClass("without_back");
@ -574,13 +597,12 @@ function changeStyle(val){
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_help").addClass("pad_color").addClass("pad_help"); $("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_add").addClass("pad_color").addClass("pad_add");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
$(".style_select").addClass("pad_select").removeClass("none_select").val(val); $("#wgt_display").removeClass("display_wood");
$("body, html").removeClass("without_radius"); $("#style_select").val(val);
$("body, html").removeClass("without_radius").removeClass("radius_ft");
break; break;
case "3": case "3":
$(".b_top_left").addClass("without_back").removeClass("btl_pad"); $(".b_top_left").addClass("without_back").removeClass("btl_pad");
@ -591,14 +613,13 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_add").addClass("pad_color").addClass("pad_add");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
$(".style_select").addClass("none_select").val(val); $("#wgt_display").removeClass("display_wood");
$("body, html").addClass("without_radius"); $("#style_select").val(val);
$("body, html").addClass("without_radius").removeClass("radius_ft");
break; break;
} }
if($("#wgt_edit").hasClass("selected")) if($("#wgt_edit").hasClass("selected"))

@ -31,12 +31,6 @@ and open the template in the editor.
<div id="wgt_reload"></div> <div id="wgt_reload"></div>
<div id="wgt_display" class="selected"></div> <div id="wgt_display" class="selected"></div>
<div id="wgt_edit"></div> <div id="wgt_edit"></div>
<div id="wgt_add"></div>
<select class="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</td> </td>
<td class="b_top_right">&nbsp;</td> <td class="b_top_right">&nbsp;</td>
</tr> </tr>
@ -45,6 +39,18 @@ and open the template in the editor.
<td class="b_center_left">&nbsp;</td> <td class="b_center_left">&nbsp;</td>
<td> <td>
<div id="help"></div> <div id="help"></div>
<div id="parameters">
<div class="inline">
<label>
<select id="style_select">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
</label>
<div id="wgt_add"></div>
</div>
</div>
<div id="data"> <div id="data">
</div> </div>

@ -14,7 +14,7 @@
*/ */
var sankoreLang = { var sankoreLang = {
display: "Показать", display: "Закрыть",
edit: "Изменить", edit: "Изменить",
add: "Добавить", add: "Добавить",
enter_data: "Введите вопрос:", enter_data: "Введите вопрос:",
@ -27,7 +27,8 @@ var sankoreLang = {
pad: "планшет", pad: "планшет",
none: "нет", none: "нет",
help: "Помощь", help: "Помощь",
help_content: "Пример текста помощи ..." help_content: "Пример текста помощи ...",
theme: "Тема"
}; };
function init(){ function init(){
@ -43,6 +44,8 @@ function init(){
var flagForSelect = false; var flagForSelect = false;
var dragElement = null; //the element that must be dragging var dragElement = null; //the element that must be dragging
var lang = ""; //locale language var lang = ""; //locale language
var resizeFlag = true;
var coords = { var coords = {
left:0, left:0,
top:0 top:0
@ -64,9 +67,11 @@ function init(){
$("#wgt_reload").text(sankoreLang.reload); $("#wgt_reload").text(sankoreLang.reload);
$("#wgt_help").text(sankoreLang.help); $("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content); $("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none); $("#style_select option[value='3']").text(sankoreLang.none);
var tmpl = $("div.inline label").html();
$("div.inline label").html(sankoreLang.theme + tmpl)
if(window.sankore){ if(window.sankore){
if(sankore.preference("blackYellowData","")){ if(sankore.preference("blackYellowData","")){
@ -91,7 +96,7 @@ function init(){
if(window.sankore){ if(window.sankore){
if(sankore.preference("by_style","")){ if(sankore.preference("by_style","")){
changeStyle(sankore.preference("by_style","")); changeStyle(sankore.preference("by_style",""));
$(".style_select").val(sankore.preference("by_style","")); $("#style_select").val(sankore.preference("by_style",""));
} else } else
changeStyle("3") changeStyle("3")
} else } else
@ -102,9 +107,15 @@ function init(){
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
$(this).addClass("selected"); $(this).addClass("selected");
$("#wgt_edit").removeClass("selected"); $("#wgt_edit").removeClass("selected");
$(".style_select").css("display","none"); $("#parameters").css("display","none");
var tmpwh = $(window).height();
var tmpww = $(window).width();
resizeFlag = true;
window.resizeTo(tmpww, tmpwh - 44)
$("#data").css("padding-bottom","");
$("#leftDiv").css("border-top-left-radius","7px");
$("#rightDiv").css("border-top-right-radius","7px");
$(this).css("display", "none"); $(this).css("display", "none");
$("#wgt_add").css("display", "none");
$("#wgt_edit").css("display", "block"); $("#wgt_edit").css("display", "block");
mode = false; mode = false;
$(".leftDiv, .rightDiv").animate({ $(".leftDiv, .rightDiv").animate({
@ -117,7 +128,7 @@ function init(){
tmpReadyTask.width($(domElem).width()) tmpReadyTask.width($(domElem).width())
.height($(domElem).height()) .height($(domElem).height())
.css("position","absolute") .css("position","absolute")
.css("top",$(domElem).position().top) .css("top",$(domElem).position().top - 40)
.css("left",$(domElem).position().left) .css("left",$(domElem).position().left)
.find(".taskContainer").removeAttr("contenteditable"); .find(".taskContainer").removeAttr("contenteditable");
@ -128,15 +139,22 @@ function init(){
opacityChanged = false; opacityChanged = false;
} }
}); });
$(document).disableTextSelect(); $(document).disableTextSelect();
} }
} else { } else {
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
$(this).addClass("selected"); $(this).addClass("selected");
$("#wgt_display").removeClass("selected"); $("#wgt_display").removeClass("selected");
$(".style_select").css("display","block"); $("#parameters").css("display","block");
tmpwh = $(window).height();
tmpww = $(window).width();
resizeFlag = true;
window.resizeTo(tmpww, tmpwh + 44)
$("#data").css("padding-bottom","42px");
$("#leftDiv").css("border-top-left-radius","0px");
$("#rightDiv").css("border-top-right-radius","0px");
$(this).css("display", "none"); $(this).css("display", "none");
$("#wgt_add").css("display", "block");
$("#wgt_display").css("display", "block"); $("#wgt_display").css("display", "block");
mode = true; mode = true;
$(document).enableTextSelect(); $(document).enableTextSelect();
@ -171,12 +189,15 @@ function init(){
$("#wgt_help").click(function(){ $("#wgt_help").click(function(){
var tmp = $(this); var tmp = $(this);
if($(this).hasClass("open")){ if($(this).hasClass("open")){
$(this).removeClass("help_pad").removeClass("help_wood")
$("#help").slideUp("100", function(){ $("#help").slideUp("100", function(){
tmp.removeClass("open"); tmp.removeClass("open");
$("#data").show(); $("#data").show();
($("#wgt_edit").hasClass("selected"))?$("#parameters").show():'';
}); });
} else { } else {
$("#data").hide(); ($("#style_select").val() == 1)?$(this).removeClass("help_pad").addClass("help_wood"):$(this).removeClass("help_wood").addClass("help_pad");
$("#data, #parameters").hide();
$("#help").slideDown("100", function(){ $("#help").slideDown("100", function(){
tmp.addClass("open"); tmp.addClass("open");
}); });
@ -200,10 +221,10 @@ function init(){
$(document).disableTextSelect(); $(document).disableTextSelect();
}); });
$(".style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='2']").text(sankoreLang.pad);
$(".style_select").change(function (event){ $("#style_select").change(function (event){
changeStyle($(this).find("option:selected").val()); changeStyle($(this).find("option:selected").val());
}) })
@ -354,12 +375,12 @@ function init(){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px"); curr.css("top", prevBottom + 15 + "px");
else else
curr.css("top", "60px").css("left", prevLeft + 255 + "px"); curr.css("top", "100px").css("left", prevLeft + 255 + "px");
} else { } else {
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");
else else
curr.css("top", "60px").css("left", prevLeft + 255 + "px"); curr.css("top", "100px").css("left", prevLeft + 255 + "px");
} }
prevBottom = curr.position().top + curr.height(), prevBottom = curr.position().top + curr.height(),
prevLeft = curr.position().left; prevLeft = curr.position().left;
@ -372,28 +393,31 @@ function init(){
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){ $(window).resize(function(){
if($("#wgt_edit").hasClass("selected")){ if(!resizeFlag){
if($(".editContainer").size() > 1){ if($("#wgt_edit").hasClass("selected")){
var prev = $(".editContainer:first"), if($(".editContainer").size() > 1){
prevBottom = prev.position().top + prev.height(), var prev = $(".editContainer:first"),
prevLeft = prev.position().left; prevBottom = prev.position().top + prev.height(),
recursionCall(prevBottom, prevLeft, prev.next()); prevLeft = prev.position().left;
recursionCall(prevBottom, prevLeft, prev.next());
}
} else {
var tmp_array = [];
$(".readyTask").each(function(){
tmp_array.push($(this));
});
orderItems(tmp_array);
} }
} else { popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
var tmp_array = []; popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(".readyTask").each(function(){ } else
tmp_array.push($(this)); resizeFlag = false;
});
orderItems(tmp_array);
}
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
}); });
if (window.widget) { if (window.widget) {
window.widget.onleave = function(){ window.widget.onleave = function(){
exportToSankore(); exportToSankore();
sankore.setPreference("by_style", $(".style_select").find("option:selected").val()); sankore.setPreference("by_style", $("#style_select").find("option:selected").val());
} }
} }
@ -416,7 +440,7 @@ function init(){
objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text(); objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text();
objToExport.width = $(domElem).width(); objToExport.width = $(domElem).width();
objToExport.height = $(domElem).height(); objToExport.height = $(domElem).height();
objToExport.top = $(domElem).position().top; objToExport.top = $(domElem).position().top - 40;
objToExport.left = $(domElem).position().left; objToExport.left = $(domElem).position().left;
arrayToExport.push(objToExport); arrayToExport.push(objToExport);
}); });
@ -475,14 +499,14 @@ function reloadItems(){
//order items //order items
function orderItems(items){ function orderItems(items){
var bottom = 45, var bottom = ($("#wgt_edit").hasClass("selected"))?85:45,
lastItemLeft = 54; lastItemLeft = 54;
for (var i in items){ for (var i in items){
if((bottom + items[i].height()) < ($(window).height() - 54)){ if((bottom + items[i].height()) < ($(window).height() - 54)){
items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data"); items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
bottom += items[i].height() + 15; bottom += items[i].height() + 15;
} else { } else {
bottom = 60; bottom = 100;
lastItemLeft += 255; lastItemLeft += 255;
items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data"); items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data");
bottom += items[i].height(); bottom += items[i].height();
@ -507,7 +531,7 @@ function shuffle( arr )
//adding a new task to the page //adding a new task to the page
function addTask(expression, result){ function addTask(expression, result){
var lastItem = $(".editContainer:last"), var lastItem = $(".editContainer:last"),
lastItemPos = lastItem.length ? lastItem.position().top : 45, lastItemPos = lastItem.length ? lastItem.position().top : 85,
lastItemHeight = lastItem.length ? lastItem.height() : 0, lastItemHeight = lastItem.length ? lastItem.height() : 0,
lastItemLeft = lastItem.length ? lastItem.position().left : 54; lastItemLeft = lastItem.length ? lastItem.position().left : 54;
var bottom = lastItemPos + lastItemHeight + 85; var bottom = lastItemPos + lastItemHeight + 85;
@ -519,7 +543,7 @@ function addTask(expression, result){
if(bottom < ($(window).height() - 54)){ if(bottom < ($(window).height() - 54)){
editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data"); editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
} else { } else {
lastItemPos = 45; lastItemPos = 85;
editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data"); editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data");
} }
main.appendTo(editContent); main.appendTo(editContent);
@ -538,13 +562,12 @@ function changeStyle(val){
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); $("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_help").removeClass("pad_color").removeClass("pad_help"); $("#wgt_help").removeClass("pad_color").removeClass("pad_help");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_add").removeClass("pad_color").removeClass("pad_add");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
$(".style_select").removeClass("pad_select").removeClass("none_select").val(val); $("#wgt_display").addClass("display_wood");
$("body, html").removeClass("without_radius"); $("#style_select").val(val);
$("body, html").removeClass("without_radius").addClass("radius_ft");
break; break;
case "2": case "2":
$(".b_top_left").addClass("btl_pad").removeClass("without_back"); $(".b_top_left").addClass("btl_pad").removeClass("without_back");
@ -556,13 +579,12 @@ function changeStyle(val){
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_help").addClass("pad_color").addClass("pad_help"); $("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_add").addClass("pad_color").addClass("pad_add");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
$(".style_select").addClass("pad_select").removeClass("none_select").val(val); $("#wgt_display").removeClass("display_wood");
$("body, html").removeClass("without_radius"); $("#style_select").val(val);
$("body, html").removeClass("without_radius").removeClass("radius_ft");
break; break;
case "3": case "3":
$(".b_top_left").addClass("without_back").removeClass("btl_pad"); $(".b_top_left").addClass("without_back").removeClass("btl_pad");
@ -573,14 +595,13 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_add").addClass("pad_color").addClass("pad_add");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
$(".style_select").addClass("none_select").val(val); $("#wgt_display").removeClass("display_wood");
$("body, html").addClass("without_radius"); $("#style_select").val(val);
$("body, html").addClass("without_radius").removeClass("radius_ft");
break; break;
} }
if($("#wgt_edit").hasClass("selected")) if($("#wgt_edit").hasClass("selected"))

@ -14,7 +14,7 @@
*/ */
var sankoreLang = { var sankoreLang = {
display: "Display", display: "Close",
edit: "Edit", edit: "Edit",
add: "Add", add: "Add",
enter_data: "Enter data:", enter_data: "Enter data:",
@ -23,11 +23,12 @@ var sankoreLang = {
cancel: "Cancel", cancel: "Cancel",
wgt_name: "Contrast", wgt_name: "Contrast",
reload: "Reload", reload: "Reload",
slate: "wood", slate: "slate",
pad: "pad", pad: "pad",
none: "none", none: "none",
help: "Help", help: "Help",
help_content: "This is an example of help content ..." help_content: "This is an example of help content ...",
theme: "Theme"
}; };
function init(){ function init(){
@ -43,6 +44,8 @@ function init(){
var flagForSelect = false; var flagForSelect = false;
var dragElement = null; //the element that must be dragging var dragElement = null; //the element that must be dragging
var lang = ""; //locale language var lang = ""; //locale language
var resizeFlag = true;
var coords = { var coords = {
left:0, left:0,
top:0 top:0
@ -64,9 +67,11 @@ function init(){
$("#wgt_reload").text(sankoreLang.reload); $("#wgt_reload").text(sankoreLang.reload);
$("#wgt_help").text(sankoreLang.help); $("#wgt_help").text(sankoreLang.help);
$("#help").html(sankoreLang.help_content); $("#help").html(sankoreLang.help_content);
$(".style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='2']").text(sankoreLang.pad);
$(".style_select option[value='3']").text(sankoreLang.none); $("#style_select option[value='3']").text(sankoreLang.none);
var tmpl = $("div.inline label").html();
$("div.inline label").html(sankoreLang.theme + tmpl)
if(window.sankore){ if(window.sankore){
if(sankore.preference("blackYellowData","")){ if(sankore.preference("blackYellowData","")){
@ -91,7 +96,7 @@ function init(){
if(window.sankore){ if(window.sankore){
if(sankore.preference("by_style","")){ if(sankore.preference("by_style","")){
changeStyle(sankore.preference("by_style","")); changeStyle(sankore.preference("by_style",""));
$(".style_select").val(sankore.preference("by_style","")); $("#style_select").val(sankore.preference("by_style",""));
} else } else
changeStyle("3") changeStyle("3")
} else } else
@ -102,9 +107,15 @@ function init(){
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
$(this).addClass("selected"); $(this).addClass("selected");
$("#wgt_edit").removeClass("selected"); $("#wgt_edit").removeClass("selected");
$(".style_select").css("display","none"); $("#parameters").css("display","none");
var tmpwh = $(window).height();
var tmpww = $(window).width();
resizeFlag = true;
window.resizeTo(tmpww, tmpwh - 44)
$("#data").css("padding-bottom","");
$("#leftDiv").css("border-top-left-radius","7px");
$("#rightDiv").css("border-top-right-radius","7px");
$(this).css("display", "none"); $(this).css("display", "none");
$("#wgt_add").css("display", "none");
$("#wgt_edit").css("display", "block"); $("#wgt_edit").css("display", "block");
mode = false; mode = false;
$(".leftDiv, .rightDiv").animate({ $(".leftDiv, .rightDiv").animate({
@ -117,7 +128,7 @@ function init(){
tmpReadyTask.width($(domElem).width()) tmpReadyTask.width($(domElem).width())
.height($(domElem).height()) .height($(domElem).height())
.css("position","absolute") .css("position","absolute")
.css("top",$(domElem).position().top) .css("top",$(domElem).position().top - 40)
.css("left",$(domElem).position().left) .css("left",$(domElem).position().left)
.find(".taskContainer").removeAttr("contenteditable"); .find(".taskContainer").removeAttr("contenteditable");
@ -128,15 +139,22 @@ function init(){
opacityChanged = false; opacityChanged = false;
} }
}); });
$(document).disableTextSelect(); $(document).disableTextSelect();
} }
} else { } else {
if(!$(this).hasClass("selected")){ if(!$(this).hasClass("selected")){
$(this).addClass("selected"); $(this).addClass("selected");
$("#wgt_display").removeClass("selected"); $("#wgt_display").removeClass("selected");
$(".style_select").css("display","block"); $("#parameters").css("display","block");
tmpwh = $(window).height();
tmpww = $(window).width();
resizeFlag = true;
window.resizeTo(tmpww, tmpwh + 44)
$("#data").css("padding-bottom","42px");
$("#leftDiv").css("border-top-left-radius","0px");
$("#rightDiv").css("border-top-right-radius","0px");
$(this).css("display", "none"); $(this).css("display", "none");
$("#wgt_add").css("display", "block");
$("#wgt_display").css("display", "block"); $("#wgt_display").css("display", "block");
mode = true; mode = true;
$(document).enableTextSelect(); $(document).enableTextSelect();
@ -171,12 +189,15 @@ function init(){
$("#wgt_help").click(function(){ $("#wgt_help").click(function(){
var tmp = $(this); var tmp = $(this);
if($(this).hasClass("open")){ if($(this).hasClass("open")){
$(this).removeClass("help_pad").removeClass("help_wood")
$("#help").slideUp("100", function(){ $("#help").slideUp("100", function(){
tmp.removeClass("open"); tmp.removeClass("open");
$("#data").show(); $("#data").show();
($("#wgt_edit").hasClass("selected"))?$("#parameters").show():'';
}); });
} else { } else {
$("#data").hide(); ($("#style_select").val() == 1)?$(this).removeClass("help_pad").addClass("help_wood"):$(this).removeClass("help_wood").addClass("help_pad");
$("#data, #parameters").hide();
$("#help").slideDown("100", function(){ $("#help").slideDown("100", function(){
tmp.addClass("open"); tmp.addClass("open");
}); });
@ -200,10 +221,10 @@ function init(){
$(document).disableTextSelect(); $(document).disableTextSelect();
}); });
$(".style_select option[value='1']").text(sankoreLang.slate); $("#style_select option[value='1']").text(sankoreLang.slate);
$(".style_select option[value='2']").text(sankoreLang.pad); $("#style_select option[value='2']").text(sankoreLang.pad);
$(".style_select").change(function (event){ $("#style_select").change(function (event){
changeStyle($(this).find("option:selected").val()); changeStyle($(this).find("option:selected").val());
}) })
@ -354,12 +375,12 @@ function init(){
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px"); curr.css("top", prevBottom + 15 + "px");
else else
curr.css("top", "60px").css("left", prevLeft + 255 + "px"); curr.css("top", "100px").css("left", prevLeft + 255 + "px");
} else { } else {
if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");
else else
curr.css("top", "60px").css("left", prevLeft + 255 + "px"); curr.css("top", "100px").css("left", prevLeft + 255 + "px");
} }
prevBottom = curr.position().top + curr.height(), prevBottom = curr.position().top + curr.height(),
prevLeft = curr.position().left; prevLeft = curr.position().left;
@ -372,28 +393,31 @@ function init(){
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){ $(window).resize(function(){
if($("#wgt_edit").hasClass("selected")){ if(!resizeFlag){
if($(".editContainer").size() > 1){ if($("#wgt_edit").hasClass("selected")){
var prev = $(".editContainer:first"), if($(".editContainer").size() > 1){
prevBottom = prev.position().top + prev.height(), var prev = $(".editContainer:first"),
prevLeft = prev.position().left; prevBottom = prev.position().top + prev.height(),
recursionCall(prevBottom, prevLeft, prev.next()); prevLeft = prev.position().left;
recursionCall(prevBottom, prevLeft, prev.next());
}
} else {
var tmp_array = [];
$(".readyTask").each(function(){
tmp_array.push($(this));
});
orderItems(tmp_array);
} }
} else { popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
var tmp_array = []; popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(".readyTask").each(function(){ } else
tmp_array.push($(this)); resizeFlag = false;
});
orderItems(tmp_array);
}
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
}); });
if (window.widget) { if (window.widget) {
window.widget.onleave = function(){ window.widget.onleave = function(){
exportToSankore(); exportToSankore();
sankore.setPreference("by_style", $(".style_select").find("option:selected").val()); sankore.setPreference("by_style", $("#style_select").find("option:selected").val());
} }
} }
@ -416,7 +440,7 @@ function init(){
objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text(); objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text();
objToExport.width = $(domElem).width(); objToExport.width = $(domElem).width();
objToExport.height = $(domElem).height(); objToExport.height = $(domElem).height();
objToExport.top = $(domElem).position().top; objToExport.top = $(domElem).position().top - 40;
objToExport.left = $(domElem).position().left; objToExport.left = $(domElem).position().left;
arrayToExport.push(objToExport); arrayToExport.push(objToExport);
}); });
@ -475,14 +499,14 @@ function reloadItems(){
//order items //order items
function orderItems(items){ function orderItems(items){
var bottom = 45, var bottom = ($("#wgt_edit").hasClass("selected"))?85:45,
lastItemLeft = 54; lastItemLeft = 54;
for (var i in items){ for (var i in items){
if((bottom + items[i].height()) < ($(window).height() - 54)){ if((bottom + items[i].height()) < ($(window).height() - 54)){
items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data"); items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
bottom += items[i].height() + 15; bottom += items[i].height() + 15;
} else { } else {
bottom = 60; bottom = 100;
lastItemLeft += 255; lastItemLeft += 255;
items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data"); items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data");
bottom += items[i].height(); bottom += items[i].height();
@ -507,7 +531,7 @@ function shuffle( arr )
//adding a new task to the page //adding a new task to the page
function addTask(expression, result){ function addTask(expression, result){
var lastItem = $(".editContainer:last"), var lastItem = $(".editContainer:last"),
lastItemPos = lastItem.length ? lastItem.position().top : 45, lastItemPos = lastItem.length ? lastItem.position().top : 85,
lastItemHeight = lastItem.length ? lastItem.height() : 0, lastItemHeight = lastItem.length ? lastItem.height() : 0,
lastItemLeft = lastItem.length ? lastItem.position().left : 54; lastItemLeft = lastItem.length ? lastItem.position().left : 54;
var bottom = lastItemPos + lastItemHeight + 85; var bottom = lastItemPos + lastItemHeight + 85;
@ -519,7 +543,7 @@ function addTask(expression, result){
if(bottom < ($(window).height() - 54)){ if(bottom < ($(window).height() - 54)){
editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data"); editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
} else { } else {
lastItemPos = 45; lastItemPos = 85;
editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data"); editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data");
} }
main.appendTo(editContent); main.appendTo(editContent);
@ -538,13 +562,12 @@ function changeStyle(val){
$(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").removeClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").removeClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").removeClass("pad_color").removeClass("pad_reload"); $("#wgt_reload").removeClass("pad_color").removeClass("pad_reload");
$("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_help").removeClass("pad_color").removeClass("pad_help"); $("#wgt_help").removeClass("pad_color").removeClass("pad_help");
$("#wgt_display").removeClass("pad_color").removeClass("pad_edit"); $("#wgt_edit").removeClass("pad_color").removeClass("pad_edit");
$("#wgt_add").removeClass("pad_color").removeClass("pad_add");
$("#wgt_name").removeClass("pad_color"); $("#wgt_name").removeClass("pad_color");
$(".style_select").removeClass("pad_select").removeClass("none_select").val(val); $("#wgt_display").addClass("display_wood");
$("body, html").removeClass("without_radius"); $("#style_select").val(val);
$("body, html").removeClass("without_radius").addClass("radius_ft");
break; break;
case "2": case "2":
$(".b_top_left").addClass("btl_pad").removeClass("without_back"); $(".b_top_left").addClass("btl_pad").removeClass("without_back");
@ -556,13 +579,12 @@ function changeStyle(val){
$(".b_bottom_left").addClass("bbl_pad").removeClass("without_back"); $(".b_bottom_left").addClass("bbl_pad").removeClass("without_back");
$(".b_bottom_center").addClass("bbc_pad").removeClass("without_back"); $(".b_bottom_center").addClass("bbc_pad").removeClass("without_back");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_help").addClass("pad_color").addClass("pad_help"); $("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_display").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_add").addClass("pad_color").addClass("pad_add");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
$(".style_select").addClass("pad_select").removeClass("none_select").val(val); $("#wgt_display").removeClass("display_wood");
$("body, html").removeClass("without_radius"); $("#style_select").val(val);
$("body, html").removeClass("without_radius").removeClass("radius_ft");
break; break;
case "3": case "3":
$(".b_top_left").addClass("without_back").removeClass("btl_pad"); $(".b_top_left").addClass("without_back").removeClass("btl_pad");
@ -573,14 +595,13 @@ function changeStyle(val){
$(".b_bottom_right").addClass("without_back").removeClass("bbr_pad"); $(".b_bottom_right").addClass("without_back").removeClass("bbr_pad");
$(".b_bottom_left").addClass("without_back").removeClass("bbl_pad"); $(".b_bottom_left").addClass("without_back").removeClass("bbl_pad");
$(".b_bottom_center").addClass("without_back").removeClass("bbc_pad"); $(".b_bottom_center").addClass("without_back").removeClass("bbc_pad");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_reload").addClass("pad_color").addClass("pad_reload"); $("#wgt_reload").addClass("pad_color").addClass("pad_reload");
$("#wgt_edit").addClass("pad_color").addClass("pad_edit"); $("#wgt_edit").addClass("pad_color").addClass("pad_edit");
$("#wgt_help").addClass("pad_color").addClass("pad_help");
$("#wgt_display").addClass("pad_color").addClass("pad_edit");
$("#wgt_add").addClass("pad_color").addClass("pad_add");
$("#wgt_name").addClass("pad_color"); $("#wgt_name").addClass("pad_color");
$(".style_select").addClass("none_select").val(val); $("#wgt_display").removeClass("display_wood");
$("body, html").addClass("without_radius"); $("#style_select").val(val);
$("body, html").addClass("without_radius").removeClass("radius_ft");
break; break;
} }
if($("#wgt_edit").hasClass("selected")) if($("#wgt_edit").hasClass("selected"))

@ -49,7 +49,7 @@ UBGraphicsWidgetItem::UBGraphicsWidgetItem(const QUrl &pWidgetUrl, QGraphicsItem
, mInitialLoadDone(false) , mInitialLoadDone(false)
, mIsFreezable(true) , mIsFreezable(true)
, mIsResizable(false) , mIsResizable(false)
, mLoadIsErronous(false) , mLoadIsErronous(false)
, mCanBeContent(0) , mCanBeContent(0)
, mCanBeTool(0) , mCanBeTool(0)
, mWidgetUrl(pWidgetUrl) , mWidgetUrl(pWidgetUrl)
@ -113,6 +113,7 @@ void UBGraphicsWidgetItem::initialize()
connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&))); connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool)));
connect(page()->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayoutCompleted()));
connect(page(), SIGNAL(linkClicked(const QUrl&)), this, SLOT(onLinkClicked(const QUrl&))); connect(page(), SIGNAL(linkClicked(const QUrl&)), this, SLOT(onLinkClicked(const QUrl&)));
} }
@ -121,6 +122,11 @@ void UBGraphicsWidgetItem::onLinkClicked(const QUrl& url)
UBApplication::webController->loadUrl(url); UBApplication::webController->loadUrl(url);
} }
void UBGraphicsWidgetItem::initialLayoutCompleted()
{
mInitialLoadDone = true;
}
QUrl UBGraphicsWidgetItem::mainHtml() QUrl UBGraphicsWidgetItem::mainHtml()
{ {
return mMainHtmlUrl; return mMainHtmlUrl;
@ -564,40 +570,33 @@ void UBGraphicsWidgetItem::injectInlineJavaScript()
void UBGraphicsWidgetItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void UBGraphicsWidgetItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{ {
if (scene() && scene()->renderingContext() != UBGraphicsScene::Screen) if (scene() && scene()->renderingContext() != UBGraphicsScene::Screen) {
{
painter->drawPixmap(0, 0, snapshot()); painter->drawPixmap(0, 0, snapshot());
} }
else else {
{ QGraphicsWebView::paint(painter, option, widget);
if (!mInitialLoadDone || mLoadIsErronous) }
{
QString message;
if (mInitialLoadDone && mLoadIsErronous) if (!mInitialLoadDone) {
message = tr("Cannot load content"); QString message;
else
message = tr("Loading ...");
painter->setFont(QFont("Arial", 12)); message = tr("Loading ...");
QFontMetrics fm = painter->fontMetrics(); painter->setFont(QFont("Arial", 12));
QRect txtBoundingRect = fm.boundingRect(message);
txtBoundingRect.moveCenter(rect().center().toPoint()); QFontMetrics fm = painter->fontMetrics();
txtBoundingRect.adjust(-10, -5, 10, 5); QRect txtBoundingRect = fm.boundingRect(message);
painter->setPen(Qt::NoPen); txtBoundingRect.moveCenter(rect().center().toPoint());
painter->setBrush(UBSettings::paletteColor); txtBoundingRect.adjust(-10, -5, 10, 5);
painter->drawRoundedRect(txtBoundingRect, 3, 3);
painter->setPen(Qt::white); painter->setPen(Qt::NoPen);
painter->drawText(rect(), Qt::AlignCenter, message); painter->setBrush(UBSettings::paletteColor);
} painter->drawRoundedRect(txtBoundingRect, 3, 3);
else
QGraphicsWebView::paint(painter, option, widget);
}
painter->setPen(Qt::white);
painter->drawText(rect(), Qt::AlignCenter, message);
}
} }
void UBGraphicsWidgetItem::geometryChangeRequested(const QRect& geom) void UBGraphicsWidgetItem::geometryChangeRequested(const QRect& geom)
@ -618,7 +617,6 @@ void UBGraphicsWidgetItem::javaScriptWindowObjectCleared()
void UBGraphicsWidgetItem::mainFrameLoadFinished (bool ok) void UBGraphicsWidgetItem::mainFrameLoadFinished (bool ok)
{ {
mInitialLoadDone = true;
mLoadIsErronous = !ok; mLoadIsErronous = !ok;
update(boundingRect()); update(boundingRect());
takeSnapshot(); takeSnapshot();

@ -21,8 +21,8 @@
#include "core/UB.h" #include "core/UB.h"
#include "UBItem.h" #include "UBItem.h"
#include "UBResizableGraphicsItem.h" #include "UBResizableGraphicsItem.h"
class UBWidgetUniboardAPI; class UBWidgetUniboardAPI;
class UBGraphicsScene; class UBGraphicsScene;
@ -163,6 +163,7 @@ class UBGraphicsWidgetItem : public QGraphicsWebView, public UBItem, public UBRe
private slots: private slots:
void onLinkClicked(const QUrl& url); void onLinkClicked(const QUrl& url);
void initialLayoutCompleted();
private: private:
bool mIsFrozen; bool mIsFrozen;

Loading…
Cancel
Save