Index: lams_tool_mindmap/web/common/mapjs.jsp =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/web/common/mapjs.jsp (.../mapjs.jsp) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/web/common/mapjs.jsp (.../mapjs.jsp) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -43,8 +43,41 @@ alert('') } }); + + // color picker + $('#background-color').minicolors({ + control: 'wheel', + theme: 'bootstrap', + swatches: ['#ff0000', '#ffff00', '#0000ff', '#008000', '#00ff00', '#800080', '#ff00ff', '#00ffff', '#87ceeb', '#ffd700', '#ffa500', '#ffffff', '#9e9e9e', '#000000'], + change: function(value, opacity) { + window.mapModel['updateStyle']('toolbar', 'background', value); + } + + , changeDelay: 1500 // Wait a bit before updating node sending to server. + + }); + $('.minicolors').css('float','right'); + $('#background-color').minicolors({ + }); + } + // Greys out the buttons to discourage people from using them. The mindmap javascript code won't let them update the values. + function disableEditButtons() { + $(".editNode").attr("disabled", true); + $(".removeSubIdea").attr("disabled", true); + $(".updateStyle").attr("disabled", true); + } + + function enableEditButtons() { + $(".editNode").attr("disabled", false); + $(".removeSubIdea").attr("disabled", false); + $(".updateStyle").attr("disabled", false); + } + + function updateColorPicker() { + swatch = $('.minicolors').find('.minicolors-input-swatch').find('span').css("backgroundColor",$('#background-color').val()); + } @@ -60,7 +93,7 @@ } function onIdeaChangedLAMS(action, args, sessionId) { - console.log("onIdeaChangedLAMS: action "+action+" args "+args); + // console.log("onIdeaChangedLAMS: action "+action+" args "+args); var ideaToUpdate = null, updateRequest = null; @@ -211,17 +244,21 @@ } else if ( action.type == 1 ) { updateUnsavedNodeIds(action.childNodeId); // add node response.nodeId, response.title, response.color + debugger; contentAggregate.addSubIdea(action.nodeId, action.title, action.childNodeId); + var newChildNode = contentAggregate.findSubIdeaById(action.childNodeId); + newChildNode.attr = {}; + newChildNode.attr.contentLocked = true; if ( action.color ) { - var newChildNode = contentAggregate.findSubIdeaById(action.childNodeId); - newChildNode = action.color; + newChildNode.attr.style = {}; + newChildNode.attr.style.background = action.color; } } else if ( action.type == 2 ) { var ideaToUpdate = contentAggregate.findSubIdeaById(action.nodeId); if ( ! ideaToUpdate.attr ) { ideaToUpdate.attr = {}; } - if ( ! ideaToUpdate.style ) { + if ( ! ideaToUpdate.attr.style ) { ideaToUpdate.attr.style = {}; } ideaToUpdate.attr.style.background = action.color; @@ -250,7 +287,6 @@ function onIdeaChangedLAMS(action, args, sessionId) { - debugger; if ( ! (action == 'updateAttr' && args[1] == 'collapsed') ) { alert("label.no.changes.can.be.made.reloading.ideas"); loadRootIdea(mindMupContent); @@ -262,7 +298,7 @@ - + var savingNow = false; @@ -300,8 +336,9 @@ // saving Mindmap every one minute - do not bank up saves if server is taking too long. $.timer(60000, function (timer) { - if ( !savingNow ) + if ( !savingNow ) { saveSingleUserMindmap(); + } }); @@ -312,34 +349,40 @@ - +
+ + +
- - - - + : + + +
- +
+ - - - - Background: + + + + <%-- Not yet implemented in back end --%> +<%-- --%> +<%-- --%> +<%-- --%> +
+