applied maxim changes

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 4dc6465f51
commit 8724a01a71
  1. 12
      resources/library/interactivities/Train.wgt/js/lib/ubw-main.js
  2. 28
      resources/library/interactivities/Train.wgt/js/main.js
  3. 1
      resources/nonDistributed/Cadran.wgt/css/main.css
  4. 7
      resources/nonDistributed/Transformation.wgt/js/main.js

@ -70,6 +70,10 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
$(input).change(function(){ $(input).change(function(){
var val = (isRadioOrcheckbox ? $(this).is(":checked") : $(this).val()); var val = (isRadioOrcheckbox ? $(this).is(":checked") : $(this).val());
parameters.value(key, val); parameters.value(key, val);
if(key != "themes"){
parameters.value("show", "3");
app.reload();
}
}); });
})(input); })(input);
}); });
@ -79,6 +83,7 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
app.onEdit = true; app.onEdit = true;
$(document.body).addClass("onEdit"); $(document.body).addClass("onEdit");
if(callbacks.onEdit && typeof callbacks.onEdit === 'function') { if(callbacks.onEdit && typeof callbacks.onEdit === 'function') {
parameters.value("show", "1");
callbacks.onEdit(app); callbacks.onEdit(app);
} }
}); });
@ -86,10 +91,12 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
app.onEdit = false; app.onEdit = false;
$(document.body).removeClass("onEdit"); $(document.body).removeClass("onEdit");
if(callbacks.onView && typeof callbacks.onView === 'function') { if(callbacks.onView && typeof callbacks.onView === 'function') {
parameters.value("show", "2");
callbacks.onView(app); callbacks.onView(app);
} }
}); });
$("button[role=reload]").click(function(){ $("button[role=reload]").click(function(){
parameters.value("show", "3");
app.reload(); app.reload();
}); });
$("button[role=help]").click(function(){ $("button[role=help]").click(function(){
@ -133,7 +140,10 @@ var Parameters = (function(){
else { else {
log("Set parameter value ["+value+"] for key : ["+key+"]"); log("Set parameter value ["+value+"] for key : ["+key+"]");
this.delegate.setPreference(key, value); this.delegate.setPreference(key, value);
this.container.trigger("preferenceChange", {key: key, value: value}); this.container.trigger("preferenceChange", {
key: key,
value: value
});
} }
} }
} }

@ -1,3 +1,5 @@
var just_a_flag = false;
function onTemplateLoadedCallback() { function onTemplateLoadedCallback() {
} }
@ -21,7 +23,20 @@ function reloadApp(app) {
var operator = app.parameters.value("operator"); var operator = app.parameters.value("operator");
var range = parseFloat(app.parameters.value("range")); var range = parseFloat(app.parameters.value("range"));
var count = parseInt(app.parameters.value("count")); var count = parseInt(app.parameters.value("count"));
var show = app.parameters.value("show");
if(!just_a_flag){
just_a_flag = true;
show = "3";
}
switch(show){
case "1":
$("#labels div div").each(function(){
$(this).css("top","auto").css("left","auto")
})
break;
case "2":
break;
default:
$scene = $("#scene"); $scene = $("#scene");
$scene.empty(); $scene.empty();
@ -71,13 +86,17 @@ function reloadApp(app) {
if(i != count-1) { if(i != count-1) {
$("<div class='operator'>"+operator+"</div>").appendTo($drops); $("<div class='operator'>"+operator+"</div>").appendTo($drops);
} }
}; }
$scene.droppable({ $scene.droppable({
drop: function(event, ui) { drop: function(event, ui) {
revert(ui.draggable); revert(ui.draggable);
} }
}); });
break;
}
} }
function reloadCallback(parameter) { function reloadCallback(parameter) {
@ -91,5 +110,8 @@ $(document).ready(function(){
onEdit: reloadApp, onEdit: reloadApp,
onView: reloadApp onView: reloadApp
}; };
init(reloadCallback, {toolbar: toolbarTemplate, parameters: parametersTemplate}, callbacks); init(reloadCallback, {
toolbar: toolbarTemplate,
parameters: parametersTemplate
}, callbacks);
}); });

@ -132,6 +132,7 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
height: 100%; height: 100%;
width: 120px;
} }
#result > div > div { #result > div > div {
position: absolute; position: absolute;

@ -124,6 +124,8 @@ function reloadApp(app) {
for(var i=0 ; i<number ; i++) { for(var i=0 ; i<number ; i++) {
editcards.append(editRow(app, i)); editcards.append(editRow(app, i));
} }
if(window.sankore)
window.sankore.enableDropOnWidget(app.onEdit);
return; return;
} }
@ -198,5 +200,8 @@ $(document).ready(function(){
onEdit: reloadApp, onEdit: reloadApp,
onView: reloadApp onView: reloadApp
}; };
init(reloadCallback, {toolbar: toolbarTemplate, parameters: parametersTemplate}, callbacks); init(reloadCallback, {
toolbar: toolbarTemplate,
parameters: parametersTemplate
}, callbacks);
}); });
Loading…
Cancel
Save