Merge git conflicts

preferencesAboutTextFull
Ilia Ryabokon 12 years ago
commit dc492cb245
  1. 2
      .gitignore
  2. BIN
      resources/images/toque.png
  3. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/delete.png
  4. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/graduations.png
  5. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/pivot.png
  6. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/scale.png
  7. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/scales.png
  8. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/weight-add.png
  9. BIN
      resources/inDevelopmentWidgets/Balance.wgt/css/images/weight.png
  10. 2
      resources/library/applications/Nuancier.wgt/css/layout.css
  11. 2
      resources/library/applications/Nuancier.wgt/index.html
  12. 76
      resources/library/applications/Nuancier.wgt/js/colorpicker.js
  13. 2
      resources/library/applications/Nuancier.wgt/js/jquery-1.8.1.min.js
  14. 4
      resources/library/interactivities/Balance.wgt/config.xml
  15. 0
      resources/library/interactivities/Balance.wgt/css/fonts/Lobster/Lobster_1.3-webfont.eot
  16. 0
      resources/library/interactivities/Balance.wgt/css/fonts/Lobster/Lobster_1.3-webfont.svg
  17. 0
      resources/library/interactivities/Balance.wgt/css/fonts/Lobster/Lobster_1.3-webfont.ttf
  18. 0
      resources/library/interactivities/Balance.wgt/css/fonts/Lobster/Lobster_1.3-webfont.woff
  19. 0
      resources/library/interactivities/Balance.wgt/css/fonts/Lobster/demo.html
  20. 0
      resources/library/interactivities/Balance.wgt/css/fonts/Lobster/stylesheet.css
  21. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.eot
  22. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.svg
  23. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.ttf
  24. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.woff
  25. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.eot
  26. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.svg
  27. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.ttf
  28. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.woff
  29. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch_Italic-webfont.eot
  30. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch_Italic-webfont.svg
  31. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch_Italic-webfont.ttf
  32. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch_Italic-webfont.woff
  33. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold-webfont.eot
  34. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold-webfont.svg
  35. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold-webfont.ttf
  36. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold-webfont.woff
  37. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold_Italic-webfont.eot
  38. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold_Italic-webfont.svg
  39. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold_Italic-webfont.ttf
  40. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Bold_Italic-webfont.woff
  41. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Italic-webfont.eot
  42. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Italic-webfont.svg
  43. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Italic-webfont.ttf
  44. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/SF_Toontime_Italic-webfont.woff
  45. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/demo.html
  46. 0
      resources/library/interactivities/Balance.wgt/css/fonts/SF-Toontime/stylesheet.css
  47. 0
      resources/library/interactivities/Balance.wgt/css/images/balance.png
  48. 0
      resources/library/interactivities/Balance.wgt/css/images/bg.png
  49. BIN
      resources/library/interactivities/Balance.wgt/css/images/delete.png
  50. BIN
      resources/library/interactivities/Balance.wgt/css/images/graduations.png
  51. 0
      resources/library/interactivities/Balance.wgt/css/images/pad-bd.png
  52. 0
      resources/library/interactivities/Balance.wgt/css/images/parameters-bg.png
  53. BIN
      resources/library/interactivities/Balance.wgt/css/images/pivot.png
  54. BIN
      resources/library/interactivities/Balance.wgt/css/images/scale.png
  55. BIN
      resources/library/interactivities/Balance.wgt/css/images/scales.png
  56. 0
      resources/library/interactivities/Balance.wgt/css/images/slate-bd.png
  57. 0
      resources/library/interactivities/Balance.wgt/css/images/slate-toolbar-edit.png
  58. 0
      resources/library/interactivities/Balance.wgt/css/images/slate-toolbar-help.png
  59. 0
      resources/library/interactivities/Balance.wgt/css/images/slate-toolbar-reload.png
  60. 0
      resources/library/interactivities/Balance.wgt/css/images/toolbar-edit.png
  61. 0
      resources/library/interactivities/Balance.wgt/css/images/toolbar-help.png
  62. 0
      resources/library/interactivities/Balance.wgt/css/images/toolbar-reload.png
  63. BIN
      resources/library/interactivities/Balance.wgt/css/images/weight-add.png
  64. BIN
      resources/library/interactivities/Balance.wgt/css/images/weight.png
  65. 81
      resources/library/interactivities/Balance.wgt/css/main.css
  66. 0
      resources/library/interactivities/Balance.wgt/css/ubw-help.css
  67. 0
      resources/library/interactivities/Balance.wgt/css/ubw-main.css
  68. 0
      resources/library/interactivities/Balance.wgt/help.html
  69. 0
      resources/library/interactivities/Balance.wgt/i18n/Messages.properties
  70. 6
      resources/library/interactivities/Balance.wgt/i18n/Messages_fr.properties
  71. 0
      resources/library/interactivities/Balance.wgt/icon.png
  72. 0
      resources/library/interactivities/Balance.wgt/index.html
  73. 0
      resources/library/interactivities/Balance.wgt/js/help-template.js
  74. 0
      resources/library/interactivities/Balance.wgt/js/help_fr-template.js
  75. 0
      resources/library/interactivities/Balance.wgt/js/lib/jquery-1.7.1.min.js
  76. 0
      resources/library/interactivities/Balance.wgt/js/lib/jquery-css-transform.js
  77. 0
      resources/library/interactivities/Balance.wgt/js/lib/jquery-ui-1.8.17.custom.min.js
  78. 0
      resources/library/interactivities/Balance.wgt/js/lib/jquery.i18n.properties-min-1.0.9.js
  79. 0
      resources/library/interactivities/Balance.wgt/js/lib/modernizr.js
  80. 0
      resources/library/interactivities/Balance.wgt/js/lib/mustache.js
  81. 0
      resources/library/interactivities/Balance.wgt/js/lib/ubw-main.js
  82. 88
      resources/library/interactivities/Balance.wgt/js/main.js
  83. 4
      resources/library/interactivities/Balance.wgt/js/templates.js
  84. 0
      resources/library/interactivities/Cadran.wgt/config.xml
  85. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/Lobster/Lobster_1.3-webfont.eot
  86. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/Lobster/Lobster_1.3-webfont.svg
  87. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/Lobster/Lobster_1.3-webfont.ttf
  88. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/Lobster/Lobster_1.3-webfont.woff
  89. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/Lobster/demo.html
  90. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/Lobster/stylesheet.css
  91. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.eot
  92. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.svg
  93. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.ttf
  94. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime-webfont.woff
  95. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.eot
  96. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.svg
  97. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.ttf
  98. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch-webfont.woff
  99. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch_Italic-webfont.eot
  100. 0
      resources/library/interactivities/Cadran.wgt/css/fonts/SF-Toontime/SF_Toontime_Blotch_Italic-webfont.svg
  101. Some files were not shown because too many files have changed in this diff Show More

