Les cartes possèdent par défaut un champ texte. Pour insérer du texte, cliquez sur cette dernière et saisissez le texte désiré. Pour ajouter une image depuis votre bibliothèque, cochez la case “utiliser une image” et utilisez le glisser-déposer. Il faut au préalable retourner la carte avec le bouton bleu.
+
Attention, la paire de cartes doit être disposée en colonne lors de l'édition.
Les cartes sont disposées de manière aléatoire dans le mode jeu.
-
L’App est capable d’identifier les écritures mathématiques équivalentes (signes autorisés : “+”, “*”, “-”, “/” et les parenthèses).
\ No newline at end of file
diff --git a/resources/library/interactivities/Memory.wgt/js/lib/ubw-main.js b/resources/library/interactivities/Memory.wgt/js/lib/ubw-main.js
index 06213d1c..1319acca 100644
--- a/resources/library/interactivities/Memory.wgt/js/lib/ubw-main.js
+++ b/resources/library/interactivities/Memory.wgt/js/lib/ubw-main.js
@@ -13,257 +13,260 @@
* along with this program. If not, see .
*/
function log(object) {
- console.log(object);
+ console.log(object);
}
function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
- document.title = fr.njin.i18n.document.title;
+ document.title = fr.njin.i18n.document.title;
- var ubwidget = $("#ubwidget");
+ var ubwidget = $("#ubwidget");
- var parameters = Object.create(Parameters,{
- container: {
- value: ubwidget
- },
- delegate: {
- value: window.sankore || Object.create(ParametersDelegate)
- }
- });
+ var parameters = Object.create(Parameters,{
+ container: {
+ value: ubwidget
+ },
+ delegate: {
+ value: window.sankore || Object.create(ParametersDelegate)
+ }
+ });
- var app = Object.create(App, {
- container: {
- value: ubwidget
- },
- parameters: {
- value: parameters
- },
- reload: {
- value: reload
- }
- });
+ var app = Object.create(App, {
+ container: {
+ value: ubwidget
+ },
+ parameters: {
+ value: parameters
+ },
+ reload: {
+ value: reload
+ }
+ });
- app.init();
- app.onEdit = false;
+ app.init();
+ app.onEdit = false;
- if(templates.toolbar) {
- $("#toolbar").html(Mustache.render(templates.toolbar, window));
- }
- if(templates.parameters) {
- $("#parameters").html(Mustache.render(templates.parameters, window));
- }
+ if(templates.toolbar) {
+ $("#toolbar").html(Mustache.render(templates.toolbar, window));
+ }
+ if(templates.parameters) {
+ $("#parameters").html(Mustache.render(templates.parameters, window));
+ }
- if(callbacks.onTemplatesLoaded && typeof callbacks.onTemplatesLoaded === 'function') {
- callbacks.onTemplatesLoaded(app);
- }
+ if(callbacks.onTemplatesLoaded && typeof callbacks.onTemplatesLoaded === 'function') {
+ callbacks.onTemplatesLoaded(app);
+ }
- log("Update setting views with stored parameters");
- $("#parameters (input|select)[role=parameter]").each(function(i, input) {
- (function(input){
- var key = input.name;
- var type = input.type;
- var isRadioOrcheckbox = (type !== undefined && (type === "checkbox" || type === "radio"));
- var stored = parameters.value(key);
- if(isRadioOrcheckbox)
- $(input).attr("checked", (typeof stored === "string" ? stored === "true" : stored));
- else
- $(input).val(stored);
- $(input).change(function(){
- var val = (isRadioOrcheckbox ? $(this).is(":checked") : $(this).val());
- parameters.value(key, val);
- });
- })(input);
- });
+ log("Update setting views with stored parameters");
+ $("#parameters (input|select)[role=parameter]").each(function(i, input) {
+ (function(input){
+ var key = input.name;
+ var type = input.type;
+ var isRadioOrcheckbox = (type !== undefined && (type === "checkbox" || type === "radio"));
+ var stored = parameters.value(key);
+ if(isRadioOrcheckbox)
+ $(input).attr("checked", (typeof stored === "string" ? stored === "true" : stored));
+ else
+ $(input).val(stored);
+ $(input).change(function(){
+ var val = (isRadioOrcheckbox ? $(this).is(":checked") : $(this).val());
+ parameters.value(key, val);
+ });
+ })(input);
+ });
- log("Toobar Initialisation");
- $("button[role=edit]").click(function(){
- app.onEdit = true;
- $(document.body).addClass("onEdit");
- if(callbacks.onEdit && typeof callbacks.onEdit === 'function') {
- callbacks.onEdit(app);
- }
- });
- $("button[role=view]").click(function(){
- app.onEdit = false;
- $(document.body).removeClass("onEdit");
- if(callbacks.onView && typeof callbacks.onView === 'function') {
- callbacks.onView(app);
- }
- });
- $("button[role=reload]").click(function(){
- app.reload();
- });
- $("button[role=help]").click(function(){
- $("body").toggleClass("showHelp");
- });
+ log("Toobar Initialisation");
+ $("button[role=edit]").click(function(){
+ app.onEdit = true;
+ $(document.body).addClass("onEdit");
+ if(callbacks.onEdit && typeof callbacks.onEdit === 'function') {
+ callbacks.onEdit(app);
+ }
+ });
+ $("button[role=view]").click(function(){
+ app.onEdit = false;
+ $(document.body).removeClass("onEdit");
+ if(callbacks.onView && typeof callbacks.onView === 'function') {
+ callbacks.onView(app);
+ }
+ });
+ $("button[role=reload]").click(function(){
+ app.reload();
+ });
+ $("button[role=help]").click(function(){
+ $("body").toggleClass("showHelp");
+ });
- $("select[name='themes']").change(function() {
- $("body").get(0).className = $("body")[0].className.replace(/\btheme-[^\s]*\b/gi, '');
- $("body").addClass("theme-"+$(this).val());
- });
- $("body").addClass("theme-"+$("select[name='themes']").val());
+ $("select[name='themes']").change(function() {
+ $("body").get(0).className = $("body")[0].className.replace(/\btheme-[^\s]*\b/gi, '');
+ $("body").addClass("theme-"+$(this).val());
+ });
+ $("body").addClass("theme-"+$("select[name='themes']").val());
}
function init(reload, templates, callbacks){
- var locale = window.sankore ? sankore.locale() : "";
- $.i18n.properties({
- name: 'Messages',
- path: 'i18n/',
- language: locale,
- callback: function(){
- initAfterI18nMessagesLoaded(reload, templates, callbacks);
- }
- });
+ var locale = window.sankore ? sankore.locale() : "";
+ $.i18n.properties({
+ name: 'Messages',
+ path: 'i18n/',
+ language: locale,
+ callback: function(){
+ initAfterI18nMessagesLoaded(reload, templates, callbacks);
+ }
+ });
}
var Parameters = (function(){
- var self = Object.create({}, {
- container: {
- value: null
- },
- delegate: {
- value: null
- },
- value: {
- value: function(key, value) {
- if(value === undefined) {
- var val = this.delegate.preference(key);
- log("Retrieve parameter value ["+val+"] as type ["+(typeof val)+"] for key : ["+key+"]");
- return (val !== undefined && (typeof val !== "string" || val)) ? val : $("#ubwidget").data(key);
- }
- else {
- log("Set parameter value ["+value+"] for key : ["+key+"]");
- this.delegate.setPreference(key, value);
- this.container.trigger("preferenceChange", {key: key, value: value});
- }
- }
- }
- });
- return self;
+ var self = Object.create({}, {
+ container: {
+ value: null
+ },
+ delegate: {
+ value: null
+ },
+ value: {
+ value: function(key, value) {
+ if(value === undefined) {
+ var val = this.delegate.preference(key);
+ log("Retrieve parameter value ["+val+"] as type ["+(typeof val)+"] for key : ["+key+"]");
+ return (val !== undefined && (typeof val !== "string" || val)) ? val : $("#ubwidget").data(key);
+ }
+ else {
+ log("Set parameter value ["+value+"] for key : ["+key+"]");
+ this.delegate.setPreference(key, value);
+ this.container.trigger("preferenceChange", {
+ key: key,
+ value: value
+ });
+ }
+ }
+ }
+ });
+ return self;
})();
var ParametersDelegate = (function(){
- var self = Object.create({}, {
- preference: {
- value: function(key) {
- return this[key];
- }
- },
- setPreference: {
- value: function(key, value) {
- this[key] = value;
- }
- }
- });
- return self;
+ var self = Object.create({}, {
+ preference: {
+ value: function(key) {
+ return this[key];
+ }
+ },
+ setPreference: {
+ value: function(key, value) {
+ this[key] = value;
+ }
+ }
+ });
+ return self;
})();
var App = (function() {
var self = Object.create({}, {
- container: {
- value: null
- },
- parameters: {
- value: null
- },
+ container: {
+ value: null
+ },
+ parameters: {
+ value: null
+ },
init: {
- value: function() {
- var that = this;
- this.container.bind("preferenceChange", function(evt, parameter) {
- that.reload(parameter);
- });
- this.reload();
- }
+ value: function() {
+ var that = this;
+ this.container.bind("preferenceChange", function(evt, parameter) {
+ that.reload(parameter);
+ });
+ this.reload();
+ }
+ },
+ reload: {
+ value: function(parameter) {
+ if(parameter === undefined)
+ log("Reload");
+ else
+ log("Update");
+ }
},
- reload: {
- value: function(parameter) {
- if(parameter === undefined)
- log("Reload");
- else
- log("Update");
- }
- },
- utils: {
- value: Object.create({}, {
- shuffle: {
- value: function(array) {
- var unpickedSize = array.length;
- while(unpickedSize > 0) {
- var n = Math.floor(Math.random()*unpickedSize);
- var temp = array[unpickedSize-1];
- array[unpickedSize-1] = array[n];
- array[n] = temp;
- unpickedSize--;
- }
- }
- },
- guid: {
- value: function() {
- var S4 = function() {
- return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
- };
- return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
- }
- },
- droppable: {
- value: function($e, callback) {
- $e.bind("dragover", function(){
- $(this).addClass("hover");
- return false;
- });
- $e.bind("dragleave", function(){
- $(this).removeClass("hover");
- return false;
- });
- $e.bind("drop", function(e){
- $(this).removeClass("hover");
- e = e || window.event;
- e.preventDefault();
- // jQuery wraps the originalEvent, so we try to detect that here...
- e = e.originalEvent || e;
+ utils: {
+ value: Object.create({}, {
+ shuffle: {
+ value: function(array) {
+ var unpickedSize = array.length;
+ while(unpickedSize > 0) {
+ var n = Math.floor(Math.random()*unpickedSize);
+ var temp = array[unpickedSize-1];
+ array[unpickedSize-1] = array[n];
+ array[n] = temp;
+ unpickedSize--;
+ }
+ }
+ },
+ guid: {
+ value: function() {
+ var S4 = function() {
+ return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
+ };
+ return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
+ }
+ },
+ droppable: {
+ value: function($e, callback) {
+ $e.bind("dragover", function(){
+ $(this).addClass("hover");
+ return false;
+ });
+ $e.bind("dragleave", function(){
+ $(this).removeClass("hover");
+ return false;
+ });
+ $e.bind("drop", function(e){
+ $(this).removeClass("hover");
+ e = e || window.event;
+ e.preventDefault();
+ // jQuery wraps the originalEvent, so we try to detect that here...
+ e = e.originalEvent || e;
- if(window.sankore) {
- function stringToXML(text){
- if (window.ActiveXObject){
- var doc=new ActiveXObject('Microsoft.XMLDOM');
- doc.async='false';
- doc.loadXML(text);
- } else {
- var parser=new DOMParser();
- doc=parser.parseFromString(text,'text/xml');
- }
- return doc;
- }
- var file = stringToXML(e.dataTransfer.getData("text/plain"));
- callback({
- src: $(file).find("path:eq(0)").text()
- });
- return false;
- }
+ if(window.sankore) {
+ function stringToXML(text){
+ if (window.ActiveXObject){
+ var doc=new ActiveXObject('Microsoft.XMLDOM');
+ doc.async='false';
+ doc.loadXML(text);
+ } else {
+ var parser=new DOMParser();
+ doc=parser.parseFromString(text,'text/xml');
+ }
+ return doc;
+ }
+ var file = stringToXML(e.dataTransfer.getData("text/plain"));
+ callback({
+ src: $(file).find("path:eq(0)").text()
+ });
+ return false;
+ }
- // Using e.files with fallback because e.dataTransfer is immutable and can't be overridden in Polyfills (http://sandbox.knarly.com/js/dropfiles/).
- var files = (e.files || e.dataTransfer.files);
- for (var i = 0; i < files.length; i++) {
- // Loop through our files with a closure so each of our FileReader's are isolated.
- (function (i) {
- if(typeof FileReader !== "undefined") {
- var reader = new FileReader();
- reader.onload = function (event) {
- callback({
- src: event.target.result,
- title: (files[i].name),
- alt: (files[i].name)
- });
- };
- reader.readAsDataURL(files[i]);
- }
- })(i);
- }
- return false;
- });
- }
- }
- })
- }
+ // Using e.files with fallback because e.dataTransfer is immutable and can't be overridden in Polyfills (http://sandbox.knarly.com/js/dropfiles/).
+ var files = (e.files || e.dataTransfer.files);
+ for (var i = 0; i < files.length; i++) {
+ // Loop through our files with a closure so each of our FileReader's are isolated.
+ (function (i) {
+ if(typeof FileReader !== "undefined") {
+ var reader = new FileReader();
+ reader.onload = function (event) {
+ callback({
+ src: event.target.result,
+ title: (files[i].name),
+ alt: (files[i].name)
+ });
+ };
+ reader.readAsDataURL(files[i]);
+ }
+ })(i);
+ }
+ return false;
+ });
+ }
+ }
+ })
+ }
});
return self;
})();
\ No newline at end of file
diff --git a/resources/library/interactivities/Memory.wgt/js/main.js b/resources/library/interactivities/Memory.wgt/js/main.js
index 0377a27e..1becd0ce 100644
--- a/resources/library/interactivities/Memory.wgt/js/main.js
+++ b/resources/library/interactivities/Memory.wgt/js/main.js
@@ -6,10 +6,10 @@ var Card = (function() {
value: -1,
writable: true
},
- id: {
- value: -1,
+ id: {
+ value: -1,
writable: true
- },
+ },
index: {
value: -1,
writable: true
@@ -39,32 +39,32 @@ var Game = (function() {
},
init: {
value: function(count) {
- if(typeof count !== "number"){
- log("Cards count must be an number");
- return;
- }
- this.cards = new Array(count);
+ if(typeof count !== "number"){
+ log("Cards count must be an number");
+ return;
+ }
+ this.cards = new Array(count);
for (i = 0; i < this.cards.length / 2; i++) {
var card = Object.create(Card, {
val: {
value: i+1
},
- id: {
- value: i*2
- }
+ id: {
+ value: i*2
+ }
});
- card.index = card.id;
+ card.index = card.id;
var card2 = Object.create(Card, {
val: {
value: i+1
},
- id: {
- value: card.index+1
- }
+ id: {
+ value: card.index+1
+ }
});
- card2.index = card2.id;
- this.cards[card.index] = card;
- this.cards[card2.index] = card2;
+ card2.index = card2.id;
+ this.cards[card.index] = card;
+ this.cards[card2.index] = card2;
}
}
},
@@ -77,17 +77,17 @@ var Game = (function() {
})();
function onTemplateLoadedCallback() {
- $("select[name=count]").each(function(i, select) {
- var min = $(select).data("min");
- var max = $(select).data("max");
- for(var i = min ; i <= max ; i=i+2) {
- var option = $("");
- option.val(i);
- option.text(fr.njin.i18n.memory.parameters.option.cards(i));
- $(select).append(option);
- }
- });
- /*
+ $("select[name=count]").each(function(i, select) {
+ var min = $(select).data("min");
+ var max = $(select).data("max");
+ for(var i = min ; i <= max ; i=i+2) {
+ var option = $("");
+ option.val(i);
+ option.text(fr.njin.i18n.memory.parameters.option.cards(i));
+ $(select).append(option);
+ }
+ });
+/*
$("#timeoutValue").text($("input[name=timeout]").val());
$("input[name=timeout]").change(function(){
$("#timeoutValue").text($(this).val());
@@ -96,146 +96,149 @@ function onTemplateLoadedCallback() {
}
function reloadApp(app) {
- var cardsCount = parseInt(app.parameters.value("count"));
- var timeout = parseInt(app.parameters.value("timeout"))*1000;
+ var cardsCount = parseInt(app.parameters.value("count"));
+ var timeout = parseInt(app.parameters.value("timeout"))*1000;
- var scene = $("#scene");
- var table = $("");
- scene.empty();
- scene.append(table);
+ var scene = $("#scene");
+ var table = $("");
+ scene.empty();
+ scene.append(table);
- var game = Object.create(Game);
- game.init(cardsCount);
+ var game = Object.create(Game);
+ game.init(cardsCount);
- var rows = new Array(game.cards.length/2);
- for(i = 0 ; i < game.cards.length/2 ; i++) {
- var row = $("");
- table.append(row);
- rows[i] = row;
- }
+ var rows = new Array(game.cards.length/2);
+ for(i = 0 ; i < game.cards.length/2 ; i++) {
+ var row = $("");
+ table.append(row);
+ rows[i] = row;
+ }
- if(!app.onEdit)
- app.utils.shuffle(game.cards);
+ if(!app.onEdit)
+ app.utils.shuffle(game.cards);
- for(i = 0 ; i < game.cards.length ; i++) {
- (function(){
- var card = game.cards[i];
- var defaultValue = defaults[card.index]
- card.index = i;
+ for(i = 0 ; i < game.cards.length ; i++) {
+ (function(){
+ var card = game.cards[i];
+ var defaultValue = defaults[card.index]
+ card.index = i;
- var pFrontTextKey = cardTextParameterKey(card, 0);
- var pBackTextKey = cardTextParameterKey(card, 1);
- window.card = card;
- window.frontDisplayValue = app.parameters.value(pFrontTextKey) || "?";
- window.backDisplayValue = app.parameters.value(pBackTextKey) || defaultValue;
+ var pFrontTextKey = cardTextParameterKey(card, 0);
+ var pBackTextKey = cardTextParameterKey(card, 1);
+ window.card = card;
+ window.frontDisplayValue = app.parameters.value(pFrontTextKey) || "?";
+ window.backDisplayValue = app.parameters.value(pBackTextKey) || defaultValue;
- var cardView = $(Mustache.render(cardTemplate, window));
- rows[i%2].append(cardView);
- cardView.data("card", card);
+ var cardView = $(Mustache.render(cardTemplate, window));
+ rows[i%2].append(cardView);
+ cardView.data("card", card);
- var checkbox = cardView.find("input[name='switch']");
- function setSwicth(index) {
- var val = app.parameters.value("#UsePicture"+cardParameterKey(card, index)) === "true";
- var $p = cardView.find(".cards > div").eq(index);
- if(val) {
- $p.addClass("usePicture");
- }else {
- $p.removeClass("usePicture");
- }
- checkbox.eq(index).attr("checked", val);
- }
- checkbox.each(function(index) {
- $(this).change(function() {
- app.parameters.value("#UsePicture"+cardParameterKey(card, index), $(this).is(':checked'));
- setSwicth(index);
- });
- });
- setSwicth(0);
- setSwicth(1);
+ var checkbox = cardView.find("input[name='switch']");
+ function setSwicth(index) {
+ var val = app.parameters.value("#UsePicture"+cardParameterKey(card, index)) === "true";
+ var $p = cardView.find(".cards > div").eq(index);
+ if(val) {
+ $p.addClass("usePicture");
+ }else {
+ $p.removeClass("usePicture");
+ }
+ checkbox.eq(index).attr("checked", val);
+ }
+ checkbox.each(function(index) {
+ $(this).change(function() {
+ app.parameters.value("#UsePicture"+cardParameterKey(card, index), $(this).is(':checked'));
+ setSwicth(index);
+ });
+ });
+ setSwicth(0);
+ setSwicth(1);
- var dropzone = cardView.find(".dropzone");
+ var dropzone = cardView.find(".dropzone");
- function setPicture(index) {
- var f = $.parseJSON(app.parameters.value("#Picture"+cardParameterKey(card, index)));
- var pictureHolder = dropzone.eq(index).parent().find(">div:eq(0)");
- if(f !== null) {
- var $img = $('').attr(f);
- pictureHolder.empty();
- pictureHolder.append($img);
- }
- }
- dropzone.each(function(index){
- app.utils.droppable($(this), function(f) {
- app.parameters.value("#Picture"+cardParameterKey(card, index), JSON.stringify(f));
- setPicture(index);
- });
- });
- setPicture(0);
- setPicture(1);
- })();
- }
- if(!app.onEdit) {
- $(".cards>div:first-child").click(function(){
- var cardView = $(this).parent();
- var card = cardView.parent().parent().data("card");
- cardView.toggleClass("flip");
- log("Flip card at index "+card.index+" w/ value "+card.val);
- if(game.selected == null)
- game.selected = card;
- else{
- var toCompare = game.selected;
- log("Compare w/ card at index "+toCompare.index+" w/ value "+toCompare.val);
- var isMatch = card.isMatch(toCompare);
- if(!isMatch) {
- var index = toCompare.index;
- var otherCardView = rows[index%2].find(">div").eq(Math.floor(index/2)).find(".cards:eq(0)");
- setTimeout(function(){
- cardView.toggleClass("flip");
- otherCardView.toggleClass("flip");
- }, timeout);
- }else{
- game.matches++;
- }
- game.selected = null;
- }
- });
- }else{
- $(".card .text > div").each(function(i, e) {
- var card = $(e).parent().parent().parent().parent().parent().parent().data("card");
- var pKey = cardTextParameterKey(card, i);
- e.contentEditable = true;
- $(e).bind('blur keyup paste', function(){
- app.parameters.value(pKey, $(this).text());
- });
- });
- $(".card-container .actions button[role=flip]").click(function(){
- var cardView = $(this).parent().parent().find(">.cards:eq(0)");
- cardView.toggleClass("flip");
- });
- $(".card-container .actions button[role=flip]").click();
- }
- if(window.sankore)
- window.sankore.enableDropOnWidget(app.onEdit);
+ function setPicture(index) {
+ var f = $.parseJSON(app.parameters.value("#Picture"+cardParameterKey(card, index)));
+ var pictureHolder = dropzone.eq(index).parent().find(">div:eq(0)");
+ if(f !== null) {
+ var $img = $('').attr(f);
+ pictureHolder.empty();
+ pictureHolder.append($img);
+ }
+ }
+ dropzone.each(function(index){
+ app.utils.droppable($(this), function(f) {
+ app.parameters.value("#Picture"+cardParameterKey(card, index), JSON.stringify(f));
+ setPicture(index);
+ });
+ });
+ setPicture(0);
+ setPicture(1);
+ })();
+ }
+ if(!app.onEdit) {
+ $(".cards>div:first-child").click(function(){
+ var cardView = $(this).parent();
+ var card = cardView.parent().parent().data("card");
+ cardView.toggleClass("flip");
+ log("Flip card at index "+card.index+" w/ value "+card.val);
+ if(game.selected == null)
+ game.selected = card;
+ else{
+ var toCompare = game.selected;
+ log("Compare w/ card at index "+toCompare.index+" w/ value "+toCompare.val);
+ var isMatch = card.isMatch(toCompare);
+ if(!isMatch) {
+ var index = toCompare.index;
+ var otherCardView = rows[index%2].find(">div").eq(Math.floor(index/2)).find(".cards:eq(0)");
+ setTimeout(function(){
+ cardView.toggleClass("flip");
+ otherCardView.toggleClass("flip");
+ }, timeout);
+ }else{
+ game.matches++;
+ }
+ game.selected = null;
+ }
+ });
+ }else{
+ $(".card .text > div").each(function(i, e) {
+ var card = $(e).parent().parent().parent().parent().parent().parent().data("card");
+ var pKey = cardTextParameterKey(card, i);
+ e.contentEditable = true;
+ $(e).bind('blur keyup paste', function(){
+ app.parameters.value(pKey, $(this).text());
+ });
+ });
+ $(".card-container .actions button[role=flip]").click(function(){
+ var cardView = $(this).parent().parent().find(">.cards:eq(0)");
+ cardView.toggleClass("flip");
+ });
+ $(".card-container .actions button[role=flip]").click();
+ }
+ if(window.sankore)
+ window.sankore.enableDropOnWidget(app.onEdit);
}
function cardParameterKey(card, i) {
- return "card"+card.id+(i%2==0 ? "Front":"Back");
+ return "card"+card.id+(i%2==0 ? "Front":"Back");
}
function cardTextParameterKey(card, i) {
- return cardParameterKey(card, i)+"Text";
+ return cardParameterKey(card, i)+"Text";
}
function reloadCallback(parameter) {
- if(parameter === undefined || parameter.key === "count")
- reloadApp(this);
+ if(parameter === undefined || parameter.key === "count")
+ reloadApp(this);
}
$(document).ready(function(){
- var callbacks = {
- onTemplatesLoaded: onTemplateLoadedCallback,
- onEdit: reloadApp,
- onView: reloadApp
- };
- init(reloadCallback, {toolbar: toolbarTemplate, parameters: parametersTemplate}, callbacks);
+ var callbacks = {
+ onTemplatesLoaded: onTemplateLoadedCallback,
+ onEdit: reloadApp,
+ onView: reloadApp
+ };
+ init(reloadCallback, {
+ toolbar: toolbarTemplate,
+ parameters: parametersTemplate
+ }, callbacks);
});
\ No newline at end of file
diff --git a/resources/library/interactivities/Transformation.wgt/config.xml b/resources/library/interactivities/Transformation.wgt/config.xml
index fca20dd9..44588cfd 100644
--- a/resources/library/interactivities/Transformation.wgt/config.xml
+++ b/resources/library/interactivities/Transformation.wgt/config.xml
@@ -3,8 +3,8 @@
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.njin.fr/sankore/apps/tableur"
version="1.0"
- width="972"
- height="400"
+ width="1050"
+ height="560"
ub:resizable="true">
La boite à transformation