diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 391d871..3365218 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -36,7 +36,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $("#sidebar-wrapper").on('click', function (event) { //4. on click disable menu option - $scope.$emit("cBEnableDisableMenuOption",""); + $scope.$emit("cBEnableDisableMenuOption", ""); }); // close all selected open panel in CB @@ -84,14 +84,34 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $('#HomeContainerDiv').css('pointer-events', 'none'); $('#HomeContainerDiv').css('opacity', '0.7'); + + $('#CBTextArea_ifr').css('pointer-events', 'none'); + $('#CBTextArea_ifr').css('opacity', '0.7'); + + + $('#jstree').css('pointer-events', 'none'); + $('#jstree').css('opacity', '0.7'); + + $('#cbEditorTopMenuBar').css('pointer-events', 'none'); + $('#cbEditorTopMenuBar').css('opacity', '0.7'); + + $('#cbEditorLeftSideBar').css('pointer-events', 'none'); + $('#cbEditorLeftSideBar').css('opacity', '0.7'); + + $('#cbEditorRightSideBar').css('pointer-events', 'none'); + $('#cbEditorRightSideBar').css('opacity', '0.7'); + + $('.tox-editor-header').css('pointer-events', 'none'); + $('.tox-editor-header').css('opacity', '0.7'); + + $timeout(function () { // in case failed default time out 40 second var opcity = $("#HomeContainerDiv").css("opacity") - if (opcity != 1) - { + if (opcity != 1) { $scope.CBEnableUI(); } }, 40000); @@ -105,6 +125,25 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // CB module enable all $('#HomeContainerDiv').css('pointer-events', 'auto'); $('#HomeContainerDiv').css('opacity', '1'); + + $('#CBTextArea_ifr').css('pointer-events', 'auto'); + $('#CBTextArea_ifr').css('opacity', '1'); + + $('#jstree').css('pointer-events', 'auto'); + $('#jstree').css('opacity', '1'); + + $('#cbEditorTopMenuBar').css('pointer-events', 'auto'); + $('#cbEditorTopMenuBar').css('opacity', '1'); + + $('#cbEditorLeftSideBar').css('pointer-events', 'auto'); + $('#cbEditorLeftSideBar').css('opacity', '1'); + + $('#cbEditorRightSideBar').css('pointer-events', 'auto'); + $('#cbEditorRightSideBar').css('opacity', '01'); + + $('.tox-editor-header').css('pointer-events', 'auto'); + $('.tox-editor-header').css('opacity', '1'); + } }); @@ -382,7 +421,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $timeout(function () { $scope.TinyMCEPanelclick(); - },1000); + }, 1000); } @@ -391,15 +430,15 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $("#CBTinyMCEPanel").on('click', function (event) { //3. on click disable menu option - $scope.$emit("cBEnableDisableMenuOption",""); + $scope.$emit("cBEnableDisableMenuOption", ""); }); } - $scope.myeditorclick=function() { + $scope.myeditorclick = function () { //1. disable menu options - $scope.$emit("cBEnableDisableMenuOption",""); + $scope.$emit("cBEnableDisableMenuOption", ""); } @@ -487,31 +526,28 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if ($scope.SelectedNotes != "" && $scope.SelectedNotes != undefined) { tinymce.get("CBTextArea").setContent($scope.SelectedNotes); - $scope.LoadModuleName = []; - $scope.Slidenumber = $scope.selectedNodeSingleObj._id; + $scope.LoadModuleName = []; + $scope.Slidenumber = $scope.selectedNodeSingleObj._id; setTimeout(function () { if ($scope.selectedNodeSingleObj.windows != "") { $scope.loadContentOfSelectedSlide($scope.selectedNodeSingleObj._id) } - else - { + else { $scope.CBEnableUI(); } - },200); + }, 200); //$scope.CBEnableUI(); } - else - { + else { tinymce.get("CBTextArea").setContent(""); $scope.CBEnableUI(); } } - else - { + else { $scope.CBEnableUI(); } } @@ -580,7 +616,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSingleObj).length; document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSiblingObjs).length; } - else{ + else { document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSingleObj).length; } } @@ -824,7 +860,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ var newSummary = document.getElementById('cbRenameSummary').value; var newversion = document.getElementById('cbRenameVersionNo').value; var newSectionText = document.getElementById('cbRenameSectionTitle').value; - if (newSectionText == ""){ + if (newSectionText == "") { newSectionText = $scope.selectedNodeSingleObj._label; } var newSlideName = ("" + newSectionText + ""); @@ -1268,15 +1304,15 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $rootScope.contentNotesForSaveCB = remaingNotesForCB; - traverseTreeSelectedSingleObj($rootScope.stru, cbCurrentId); + traverseTreeSelectedSingleObj($rootScope.stru, cbCurrentId); if ($scope.selectedNodeSingleObj._isBranch == "false") { - $rootScope.contentNotesForSaveCB.push( - { - "notes": notesForSelectedSlide, - "windows": windowsInSelectedSlide, - "_id": cbCurrentId - }); + $rootScope.contentNotesForSaveCB.push( + { + "notes": notesForSelectedSlide, + "windows": windowsInSelectedSlide, + "_id": cbCurrentId + }); } else if ($scope.selectedNodeSingleObj._isBranch == "true" && $scope.selectedNodeSingleObj._isRoot == "true") { @@ -1286,7 +1322,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ { "windows": windowsInSelectedSlide, "summary": $scope.selectedNodeSingleObj.summary, - "author": $scope.selectedNodeSingleObj.author, + "author": $scope.selectedNodeSingleObj.author, "modified": $scope.selectedNodeSingleObj.modified, "password": "", "version": $scope.selectedNodeSingleObj.version, @@ -1316,7 +1352,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $rootScope.cbDynamicContents = $rootScope.contentNotesForSaveCB; $rootScope.note = $rootScope.contentNotesForSaveCB; - console.log($rootScope.contentNotesForSaveCB); + console.log($rootScope.contentNotesForSaveCB); } @@ -1333,7 +1369,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //$rootScope.contentNotesForSaveCB = $rootScope.cbJsonData.slideshow.content.element; $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;//Assign Dnamic Contents } - $rootScope.updatedContentFromEditor(cbCurrentId); + $rootScope.updatedContentFromEditor(cbCurrentId); $rootScope.dynamicUpdatedJsonForSaveCB = { @@ -1374,12 +1410,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ else { $(document).execCommand("SaveAs", true, filename); - document.execCommand("SaveAs", true, filename); - angular.element(document.execCommand("SaveAs", false, filename)).scope(); + document.execCommand("SaveAs", true, filename); + angular.element(document.execCommand("SaveAs", false, filename)).scope(); //var e = document.createEvent('MouseEvents'), //a = document.createElement('a'); - // a.download = filename; + // a.download = filename; //a.href = window.URL.createObjectURL(blob); //a.dataset.downloadurl = ['text/json', a.download, a.href].join(':'); //e.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); @@ -1390,19 +1426,19 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //$rootScope.contentNotesForSaveCB = []; //$rootScope.structureObjForSaveCB = []; - // $http({ method: 'Post', url: $scope.fileName }).success(function (data) { - // localStorage.setItem("cbJsonDataObject", JSON.stringify(data)); - // $rootScope.cbJsonData = JSON.parse(localStorage.getItem("cbJsonDataObject")); - // $rootScope.cbDynamicJsonData = data; - // //$scope.getCBsummary(); - // $rootScope.cbJsonData.slideshow.content.element = "Eement data"; - // $rootScope.cbDynamicJsonData.slideshow.content.element = "slideshow element data"; - // $rootScope.note = "save data" - // //$scope.openCurriculumDetail(); - // }) - //.error(function (data, status, headers, config) { - // console.log(data); - //}); + // $http({ method: 'Post', url: $scope.fileName }).success(function (data) { + // localStorage.setItem("cbJsonDataObject", JSON.stringify(data)); + // $rootScope.cbJsonData = JSON.parse(localStorage.getItem("cbJsonDataObject")); + // $rootScope.cbDynamicJsonData = data; + // //$scope.getCBsummary(); + // $rootScope.cbJsonData.slideshow.content.element = "Eement data"; + // $rootScope.cbDynamicJsonData.slideshow.content.element = "slideshow element data"; + // $rootScope.note = "save data" + // //$scope.openCurriculumDetail(); + // }) + //.error(function (data, status, headers, config) { + // console.log(data); + //}); }; $scope.addSection = function (currentid, AddSecionId) { @@ -1419,14 +1455,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (currentid == "-225638207") { $rootScope.selectedNodeSingle.push( { - "structure": { - "structure": [ - ], - "_label": "New Section", - "_id": AddSecionId, - "_isRoot": "false", - "_isBranch": "true", - "_isLocked": "false" + "structure": { + "structure": [ + ], + "_label": "New Section", + "_id": AddSecionId, + "_isRoot": "false", + "_isBranch": "true", + "_isLocked": "false" } }); @@ -1481,11 +1517,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // }); //} //else { - for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { - if ($rootScope.structureObjForSaveCB[i]._id == currentid) { - $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; - } + for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { + if ($rootScope.structureObjForSaveCB[i]._id == currentid) { + $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; } + } //} } // setTimeout(function () { traverseTreeForSetIcons($rootScope.stru, currentid); }, 1500); @@ -1510,13 +1546,13 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ "_isBranch": "false", "_isLocked": "false" }); - $rootScope.structureObjForSaveCB.push({ + $rootScope.structureObjForSaveCB.push({ "_label": "NEW Slide1", "_id": AddSlideId, "_isRoot": "false", "_isBranch": "false", "_isLocked": "false" - }); + }); } else { $scope.selectedNodeSingleObj['structure'].push({ @@ -1543,11 +1579,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // }); //} //else { - for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { - if ($rootScope.structureObjForSaveCB[i]._id == currentid) { - $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; - } + for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { + if ($rootScope.structureObjForSaveCB[i]._id == currentid) { + $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; } + } //} } // setTimeout(function () { traverseTreeForSetIcons($rootScope.stru, currentid); }, 3000); @@ -1620,7 +1656,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ .from(content) .where("_id == " + id) .select(); - // console.log('contenctForSelectedSlide' + contenctForSelectedSlide[0].notes) + // console.log('contenctForSelectedSlide' + contenctForSelectedSlide[0].notes) var windowsInSelectedSlide = contenctForSelectedSlide[0].windows; var allwindowData = windowsInSelectedSlide.window; @@ -1724,49 +1760,49 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if ($scope.LoadModuleName != undefined) { - var index = $scope.LoadModuleName.indexOf(name); - if (index != -1) { - // remove module which one is loaded - $scope.LoadModuleName.splice(index, 1); - } + var index = $scope.LoadModuleName.indexOf(name); + if (index != -1) { + // remove module which one is loaded + $scope.LoadModuleName.splice(index, 1); + } - if ($scope.LoadModuleName.length > 0) { - var nextmodulename = $scope.LoadModuleName[0]; - $scope.loadModuleWithCB(nextmodulename); + if ($scope.LoadModuleName.length > 0) { + var nextmodulename = $scope.LoadModuleName[0]; + $scope.loadModuleWithCB(nextmodulename); - } - else { //Added Code by sandeep for user story-52696 - $("#viwerSelect").empty(); - var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); - if (modulePanel != undefined && modulePanel != null) { - // $('#viwerSelect').append(''); - - //Added code by sandeep for fixed Bug-58066 - if (modulePanel.length > 0) { - $('#viwerSelect').show(); - } - } - else { - $('#viwerSelect').hide(); - } - for (var i = 0 ; i < modulePanel.length; i++) { - var paneld = modulePanel[i].id; - var panelTitle = document.getElementById(paneld).childNodes[0].innerText; - $('#viwerSelect').append(''); - } + } + else { //Added Code by sandeep for user story-52696 + $("#viwerSelect").empty(); + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); + if (modulePanel != undefined && modulePanel != null) { + // $('#viwerSelect').append(''); - $scope.CBEnableUI(); - // scroll down to first panel + //Added code by sandeep for fixed Bug-58066 if (modulePanel.length > 0) { - if (modulePanel[0].id != undefined) { - var lastpanel = modulePanel[0].id; - //$('body,html').animate({ scrollTop: $('#' + lastpanel).position().top }, 1000); - } - } - - + $('#viwerSelect').show(); + } + } + else { + $('#viwerSelect').hide(); + } + for (var i = 0 ; i < modulePanel.length; i++) { + var paneld = modulePanel[i].id; + var panelTitle = document.getElementById(paneld).childNodes[0].innerText; + $('#viwerSelect').append(''); + } + + $scope.CBEnableUI(); + // scroll down to first panel + if (modulePanel.length > 0) { + if (modulePanel[0].id != undefined) { + var lastpanel = modulePanel[0].id; + //$('body,html').animate({ scrollTop: $('#' + lastpanel).position().top }, 1000); + } } + + } + } }); @@ -1954,24 +1990,23 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } $scope.loadDissectibleAnatomyModule = function (moduleName) { - var DAData = ModuleService.getModuleData(moduleName); + var DAData = ModuleService.getModuleData(moduleName); - if (DAData != undefined && DAData.length > 0) { - $rootScope.isCallFromOtherModule = true; + if (DAData != undefined && DAData.length > 0) { + $rootScope.isCallFromOtherModule = true; - var daSectionExist = document.getElementById('daCustomModuleDiv'); + var daSectionExist = document.getElementById('daCustomModuleDiv'); - if (daSectionExist==null){ - $('#cbparentcustomDiv').append($('
')); - $e = $('#daCustomModuleDiv').append(""); - $compile($e)($scope); - } - else - { - // open new da panel on same slide by open resource - $rootScope.openDABodyViewMain(); - } + if (daSectionExist == null) { + $('#cbparentcustomDiv').append($('
')); + $e = $('#daCustomModuleDiv').append(""); + $compile($e)($scope); + } + else { + // open new da panel on same slide by open resource + $rootScope.openDABodyViewMain(); } + } } @@ -2045,13 +2080,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ findKeyForChange($rootScope.contentNotesForSaveCB, currentId); $scope.selectedKey.windows.window = []; - for (var s = 0; s < $scope.updatedWindowListForSaveCB.length; s++) - { + for (var s = 0; s < $scope.updatedWindowListForSaveCB.length; s++) { var arrToStrWinObj = JSON.stringify($scope.updatedWindowListForSaveCB[s]); $scope.selectedKey.windows.window.push(arrToStrWinObj); } - $scope.updatedWindowListForSaveCB = []; - console.log($scope.selectedKey.windows.window); + $scope.updatedWindowListForSaveCB = []; + console.log($scope.selectedKey.windows.window); } $scope.saveCIWindowActivity_Old = function (keyName, value) { @@ -2112,7 +2146,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ for (i in o) { if (o[i] !== null && typeof (o[i]) == "object") { - if (o[i]._id == keyname) { + if (o[i]._id == keyname) { $scope.selectedKey = o[i]; } findKeyForChange(o[i], keyname); @@ -2202,7 +2236,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ containsCapturedContent: true,//$rootScope.TheeDWindowData[i] // N //annotationData: "",//$rootScope.TheeDWindowData[i] N - contextMenu:{ lockResize: true, hideTitleBar: true, hideToolBar: false, hideLeftBar: false, hideTopToolBar: false }, + contextMenu: { lockResize: true, hideTitleBar: true, hideToolBar: false, hideLeftBar: false, hideTopToolBar: false }, position: { top: $rootScope.TheeDWindowData[i].top, left: $rootScope.TheeDWindowData[i].left, @@ -2221,7 +2255,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ windowListId: 0, //$rootScope.TheeDWindowData[i] // N threeDData: $rootScope.TheeDWindowData[i].threeDAnatomyData, contentPath: $rootScope.TheeDWindowData[i].ImagePath, - scrollPosition: { vertical: $rootScope.TheeDWindowData[i].verticalScroll ? 0 : 0 , horizontal: 0 }, + scrollPosition: { vertical: $rootScope.TheeDWindowData[i].verticalScroll ? 0 : 0, horizontal: 0 }, }); } @@ -2314,8 +2348,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } if(isNotSaved) $rootScope.AAWindowData = []; - } } + } //Save DISSECTIBLE_ANATOMY activity for CB $scope.saveDAWindowActivity = function (isNotSaved) { @@ -2329,7 +2363,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ highlightOptionsSelectedId: 0, selectedStructureID: 0,//N contentDescriptorId: 0, - callOuts: $rootScope.DaWindowData[i].CurriculumTermData, + callOuts: $rootScope.DaWindowData[i].CurriculumTermData, //hideAllPins: $rootScope.DaWindowData[i].isHidePinBtnClicked, //selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate, layerNumber: parseInt($rootScope.DaWindowData[i].layerNumber) + 1, @@ -2351,7 +2385,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ }, id: $rootScope.DaWindowData[i].voId, //showSelectedPins: $rootScope.DaWindowData[i].isShowSelectedSystemPinsClicked, - // hideCallOuts: false,//N + // hideCallOuts: false,//N //showAllPins: $rootScope.DaWindowData[i].isShowBodyWithCBPinData,//N //scaleIndex: 0,//N //bodySystemId: $rootScope.DaWindowData[i].SelectedSystemID, @@ -2366,9 +2400,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //contextMenu: { hideLeftBar: false, hideTitleBar: false, hideTopToolBar: false, lockResize: false }, //activePinArray: $rootScope.DaWindowData[i].activePinArray, // Selected PINID on Body //sliderVal: $rootScope.DaWindowData[i].sliderVal, - zoom: $rootScope.DaWindowData[i].zoomInOut, + zoom: $rootScope.DaWindowData[i].zoomInOut, skinId: $rootScope.DaWindowData[i].curentEthnicity, - isResizeLock: false , //.isResizeLock,//N + isResizeLock: false, //.isResizeLock,//N mode: $rootScope.DaWindowData[i].mode, windowListId: 0,//windowData.windowListId,//25 canvasVScrollX: $rootScope.DaWindowData[i].CanvasDivTopPosition, @@ -2410,6 +2444,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.selectedKey.windows.window.push(arrToStrWinObj); } + } $scope.updatedWindowListForSaveCB = []; console.log($rootScope.contentNotesForSaveCB); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html b/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html index d48b840..d44815f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html @@ -3,19 +3,19 @@
-
+
- + - +
@@ -56,48 +56,48 @@
-
- -
- +
+
+
+ + diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js index 1b9c5ec..748bae5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js +++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js @@ -1,8 +1,88 @@ -/* - * jQuery MiniColors: A tiny color picker built on jQuery - * - * Copyright Cory LaViska for A Beautiful Site, LLC. (http://www.abeautifulsite.net/) - * - * Licensed under the MIT license: http://opensource.org/licenses/MIT - * - */jQuery&&function(e){function t(t,n){var r=e('
'),i=e.minicolors.defaults;if(t.data("minicolors-initialized"))return;n=e.extend(!0,{},i,n);r.addClass("minicolors-theme-"+n.theme).toggleClass("minicolors-with-opacity",n.opacity);n.position!==undefined&&e.each(n.position.split(" "),function(){r.addClass("minicolors-position-"+this)});t.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",n).prop("size",7).wrap(r).after('
'+'
'+'
'+"
"+'
'+'
'+"
"+'
'+'
'+'
'+"
"+"
");if(!n.inline){t.after('');t.next(".minicolors-swatch").on("click",function(e){e.preventDefault();t.focus()})}t.parent().find(".minicolors-panel").on("selectstart",function(){return!1}).end();n.inline&&t.parent().addClass("minicolors-inline");u(t,!1);t.data("minicolors-initialized",!0)}function n(e){var t=e.parent();e.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input");t.before(e).remove()}function r(e){var t=e.parent(),n=t.find(".minicolors-panel"),r=e.data("minicolors-settings");if(!e.data("minicolors-initialized")||e.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus"))return;i();t.addClass("minicolors-focus");n.stop(!0,!0).fadeIn(r.showSpeed,function(){r.show&&r.show.call(e.get(0))})}function i(){e(".minicolors-input").each(function(){var t=e(this),n=t.data("minicolors-settings"),r=t.parent();if(n.inline)return;r.find(".minicolors-panel").fadeOut(n.hideSpeed,function(){r.hasClass("minicolors-focus")&&n.hide&&n.hide.call(t.get(0));r.removeClass("minicolors-focus")})})}function s(e,t,n){var r=e.parents(".minicolors").find(".minicolors-input"),i=r.data("minicolors-settings"),s=e.find("[class$=-picker]"),u=e.offset().left,a=e.offset().top,f=Math.round(t.pageX-u),l=Math.round(t.pageY-a),c=n?i.animationSpeed:0,h,p,d,v;if(t.originalEvent.changedTouches){f=t.originalEvent.changedTouches[0].pageX-u;l=t.originalEvent.changedTouches[0].pageY-a}f<0&&(f=0);l<0&&(l=0);f>e.width()&&(f=e.width());l>e.height()&&(l=e.height());if(e.parent().is(".minicolors-slider-wheel")&&s.parent().is(".minicolors-grid")){h=75-f;p=75-l;d=Math.sqrt(h*h+p*p);v=Math.atan2(p,h);v<0&&(v+=Math.PI*2);if(d>75){d=75;f=75-75*Math.cos(v);l=75-75*Math.sin(v)}f=Math.round(f);l=Math.round(l)}e.is(".minicolors-grid")?s.stop(!0).animate({top:l+"px",left:f+"px"},c,i.animationEasing,function(){o(r,e)}):s.stop(!0).animate({top:l+"px"},c,i.animationEasing,function(){o(r,e)})}function o(e,t){function n(e,t){var n,r;if(!e.length||!t)return null;n=e.offset().left;r=e.offset().top;return{x:n-t.offset().left+e.outerWidth()/2,y:r-t.offset().top+e.outerHeight()/2}}var r,i,s,o,u,f,l,h=e.val(),d=e.attr("data-opacity"),v=e.parent(),g=e.data("minicolors-settings"),y=v.find(".minicolors-swatch"),b=v.find(".minicolors-grid"),w=v.find(".minicolors-slider"),E=v.find(".minicolors-opacity-slider"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]"),T=E.find("[class$=-picker]"),N=n(S,b),C=n(x,w),k=n(T,E);if(t.is(".minicolors-grid, .minicolors-slider")){switch(g.control){case"wheel":o=b.width()/2-N.x;u=b.height()/2-N.y;f=Math.sqrt(o*o+u*u);l=Math.atan2(u,o);l<0&&(l+=Math.PI*2);if(f>75){f=75;N.x=69-75*Math.cos(l);N.y=69-75*Math.sin(l)}i=p(f/.75,0,100);r=p(l*180/Math.PI,0,360);s=p(100-Math.floor(C.y*(100/w.height())),0,100);h=m({h:r,s:i,b:s});w.css("backgroundColor",m({h:r,s:i,b:100}));break;case"saturation":r=p(parseInt(N.x*(360/b.width()),10),0,360);i=p(100-Math.floor(C.y*(100/w.height())),0,100);s=p(100-Math.floor(N.y*(100/b.height())),0,100);h=m({h:r,s:i,b:s});w.css("backgroundColor",m({h:r,s:100,b:s}));v.find(".minicolors-grid-inner").css("opacity",i/100);break;case"brightness":r=p(parseInt(N.x*(360/b.width()),10),0,360);i=p(100-Math.floor(N.y*(100/b.height())),0,100);s=p(100-Math.floor(C.y*(100/w.height())),0,100);h=m({h:r,s:i,b:s});w.css("backgroundColor",m({h:r,s:i,b:100}));v.find(".minicolors-grid-inner").css("opacity",1-s/100);break;default:r=p(360-parseInt(C.y*(360/w.height()),10),0,360);i=p(Math.floor(N.x*(100/b.width())),0,100);s=p(100-Math.floor(N.y*(100/b.height())),0,100);h=m({h:r,s:i,b:s});b.css("backgroundColor",m({h:r,s:100,b:100}))}e.val(c(h,g.letterCase))}if(t.is(".minicolors-opacity-slider")){g.opacity?d=parseFloat(1-k.y/E.height()).toFixed(2):d=1;g.opacity&&e.attr("data-opacity",d)}y.find("SPAN").css({backgroundColor:h,opacity:d});a(e,h,d)}function u(e,t){var n,r,i,s,o,u,f,l=e.parent(),d=e.data("minicolors-settings"),v=l.find(".minicolors-swatch"),y=l.find(".minicolors-grid"),b=l.find(".minicolors-slider"),w=l.find(".minicolors-opacity-slider"),E=y.find("[class$=-picker]"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]");n=c(h(e.val(),!0),d.letterCase);n||(n=c(h(d.defaultValue,!0),d.letterCase));r=g(n);t||e.val(n);if(d.opacity){i=e.attr("data-opacity")===""?1:p(parseFloat(e.attr("data-opacity")).toFixed(2),0,1);isNaN(i)&&(i=1);e.attr("data-opacity",i);v.find("SPAN").css("opacity",i);o=p(w.height()-w.height()*i,0,w.height());x.css("top",o+"px")}v.find("SPAN").css("backgroundColor",n);switch(d.control){case"wheel":u=p(Math.ceil(r.s*.75),0,y.height()/2);f=r.h*Math.PI/180;s=p(75-Math.cos(f)*u,0,y.width());o=p(75-Math.sin(f)*u,0,y.height());E.css({top:o+"px",left:s+"px"});o=150-r.b/(100/y.height());n===""&&(o=0);S.css("top",o+"px");b.css("backgroundColor",m({h:r.h,s:r.s,b:100}));break;case"saturation":s=p(5*r.h/12,0,150);o=p(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height());E.css({top:o+"px",left:s+"px"});o=p(b.height()-r.s*(b.height()/100),0,b.height());S.css("top",o+"px");b.css("backgroundColor",m({h:r.h,s:100,b:r.b}));l.find(".minicolors-grid-inner").css("opacity",r.s/100);break;case"brightness":s=p(5*r.h/12,0,150);o=p(y.height()-Math.ceil(r.s/(100/y.height())),0,y.height());E.css({top:o+"px",left:s+"px"});o=p(b.height()-r.b*(b.height()/100),0,b.height());S.css("top",o+"px");b.css("backgroundColor",m({h:r.h,s:r.s,b:100}));l.find(".minicolors-grid-inner").css("opacity",1-r.b/100);break;default:s=p(Math.ceil(r.s/(100/y.width())),0,y.width());o=p(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height());E.css({top:o+"px",left:s+"px"});o=p(b.height()-r.h/(360/b.height()),0,b.height());S.css("top",o+"px");y.css("backgroundColor",m({h:r.h,s:100,b:100}))}e.data("minicolors-initialized")&&a(e,n,i)}function a(e,t,n){var r=e.data("minicolors-settings"),i=e.data("minicolors-lastChange");if(!i||i.hex!==t||i.opacity!==n){e.data("minicolors-lastChange",{hex:t,opacity:n});if(r.change)if(r.changeDelay){clearTimeout(e.data("minicolors-changeTimeout"));e.data("minicolors-changeTimeout",setTimeout(function(){r.change.call(e.get(0),t,n)},r.changeDelay))}else r.change.call(e.get(0),t,n);e.trigger("change").trigger("input")}}function f(t){var n=h(e(t).val(),!0),r=b(n),i=e(t).attr("data-opacity");if(!r)return null;i!==undefined&&e.extend(r,{a:parseFloat(i)});return r}function l(t,n){var r=h(e(t).val(),!0),i=b(r),s=e(t).attr("data-opacity");if(!i)return null;s===undefined&&(s=1);return n?"rgba("+i.r+", "+i.g+", "+i.b+", "+parseFloat(s)+")":"rgb("+i.r+", "+i.g+", "+i.b+")"}function c(e,t){return t==="uppercase"?e.toUpperCase():e.toLowerCase()}function h(e,t){e=e.replace(/[^A-F0-9]/ig,"");if(e.length!==3&&e.length!==6)return"";e.length===3&&t&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);return"#"+e}function p(e,t,n){en&&(e=n);return e}function d(e){var t={},n=Math.round(e.h),r=Math.round(e.s*255/100),i=Math.round(e.b*255/100);if(r===0)t.r=t.g=t.b=i;else{var s=i,o=(255-r)*i/255,u=(s-o)*(n%60)/60;n===360&&(n=0);if(n<60){t.r=s;t.b=o;t.g=o+u}else if(n<120){t.g=s;t.b=o;t.r=s-u}else if(n<180){t.g=s;t.r=o;t.b=o+u}else if(n<240){t.b=s;t.r=o;t.g=s-u}else if(n<300){t.b=s;t.g=o;t.r=o+u}else if(n<360){t.r=s;t.g=o;t.b=s-u}else{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 v(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];e.each(n,function(e,t){t.length===1&&(n[e]="0"+t)});return"#"+n.join("")}function m(e){return v(d(e))}function g(e){var t=y(b(e));t.s===0&&(t.h=360);return t}function y(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),i=r-n;t.b=r;t.s=r!==0?255*i/r:0;t.s!==0?e.r===r?t.h=(e.g-e.b)/i:e.g===r?t.h=2+(e.b-e.r)/i:t.h=4+(e.r-e.g)/i:t.h=-1;t.h*=60;t.h<0&&(t.h+=360);t.s*=100/255;t.b*=100/255;return t}function b(e){e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:e>>16,g:(e&65280)>>8,b:e&255}}e.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",defaultValue:"",hide:null,hideSpeed:100,inline:!1,letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default"}};e.extend(e.fn,{minicolors:function(s,o){switch(s){case"destroy":e(this).each(function(){n(e(this))});return e(this);case"hide":i();return e(this);case"opacity":if(o===undefined)return e(this).attr("data-opacity");e(this).each(function(){u(e(this).attr("data-opacity",o))});return e(this);case"rgbObject":return f(e(this),s==="rgbaObject");case"rgbString":case"rgbaString":return l(e(this),s==="rgbaString");case"settings":if(o===undefined)return e(this).data("minicolors-settings");e(this).each(function(){var t=e(this).data("minicolors-settings")||{};n(e(this));e(this).minicolors(e.extend(!0,t,o))});return e(this);case"show":r(e(this).eq(0));return e(this);case"value":if(o===undefined)return e(this).val();e(this).each(function(){u(e(this).val(o))});return e(this);default:s!=="create"&&(o=s);e(this).each(function(){t(e(this),o)});return e(this)}}});e(document).on("mousedown.minicolors touchstart.minicolors",function(t){e(t.target).parents().add(t.target).hasClass("minicolors")||i()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var n=e(this);t.preventDefault();e(document).data("minicolors-target",n);s(n,t,!0)}).on("mousemove.minicolors touchmove.minicolors",function(t){var n=e(document).data("minicolors-target");n&&s(n,t)}).on("mouseup.minicolors touchend.minicolors",function(){e(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(t){var n=e(this).parent().find(".minicolors-input");t.preventDefault();r(n)}).on("focus.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;r(t)}).on("blur.minicolors",".minicolors-input",function(){var t=e(this),n=t.data("minicolors-settings");if(!t.data("minicolors-initialized"))return;t.val(h(t.val(),!0));t.val()===""&&t.val(h(n.defaultValue,!0));t.val(c(t.val(),n.letterCase))}).on("keydown.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;switch(t.keyCode){case 9:i();break;case 13:case 27:i();n.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;u(t,!0)}).on("paste.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;setTimeout(function(){u(t,!0)},1)})}(jQuery); \ No newline at end of file +(function (c) { "function" === typeof define && define.amd ? define(["jquery"], c) : "object" === typeof exports ? module.exports = c(require("jquery")) : c(jQuery) })(function (c) { + function L(a, b) { + var d = c('
'), e = c.minicolors.defaults, m; if (!a.data("minicolors-initialized")) { + b = c.extend(!0, {}, e, b); d.addClass("minicolors-theme-" + b.theme).toggleClass("minicolors-with-opacity", b.opacity); void 0 !== b.position && c.each(b.position.split(" "), function () { d.addClass("minicolors-position-" + this) }); e = "rgb" === + b.format ? b.opacity ? "25" : "20" : b.keywords ? "11" : "7"; a.addClass("minicolors-input").data("minicolors-initialized", !1).data("minicolors-settings", b).prop("size", e).wrap(d).after('
'); + b.inline || (a.after(''), a.next(".minicolors-input-swatch").on("click", function (b) { b.preventDefault(); a.focus() })); e = a.parent().find(".minicolors-panel"); e.on("selectstart", function () { return !1 }).end(); if (b.swatches && 0 !== b.swatches.length) { + e.addClass("minicolors-with-swatches"); var l = c('
    ').appendTo(e); for (m = 0; m < b.swatches.length; ++m) { + if ("object" === + c.type(b.swatches[m])) { e = b.swatches[m].name; var h = b.swatches[m].color } else e = "", h = b.swatches[m]; h = p(h) ? q(h, !0) : u(x(h, !0)); c('
  • ').appendTo(l).data("swatch-color", b.swatches[m]).find(".minicolors-swatch-color").css({ backgroundColor: B(h), opacity: h.a }); b.swatches[m] = h + } + } b.inline && a.parent().addClass("minicolors-inline"); w(a, !1); a.data("minicolors-initialized", !0) + } + } function E(a) { + var b = a.parent(); + a.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"); b.before(a).remove() + } function C(a) { c("#modeleditstyle").draggable("disable"); var b = a.parent(), d = b.find(".minicolors-panel"), e = a.data("minicolors-settings"); !a.data("minicolors-initialized") || a.prop("disabled") || b.hasClass("minicolors-inline") || b.hasClass("minicolors-focus") || (z(), b.addClass("minicolors-focus"), d.stop(!0, !0).fadeIn(e.showSpeed, function () { e.show && e.show.call(a.get(0)) })) } + function z() { c(".minicolors-focus").each(function () { var a = c(this), b = a.find(".minicolors-input"), d = a.find(".minicolors-panel"), e = b.data("minicolors-settings"); d.fadeOut(e.hideSpeed, function () { c("#modeleditstyle").draggable("enable"); e.hide && e.hide.call(b.get(0)); a.removeClass("minicolors-focus") }) }) } function F(a, b, d) { + var e = a.parents(".minicolors").find(".minicolors-input"), c = e.data("minicolors-settings"), l = a.find("[class$=-picker]"), h = a.offset().left, k = a.offset().top, g = Math.round(b.pageX - h), f = Math.round(b.pageY - + k); d = d ? c.animationSpeed : 0; b.originalEvent.changedTouches && (g = b.originalEvent.changedTouches[0].pageX - h, f = b.originalEvent.changedTouches[0].pageY - k); 0 > g && (g = 0); 0 > f && (f = 0); g > a.width() && (g = a.width()); f > a.height() && (f = a.height()); a.parent().is(".minicolors-slider-wheel") && l.parent().is(".minicolors-grid") && (h = 75 - g, k = 75 - f, b = Math.sqrt(h * h + k * k), h = Math.atan2(k, h), 0 > h && (h += 2 * Math.PI), 75 < b && (b = 75, g = 75 - 75 * Math.cos(h), f = 75 - 75 * Math.sin(h)), g = Math.round(g), f = Math.round(f)); a.is(".minicolors-grid") ? l.stop(!0).animate({ + top: f + + "px", left: g + "px" + }, d, c.animationEasing, function () { G(e, a) }) : l.stop(!0).animate({ top: f + "px" }, d, c.animationEasing, function () { G(e, a) }) + } function G(a, b) { + function d(a, b) { if (!a.length || !b) return null; var d = a.offset().left; var e = a.offset().top; return { x: d - b.offset().left + a.outerWidth() / 2, y: e - b.offset().top + a.outerHeight() / 2 } } var e = a.val(); var c = a.attr("data-opacity"); var l = a.parent(); var h = a.data("minicolors-settings"); var k = l.find(".minicolors-swatch"); var g = l.find(".minicolors-grid"); var r = l.find(".minicolors-slider"), + p = l.find(".minicolors-opacity-slider"); var n = g.find("[class$=-picker]"); var t = r.find("[class$=-picker]"), q = p.find("[class$=-picker]"); n = d(n, g); t = d(t, r); q = d(q, p); if (b.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")) { + switch (h.control) { + case "wheel": e = g.width() / 2 - n.x; l = g.height() / 2 - n.y; g = Math.sqrt(e * e + l * l); e = Math.atan2(l, e); 0 > e && (e += 2 * Math.PI); 75 < g && (g = 75, n.x = 69 - 75 * Math.cos(e), n.y = 69 - 75 * Math.sin(e)); c = f(g / .75, 0, 100); k = f(180 * e / Math.PI, 0, 360); n = f(100 - Math.floor(t.y * (100 / r.height())), + 0, 100); e = v({ h: k, s: c, b: n }); r.css("backgroundColor", v({ h: k, s: c, b: 100 })); break; case "saturation": k = f(parseInt(n.x * (360 / g.width()), 10), 0, 360); c = f(100 - Math.floor(t.y * (100 / r.height())), 0, 100); n = f(100 - Math.floor(n.y * (100 / g.height())), 0, 100); e = v({ h: k, s: c, b: n }); r.css("backgroundColor", v({ h: k, s: 100, b: n })); l.find(".minicolors-grid-inner").css("opacity", c / 100); break; case "brightness": k = f(parseInt(n.x * (360 / g.width()), 10), 0, 360); c = f(100 - Math.floor(n.y * (100 / g.height())), 0, 100); n = f(100 - Math.floor(t.y * (100 / r.height())), + 0, 100); e = v({ h: k, s: c, b: n }); r.css("backgroundColor", v({ h: k, s: c, b: 100 })); l.find(".minicolors-grid-inner").css("opacity", 1 - n / 100); break; default: k = f(360 - parseInt(t.y * (360 / r.height()), 10), 0, 360), c = f(Math.floor(n.x * (100 / g.width())), 0, 100), n = f(100 - Math.floor(n.y * (100 / g.height())), 0, 100), e = v({ h: k, s: c, b: n }), g.css("backgroundColor", v({ h: k, s: 100, b: 100 })) + } c = h.opacity ? parseFloat(1 - q.y / p.height()).toFixed(2) : 1; H(a, e, c) + } else k.find("span").css({ backgroundColor: e, opacity: c }), D(a, e, c) + } function H(a, b, d) { + var e = a.parent(), + c = a.data("minicolors-settings"); e = e.find(".minicolors-input-swatch"); c.opacity && a.attr("data-opacity", d); if ("rgb" === c.format) { b = p(b) ? q(b, !0) : u(x(b, !0)); d = "" === a.attr("data-opacity") ? 1 : f(parseFloat(a.attr("data-opacity")).toFixed(2), 0, 1); if (isNaN(d) || !c.opacity) d = 1; b = 1 >= a.minicolors("rgbObject").a && b && c.opacity ? "rgba(" + b.r + ", " + b.g + ", " + b.b + ", " + parseFloat(d) + ")" : "rgb(" + b.r + ", " + b.g + ", " + b.b + ")" } else p(b) && (b = I(b)), b = A(b, c.letterCase); a.val(b); e.find("span").css({ backgroundColor: b, opacity: d }); D(a, + b, d) + } function w(a, b) { + var d; var e = a.parent(); var m = a.data("minicolors-settings"); var l = e.find(".minicolors-input-swatch"); var h = e.find(".minicolors-grid"), k = e.find(".minicolors-slider"); var g = e.find(".minicolors-opacity-slider"); var r = h.find("[class$=-picker]"), u = k.find("[class$=-picker]"), n = g.find("[class$=-picker]"); if (p(a.val())) { var t = I(a.val()); (d = f(parseFloat(J(a.val())).toFixed(2), 0, 1)) && a.attr("data-opacity", d) } else t = A(x(a.val(), !0), m.letterCase); t || (t = A(K(m.defaultValue, !0), m.letterCase)); + d = M(t); var w = m.keywords ? c.map(m.keywords.split(","), function (a) { return c.trim(a.toLowerCase()) }) : []; w = "" !== a.val() && -1 < c.inArray(a.val().toLowerCase(), w) ? A(a.val()) : p(a.val()) ? q(a.val()) : t; b || a.val(w); if (m.opacity) { var y = "" === a.attr("data-opacity") ? 1 : f(parseFloat(a.attr("data-opacity")).toFixed(2), 0, 1); isNaN(y) && (y = 1); a.attr("data-opacity", y); l.find("span").css("opacity", y); g = f(g.height() - g.height() * y, 0, g.height()); n.css("top", g + "px") } "transparent" === a.val().toLowerCase() && l.find("span").css("opacity", + 0); l.find("span").css("backgroundColor", t); switch (m.control) { + case "wheel": e = f(Math.ceil(.75 * d.s), 0, h.height() / 2); l = d.h * Math.PI / 180; m = f(75 - Math.cos(l) * e, 0, h.width()); g = f(75 - Math.sin(l) * e, 0, h.height()); r.css({ top: g + "px", left: m + "px" }); g = 150 - d.b / (100 / h.height()); "" === t && (g = 0); u.css("top", g + "px"); k.css("backgroundColor", v({ h: d.h, s: d.s, b: 100 })); break; case "saturation": m = f(5 * d.h / 12, 0, 150); g = f(h.height() - Math.ceil(d.b / (100 / h.height())), 0, h.height()); r.css({ top: g + "px", left: m + "px" }); g = f(k.height() - d.s * (k.height() / + 100), 0, k.height()); u.css("top", g + "px"); k.css("backgroundColor", v({ h: d.h, s: 100, b: d.b })); e.find(".minicolors-grid-inner").css("opacity", d.s / 100); break; case "brightness": m = f(5 * d.h / 12, 0, 150); g = f(h.height() - Math.ceil(d.s / (100 / h.height())), 0, h.height()); r.css({ top: g + "px", left: m + "px" }); g = f(k.height() - d.b * (k.height() / 100), 0, k.height()); u.css("top", g + "px"); k.css("backgroundColor", v({ h: d.h, s: d.s, b: 100 })); e.find(".minicolors-grid-inner").css("opacity", 1 - d.b / 100); break; default: m = f(Math.ceil(d.s / (100 / h.width())), + 0, h.width()), g = f(h.height() - Math.ceil(d.b / (100 / h.height())), 0, h.height()), r.css({ top: g + "px", left: m + "px" }), g = f(k.height() - d.h / (360 / k.height()), 0, k.height()), u.css("top", g + "px"), h.css("backgroundColor", v({ h: d.h, s: 100, b: 100 })) + } a.data("minicolors-initialized") && D(a, w, y) + } function D(a, b, d) { + var e = a.data("minicolors-settings"), c = a.data("minicolors-lastChange"), f; if (!c || c.value !== b || c.opacity !== d) { + a.data("minicolors-lastChange", { value: b, opacity: d }); if (e.swatches && 0 !== e.swatches.length) { + c = p(b) ? q(b, !0) : u(b); + var h = -1; for (f = 0; f < e.swatches.length; ++f) if (c.r === e.swatches[f].r && c.g === e.swatches[f].g && c.b === e.swatches[f].b && c.a === e.swatches[f].a) { h = f; break } a.parent().find(".minicolors-swatches .minicolors-swatch").removeClass("selected"); -1 !== h && a.parent().find(".minicolors-swatches .minicolors-swatch").eq(f).addClass("selected") + } e.change && (e.changeDelay ? (clearTimeout(a.data("minicolors-changeTimeout")), a.data("minicolors-changeTimeout", setTimeout(function () { e.change.call(a.get(0), b, d) }, e.changeDelay))) : e.change.call(a.get(0), + b, d)); a.trigger("change").trigger("input") + } + } function N(a) { var b = c(a).attr("data-opacity"); p(c(a).val()) ? a = q(c(a).val(), !0) : (a = x(c(a).val(), !0), a = u(a)); if (!a) return null; void 0 !== b && c.extend(a, { a: parseFloat(b) }); return a } function O(a, b) { var d = c(a).attr("data-opacity"); if (p(c(a).val())) var e = q(c(a).val(), !0); else e = x(c(a).val(), !0), e = u(e); if (!e) return null; void 0 === d && (d = 1); return b ? "rgba(" + e.r + ", " + e.g + ", " + e.b + ", " + parseFloat(d) + ")" : "rgb(" + e.r + ", " + e.g + ", " + e.b + ")" } function A(a, b) { + return "uppercase" === + b ? a.toUpperCase() : a.toLowerCase() + } function x(a, b) { a = a.replace(/^#/g, ""); if (!a.match(/^[A-F0-9]{3,6}/ig) || 3 !== a.length && 6 !== a.length) return ""; 3 === a.length && b && (a = a[0] + a[0] + a[1] + a[1] + a[2] + a[2]); return "#" + a } function q(a, b) { + var d = a.replace(/[^\d,.]/g, "").split(","); d[0] = f(parseInt(d[0], 10), 0, 255); d[1] = f(parseInt(d[1], 10), 0, 255); d[2] = f(parseInt(d[2], 10), 0, 255); d[3] && (d[3] = f(parseFloat(d[3], 10), 0, 1)); return b ? d[3] ? { r: d[0], g: d[1], b: d[2], a: d[3] } : { r: d[0], g: d[1], b: d[2] } : "undefined" !== typeof d[3] && 1 >= d[3] ? "rgba(" + + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + ")" : "rgb(" + d[0] + ", " + d[1] + ", " + d[2] + ")" + } function K(a, b) { return p(a) ? q(a) : x(a, b) } function f(a, b, d) { a < b && (a = b); a > d && (a = d); return a } function p(a) { return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) && 4 === a.length ? !0 : !1 } function J(a) { return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i)) && 6 === a.length ? a[4] : "1" } function I(a) { + return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) && + 4 === a.length ? "#" + ("0" + parseInt(a[1], 10).toString(16)).slice(-2) + ("0" + parseInt(a[2], 10).toString(16)).slice(-2) + ("0" + parseInt(a[3], 10).toString(16)).slice(-2) : "" + } function B(a) { var b = [a.r.toString(16), a.g.toString(16), a.b.toString(16)]; c.each(b, function (a, c) { 1 === c.length && (b[a] = "0" + c) }); return "#" + b.join("") } function v(a) { + var b, d; var c = Math.round(a.h); var f = Math.round(255 * a.s / 100); a = Math.round(255 * a.b / 100); if (0 === f) c = b = d = a; else { + f = (255 - f) * a / 255; var l = c % 60 * (a - f) / 60; 360 === c && (c = 0); 60 > c ? (c = a, d = f, b = f + l) : + 120 > c ? (b = a, d = f, c = a - l) : 180 > c ? (b = a, c = f, d = f + l) : 240 > c ? (d = a, c = f, b = a - l) : 300 > c ? (d = a, b = f, c = f + l) : 360 > c ? (c = a, b = f, d = a - l) : d = b = c = 0 + } return B({ r: Math.round(c), g: Math.round(b), b: Math.round(d) }) + } function M(a) { a = u(a); var b = { h: 0, s: 0, b: 0 }, c = Math.max(a.r, a.g, a.b), e = c - Math.min(a.r, a.g, a.b); b.b = c; b.s = 0 !== c ? 255 * e / c : 0; b.h = 0 !== b.s ? a.r === c ? (a.g - a.b) / e : a.g === c ? 2 + (a.b - a.r) / e : 4 + (a.r - a.g) / e : -1; b.h *= 60; 0 > b.h && (b.h += 360); b.s *= 100 / 255; b.b *= 100 / 255; 0 === b.s && (b.h = 360); return b } function u(a) { + a = parseInt(-1 < a.indexOf("#") ? a.substring(1) : + a, 16); return { r: a >> 16, g: (a & 65280) >> 8, b: a & 255 } + } c.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", show: null, showSpeed: 100, theme: "default", swatches: [] } }; c.extend(c.fn, { + minicolors: function (a, b) { + switch (a) { + case "destroy": return c(this).each(function () { E(c(this)) }), c(this); case "hide": return z(), c(this); case "opacity": if (void 0 === + b) return c(this).attr("data-opacity"); c(this).each(function () { w(c(this).attr("data-opacity", b)) }); return c(this); case "rgbObject": return N(c(this), "rgbaObject" === a); case "rgbString": case "rgbaString": return O(c(this), "rgbaString" === a); case "settings": if (void 0 === b) return c(this).data("minicolors-settings"); c(this).each(function () { var a = c(this).data("minicolors-settings") || {}; E(c(this)); c(this).minicolors(c.extend(!0, a, b)) }); return c(this); case "show": return C(c(this).eq(0)), c(this); case "value": if (void 0 === + b) return c(this).val(); c(this).each(function () { "object" === typeof b && null !== b ? (void 0 !== b.opacity && c(this).attr("data-opacity", f(b.opacity, 0, 1)), b.color && c(this).val(b.color)) : c(this).val(b); w(c(this)) }); return c(this); default: return "create" !== a && (b = a), c(this).each(function () { L(c(this), b) }), c(this) + } + } + }); c([document]).on("mousedown.minicolors touchstart.minicolors", function (a) { c(a.target).parents().add(a.target).hasClass("minicolors") || z() }).on("mousedown.minicolors touchstart.minicolors", ".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider", + function (a) { var b = c(this); a.preventDefault(); c(a.delegateTarget).data("minicolors-target", b); F(b, a, !0) }).on("mousemove.minicolors touchmove.minicolors", function (a) { var b = c(a.delegateTarget).data("minicolors-target"); b && F(b, a) }).on("mouseup.minicolors touchend.minicolors", function () { c(this).removeData("minicolors-target") }).on("click.minicolors", ".minicolors-swatches li", function (a) { + a.preventDefault(); var b = c(this); a = b.parents(".minicolors").find(".minicolors-input"); b = b.data("swatch-color"); H(a, b, + J(b)); w(a) + }).on("mousedown.minicolors touchstart.minicolors", ".minicolors-input-swatch", function (a) { var b = c(this).parent().find(".minicolors-input"); a.preventDefault(); C(b) }).on("focus.minicolors", ".minicolors-input", function () { var a = c(this); a.data("minicolors-initialized") && C(a) }).on("blur.minicolors", ".minicolors-input", function () { + var a = c(this), b = a.data("minicolors-settings"); if (a.data("minicolors-initialized")) { + var d = b.keywords ? c.map(b.keywords.split(","), function (a) { return c.trim(a.toLowerCase()) }) : + []; if ("" !== a.val() && -1 < c.inArray(a.val().toLowerCase(), d)) var e = a.val(); else d = p(a.val()) ? q(a.val(), !0) : (d = x(a.val(), !0)) ? u(d) : null, e = null === d ? b.defaultValue : "rgb" === b.format ? b.opacity ? q("rgba(" + d.r + "," + d.g + "," + d.b + "," + a.attr("data-opacity") + ")") : q("rgb(" + d.r + "," + d.g + "," + d.b + ")") : B(d); d = b.opacity ? a.attr("data-opacity") : 1; "transparent" === e.toLowerCase() && (d = 0); a.closest(".minicolors").find(".minicolors-input-swatch > span").css("opacity", d); a.val(e); "" === a.val() && a.val(K(b.defaultValue, !0)); a.val(A(a.val(), + b.letterCase)) + } + }).on("keydown.minicolors", ".minicolors-input", function (a) { var b = c(this); if (b.data("minicolors-initialized")) switch (a.which) { case 9: z(); break; case 13: case 27: z(), b.blur() } }).on("keyup.minicolors", ".minicolors-input", function () { var a = c(this); a.data("minicolors-initialized") && w(a, !0) }).on("paste.minicolors", ".minicolors-input", function () { var a = c(this); a.data("minicolors-initialized") && setTimeout(function () { w(a, !0) }, 1) }) +}); \ No newline at end of file