2
.gitignore vendored

@ -70,3 +70,5 @@ plugins/cffadaptor/objects
#####################
*.qm
.DS_Store

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

@ -34,6 +34,8 @@ html, body {
font-size: 12px;
line-height: 18px;
color: #52697E;
width: 100%;
height: 100%;
}
body {
text-align: center;

@ -4,7 +4,7 @@
<link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
<link rel="stylesheet" media="screen" type="text/css" href="css/layout.css" />
<title>ColorPicker - jQuery plugin</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/colorpicker.js"></script>
<script type="text/javascript" src="js/eye.js"></script>
<script type="text/javascript" src="js/utils.js"></script>

@ -5,12 +5,16 @@
*
* Dual licensed under the MIT and GPL licenses
*
*/
*/
(function ($) {
var ColorPicker = function () {
var
ids = {},
penFlag = true,
tmpColor = {
a:"",
b:""
},
inAction,
charMin = 65,
visible,
@ -108,7 +112,10 @@
}
setSelector(col, cal.get(0));
setHue(col, cal.get(0));
setNewColor(col, cal.get(0));
//setNewColor(col, cal.get(0));
$(cal.get(0)).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(col));
tmpColor.a = cal.get(0);
tmpColor.b = col;
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
},
blur = function (ev) {
@ -174,14 +181,25 @@
$(document).unbind('mousemove', moveHue);
return false;
},
downSelector = function (ev) {
downSelector = function (ev) {
var current = {
cal: $(this).parent(),
pos: $(this).offset()
};
current.preview = current.cal.data('colorpicker').livePreview;
current.preview = current.cal.data('colorpicker').livePreview;
$(document).bind('mouseup', current, upSelector);
$(document).bind('mousemove', current, moveSelector);
change.apply(
current.cal.data('colorpicker')
.fields
.eq(6)
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - current.pos.top))))/150, 10))
.end()
.eq(5)
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - current.pos.left))))/150, 10))
.get(0),
[current.preview]
);
},
moveSelector = function (ev) {
change.apply(
@ -202,6 +220,18 @@
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
$(document).unbind('mouseup', upSelector);
$(document).unbind('mousemove', moveSelector);
if(penFlag){
$("div.tools_change").removeClass("tools_compass");
window.sankore.setTool('pen');
window.sankore.setPenColor('#' + HSBToHex(tmpColor.b));
sankore.returnStatus("PEN installed", penFlag);
} else {
$("div.tools_change").addClass("tools_compass");
window.sankore.setTool('compass');
window.sankore.setPenColor('#' + HSBToHex(tmpColor.b));
sankore.returnStatus("Compass installed", penFlag);
}
//$(tmpColor.a).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(tmpColor.b));
return false;
},
enterSubmit = function (ev) {
@ -249,7 +279,7 @@
cal.css({
left: left + 'px',
top: top + 'px'
});
});
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
cal.show();
}
@ -325,7 +355,7 @@
r: hex >> 16,
g: (hex & 0x00FF00) >> 8,
b: (hex & 0x0000FF)
};
};
},
HexToHSB = function (hex) {
return RGBToHSB(HexToRGB(hex));
@ -379,43 +409,43 @@
rgb.r=t1;
rgb.b=t2;
rgb.g=t2+t3
}
}
else if(h<120) {
rgb.g=t1;
rgb.b=t2;
rgb.r=t1-t3
}
}
else if(h<180) {
rgb.g=t1;
rgb.r=t2;
rgb.b=t2+t3
}
}
else if(h<240) {
rgb.b=t1;
rgb.r=t2;
rgb.g=t1-t3
}
}
else if(h<300) {
rgb.b=t1;
rgb.g=t2;
rgb.r=t2+t3
}
}
else if(h<360) {
rgb.r=t1;
rgb.g=t2;
rgb.b=t1-t3
}
}
else {
rgb.r=0;
rgb.g=0;
rgb.b=0
}
}
}
return {
r:Math.round(rgb.r),
g:Math.round(rgb.g),
b:Math.round(rgb.b)
};
};
},
RGBToHex = function (rgb) {
var hex = [
@ -433,6 +463,9 @@
HSBToHex = function (hsb) {
return RGBToHex(HSBToRGB(hsb));
},
// changeCursor = function (flag) {
// alert(flag)
// },
restoreOriginal = function () {
var cal = $(this).parent();
var col = cal.data('colorpicker').origColor;
@ -446,6 +479,15 @@
};
return {
init: function (opt) {
if(window.sankore)
sankore.setTool("arrow");
// $(document).mouseout(function(event){
// if(event.target.tagName == "DIV" && event.target.className == "colorpicker")
// changeCursor(true)
// })
// $("body").mouseleave(function(){
// changeCursor(true)
// })
opt = $.extend({}, defaults, opt||{});
if (typeof opt.color == 'string') {
opt.color = HexToHSB(opt.color);
@ -465,9 +507,13 @@
var cal = $(tpl).attr('id', id);
if (options.flat) {
cal.appendTo(this).show();
} else {
}
else {
cal.appendTo(document.body);
}
// cal.bind("mouseover", function(){
// window.sankore.setTool('arrow');
// })
options.fields = cal
.find('input')
.bind('keyup', keyDown)

File diff suppressed because one or more lines are too long

@ -3,8 +3,8 @@
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.njin.fr/sankore/apps/balance"
version="1.0"
width="1025"
height="880"
width="540"
height="450"
ub:resizable="true">
<name>La Balance</name>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -15,7 +15,7 @@
}
#scalesWrapper {
padding: 0px 100px 200px;
padding: 0px 100px 100px;
position: relative;
}
@ -29,10 +29,10 @@
.scale {
position: absolute;
width: 250px;
width: 125px;
height: 0;
padding: 200px 45px 50px;
top: 145px;
padding: 90px 20px 35px;
top: 72px;
background: url(images/scale.png) no-repeat center bottom;
}
@ -45,12 +45,12 @@
#leftScale {
left: 0;
margin-left: -150px;
margin-left: -75px;
}
#rightScale {
right: 0;
margin-right: -150px;
margin-right: -75px;
}
#tray {
@ -58,27 +58,27 @@
background-color: red;
top: 50%;
margin-top: -1px;
width: 550px;
height: 288px;
width: 225px;
height: 144px;
background: url("images/scales.png") no-repeat center;
}
#graduations {
width: 100px;
height: 30px;
width: 50px;
height: 15px;
position: absolute;
top: 0;
left: 50%;
margin-left: -50px;
margin-left: -25px;
background: url(images/graduations.png) center no-repeat;
}
#pivot {
position: absolute;
width: 80px;
height: 80px;
left: 235px;
top: 106px;
width: 40px;
height: 40px;
left: 93px;
top: 52px;
background: url(images/pivot.png) center no-repeat;
}
@ -101,14 +101,14 @@
text-indent: -100px;
width: 68px;
height: 70px;
width: 34px;
height: 34px;
margin-left: 10px;
cursor: pointer;
border-radius: 4px;
border-radius: 2px;
border: 1px solid rgba(255,255,255, 0.15);
background: rgba(0,0,0, 0.15) url(images/weight-add.png) center no-repeat;
}
@ -124,15 +124,15 @@
.object input {
border: none;
width: 40px;
padding: none;
margin: 0 2px 0 0;
width: 100%;
padding: 0;
margin: 0;
text-align: center;
font-size: 16px;
font-size: 12px;
color: #000;
border-radius: 3px;
border-radius: 2px;
background-color: #FFF;
box-shadow: 0 1px 2px rgba(0,0,0, 0.4);
}
@ -140,7 +140,7 @@
.object .tools {
display: none;
position: absolute;
top: -23px;
top: -13px;
width: 100%;
text-align: center;
}
@ -150,8 +150,8 @@
position: relative;
overflow: hidden;
cursor: pointer;
width: 22px;
height: 22px;
width: 11px;
height: 11px;
text-indent: -100px;
border: none;
margin: 0;
@ -180,7 +180,7 @@
position: absolute;
width: 100%;
height: 20px;
top: 72px;
top: 36px;
border-radius: 4px;
box-shadow: 0 3px 0 #999, 0 1px 2px rgba(0,0,0, .65);
background-color: #CCC;
@ -198,9 +198,9 @@
#weights {
display: none;
position: absolute;
top: 40px;
right: 40px;
width: 230px;
top: 20px;
right: 0px;
width: 160px;
}
.onEdit #weights {
@ -213,21 +213,26 @@
.weight {
position: relative;
width: 64px;
height: 70px;
width: 32px;
height: 35px;
margin-left: 10px;
margin-bottom: 30px;
font-size: 16px;
font-size: 12px;
text-align: center;
color: #CCC;
text-shadow: 0 -1px 0 #000;
}
.weight .unit {
font-size: 10px;
}
.weight .amount {
height: 100%;
padding: 4px 4px 0;
padding: 4px 2px 0;
border-radius: 4px;
border: 1px solid rgba(255,255,255, 0.15);
background-color: rgba(0,0,0, 0.15);
@ -235,10 +240,10 @@
.weight > div.bg {
position: absolute;
left: -3px;
left: -2px;
bottom: -18px;
width: 70px;
height: 64px;
width: 35px;
height: 32px;
background: url(images/weight.png) no-repeat center bottom;
}

@ -1,11 +1,11 @@
fr.njin.i18n.document.title = La Balance
fr.njin.i18n.toolbar.edit = Editer
fr.njin.i18n.toolbar.view = Fermer
fr.njin.i18n.toolbar.edit = Modifier
fr.njin.i18n.toolbar.view = Afficher
fr.njin.i18n.toolbar.reload = Recharger
fr.njin.i18n.toolbar.help = Aide
fr.njin.i18n.parameters.label.themes = Thème
fr.njin.i18n.parameters.label.themes = Thèmes
fr.njin.i18n.parameters.label.slate.themes = ardoise
fr.njin.i18n.parameters.label.pad.themes = tablette
fr.njin.i18n.parameters.label.none.themes = aucun

@ -1,14 +1,47 @@
var weighValues = [500,200,100,50,20,10];
function onTemplateLoadedCallback(app) {
$("#weights").append($(Mustache.render(weightTemplate, {weight: 500})));
$("#weights").append($(Mustache.render(weightTemplate, {weight: 200})));
$("#weights").append($(Mustache.render(weightTemplate, {weight: 100})));
$("#weights").append($(Mustache.render(weightTemplate, {weight: 50})));
$("#weights").append($(Mustache.render(weightTemplate, {weight: 20})));
$("#weights").append($(Mustache.render(weightTemplate, {weight: 10})));
$.each(weighValues, function(){
$("#weights").append($(Mustache.render(weightTemplate, {weight: this})));
});
$("#weights > .weight").draggable({helper: "clone"});
$("#leftScale").droppable({
accept: ".object",
drop: function(event, ui) {
if($(ui.draggable).hasClass("inScale"))
return;
var object = $(ui.draggable).clone();
object.data("weight", $(ui.draggable).data("weight"));
object.addClass("inScale");
$("#leftScale").append(object);
placeObject($("#leftScale"), object);
refreshScales();
object.draggable({
stop: function(event, ui) {
if($(ui.helper).hasClass("onOut")) {
$(ui.helper).remove();
refreshScales();
}
}
});
},
out: function(event, ui) {
$(ui.draggable).addClass("onOut");
},
over: function(event, ui) {
$(ui.draggable).removeClass("onOut");
}
});
$("#rightScale").droppable({
accept: ".weight",
accept: ".weight.right",
drop: function(event, ui) {
if($(ui.draggable).hasClass("inScale"))
return;
@ -72,6 +105,10 @@ function objectForGUID(app, guid) {
window.object = guid;
var objectUi = $(Mustache.render(objectTemplate, window));
var weight = getWeightFor(app.parameters, guid);
if(!app.onEdit && (weight == undefined || $.trim(weight) == ""))
weight = weighValues[Math.floor(Math.random()*weighValues.length)];
if(weight !== undefined) {
objectUi.data("weight", weight);
objectUi.find("input[name=weight]").val(weight);
@ -137,8 +174,8 @@ function placeObject($container, $object) {
var count = $container.children().size() - 1;
var left = width * (count % 4) + 25;
var bottom = height * (Math.floor(count / 4)) + 40;
var left = width * (count % 4) + 5;
var bottom = height * (Math.floor(count / 4)) + 12;
log("Place at ["+left+" , "+bottom+"]");
$object.css("left", left+"px").css("bottom", bottom+"px");
@ -215,39 +252,6 @@ function reloadApp(app) {
}
refreshScales();
$("#leftScale").droppable({
accept: ".object",
drop: function(event, ui) {
if($(ui.draggable).hasClass("inScale"))
return;
var object = $(ui.draggable).clone();
object.data("weight", $(ui.draggable).data("weight"));
object.addClass("inScale");
$("#leftScale").append(object);
placeObject($("#leftScale"), object);
refreshScales();
object.draggable({
stop: function(event, ui) {
if($(ui.helper).hasClass("onOut")) {
$(ui.helper).remove();
refreshScales();
}
}
});
},
out: function(event, ui) {
$(ui.draggable).addClass("onOut");
},
over: function(event, ui) {
$(ui.draggable).removeClass("onOut");
}
});
if(app.onEdit) {

@ -23,8 +23,8 @@ var objectTemplate =
'<div class="tools">'+
'<button role="remove">{{fr.njin.i18n.balance.parameters.label.remove}}</button>'+
'</div>'+
'<div class="amount"><input type="text" name="weight">g</div><div class="bg"></div>'+
'<div class="amount"><input type="text" name="weight"></div><div class="bg"></div>'+
'</div>';
var weightTemplate =
'<div id="{{object}}" class="weight w{{weight}}" data-weight="{{weight}}"><div class="amount">{{weight}}g</div><div class="bg"></div></div>';
'<div id="{{object}}" class="weight right w{{weight}}" data-weight="{{weight}}"><div class="amount">{{weight}}</div><div class="bg"></div></div>';

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save