Index: lams_central/web/css/jquery.minicolors.css =================================================================== diff -u --- lams_central/web/css/jquery.minicolors.css (revision 0) +++ lams_central/web/css/jquery.minicolors.css (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -0,0 +1,319 @@ +.minicolors { + position: relative; +} + +.minicolors-sprite { + background-image: url(../images/css/jquery.minicolors.png); +} + +.minicolors-swatch { + position: absolute; + vertical-align: middle; + background-position: -80px 0; + border: solid 1px #ccc; + cursor: text; + padding: 0; + margin: 0; + display: inline-block; +} + +.minicolors-swatch-color { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.minicolors input[type=hidden] + .minicolors-swatch { + width: 28px; + position: static; + cursor: pointer; +} + +.minicolors input[type=hidden][disabled] + .minicolors-swatch { + cursor: default; +} + +/* Panel */ +.minicolors-panel { + position: absolute; + width: 173px; + background: white; + border: solid 1px #CCC; + box-shadow: 0 0 20px rgba(0, 0, 0, .2); + z-index: 99999; + box-sizing: content-box; + display: none; +} + +.minicolors-panel.minicolors-visible { + display: block; +} + +/* Panel positioning */ +.minicolors-position-top .minicolors-panel { + top: -154px; +} + +.minicolors-position-right .minicolors-panel { + right: 0; +} + +.minicolors-position-bottom .minicolors-panel { + top: auto; +} + +.minicolors-position-left .minicolors-panel { + left: 0; +} + +.minicolors-with-opacity .minicolors-panel { + width: 194px; +} + +.minicolors .minicolors-grid { + position: relative; + top: 1px; + left: 1px; + width: 150px; + height: 150px; + background-position: -120px 0; + cursor: crosshair; +} + +.minicolors .minicolors-grid-inner { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; +} + +.minicolors-slider-saturation .minicolors-grid { + background-position: -420px 0; +} + +.minicolors-slider-saturation .minicolors-grid-inner { + background-position: -270px 0; + background-image: inherit; +} + +.minicolors-slider-brightness .minicolors-grid { + background-position: -570px 0; +} + +.minicolors-slider-brightness .minicolors-grid-inner { + background-color: black; +} + +.minicolors-slider-wheel .minicolors-grid { + background-position: -720px 0; +} + +.minicolors-slider, +.minicolors-opacity-slider { + position: absolute; + top: 1px; + left: 152px; + width: 20px; + height: 150px; + background-color: white; + background-position: 0 0; + cursor: row-resize; +} + +.minicolors-slider-saturation .minicolors-slider { + background-position: -60px 0; +} + +.minicolors-slider-brightness .minicolors-slider { + background-position: -20px 0; +} + +.minicolors-slider-wheel .minicolors-slider { + background-position: -20px 0; +} + +.minicolors-opacity-slider { + left: 173px; + background-position: -40px 0; + display: none; +} + +.minicolors-with-opacity .minicolors-opacity-slider { + display: block; +} + +/* Pickers */ +.minicolors-grid .minicolors-picker { + position: absolute; + top: 70px; + left: 70px; + width: 12px; + height: 12px; + border: solid 1px black; + border-radius: 10px; + margin-top: -6px; + margin-left: -6px; + background: none; +} + +.minicolors-grid .minicolors-picker > div { + position: absolute; + top: 0; + left: 0; + width: 8px; + height: 8px; + border-radius: 8px; + border: solid 2px white; + box-sizing: content-box; +} + +.minicolors-picker { + position: absolute; + top: 0; + left: 0; + width: 18px; + height: 2px; + background: white; + border: solid 1px black; + margin-top: -2px; + box-sizing: content-box; +} + +/* Swatches */ +.minicolors-swatches, +.minicolors-swatches li { + margin: 5px 0 3px 5px; + padding: 0; + list-style: none; + overflow: hidden; +} + +.minicolors-swatches .minicolors-swatch { + position: relative; + float: left; + cursor: pointer; + margin:0 4px 0 0; +} + +.minicolors-with-opacity .minicolors-swatches .minicolors-swatch { + margin-right: 7px; +} + +.minicolors-swatch.selected { + border-color: #000; +} + +/* Inline controls */ +.minicolors-inline { + display: inline-block; +} + +.minicolors-inline .minicolors-input { + display: none !important; +} + +.minicolors-inline .minicolors-panel { + position: relative; + top: auto; + left: auto; + box-shadow: none; + z-index: auto; + display: inline-block; +} + +/* Default theme */ +.minicolors-theme-default .minicolors-swatch { + top: 5px; + left: 5px; + width: 18px; + height: 18px; +} +.minicolors-theme-default .minicolors-swatches .minicolors-swatch { + margin-bottom: 2px; + top: 0; + left: 0; + width: 18px; + height: 18px; +} +.minicolors-theme-default.minicolors-position-right .minicolors-swatch { + left: auto; + right: 5px; +} +.minicolors-theme-default.minicolors { + width: auto; + display: inline-block; +} +.minicolors-theme-default .minicolors-input { + height: 20px; + width: auto; + display: inline-block; + padding-left: 26px; +} +.minicolors-theme-default.minicolors-position-right .minicolors-input { + padding-right: 26px; + padding-left: inherit; +} + +/* Bootstrap theme */ +.minicolors-theme-bootstrap .minicolors-swatch { + z-index: 2; + top: 3px; + left: 3px; + width: 28px; + height: 28px; + border-radius: 3px; +} +.minicolors-theme-bootstrap .minicolors-swatches .minicolors-swatch { + margin-bottom: 2px; + top: 0; + left: 0; + width: 20px; + height: 20px; +} +.minicolors-theme-bootstrap .minicolors-swatch-color { + border-radius: inherit; +} +.minicolors-theme-bootstrap.minicolors-position-right > .minicolors-swatch { + left: auto; + right: 3px; +} +.minicolors-theme-bootstrap .minicolors-input { + float: none; + padding-left: 44px; +} +.minicolors-theme-bootstrap.minicolors-position-right .minicolors-input { + padding-right: 44px; + padding-left: 12px; +} +.minicolors-theme-bootstrap .minicolors-input.input-lg + .minicolors-swatch { + top: 4px; + left: 4px; + width: 37px; + height: 37px; + border-radius: 5px; +} +.minicolors-theme-bootstrap .minicolors-input.input-sm + .minicolors-swatch { + width: 24px; + height: 24px; +} +.minicolors-theme-bootstrap .minicolors-input.input-xs + .minicolors-swatch { + width: 18px; + height: 18px; +} +.input-group .minicolors-theme-bootstrap:not(:first-child) .minicolors-input { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +/* Semantic Ui theme */ +.minicolors-theme-semanticui .minicolors-swatch { + top: 0; + left: 0; + padding: 18px; +} +.minicolors-theme-semanticui input { + text-indent: 30px; +} Index: lams_central/web/images/css/jquery.minicolors.png =================================================================== diff -u Binary files differ Index: lams_central/web/includes/javascript/jquery.minicolors.min.js =================================================================== diff -u --- lams_central/web/includes/javascript/jquery.minicolors.min.js (revision 0) +++ lams_central/web/includes/javascript/jquery.minicolors.min.js (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -0,0 +1,8 @@ +// +// jQuery MiniColors: A tiny color picker built on jQuery +// +// Developed by Cory LaViska for A Beautiful Site, LLC +// +// Licensed under the MIT license: http://opensource.org/licenses/MIT +// +!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";function t(t,o){var s,a,n,e,r,l=i('
'),h=i.minicolors.defaults;if(!t.data("minicolors-initialized")){if(o=i.extend(!0,{},h,o),l.addClass("minicolors-theme-"+o.theme).toggleClass("minicolors-with-opacity",o.opacity),void 0!==o.position&&i.each(o.position.split(" "),function(){l.addClass("minicolors-position-"+this)}),s="rgb"===o.format?o.opacity?"25":"20":o.keywords?"11":"7",t.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",o).prop("size",s).wrap(l).after('
'),o.inline||(t.after(''),t.next(".minicolors-input-swatch").on("click",function(i){i.preventDefault(),t.focus()})),e=t.parent().find(".minicolors-panel"),e.on("selectstart",function(){return!1}).end(),o.swatches&&0!==o.swatches.length)for(e.addClass("minicolors-with-swatches"),a=i('').appendTo(e),r=0;r').appendTo(a).data("swatch-color",o.swatches[r]).find(".minicolors-swatch-color").css({backgroundColor:C(n),opacity:n.a}),o.swatches[r]=n;o.inline&&t.parent().addClass("minicolors-inline"),c(t,!1),t.data("minicolors-initialized",!0)}}function o(i){var t=i.parent();i.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(i).remove()}function s(i){var t=i.parent(),o=t.find(".minicolors-panel"),s=i.data("minicolors-settings");!i.data("minicolors-initialized")||i.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus")||(a(),t.addClass("minicolors-focus"),o.stop(!0,!0).fadeIn(s.showSpeed,function(){s.show&&s.show.call(i.get(0))}))}function a(){i(".minicolors-focus").each(function(){var t=i(this),o=t.find(".minicolors-input"),s=t.find(".minicolors-panel"),a=o.data("minicolors-settings");s.fadeOut(a.hideSpeed,function(){a.hide&&a.hide.call(o.get(0)),t.removeClass("minicolors-focus")})})}function n(i,t,o){var s,a,n,r,c=i.parents(".minicolors").find(".minicolors-input"),l=c.data("minicolors-settings"),h=i.find("[class$=-picker]"),d=i.offset().left,p=i.offset().top,u=Math.round(t.pageX-d),g=Math.round(t.pageY-p),m=o?l.animationSpeed:0;t.originalEvent.changedTouches&&(u=t.originalEvent.changedTouches[0].pageX-d,g=t.originalEvent.changedTouches[0].pageY-p),u<0&&(u=0),g<0&&(g=0),u>i.width()&&(u=i.width()),g>i.height()&&(g=i.height()),i.parent().is(".minicolors-slider-wheel")&&h.parent().is(".minicolors-grid")&&(s=75-u,a=75-g,n=Math.sqrt(s*s+a*a),r=Math.atan2(a,s),r<0&&(r+=2*Math.PI),n>75&&(n=75,u=75-75*Math.cos(r),g=75-75*Math.sin(r)),u=Math.round(u),g=Math.round(g)),i.is(".minicolors-grid")?h.stop(!0).animate({top:g+"px",left:u+"px"},m,l.animationEasing,function(){e(c,i)}):h.stop(!0).animate({top:g+"px"},m,l.animationEasing,function(){e(c,i)})}function e(i,t){function o(i,t){var o,s;return i.length&&t?(o=i.offset().left,s=i.offset().top,{x:o-t.offset().left+i.outerWidth()/2,y:s-t.offset().top+i.outerHeight()/2}):null}var s,a,n,e,c,h,d,p=i.val(),u=i.attr("data-opacity"),g=i.parent(),m=i.data("minicolors-settings"),v=g.find(".minicolors-input-swatch"),b=g.find(".minicolors-grid"),w=g.find(".minicolors-slider"),y=g.find(".minicolors-opacity-slider"),C=b.find("[class$=-picker]"),M=w.find("[class$=-picker]"),x=y.find("[class$=-picker]"),I=o(C,b),S=o(M,w),z=o(x,y);if(t.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")){switch(m.control){case"wheel":e=b.width()/2-I.x,c=b.height()/2-I.y,h=Math.sqrt(e*e+c*c),d=Math.atan2(c,e),d<0&&(d+=2*Math.PI),h>75&&(h=75,I.x=69-75*Math.cos(d),I.y=69-75*Math.sin(d)),a=f(h/.75,0,100),s=f(180*d/Math.PI,0,360),n=f(100-Math.floor(S.y*(100/w.height())),0,100),p=k({h:s,s:a,b:n}),w.css("backgroundColor",k({h:s,s:a,b:100}));break;case"saturation":s=f(parseInt(I.x*(360/b.width()),10),0,360),a=f(100-Math.floor(S.y*(100/w.height())),0,100),n=f(100-Math.floor(I.y*(100/b.height())),0,100),p=k({h:s,s:a,b:n}),w.css("backgroundColor",k({h:s,s:100,b:n})),g.find(".minicolors-grid-inner").css("opacity",a/100);break;case"brightness":s=f(parseInt(I.x*(360/b.width()),10),0,360),a=f(100-Math.floor(I.y*(100/b.height())),0,100),n=f(100-Math.floor(S.y*(100/w.height())),0,100),p=k({h:s,s:a,b:n}),w.css("backgroundColor",k({h:s,s:a,b:100})),g.find(".minicolors-grid-inner").css("opacity",1-n/100);break;default:s=f(360-parseInt(S.y*(360/w.height()),10),0,360),a=f(Math.floor(I.x*(100/b.width())),0,100),n=f(100-Math.floor(I.y*(100/b.height())),0,100),p=k({h:s,s:a,b:n}),b.css("backgroundColor",k({h:s,s:100,b:100}))}u=m.opacity?parseFloat(1-z.y/y.height()).toFixed(2):1,r(i,p,u)}else v.find("span").css({backgroundColor:p,opacity:u}),l(i,p,u)}function r(i,t,o){var s,a=i.parent(),n=i.data("minicolors-settings"),e=a.find(".minicolors-input-swatch");n.opacity&&i.attr("data-opacity",o),"rgb"===n.format?(s=v(t)?g(t,!0):I(u(t,!0)),o=""===i.attr("data-opacity")?1:f(parseFloat(i.attr("data-opacity")).toFixed(2),0,1),!isNaN(o)&&n.opacity||(o=1),t=i.minicolors("rgbObject").a<=1&&s&&n.opacity?"rgba("+s.r+", "+s.g+", "+s.b+", "+parseFloat(o)+")":"rgb("+s.r+", "+s.g+", "+s.b+")"):(v(t)&&(t=y(t)),t=p(t,n.letterCase)),i.val(t),e.find("span").css({backgroundColor:t,opacity:o}),l(i,t,o)}function c(t,o){var s,a,n,e,r,c,h,d,w,C,x=t.parent(),I=t.data("minicolors-settings"),S=x.find(".minicolors-input-swatch"),z=x.find(".minicolors-grid"),F=x.find(".minicolors-slider"),T=x.find(".minicolors-opacity-slider"),D=z.find("[class$=-picker]"),j=F.find("[class$=-picker]"),q=T.find("[class$=-picker]");switch(v(t.val())?(s=y(t.val()),r=f(parseFloat(b(t.val())).toFixed(2),0,1),r&&t.attr("data-opacity",r)):s=p(u(t.val(),!0),I.letterCase),s||(s=p(m(I.defaultValue,!0),I.letterCase)),a=M(s),e=I.keywords?i.map(I.keywords.split(","),function(t){return i.trim(t.toLowerCase())}):[],c=""!==t.val()&&i.inArray(t.val().toLowerCase(),e)>-1?p(t.val()):v(t.val())?g(t.val()):s,o||t.val(c),I.opacity&&(n=""===t.attr("data-opacity")?1:f(parseFloat(t.attr("data-opacity")).toFixed(2),0,1),isNaN(n)&&(n=1),t.attr("data-opacity",n),S.find("span").css("opacity",n),d=f(T.height()-T.height()*n,0,T.height()),q.css("top",d+"px")),"transparent"===t.val().toLowerCase()&&S.find("span").css("opacity",0),S.find("span").css("backgroundColor",s),I.control){case"wheel":w=f(Math.ceil(.75*a.s),0,z.height()/2),C=a.h*Math.PI/180,h=f(75-Math.cos(C)*w,0,z.width()),d=f(75-Math.sin(C)*w,0,z.height()),D.css({top:d+"px",left:h+"px"}),d=150-a.b/(100/z.height()),""===s&&(d=0),j.css("top",d+"px"),F.css("backgroundColor",k({h:a.h,s:a.s,b:100}));break;case"saturation":h=f(5*a.h/12,0,150),d=f(z.height()-Math.ceil(a.b/(100/z.height())),0,z.height()),D.css({top:d+"px",left:h+"px"}),d=f(F.height()-a.s*(F.height()/100),0,F.height()),j.css("top",d+"px"),F.css("backgroundColor",k({h:a.h,s:100,b:a.b})),x.find(".minicolors-grid-inner").css("opacity",a.s/100);break;case"brightness":h=f(5*a.h/12,0,150),d=f(z.height()-Math.ceil(a.s/(100/z.height())),0,z.height()),D.css({top:d+"px",left:h+"px"}),d=f(F.height()-a.b*(F.height()/100),0,F.height()),j.css("top",d+"px"),F.css("backgroundColor",k({h:a.h,s:a.s,b:100})),x.find(".minicolors-grid-inner").css("opacity",1-a.b/100);break;default:h=f(Math.ceil(a.s/(100/z.width())),0,z.width()),d=f(z.height()-Math.ceil(a.b/(100/z.height())),0,z.height()),D.css({top:d+"px",left:h+"px"}),d=f(F.height()-a.h/(360/F.height()),0,F.height()),j.css("top",d+"px"),z.css("backgroundColor",k({h:a.h,s:100,b:100}))}t.data("minicolors-initialized")&&l(t,c,n)}function l(i,t,o){var s,a,n,e=i.data("minicolors-settings"),r=i.data("minicolors-lastChange");if(!r||r.value!==t||r.opacity!==o){if(i.data("minicolors-lastChange",{value:t,opacity:o}),e.swatches&&0!==e.swatches.length){for(s=v(t)?g(t,!0):I(t),a=-1,n=0;no&&(i=o),i}function v(i){var t=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return!(!t||4!==t.length)}function b(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i),i&&6===i.length?i[4]:"1"}function w(i){var t={},o=Math.round(i.h),s=Math.round(255*i.s/100),a=Math.round(255*i.b/100);if(0===s)t.r=t.g=t.b=a;else{var n=a,e=(255-s)*a/255,r=(n-e)*(o%60)/60;360===o&&(o=0),o<60?(t.r=n,t.b=e,t.g=e+r):o<120?(t.g=n,t.b=e,t.r=n-r):o<180?(t.g=n,t.r=e,t.b=e+r):o<240?(t.b=n,t.r=e,t.g=n-r):o<300?(t.b=n,t.g=e,t.r=e+r):o<360?(t.r=n,t.g=e,t.b=n-r):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function y(i){return i=i.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i),i&&4===i.length?"#"+("0"+parseInt(i[1],10).toString(16)).slice(-2)+("0"+parseInt(i[2],10).toString(16)).slice(-2)+("0"+parseInt(i[3],10).toString(16)).slice(-2):""}function C(t){var o=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];return i.each(o,function(i,t){1===t.length&&(o[i]="0"+t)}),"#"+o.join("")}function k(i){return C(w(i))}function M(i){var t=x(I(i));return 0===t.s&&(t.h=360),t}function x(i){var t={h:0,s:0,b:0},o=Math.min(i.r,i.g,i.b),s=Math.max(i.r,i.g,i.b),a=s-o;return t.b=s,t.s=0!==s?255*a/s:0,0!==t.s?i.r===s?t.h=(i.g-i.b)/a:i.g===s?t.h=2+(i.b-i.r)/a:t.h=4+(i.r-i.g)/a:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function I(i){return i=parseInt(i.indexOf("#")>-1?i.substring(1):i,16),{r:i>>16,g:(65280&i)>>8,b:255&i}}i.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",defaultValue:"",format:"hex",hide:null,hideSpeed:100,inline:!1,keywords:"",letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default",swatches:[]}},i.extend(i.fn,{minicolors:function(n,e){switch(n){case"destroy":return i(this).each(function(){o(i(this))}),i(this);case"hide":return a(),i(this);case"opacity":return void 0===e?i(this).attr("data-opacity"):(i(this).each(function(){c(i(this).attr("data-opacity",e))}),i(this));case"rgbObject":return h(i(this),"rgbaObject"===n);case"rgbString":case"rgbaString":return d(i(this),"rgbaString"===n);case"settings":return void 0===e?i(this).data("minicolors-settings"):(i(this).each(function(){var t=i(this).data("minicolors-settings")||{};o(i(this)),i(this).minicolors(i.extend(!0,t,e))}),i(this));case"show":return s(i(this).eq(0)),i(this);case"value":return void 0===e?i(this).val():(i(this).each(function(){"object"==typeof e&&"null"!==e?(e.opacity&&i(this).attr("data-opacity",f(e.opacity,0,1)),e.color&&i(this).val(e.color)):i(this).val(e),c(i(this))}),i(this));default:return"create"!==n&&(e=n),i(this).each(function(){t(i(this),e)}),i(this)}}}),i([document,top.document]).on("mousedown.minicolors touchstart.minicolors",function(t){i(t.target).parents().add(t.target).hasClass("minicolors")||a()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var o=i(this);t.preventDefault(),i(t.delegateTarget).data("minicolors-target",o),n(o,t,!0)}).on("mousemove.minicolors touchmove.minicolors",function(t){var o=i(t.delegateTarget).data("minicolors-target");o&&n(o,t)}).on("mouseup.minicolors touchend.minicolors",function(){i(this).removeData("minicolors-target")}).on("click.minicolors",".minicolors-swatches li",function(t){t.preventDefault();var o=i(this),s=o.parents(".minicolors").find(".minicolors-input"),a=o.data("swatch-color");r(s,a,b(a)),c(s)}).on("mousedown.minicolors touchstart.minicolors",".minicolors-input-swatch",function(t){var o=i(this).parent().find(".minicolors-input");t.preventDefault(),s(o)}).on("focus.minicolors",".minicolors-input",function(){var t=i(this);t.data("minicolors-initialized")&&s(t)}).on("blur.minicolors",".minicolors-input",function(){var t,o,s,a,n,e=i(this),r=e.data("minicolors-settings");e.data("minicolors-initialized")&&(t=r.keywords?i.map(r.keywords.split(","),function(t){return i.trim(t.toLowerCase())}):[],""!==e.val()&&i.inArray(e.val().toLowerCase(),t)>-1?n=e.val():(v(e.val())?s=g(e.val(),!0):(o=u(e.val(),!0),s=o?I(o):null),n=null===s?r.defaultValue:"rgb"===r.format?g(r.opacity?"rgba("+s.r+","+s.g+","+s.b+","+e.attr("data-opacity")+")":"rgb("+s.r+","+s.g+","+s.b+")"):C(s)),a=r.opacity?e.attr("data-opacity"):1,"transparent"===n.toLowerCase()&&(a=0),e.closest(".minicolors").find(".minicolors-input-swatch > span").css("opacity",a),e.val(n),""===e.val()&&e.val(m(r.defaultValue,!0)),e.val(p(e.val(),r.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(t){var o=i(this);if(o.data("minicolors-initialized"))switch(t.keyCode){case 9:a();break;case 13:case 27:a(),o.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var t=i(this);t.data("minicolors-initialized")&&c(t,!0)}).on("paste.minicolors",".minicolors-input",function(){var t=i(this);t.data("minicolors-initialized")&&setTimeout(function(){c(t,!0)},1)})}); \ No newline at end of file Index: lams_tool_mindmap/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -95,9 +95,9 @@ error.occured.during.save=An error occurred while saving. Please reload your page. label.your.mindmap.saved.every.minute=Your Mindmap will be saved automatically every minute and when you press Finish. label.zoom=Zoom -label.zoom.reset=Reset -label.zoom.increase=+ -label.zoom.decrease=- +label.zoom.reset=100% +label.zoom.increase=Zoom In +label.zoom.decrease=Zoom Out label.add.idea=Add Idea label.edit.idea.text=Edit Idea Text label.delete.idea=Delete Idea Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java (.../LearningAction.java) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java (.../LearningAction.java) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -66,7 +66,6 @@ import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeModel; import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NotifyRequestModel; import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NotifyResponseModel; -import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.PollResponseModel; import org.lamsfoundation.lams.tool.mindmap.web.forms.LearningForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.Configuration; @@ -730,108 +729,6 @@ } /** - * Returns lists of Poll Requests (Actions) on Mindmap Nodes made by other learners - * - * @param mapping - * @param form - * @param request - * @param response - * @return null - */ - public ActionForward pollServerAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - - Long mindmapId = WebUtil.readLongParam(request, "mindmapId", false); - Long userId = WebUtil.readLongParam(request, "userId", false); - Long toolSessionId = WebUtil.readLongParam(request, "sessionId", false); - Long lastActionId = WebUtil.readLongParam(request, "lastActionID", false); - - PollResponseModel pollResponseModel = new PollResponseModel(); - - List requestsList = mindmapService.getLastRequestsAfterGlobalId(lastActionId, mindmapId, userId, toolSessionId); - for (Iterator iterator = requestsList.iterator(); iterator.hasNext();) { - MindmapRequest mindmapRequest = (MindmapRequest) iterator.next(); - int requestType = mindmapRequest.getType(); - - NotifyRequestModel notifyRequestModel = null; - NodeConceptModel nodeConceptModel = null; - - MindmapNode rootMindmapNode = null; - if ((requestType != 0) && (requestType != 1)) { - //List nodesList = mindmapService.getMindmapNodeByUniqueId(mindmapRequest.getNodeId(), mindmapId); - List nodesList = mindmapService.getMindmapNodeByUniqueIdSessionId(mindmapRequest.getNodeId(), mindmapId, - toolSessionId); - - if ((nodesList != null) && (nodesList.size() > 0)) { - rootMindmapNode = (MindmapNode) nodesList.get(0); - } else { - LearningAction.log.error("pollServerAction(): Error finding node while changing text or color!"); - } - } - - MindmapNode mindmapNode = null; - if (requestType == 1) { - //List nodesList = mindmapService.getMindmapNodeByUniqueId(mindmapRequest.getNodeChildId(), mindmapId); - List nodesList = mindmapService.getMindmapNodeByUniqueIdSessionId(mindmapRequest.getNodeChildId(), - mindmapId, toolSessionId); - - if ((nodesList != null) && (nodesList.size() > 0)) { - mindmapNode = (MindmapNode) nodesList.get(0); - } else { - LearningAction.log.error("pollServerAction(): Error finding node while creating a node!"); - } - } - - // delete node - if (requestType == 0) { - notifyRequestModel = new NotifyRequestModel(mindmapRequest.getGlobalId(), mindmapRequest.getNodeId(), - mindmapRequest.getType(), null, null, null); - } - // create node - else if (requestType == 1) { - nodeConceptModel = new NodeConceptModel(); - nodeConceptModel.setId(mindmapNode.getUniqueId()); - nodeConceptModel.setText(mindmapNode.getText()); - nodeConceptModel.setColor(mindmapNode.getColor()); - - MindmapUser mindmapUser = mindmapNode.getUser(); - if (mindmapUser != null) { - nodeConceptModel.setCreator(mindmapUser.getFirstName() + " " + mindmapUser.getLastName()); - } else { - nodeConceptModel.setCreator("Student"); - } - - notifyRequestModel = new NotifyRequestModel(mindmapRequest.getGlobalId(), mindmapRequest.getNodeId(), - mindmapRequest.getType(), null, null, nodeConceptModel); - } - // change color - else if (requestType == 2) { - notifyRequestModel = new NotifyRequestModel(mindmapRequest.getGlobalId(), mindmapRequest.getNodeId(), - mindmapRequest.getType(), null, rootMindmapNode.getColor(), null); - } - // change text - else if (requestType == 3) { - notifyRequestModel = new NotifyRequestModel(mindmapRequest.getGlobalId(), mindmapRequest.getNodeId(), - mindmapRequest.getType(), rootMindmapNode.getText(), null, null); - } - - pollResponseModel.addNotifyRequest(notifyRequestModel); - } - - String pollResponse = mindmapService.getXStream().toXML(pollResponseModel); - - try { - response.setContentType("text/xml"); - response.setCharacterEncoding("utf-8"); - response.getWriter().write(pollResponse); - } catch (IOException e) { - e.printStackTrace(); - } - - return null; - } - - /** * Returns the serialized JSON of the Mindmap Nodes from Database * * @param mapping 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 --%> +<%-- --%> +<%-- --%> +<%-- --%> +
+
Index: lams_tool_mindmap/web/includes/css/mindmap.scss =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/web/includes/css/mindmap.scss (.../mindmap.scss) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/web/includes/css/mindmap.scss (.../mindmap.scss) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -2,7 +2,6 @@ #mindmap-controls { height: 50px; - overflow-y: scroll; padding: 5px; } Index: lams_tool_mindmap/web/includes/javascript/mapjs/main.js =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/web/includes/javascript/mapjs/main.js (.../main.js) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/web/includes/javascript/mapjs/main.js (.../main.js) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -12715,29 +12715,33 @@ imageInsertController = new MAPJS.ImageInsertController('http://localhost:4999?u='), mapModel = new MAPJS.MapModel(MAPJS.DOMRender.layoutCalculator, []); - jQuery.fn.attachmentEditorWidget = function (mapModel) { - return this.each(function () { - mapModel.addEventListener('attachmentOpened', function (nodeId, attachment) { - mapModel.setAttachment( - 'attachmentEditorWidget', - nodeId, { - contentType: 'text/html', - content: window.prompt('attachment', attachment && attachment.content) - } - ); - }); - }); - }; +// LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. +// Re-enable when we support HTML attachments. +// jQuery.fn.attachmentEditorWidget = function (mapModel) { +// return this.each(function () { +// mapModel.addEventListener('attachmentOpened', function (nodeId, attachment) { +// mapModel.setAttachment( +// 'attachmentEditorWidget', +// nodeId, { +// contentType: 'text/html', +// content: window.prompt('attachment', attachment && attachment.content) +// } +// ); +// }); +// }); +// }; window.onerror = window.alert; jQuery('#themecss').themeCssWidget(themeProvider, new ThemeProcessor(), mapModel); container.domMapWidget(console, mapModel, false, imageInsertController); jQuery('body').mapToolbarWidget(mapModel); - jQuery('body').attachmentEditorWidget(mapModel); + // LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. + // Re-enable when we support HTML attachments. + // jQuery('body').attachmentEditorWidget(mapModel); + // mapModel.setIdea(idea); // LAMS Modification - jQuery('#linkEditWidget').linkEditWidget(mapModel); window.mapModel = mapModel; jQuery('.arrow').click(function () { @@ -19002,22 +19006,24 @@ } element.text(label).show(); }, - applyAttachment = function () { - const attachment = nodeContent.attr && nodeContent.attr.attachment; - let element = self.find('a.mapjs-attachment'); - if (!attachment) { - element.hide(); - return; - } - if (element.length === 0) { - element = jQuery(''). - appendTo(decorations()).click(function () { - self.trigger('attachment-click'); - self.trigger('decoration-click', 'attachment'); - }); - } - element.show(); - }, +// LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. +// Re-enable when we support HTML attachments. +// applyAttachment = function () { +// const attachment = nodeContent.attr && nodeContent.attr.attachment; +// let element = self.find('a.mapjs-attachment'); +// if (!attachment) { +// element.hide(); +// return; +// } +// if (element.length === 0) { +// element = jQuery(''). +// appendTo(decorations()).click(function () { +// self.trigger('attachment-click'); +// self.trigger('decoration-click', 'attachment'); +// }); +// } +// element.show(); +// }, applyNote = function () { const note = nodeContent.attr && nodeContent.attr.note; let element = self.find('a.mapjs-note'); @@ -19202,7 +19208,9 @@ applyLinkUrl(nodeContent.title); applyLabel(nodeContent.label); applyNote(); - applyAttachment(); + // LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. + // Re-enable when we support HTML attachments. + // applyAttachment(); this.css({margin: '', width: '', height: ''}); if (decorationEdge === 'left') { nodeCacheData.innerRect.dx = decorations().outerWidth(); @@ -19666,9 +19674,11 @@ } mapModel.editNode('mouse'); }) - .on('attachment-click', function () { - mapModel.openAttachment('mouse', node.id); - }) +// LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. +// Re-enable when we support HTML attachments. +// .on('attachment-click', function () { +// mapModel.openAttachment('mouse', node.id); +// }) .on('decoration-click', function (evt, decorationType) { mapModel.decorationAction('mouse', node.id, decorationType); }) @@ -20036,7 +20046,9 @@ '=': 'activateSiblingNodes', '.': 'activateSelectedNode', '/': 'toggleCollapse', - 'a': 'openAttachment', + // LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. + // Re-enable when we support HTML attachments. + // 'a': 'openAttachment', 'i': 'editIcon' }, self = this; @@ -21012,23 +21024,25 @@ analytic('decorationAction', source); self.dispatchEvent('decorationActionRequested', nodeId, decorationType); }; - this.openAttachment = function (source, nodeId) { - analytic('openAttachment', source); - nodeId = nodeId || currentlySelectedIdeaId; - const node = layoutModel.getNode(nodeId), - attachment = node && node.attr && node.attr.attachment; - if (node) { - self.dispatchEvent('attachmentOpened', nodeId, attachment); - } - }; - this.setAttachment = function (source, nodeId, attachment) { - const hasAttachment = !!(attachment && attachment.content); - if (!isEditingEnabled) { - return false; - } - analytic('setAttachment', source); - idea.updateAttr(nodeId, 'attachment', hasAttachment && attachment); - }; +// LAMS Modification. Disable attachments, otherwise a popup dialog appears when you typed on a locked idea. +// Re-enable when we support HTML attachments. +// this.openAttachment = function (source, nodeId) { +// analytic('openAttachment', source); +// nodeId = nodeId || currentlySelectedIdeaId; +// const node = layoutModel.getNode(nodeId), +// attachment = node && node.attr && node.attr.attachment; +// if (node) { +// self.dispatchEvent('attachmentOpened', nodeId, attachment); +// } +// }; +// this.setAttachment = function (source, nodeId, attachment) { +// const hasAttachment = !!(attachment && attachment.content); +// if (!isEditingEnabled) { +// return false; +// } +// analytic('setAttachment', source); +// idea.updateAttr(nodeId, 'attachment', hasAttachment && attachment); +// }; this.toggleLink = function (source, nodeIdTo) { const exists = _.find(idea.links, function (link) { return (String(link.ideaIdFrom) === String(nodeIdTo) && String(link.ideaIdTo) === String(currentlySelectedIdeaId)) || (String(link.ideaIdTo) === String(nodeIdTo) && String(link.ideaIdFrom) === String(currentlySelectedIdeaId)); @@ -21843,12 +21857,23 @@ return this.each(function () { const element = jQuery(this); let preventRoundtrip = false; - mapModel.addEventListener('nodeSelectionChanged', function () { + mapModel.addEventListener('nodeSelectionChanged', function (ideaId, isSelected) { preventRoundtrip = true; element.find('.updateStyle[data-mm-target-property]').val(function () { return mapModel.getSelectedStyle(jQuery(this).data('mm-target-property')); }).change(); preventRoundtrip = false; + // LAMS Modification - next 9 lines. Calls a LAMS methods to manage buttons and the color picker. + if ( isSelected ) { + updateColorPicker(); + var attr = mapModel.findIdeaById(ideaId).attr; + if ( attr && attr.contentLocked ) { + disableEditButtons(); + } else { + enableEditButtons(); + } + } + // End LAMS Modification }); mapModel.addEventListener('addLinkModeToggled', function () { element.find('.toggleAddLinkMode').toggleClass('active'); Index: lams_tool_mindmap/web/pages/authoring/authoring.jsp =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -1,13 +1,14 @@ <%@ include file="/common/taglibs.jsp"%> <%@ page import="org.lamsfoundation.lams.tool.mindmap.util.MindmapConstants"%> + + - + + Index: lams_tool_mindmap/web/pages/monitoring/mindmapDisplay.jsp =================================================================== diff -u -r9cda52bbbc8ef19343bd53f563c0734560af1a3a -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e --- lams_tool_mindmap/web/pages/monitoring/mindmapDisplay.jsp (.../mindmapDisplay.jsp) (revision 9cda52bbbc8ef19343bd53f563c0734560af1a3a) +++ lams_tool_mindmap/web/pages/monitoring/mindmapDisplay.jsp (.../mindmapDisplay.jsp) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e) @@ -1,13 +1,14 @@ <%@ include file="/common/taglibs.jsp"%> + - - - + + + + -