From 7829adb5a023f0b87a3b51229f64bf5031f4ce3a Mon Sep 17 00:00:00 2001 From: jfh Date: Thu, 20 Aug 2020 15:29:39 +0200 Subject: [PATCH 1/2] don't remove the style --- src/editor/svg-editor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/editor/svg-editor.js b/src/editor/svg-editor.js index ce62c59c..6e372db7 100644 --- a/src/editor/svg-editor.js +++ b/src/editor/svg-editor.js @@ -6195,7 +6195,6 @@ editor.init = function () { $.process_cancel(uiStrings.notification.loadingImage); e.stopPropagation(); e.preventDefault(); - $('#workarea').removeAttr('style'); $('#main_menu').hide(); const file = (e.type === 'drop') ? e.dataTransfer.files[0] : this.files[0]; if (!file) { From 512ee2cd835fb7f349621fe31a96fd9bb227246a Mon Sep 17 00:00:00 2001 From: jfh Date: Fri, 21 Aug 2020 12:31:23 +0200 Subject: [PATCH 2/2] build dist --- badges/licenses-badge-dev.svg | 2 +- dist/extensions/imagelib/openclipart.js | 7 +++++-- dist/index-es.js | 1 - dist/index-es.min.js | 2 +- dist/index-es.min.js.map | 2 +- dist/index-umd.js | 1 - dist/index-umd.min.js | 2 +- dist/index-umd.min.js.map | 2 +- src/svgedit-config-iife.js | 1 - src/xdomain-svgedit-config-iife.js | 1 - 10 files changed, 10 insertions(+), 11 deletions(-) diff --git a/badges/licenses-badge-dev.svg b/badges/licenses-badge-dev.svg index 677529f4..831d6168 100644 --- a/badges/licenses-badge-dev.svg +++ b/badges/licenses-badge-dev.svg @@ -1 +1 @@ -License typesLicense types(all devDeps)(all devDeps)PublicPublicdomaindomain1. (MIT OR CC0-1.0)1. (MIT OR CC0-1.0)2. CC0-1.02. CC0-1.03. Unlicense3. UnlicensePermissivePermissive1. (AFL-2.1 OR BSD-3-Clause)1. (AFL-2.1 OR BSD-3-Clause)2. (BSD-2-Clause OR (MIT OR Apache-2.0))2. (BSD-2-Clause OR (MIT OR Apache-2.0))3. (GPL-3.0-or-later OR MIT)3. (GPL-3.0-or-later OR MIT)4. (MIT OR Apache-2.0)4. (MIT OR Apache-2.0)5. (MPL-2.0 OR Apache-2.0)5. (MPL-2.0 OR Apache-2.0)6. (WTFPL OR MIT)6. (WTFPL OR MIT)7. 0BSD7. 0BSD8. Apache-2.08. Apache-2.09. Artistic-2.09. Artistic-2.010. BSD10. BSD11. BSD-2-Clause11. BSD-2-Clause12. BSD-3-Clause12. BSD-3-Clause13. CC-BY-3.013. CC-BY-3.014. CC-BY-4.014. CC-BY-4.015. ISC15. ISC16. MIT16. MIT17. Zlib17. ZlibWeaklyWeaklyprotectiveprotective1. LGPL-3.01. LGPL-3.02. MPL-2.02. MPL-2.0UncategorizedUncategorized1. jsonify (0.0.0)1. jsonify (0.0.0)MissingMissing1. boundary (1.0.1)1. boundary (1.0.1)2. structured-source (3.0.2)2. structured-source (3.0.2)3. taffydb (2.6.2)3. taffydb (2.6.2) \ No newline at end of file +License typesLicense types(all devDeps)(all devDeps)PermissivePermissive1. ISC1. ISC2. MIT2. MIT \ No newline at end of file diff --git a/dist/extensions/imagelib/openclipart.js b/dist/extensions/imagelib/openclipart.js index 56e2c7b8..3206b4c2 100644 --- a/dist/extensions/imagelib/openclipart.js +++ b/dist/extensions/imagelib/openclipart.js @@ -1132,7 +1132,8 @@ while (_node2.childNodes[j]) { var cn = _node2.childNodes[j]; cn.remove(); // `j` should stay the same as removing will cause node to be present - } + } // eslint-disable-next-line unicorn/no-fn-reference-in-iterator + attVal.childNodes.forEach(_childrenToJML(_node2)); } else { @@ -1159,11 +1160,13 @@ } if (attVal.head) { + // eslint-disable-next-line unicorn/no-fn-reference-in-iterator attVal.head.forEach(_appendJML(head)); } } if (attVal.body) { + // eslint-disable-next-line unicorn/no-fn-reference-in-iterator attVal.body.forEach(_appendJMLOrText(_body)); } } @@ -1450,7 +1453,7 @@ // Todo: Fix to allow application of stylesheets of style tags within fragments? - return nodes.length <= 1 ? nodes[0] // eslint-disable-next-line + return nodes.length <= 1 ? nodes[0] // eslint-disable-next-line unicorn/no-fn-reference-in-iterator : nodes.reduce(_fragReducer, doc.createDocumentFragment()); // nodes; } diff --git a/dist/index-es.js b/dist/index-es.js index c9fa9b35..faa69cbe 100644 --- a/dist/index-es.js +++ b/dist/index-es.js @@ -35951,7 +35951,6 @@ editor.init = function () { $$c.process_cancel(uiStrings$1.notification.loadingImage); e.stopPropagation(); e.preventDefault(); - $$c('#workarea').removeAttr('style'); $$c('#main_menu').hide(); var file = e.type === 'drop' ? e.dataTransfer.files[0] : this.files[0]; diff --git a/dist/index-es.min.js b/dist/index-es.min.js index b0711ef9..7616001f 100644 --- a/dist/index-es.min.js +++ b/dist/index-es.min.js @@ -138,5 +138,5 @@ var Er="http://www.w3.org/2000/svg",Gr="http://www.w3.org/1999/xlink"; * John Dyers' website: {@link http://johndyer.name} * Color Picker page: {@link http://johndyer.name/photoshop-like-javascript-color-picker/} */ -function Nr(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)}window.console||(window.console={log:function(e){},dir:function(e){}});var Pr,Ir,Tr=function(e){return null==e},Lr=jQuery,Mr=function(e,t,n){var r=Lr("#svg_editor").parent();Object.entries(t).forEach((function(t){var a=f(t,2),i=a[0],o=a[1];if(o){n&&(i="#"+i);var s=r.find(i);if(s.length){var l=s[0];switch(e){case"aria-label":l.setAttribute("aria-label",o);break;case"content":p(l.childNodes).some((function(e){return!(3!==e.nodeType||!e.textContent.trim())&&(e.textContent=o,!0)}));break;case"title":l.title=o}}else console.log("Missing element for localization: "+i)}else console.log(i)}))},Or=function(){var e=n(regeneratorRuntime.mark((function e(t){var n,r,a,i,o,s,l,c,u,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ir.addLangData(Pr);case 2:if(n=e.sent,Lr.each(n,(function(e,n){n.data&&(t=Lr.merge(t,n.data))})),t.tools){e.next=6;break}return e.abrupt("return",void 0);case 6:return a=(r=t).tools,i=r.properties,o=r.config,s=r.layers,l=r.common,c=r.ui,Mr("content",{curve_segments:i.curve_segments,fitToContent:a.fitToContent,fit_to_all:a.fit_to_all,fit_to_canvas:a.fit_to_canvas,fit_to_layer_content:a.fit_to_layer_content,fit_to_sel:a.fit_to_sel,icon_large:o.icon_large,icon_medium:o.icon_medium,icon_small:o.icon_small,icon_xlarge:o.icon_xlarge,image_opt_embed:o.image_opt_embed,image_opt_ref:o.image_opt_ref,includedImages:o.included_images,largest_object:a.largest_object,layersLabel:s.layers,page:a.page,relativeToLabel:a.relativeTo,selLayerLabel:s.move_elems_to,selectedPredefined:o.select_predefined,selected_objects:a.selected_objects,smallest_object:a.smallest_object,straight_segments:i.straight_segments,svginfo_bg_url:o.editor_img_url+":",svginfo_bg_note:o.editor_bg_note,svginfo_change_background:o.background,svginfo_dim:o.doc_dims,svginfo_editor_prefs:o.editor_prefs,svginfo_height:l.height,svginfo_icons:o.icon_size,svginfo_image_props:o.image_props,svginfo_lang:o.language,svginfo_title:o.doc_title,svginfo_width:l.width,tool_docprops_cancel:l.cancel,tool_docprops_save:l.ok,tool_source_cancel:l.cancel,tool_source_save:l.ok,tool_prefs_cancel:l.cancel,tool_prefs_save:l.ok,sidepanel_handle:s.layers.split("").join(" "),tool_clear:a.new_doc,tool_docprops:a.docprops,tool_export:a.export_img,tool_import:a.import_doc,tool_open:a.open_doc,tool_save:a.save_doc,tool_editor_prefs:o.editor_prefs,tool_editor_homepage:a.editor_homepage,svginfo_units_rulers:o.units_and_rulers,svginfo_rulers_onoff:o.show_rulers,svginfo_unit:o.base_unit,svginfo_grid_settings:o.grid,svginfo_snap_onoff:o.snapping_onoff,svginfo_snap_step:o.snapping_stepsize,svginfo_grid_color:o.grid_color},!0),u={},["cut","copy","paste","paste_in_place","delete","group","ungroup","move_front","move_up","move_down","move_back"].forEach((function(e){u['#cmenu_canvas a[href="#'+e+'"]']=a[e]})),["dupe","merge_down","merge_all"].forEach((function(e){u['#cmenu_layers a[href="#'+e+'"]']=s[e]})),u['#cmenu_layers a[href="#delete"]']=s.del,Mr("content",u),d={},Object.entries({tool_blur:i.blur,tool_position:a.align_to_page,tool_font_family:i.font_family,zoom_panel:c.zoom_level,stroke_linejoin:i.linejoin_miter,stroke_linecap:i.linecap_butt,tool_opacity:i.opacity}).forEach((function(e){var t=f(e,2),n=t[0],r=t[1];d["#"+n+" button"]=r})),Object.entries({group_opacity:i.opacity,zoom:c.zoom_level}).forEach((function(e){var t=f(e,2),n=t[0],r=t[1];d["#"+n]=r})),Mr("aria-label",d),Mr("title",{align_relative_to:a.align_relative_to,circle_cx:i.circle_cx,circle_cy:i.circle_cy,circle_r:i.circle_r,cornerRadiusLabel:i.corner_radius,ellipse_cx:i.ellipse_cx,ellipse_cy:i.ellipse_cy,ellipse_rx:i.ellipse_rx,ellipse_ry:i.ellipse_ry,fill_color:i.fill_color,font_family:i.font_family,idLabel:i.id,image_height:i.image_height,image_url:i.image_url,image_width:i.image_width,layer_delete:s.del,layer_down:s.move_down,layer_new:s.new,layer_rename:s.rename,layer_moreopts:l.more_opts,layer_up:s.move_up,line_x1:i.line_x1,line_x2:i.line_x2,line_y1:i.line_y1,line_y2:i.line_y2,linecap_butt:i.linecap_butt,linecap_round:i.linecap_round,linecap_square:i.linecap_square,linejoin_bevel:i.linejoin_bevel,linejoin_miter:i.linejoin_miter,linejoin_round:i.linejoin_round,main_icon:a.main_menu,palette:c.palette_info,zoom_panel:c.zoom_level,path_node_x:i.node_x,path_node_y:i.node_y,rect_height_tool:i.rect_height,rect_width_tool:i.rect_width,seg_type:i.seg_type,selLayerNames:s.move_selected,selected_x:i.pos_x,selected_y:i.pos_y,stroke_color:i.stroke_color,stroke_style:i.stroke_style,stroke_width:i.stroke_width,svginfo_title:o.doc_title,text:i.text_contents,toggle_stroke_tools:c.toggle_stroke_tools,tool_add_subpath:a.add_subpath,tool_alignbottom:a.align_bottom,tool_aligncenter:a.align_center,tool_alignleft:a.align_left,tool_alignmiddle:a.align_middle,tool_alignright:a.align_right,tool_aligntop:a.align_top,tool_angle:i.angle,tool_blur:i.blur,tool_bold:i.bold,tool_circle:a.mode_circle,tool_clone:a.clone,tool_clone_multi:a.clone,tool_delete:a.del,tool_delete_multi:a.del,tool_ellipse:a.mode_ellipse,tool_fhellipse:a.mode_fhellipse,tool_fhpath:a.mode_fhpath,tool_fhrect:a.mode_fhrect,tool_font_size:i.font_size,tool_group_elements:a.group_elements,tool_make_link:a.make_link,tool_link_url:a.set_link_url,tool_image:a.mode_image,tool_italic:i.italic,tool_line:a.mode_line,tool_move_bottom:a.move_bottom,tool_move_top:a.move_top,tool_node_clone:a.node_clone,tool_node_delete:a.node_delete,tool_node_link:a.node_link,tool_opacity:i.opacity,tool_openclose_path:a.openclose_path,tool_path:a.mode_path,tool_position:a.align_to_page,tool_rect:a.mode_rect,tool_redo:a.redo,tool_reorient:a.reorient_path,tool_select:a.mode_select,tool_source:a.source_save,tool_square:a.mode_square,tool_text:a.mode_text,tool_topath:a.to_path,tool_undo:a.undo,tool_ungroup:a.ungroup,tool_wireframe:a.wireframe_mode,tool_zoom:a.mode_zoom,url_notice:a.no_embed},!0),e.abrupt("return",{langParam:Pr,langData:t});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),jr=function(){var e=n(regeneratorRuntime.mark((function e(t,n,r){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t?Pr=t:navigator.userLanguage?Pr=navigator.userLanguage:navigator.language&&(Pr=navigator.language),console.log("Lang: "+Pr),n.includes(Pr)||"test"===Pr||(Pr="en"),a=r.langPath+"lang."+Pr+".js",e.t0=Or,e.next=7,mt(a,{global:"svgEditorLang_"+Pr.replace(/-/g,"_")});case 7:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();function Vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.before,r=t.after,a=t.favicon,i=t.canvas,o=t.image,s=void 0===o||o,l=t.acceptErrors;function c(e){var t={};if(Array.isArray(e)){var o=Vr(e,2);e=o[0];var c=o[1];t=void 0===c?{}:c}var u=t.favicon,d=void 0===u?a:u,h=t,f=h.before,p=void 0===f?n:f,g=h.after,m=void 0===g?r:g,v=h.canvas,y=void 0===v?i:v,_=h.image,b=void 0===_?s:_;function x(){p?p.before(w):m?m.after(w):document.head.appendChild(w)}var w=document.createElement("link");return new Promise((function(n,r){var a=r;if(l&&(a="function"==typeof l?function(a){l({error:a,stylesheetURL:e,options:t,resolve:n,reject:r})}:n),e.endsWith(".css")?d=!1:e.endsWith(".ico")&&(d=!0),d){if(w.rel="shortcut icon",w.type="image/x-icon",!1===b)return w.href=e,x(),void n(w);var i=document.createElement("canvas");i.width=16,i.height=16;var o=i.getContext("2d"),s=document.createElement("img");return s.addEventListener("error",(function(e){r(e)})),s.addEventListener("load",(function(){o.drawImage(s,0,0),w.href=y?i.toDataURL("image/x-icon"):e,x(),n(w)})),void(s.src=e)}w.rel="stylesheet",w.type="text/css",w.href=e,x(),w.addEventListener("error",(function(e){a(e)})),w.addEventListener("load",(function(){n(w)}))}))}return e=Array.isArray(e)?e:[e],Promise.all(e.map((function(e){return c(e)})))}var Br=function(e){return document.querySelector(e)},Dr={},Ur=[function(e){function t(t){if("string"==typeof t.data){var n=t.handler,r=t.data.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||27===t.which||!/textarea|select/i.test(t.target.nodeName)&&"text"!==t.target.type){var a="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],i=String.fromCharCode(t.which).toLowerCase(),o="",s={};t.altKey&&"alt"!==a&&(o+="alt+"),t.ctrlKey&&"ctrl"!==a&&(o+="ctrl+"),t.metaKey&&!t.ctrlKey&&"meta"!==a&&(o+="meta+"),t.shiftKey&&"shift"!==a&&(o+="shift+"),a?s[o+a]=!0:(s[o+i]=!0,s[o+e.hotkeys.shiftNums[i]]=!0,"shift+"===o&&(s[e.hotkeys.shiftNums[i]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"}},e.each(["keydown","keyup","keypress"],(function(){e.event.special[this]={add:t}})),e},function(e){var t={};return e.svgIcons=function(n){var r,a,i,o,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c="http://www.w3.org/2000/svg",u="http://www.w3.org/1999/xlink",d=l.w||24,h=l.h||24,f=!1,p=!1,g=0,m="data:image/svg+xml;charset=utf-8;base64,";if(l.svgz){o=e('').appendTo("body").hide();try{a=o[0].contentDocument,o.load(y),y(0,!0)}catch(e){w()}}else{var v=new DOMParser;e.ajax({url:n,dataType:"string",success:function(t){t?(a=v.parseFromString(t,"text/xml"),e((function(){y("ajax")}))):e(w)},error:function(t){window.opera?e((function(){w()})):t.responseText?((a=v.parseFromString(t.responseText,"text/xml")).childNodes.length||e(w),e((function(){y("ajax")}))):e(w)}})}function y(t,n){if("ajax"!==t){if(p)return;var s=(a=o[0].contentDocument)&&a.getElementById("svg_eof");if(!(s||n&&s))return void(++g<50?setTimeout(y,20):(w(),p=!0));p=!0}if(r=e(a.firstChild).children(),l.no_img)setTimeout((function(){f||x()}),500);else{var c=m+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";i=e(new Image).attr({src:c,width:0,height:0,alt:l.testIconAlt||"icon"}).appendTo("body").load((function(){x(!0)})).error((function(){x()}))}}function _(e,t,n,r){if(Cr&&t.css("visibility","hidden"),l.replace){r&&t.attr("id",n);var a=e.attr("class");if(a&&t.attr("class","svg_icon "+a),!e.alt){var i="icon";l.alts&&(i=l.alts[n]||i),t.attr("alt",i)}e.replaceWith(t)}else e.append(t);Cr&&setTimeout((function(){t.removeAttr("style")}),1)}function b(e,n){void 0!==l.id_match&&!1===l.id_match||_(s,e,n,!0),t[n]=e}function x(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!f){var p;if(l.no_img&&(n=!1),n&&(p=e(document.createElement("div"))).hide().appendTo("body"),a){var g=l.fallback_path||"";e.each(a,(function(t,n){s=e("#"+t);var r="icon";l.alts&&(r=l.alts[t]||r),b(e(new Image).attr({class:"svg_icon",src:g+n,width:d,height:h,alt:r}),t)}))}else for(var v=r.length,y=0;y0&&!n&&(i=Ar(i,r)),_(e(this),i,a)}))})),a||(n&&p.remove(),o&&o.remove(),i&&i.remove()),l.resize&&e.resizeSvgIcons(l.resize),f=!0,l.callback&&l.callback(t)}}function w(){if(n.includes(".svgz")){var t=n.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg"),e.svgIcons(t,l)}else l.fallback&&x(!1,l.fallback)}},e.getSvgIcon=function(e,n){var r=t[e];return n&&r&&(r=Ar(r,0).clone(!0)),r},e.resizeSvgIcons=function(t){var n=!e(".svg_icon:first").length;e.each(t,(function(t,r){var a=Array.isArray(r),i=a?r[0]:r,o=a?r[1]:r;n&&(t=t.replace(/\.svg_icon/g,"svg")),e(t).each((function(){this.setAttribute("width",i),this.setAttribute("height",o),window.opera&&window.widget&&(this.parentNode.style.width=i+"px",this.parentNode.style.height=o+"px")}))}))},e},function(t){t.loadingStylesheets||(t.loadingStylesheets=[]),t.loadingStylesheets.includes("jgraduate/css/jGraduate.css")||t.loadingStylesheets.push("jgraduate/css/jGraduate.css"),t.jGraduate={Paint:function e(t){r(this,e);var n=t||{};if(this.alpha=isNaN(n.alpha)?100:n.alpha,n.copy)switch(this.type=n.copy.type,this.alpha=n.copy.alpha,this.solidColor=null,this.linearGradient=null,this.radialGradient=null,this.type){case"none":break;case"solidColor":this.solidColor=n.copy.solidColor;break;case"linearGradient":this.linearGradient=n.copy.linearGradient.cloneNode(!0);break;case"radialGradient":this.radialGradient=n.copy.radialGradient.cloneNode(!0)}else n.linearGradient?(this.type="linearGradient",this.solidColor=null,this.radialGradient=null,this.linearGradient=n.linearGradient.cloneNode(!0)):n.radialGradient?(this.type="radialGradient",this.solidColor=null,this.linearGradient=null,this.radialGradient=n.radialGradient.cloneNode(!0)):n.solidColor?(this.type="solidColor",this.solidColor=n.solidColor):(this.type="none",this.solidColor=null,this.linearGradient=null,this.radialGradient=null)}},t.fn.jGraduateDefaults={paint:new t.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var n=navigator.userAgent.includes("Gecko/");function a(e,t,r){var a=document.createElementNS(Er,e);return function(e,t){n?Object.entries(t).forEach((function(t){var n=f(t,2),r=n[0],a=n[1];e.setAttribute(r,a)})):Object.entries(t).forEach((function(t){var n=f(t,2),r=n[0],a=n[1],i=e[r];i&&"SVGLength"===i.constructor?i.baseVal.value=a:e.setAttribute(r,a)}))}(a,t),r&&r.append(a),a}return t.fn.jGraduate=function(n,r,i){return this.each((function(){var o=t(this),s=t.extend(!0,{},t.fn.jGraduateDefaults,n||{}),l=o.attr("id"),c="#"+o.attr("id")+" ";if(c){var u=function(){switch(o.paint.type){case"radialGradient":o.paint.linearGradient=null;break;case"linearGradient":o.paint.radialGradient=null;break;case"solidColor":o.paint.radialGradient=o.paint.linearGradient=null}"function"==typeof o.okCallback&&o.okCallback(o.paint),o.hide()},d=function(){"function"==typeof o.cancelCallback&&o.cancelCallback(),o.hide()};t.extend(!0,o,{paint:new t.jGraduate.Paint({copy:s.paint}),okCallback:"function"==typeof r?r:null,cancelCallback:"function"==typeof i?i:null});var h=null,f=t(window);"none"===o.paint.type&&(o.paint=new t.jGraduate.Paint({solidColor:"ffffff"})),o.addClass("jGraduate_Picker"),o.html('
  • Solid Color
  • Linear Gradient
  • Radial Gradient
');var p=t(c+"> .jGraduate_colPick"),g=t(c+"> .jGraduate_gradPick");g.html('

'+s.window.pickerTitle+'


');var m={};t(".jGraduate_SliderBar").width(145);var v,y=t("#"+l+"_jGraduate_GradContainer")[0],_=a("svg",{id:l+"_jgraduate_svg",width:256,height:256,xmlns:Er},y),b=o.paint.type,x=o.paint[b],w=x,S=o.paint.alpha,k="solidColor"===b;switch(b){case"solidColor":case"linearGradient":if(k||(w.id=l+"_lg_jgraduate_grad",x=w=_.appendChild(w)),a("radialGradient",{id:l+"_rg_jgraduate_grad"},_),"linearGradient"===b)break;case"radialGradient":k||(w.id=l+"_rg_jgraduate_grad",x=w=_.appendChild(w)),a("linearGradient",{id:l+"_lg_jgraduate_grad"},_)}if(k){x=w=t("#"+l+"_lg_jgraduate_grad")[0],Ie(0,"#"+(h=o.paint[b]),1);var C=e(s.newstop);if("string"===C)switch(s.newstop){case"same":Ie(1,"#"+h,1);break;case"inverse":for(var A="",E=0;E<6;E+=2){var G=(255-Number.parseInt(h.substr(E,2),16)).toString(16);G.length<2&&(G=0+G),A+=G}Ie(1,"#"+A,1);break;case"white":Ie(1,"#ffffff",1);break;case"black":Ie(1,"#000000",1)}else if("object"===C){var N="opac"in s.newstop?s.newstop.opac:1;Ie(1,s.newstop.color||"#"+h,N)}}var P,I=Number.parseFloat(x.getAttribute("x1")||0),T=Number.parseFloat(x.getAttribute("y1")||0),L=Number.parseFloat(x.getAttribute("x2")||1),M=Number.parseFloat(x.getAttribute("y2")||0),O=Number.parseFloat(x.getAttribute("cx")||.5),j=Number.parseFloat(x.getAttribute("cy")||.5),V=Number.parseFloat(x.getAttribute("fx")||O),R=Number.parseFloat(x.getAttribute("fy")||j),B=a("rect",{id:l+"_jgraduate_rect",x:0,y:0,width:256,height:256,fill:"url(#"+l+"_jgraduate_grad)","fill-opacity":S/100},_),D=t("
").attr({class:"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:256*T,left:256*I}).data("coord","start").appendTo(y),U=D.clone().text(2).css({top:256*M,left:256*L}).attr("title","End stop").data("coord","end").appendTo(y),F=t("
").attr({class:"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:256*j,left:256*O}).data("coord","center").appendTo(y),z=F.clone().text("F").css({top:256*R,left:256*V,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(y);z[0].id=l+"_jGraduate_focusCoord",t.each(["x1","y1","x2","y2","cx","cy","fx","fy"],(function(e,n){var r=isNaN(n[1]),a=w.getAttribute(n);a||(a=r?"0.5":"x2"===n?"1.0":"0.0"),m[n]=t("#"+l+"_jGraduate_"+n).val(a).change((function(){isNaN(Number.parseFloat(this.value))||this.value<0?this.value=0:this.value>1&&(this.value=1),("f"!==n[0]||P)&&(r&&"radialGradient"===b||!r&&"linearGradient"===b)&&w.setAttribute(n,this.value);var e=r?"c"===n[0]?F:z:"1"===n[1]?D:U,t=n.includes("x")?"left":"top";e.css(t,256*this.value)})).change()}));var H,q,W,X,Y=t("#"+l+"_jGraduate_StopSlider"),Q=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},void 0),K=1,Z=1,$=0,J=O,ee=j,te=a("svg",{width:"100%",height:45},Y[0]),ne=a("pattern",{width:16,height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},te),re=a("image",{width:16,height:16},ne),ae=s.images.clientPath+"map-opacity.png";re.setAttributeNS(Gr,"xlink:href",ae),t(te).click((function(e){if(X=Y.offset(),"path"!==e.target.tagName){var t=e.pageX-X.left-8;Ie((t=t<10?10:t>266?266:t)/256,0,0,!0),e.stopPropagation()}})),t(te).mouseover((function(){te.append(Q)})),v=a("g",{},te),a("line",{x1:10,y1:15,x2:266,y2:15,"stroke-width":2,stroke:"#000"},te);var ie,oe,se,le,ce=g.find(".jGraduate_spreadMethod").change((function(){w.setAttribute("spreadMethod",t(this).val())})),ue=null,de=function(e){var t=e.pageX-ie.left,n=e.pageY-ie.top;t=t<0?0:t>256?256:t,n=n<0?0:n>256?256:n,ue.css("left",t).css("top",n);var r=t/256,a=n/256,i=ue.data("coord"),o=w;switch(i){case"start":m.x1.val(r),m.y1.val(a),o.setAttribute("x1",r),o.setAttribute("y1",a);break;case"end":m.x2.val(r),m.y2.val(a),o.setAttribute("x2",r),o.setAttribute("y2",a);break;case"center":m.cx.val(r),m.cy.val(a),o.setAttribute("cx",r),o.setAttribute("cy",a),J=r,ee=a,Me();break;case"focus":m.fx.val(r),m.fy.val(a),o.setAttribute("fx",r),o.setAttribute("fy",a),Me()}e.preventDefault()},he=function e(){ue=null,f.unbind("mousemove",de).unbind("mouseup",e)},fe=(H=w.getElementsByTagNameNS(Er,"stop")).length;if(fe<2){for(;fe<2;)w.append(document.createElementNS(Er,"stop")),++fe;H=w.getElementsByTagNameNS(Er,"stop")}for(var pe=0;pe99.5&&(n=99.5),n>0?Z=1-n/100:K=-n/100-1,a=(n+100)/2*145/100,t&&Me();break;case"angle":a=($=n)/180,a+=.5,a*=145,t&&Me()}a>145?a=145:a<0&&(a=0),r.css({"margin-left":a-5})})).change()}));for(var Ae=function(e){!function(e){var t=le.offset.left,n=le.parent,r=e.pageX-t-Number.parseInt(n.css("border-left-width"));r>145&&(r=145),r<=0&&(r=0);var a=r-5;switch(r/=145,le.type){case"radius":(r=Math.pow(2*r,2.5))>.98&&r<1.02&&(r=1),r<=.01&&(r=.01),w.setAttribute("r",r);break;case"opacity":o.paint.alpha=Number.parseInt(100*r),B.setAttribute("fill-opacity",r);break;case"ellip":K=1,Z=1,r<.5?K=(r/=.5)<=0?.01:r:r>.5&&(Z=(r=2-(r/=.5))<=0?.01:r),Me(),Z===(r-=1)+1&&(r=Math.abs(r));break;case"angle":r-=.5,$=r*=180,Me(),r/=100}le.elem.css({"margin-left":a}),r=Math.round(100*r),le.input.val(r)}(e),e.preventDefault()},Ee=function e(t){f.unbind("mousemove",Ae).unbind("mouseup",e),le=null},Ge=(255*o.paint.alpha/100).toString(16);Ge.length<2;)Ge="0"+Ge;Ge=Ge.split(".")[0],h="none"===o.paint.solidColor?"":o.paint.solidColor+Ge,k||(h=H[0].getAttribute("stop-color")),t.extend(t.fn.jPicker.defaults.window,{alphaSupport:!0,effects:{type:"show",speed:0}}),p.jPicker({window:{title:s.window.pickerTitle},images:{clientPath:s.images.clientPath},color:{active:h,alphaSupport:!0}},(function(e){o.paint.type="solidColor",o.paint.alpha=e.val("ahex")?Math.round(e.val("a")/255*100):100,o.paint.solidColor=e.val("hex")?e.val("hex"):"none",o.paint.radialGradient=null,u()}),null,(function(){d()}));var Ne,Pe=t(c+" .jGraduate_tabs li");switch(Pe.click((function(){Pe.removeClass("jGraduate_tab_current"),t(this).addClass("jGraduate_tab_current"),t(c+" > div").hide();var e=t(this).attr("data-type");if(t(c+" .jGraduate_gradPick").show(),"rg"===e||"lg"===e){t(".jGraduate_"+e+"_field").show(),t(".jGraduate_"+("lg"===e?"rg":"lg")+"_field").hide(),t("#"+l+"_jgraduate_rect")[0].setAttribute("fill","url(#"+l+"_"+e+"_jgraduate_grad)"),b="lg"===e?"linearGradient":"radialGradient",t("#"+l+"_jGraduate_OpacInput").val(o.paint.alpha).change();var n=t("#"+l+"_"+e+"_jgraduate_grad")[0];if(w!==n){var r=t(w).find("stop");t(n).empty().append(r),w=n;var a=ce.val();w.setAttribute("spreadMethod",a)}P="rg"===e&&null!==w.getAttribute("fx")&&!(O===V&&j===R),t("#"+l+"_jGraduate_focusCoord").toggle(P),P&&(t("#"+l+"_jGraduate_match_ctr")[0].checked=!1)}else t(c+" .jGraduate_gradPick").hide(),t(c+" .jGraduate_colPick").show()})),t(c+" > div").hide(),Pe.removeClass("jGraduate_tab_current"),o.paint.type){case"linearGradient":Ne=t(c+" .jGraduate_tab_lingrad");break;case"radialGradient":Ne=t(c+" .jGraduate_tab_radgrad");break;default:Ne=t(c+" .jGraduate_tab_color")}o.show(),setTimeout((function(){Ne.addClass("jGraduate_tab_current").click()}),10)}else t.alert("Container element must have an id attribute to maintain unique id strings for sub-elements.");function Ie(e,n,r,i,o){var c=o||a("stop",{"stop-color":n,"stop-opacity":r,offset:e},w);o?(n=o.getAttribute("stop-color"),r=o.getAttribute("stop-opacity"),e=o.getAttribute("offset")):w.append(c),null===r&&(r=1);var u="M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",d=a("path",{d:u,fill:"url(#jGraduate_trans)",transform:"translate("+(10+256*e)+", 26)"},v),h=a("path",{d:u,fill:n,"fill-opacity":r,transform:"translate("+(10+256*e)+", 26)",stroke:"#000","stroke-width":1.5},v);return t(h).mousedown((function(e){return Te(this),W=q,f.mousemove(Oe).mouseup(Le),X=Y.offset(),e.preventDefault(),!1})).data("stop",c).data("bg",d).dblclick((function(){t("div.jGraduate_LightBox").show();for(var e=this,r=Number(c.getAttribute("stop-opacity"))||1,a=c.getAttribute("stop-color")||1,i=(255*Number.parseFloat(r)).toString(16);i.length<2;)i="0"+i;n=a.substr(1)+i,t("#"+l+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:s.images.clientPath},color:{active:n,alphaSupport:!0}},(function(n,i){a=n.val("hex")?"#"+n.val("hex"):"none",r=null!==n.val("a")?n.val("a")/256:1,e.setAttribute("fill",a),e.setAttribute("fill-opacity",r),c.setAttribute("stop-color",a),c.setAttribute("stop-opacity",r),t("div.jGraduate_LightBox").hide(),t("#"+l+"_jGraduate_stopPicker").hide()}),null,(function(){t("div.jGraduate_LightBox").hide(),t("#"+l+"_jGraduate_stopPicker").hide()}))})),t(w).find("stop").each((function(){var r=t(this);if(Number(this.getAttribute("offset"))>e){if(!n){var a=this.getAttribute("stop-color"),i=this.getAttribute("stop-opacity");c.setAttribute("stop-color",a),h.setAttribute("fill",a),c.setAttribute("stop-opacity",null===i?1:i),h.setAttribute("fill-opacity",null===i?1:i)}return r.before(c),!1}return!0})),i&&Te(h),c}function Te(e){q&&q.setAttribute("stroke","#000"),e.setAttribute("stroke","blue"),q=e}function Le(){f.unbind("mousemove",Oe),"none"!==Q.getAttribute("display")&&function(){Q.setAttribute("display","none");var e=t(q),n=e.data("stop"),r=e.data("bg");t([q,n,r]).remove()}(),W=null}function Me(){var e=$?"rotate("+$+","+J+","+ee+") ":"";if(1===K&&1===Z)w.removeAttribute("gradientTransform");else{var t=-J*(K-1),n=-ee*(Z-1);w.setAttribute("gradientTransform",e+"translate("+t+","+n+") scale("+K+","+Z+")")}}function Oe(e){var n=e.pageX-X.left,r=e.pageY-X.top,a="translate("+(n=n<10?10:n>266?266:n)+", 26)";r<-60||r>130?(Q.setAttribute("display","block"),Q.setAttribute("transform",a)):Q.setAttribute("display","none"),W.setAttribute("transform",a),t.data(W,"bg").setAttribute("transform",a);var i=(n-10)/256;t.data(W,"stop").setAttribute("offset",i);var o=0;t(w).find("stop").each((function(e){var n=this.getAttribute("offset"),r=t(this);nn(o,"offsetLeft")+o.offsetWidth*s-this.spinCfg._btn_width?i=120?this.adjustValue(this.spinCfg.step):e.wheelDelta<=-120&&this.adjustValue(-this.spinCfg.step),e.preventDefault()})).change((function(e){this.adjustValue(0)})),this.addEventListener&&this.addEventListener("DOMMouseScroll",(function(e){e.detail>0?this.adjustValue(-this.spinCfg.step):e.detail<0&&this.adjustValue(this.spinCfg.step),e.preventDefault()}))}))},e},Y,function(e){var t=e(window),n=e(document);return e.extend(e.fn,{contextMenu:function(r,a){return void 0!==r.menu&&(void 0===r.inSpeed&&(r.inSpeed=150),void 0===r.outSpeed&&(r.outSpeed=75),0===r.inSpeed&&(r.inSpeed=-1),0===r.outSpeed&&(r.outSpeed=-1),e(this).each((function(){var i=e(this),o=e(i).offset(),s=e("#"+r.menu);s.addClass("contextMenu"),e(this).bind("mousedown",(function(l){e(this).mouseup((function(c){var u=e(this);if(u.unbind("mouseup"),2===l.button||r.allowLeft||l.ctrlKey&&q()){if(c.stopPropagation(),e(".contextMenu").hide(),i.hasClass("disabled"))return!1;var d=c.pageX,h=c.pageY,f=t.width()-s.width(),p=t.height()-s.height();d>f-15&&(d=f-15),h>p-30&&(h=p-30),n.unbind("click"),s.css({top:h,left:d}).fadeIn(r.inSpeed),s.find("A").mouseover((function(){s.find("LI.hover").removeClass("hover"),e(this).parent().addClass("hover")})).mouseout((function(){s.find("LI.hover").removeClass("hover")})),n.keypress((function(e){switch(e.keyCode){case 38:s.find("LI.hover").length?(s.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover"),s.find("LI.hover").length||s.find("LI:last").addClass("hover")):s.find("LI:last").addClass("hover");break;case 40:s.find("LI.hover").length?(s.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover"),s.find("LI.hover").length||s.find("LI:first").addClass("hover")):s.find("LI:first").addClass("hover");break;case 13:s.find("LI.hover A").trigger("click");break;case 27:n.trigger("click")}})),s.find("A").unbind("mouseup"),s.find("LI:not(.disabled) A").mouseup((function(){return n.unbind("click").unbind("keypress"),e(".contextMenu").hide(),a&&a(e(this).attr("href").substr(1),e(u),{x:d-o.left,y:h-o.top,docX:d,docY:h}),!1})),setTimeout((function(){n.click((function(){return n.unbind("click").unbind("keypress"),s.fadeOut(r.outSpeed),!1}))}),0)}}))})),e.browser.mozilla?e("#"+r.menu).each((function(){e(this).css({MozUserSelect:"none"})})):e.browser.msie?e("#"+r.menu).each((function(){e(this).bind("selectstart.disableTextSelect",(function(){return!1}))})):e("#"+r.menu).each((function(){e(this).bind("mousedown.disableTextSelect",(function(){return!1}))})),e(i).add(e("UL.contextMenu")).bind("contextmenu",(function(){return!1}))})),e(this))},disableContextMenuItems:function(t){return void 0===t?(e(this).find("LI").addClass("disabled"),e(this)):(e(this).each((function(){if(void 0!==t){var n,r=v(t.split(","));try{for(r.s();!(n=r.n()).done;){var a=n.value;e(this).find('A[href="'+a+'"]').parent().addClass("disabled")}}catch(e){r.e(e)}finally{r.f()}}})),e(this))},enableContextMenuItems:function(t){return void 0===t?(e(this).find("LI.disabled").removeClass("disabled"),e(this)):(e(this).each((function(){if(void 0!==t){var n,r=v(t.split(","));try{for(r.s();!(n=r.n()).done;){var a=n.value;e(this).find('A[href="'+a+'"]').parent().removeClass("disabled")}}catch(e){r.e(e)}finally{r.f()}}})),e(this))},disableContextMenu:function(){return e(this).each((function(){e(this).addClass("disabled")})),e(this)},enableContextMenu:function(){return e(this).each((function(){e(this).removeClass("disabled")})),e(this)},destroyContextMenu:function(){return e(this).each((function(){e(this).unbind("mousedown").unbind("mouseup")})),e(this)}}),e},function(t){t.loadingStylesheets||(t.loadingStylesheets=[]);t.loadingStylesheets.includes("jgraduate/css/jPicker.css")||t.loadingStylesheets.push("jgraduate/css/jPicker.css");var n=function e(n,a){r(this,e);var i=this;function o(e){k.forEach((function(t){t.call(i,i,e)}))}function s(e){var r=n.offset();f={l:0|r.left,t:0|r.top},clearTimeout(p),p=setTimeout((function(){u.call(i,e)}),0),t(document).bind("mousemove",l).bind("mouseup",c),e.preventDefault()}function l(e){return clearTimeout(p),p=setTimeout((function(){u.call(i,e)}),0),e.stopPropagation(),e.preventDefault(),!1}function c(e){return t(document).unbind("mouseup",c).unbind("mousemove",l),e.stopPropagation(),e.preventDefault(),!1}function u(e){var t=n.w,r=n.h,a=e.pageX-f.l,o=e.pageY-f.t;a<0?a=0:a>t&&(a=t),o<0?o=0:o>r&&(o=r),d.call(i,"xy",{x:a/t*_+v,y:o/r*w+b})}function d(e,t,n){if(!(void 0!==t))switch(Tr(e)&&(e="xy"),e.toLowerCase()){case"x":return g;case"y":return m;case"xy":default:return{x:g,y:m}}if(Tr(n)||n!==i){var r,a,s=!1;switch(Tr(e)&&(e="xy"),e.toLowerCase()){case"x":r=t&&(t.x&&0|t.x||0|t)||0;break;case"y":a=t&&(t.y&&0|t.y||0|t)||0;break;case"xy":default:r=t&&t.x&&0|t.x||0,a=t&&t.y&&0|t.y||0}Tr(r)||(ry&&(r=y),g!==r&&(g=r,s=!0)),Tr(a)||(ax&&(a=x),m!==a&&(m=a,s=!0)),s&&o.call(i,n||i)}}function h(e){"function"==typeof e&&k.push(e)}var f,p,g=0,m=0,v=0,y=100,_=100,b=0,x=100,w=100,S=n.find("img:first"),k=[];t.extend(!0,i,{val:d,range:function(e,t){var n,r,a,i;if(!(void 0!==t))switch(Tr(e)&&(e="all"),e.toLowerCase()){case"minx":return v;case"maxx":return y;case"rangex":return{minX:v,maxX:y,rangeX:_};case"miny":return b;case"maxy":return x;case"rangey":return{minY:b,maxY:x,rangeY:w};case"all":default:return{minX:v,maxX:y,rangeX:_,minY:b,maxY:x,rangeY:w}}switch(Tr(e)&&(e="all"),e.toLowerCase()){case"minx":n=t&&(t.minX&&0|t.minX||0|t)||0;break;case"maxx":r=t&&(t.maxX&&0|t.maxX||0|t)||0;break;case"rangex":n=t&&t.minX&&0|t.minX||0,r=t&&t.maxX&&0|t.maxX||0;break;case"miny":a=t&&(t.minY&&0|t.minY||0|t)||0;break;case"maxy":i=t&&(t.maxY&&0|t.maxY||0|t)||0;break;case"rangey":a=t&&t.minY&&0|t.minY||0,i=t&&t.maxY&&0|t.maxY||0;break;case"all":default:n=t&&t.minX&&0|t.minX||0,r=t&&t.maxX&&0|t.maxX||0,a=t&&t.minY&&0|t.minY||0,i=t&&t.maxY&&0|t.maxY||0}Tr(n)||v===n||(_=y-(v=n)),Tr(r)||y===r||(_=(y=r)-v),Tr(a)||b===a||(w=x-(b=a)),Tr(i)||x===i||(w=(x=i)-b)},bind:h,unbind:function(e){if("function"==typeof e)for(var t;t=k.includes(e);)k.splice(t,1)},destroy:function(){t(document).unbind("mouseup",c).unbind("mousemove",l),n.unbind("mousedown",s),n=null,S=null,k=null}}),S.src=a.arrow&&a.arrow.image,S.w=a.arrow&&a.arrow.width||S.width(),S.h=a.arrow&&a.arrow.height||S.height(),n.w=a.map&&a.map.width||n.width(),n.h=a.map&&a.map.height||n.height(),n.bind("mousedown",s),h.call(i,(function(){var e=n.w,t=n.h,r=S.w,a=S.h,i=0,o=0;setTimeout((function(){_>0&&(i=g===y?e:g/_*e|0),w>0&&(o=m===x?t:m/w*t|0),r>=e?i=(e>>1)-(r>>1):i-=r>>1,a>=t?o=(t>>1)-(a>>1):o-=a>>1,S.css({left:i+"px",top:o+"px"})}))}))},a=function e(n,a,i,o){r(this,e);var s=this,l=n.find("td.Text input");function c(e){if(""!==e.target.value||e.target===w.get(0)||(Tr(i)||e.target===i.get(0))&&!Tr(i)){if(!h(e))return e;switch(e.target){case g.get(0):switch(e.keyCode){case 38:return g.val(f.call(s,1+(g.val()<<0),0,255)),a.val("r",g.val(),e.target),!1;case 40:return g.val(f.call(s,(g.val()<<0)-1,0,255)),a.val("r",g.val(),e.target),!1}break;case m.get(0):switch(e.keyCode){case 38:return m.val(f.call(s,1+(m.val()<<0),0,255)),a.val("g",m.val(),e.target),!1;case 40:return m.val(f.call(s,(m.val()<<0)-1,0,255)),a.val("g",m.val(),e.target),!1}break;case v.get(0):switch(e.keyCode){case 38:return v.val(f.call(s,1+(v.val()<<0),0,255)),a.val("b",v.val(),e.target),!1;case 40:return v.val(f.call(s,(v.val()<<0)-1,0,255)),a.val("b",v.val(),e.target),!1}break;case y&&y.get(0):switch(e.keyCode){case 38:return y.val(f.call(s,Number.parseFloat(y.val())+1,0,100)),a.val("a",Nr(255*y.val()/100,o),e.target),!1;case 40:return y.val(f.call(s,Number.parseFloat(y.val())-1,0,100)),a.val("a",Nr(255*y.val()/100,o),e.target),!1}break;case _.get(0):switch(e.keyCode){case 38:return _.val(f.call(s,1+(_.val()<<0),0,360)),a.val("h",_.val(),e.target),!1;case 40:return _.val(f.call(s,(_.val()<<0)-1,0,360)),a.val("h",_.val(),e.target),!1}break;case b.get(0):switch(e.keyCode){case 38:return b.val(f.call(s,1+(b.val()<<0),0,100)),a.val("s",b.val(),e.target),!1;case 40:return b.val(f.call(s,(b.val()<<0)-1,0,100)),a.val("s",b.val(),e.target),!1}break;case x.get(0):switch(e.keyCode){case 38:return x.val(f.call(s,1+(x.val()<<0),0,100)),a.val("v",x.val(),e.target),!1;case 40:return x.val(f.call(s,(x.val()<<0)-1,0,100)),a.val("v",x.val(),e.target),!1}}}}function u(e){if(""!==e.target.value||e.target===w.get(0)||(Tr(i)||e.target===i.get(0))&&!Tr(i)){if(!h(e))return e;switch(e.target){case g.get(0):g.val(f.call(s,g.val(),0,255)),a.val("r",g.val(),e.target);break;case m.get(0):m.val(f.call(s,m.val(),0,255)),a.val("g",m.val(),e.target);break;case v.get(0):v.val(f.call(s,v.val(),0,255)),a.val("b",v.val(),e.target);break;case y&&y.get(0):y.val(f.call(s,y.val(),0,100)),a.val("a",Nr(255*y.val()/100,o),e.target);break;case _.get(0):_.val(f.call(s,_.val(),0,360)),a.val("h",_.val(),e.target);break;case b.get(0):b.val(f.call(s,b.val(),0,100)),a.val("s",b.val(),e.target);break;case x.get(0):x.val(f.call(s,x.val(),0,100)),a.val("v",x.val(),e.target);break;case w.get(0):w.val(w.val().replace(/[^a-fA-F\d]/g,"").toLowerCase().substring(0,6)),i&&i.val(w.val()),a.val("hex",""!==w.val()?w.val():null,e.target);break;case i&&i.get(0):i.val(i.val().replace(/[^a-fA-F\d]/g,"").toLowerCase().substring(0,6)),w.val(i.val()),a.val("hex",""!==i.val()?i.val():null,e.target);break;case S&&S.get(0):S.val(S.val().replace(/[^a-fA-F\d]/g,"").toLowerCase().substring(0,2)),a.val("a",Tr(S.val())?null:Number.parseInt(S.val(),16),e.target)}}}function d(e){if(!Tr(a.val()))switch(e.target){case g.get(0):g.val(a.val("r"));break;case m.get(0):m.val(a.val("g"));break;case v.get(0):v.val(a.val("b"));break;case y&&y.get(0):y.val(Nr(100*a.val("a")/255,o));break;case _.get(0):_.val(a.val("h"));break;case b.get(0):b.val(a.val("s"));break;case x.get(0):x.val(a.val("v"));break;case w.get(0):case i&&i.get(0):w.val(a.val("hex")),i&&i.val(a.val("hex"));break;case S&&S.get(0):S.val(a.val("ahex").substring(6))}}function h(e){switch(e.keyCode){case 9:case 16:case 29:case 37:case 39:return!1;case"c".charCodeAt():case"v".charCodeAt():if(e.ctrlKey)return!1}return!0}function f(e,t,n){return""===e||isNaN(e)?t:e>n?n:e7?l.eq(6):null,_=l.eq(0),b=l.eq(1),x=l.eq(2),w=l.eq(l.length>7?7:6),S=l.length>7?l.eq(8):null;t.extend(!0,s,{destroy:function(){g.add(m).add(v).add(y).add(_).add(b).add(x).add(w).add(i).add(S).unbind("keyup",u).unbind("blur",d),g.add(m).add(v).add(y).add(_).add(b).add(x).unbind("keydown",c),a.unbind(p),g=null,m=null,v=null,y=null,_=null,b=null,x=null,w=null,S=null}}),g.add(m).add(v).add(y).add(_).add(b).add(x).add(w).add(i).add(S).bind("keyup",u).bind("blur",d),g.add(m).add(v).add(y).add(_).add(b).add(x).bind("keydown",c),a.bind(p)};t.jPicker={List:[],Color:function(n){var r=this;function a(e){for(var t=0;t255&&(x.r=255),o!==x.r&&(o=x.r,_=!0);break;case"g":if(S)return;w=!0,x.g=n&&n.g&&0|n.g||n&&0|n||0,x.g<0?x.g=0:x.g>255&&(x.g=255),s!==x.g&&(s=x.g,_=!0);break;case"b":if(S)return;w=!0,x.b=n&&n.b&&0|n.b||n&&0|n||0,x.b<0?x.b=0:x.b>255&&(x.b=255),c!==x.b&&(c=x.b,_=!0);break;case"a":x.a=n&&!Tr(n.a)?0|n.a:0|n,x.a<0?x.a=0:x.a>255&&(x.a=255),u!==x.a&&(u=x.a,_=!0);break;case"h":if(w)return;S=!0,x.h=n&&n.h&&0|n.h||n&&0|n||0,x.h<0?x.h=0:x.h>360&&(x.h=360),d!==x.h&&(d=x.h,_=!0);break;case"s":if(w)return;S=!0,x.s=Tr(n.s)?0|n:0|n.s,x.s<0?x.s=0:x.s>100&&(x.s=100),h!==x.s&&(h=x.s,_=!0);break;case"v":if(w)return;S=!0,x.v=Tr(n.v)?0|n:0|n.v,x.v<0?x.v=0:x.v>100&&(x.v=100),f!==x.v&&(f=x.v,_=!0)}})),_){if(w){o=o||0,s=s||0,c=c||0;var k=l.rgbToHsv({r:o,g:s,b:c});d=k.h,h=k.s,f=k.v}else if(S){d=d||0,h=Tr(h)?100:h,f=Tr(f)?100:f;var C=l.hsvToRgb({h:d,s:h,v:f});o=C.r,s=C.g,c=C.b}u=Tr(u)?255:u,a.call(r,g||r)}}}}var o,s,c,u,d,h,f,g=[];t.extend(!0,r,{val:i,bind:function(e){"function"==typeof e&&g.push(e)},unbind:function(e){if("function"==typeof e)for(var t;t=g.includes(e);)g.splice(t,1)},destroy:function(){g=null}}),n&&(Tr(n.ahex)?Tr(n.hex)?Tr(n.r)||Tr(n.g)||Tr(n.b)?Tr(n.h)||Tr(n.s)||Tr(n.v)||i("hsv"+(Tr(n.a)?"":"a"),n):i("rgb"+(Tr(n.a)?"":"a"),n):i((Tr(n.a)?"":"a")+"hex",Tr(n.a)?n:{ahex:n.hex+l.intToHex(n.a)}):i("ahex",n))},ColorMethods:{hexToRgba:function(e){if(""===e||"none"===e)return{r:null,g:null,b:null,a:null};var t="00",n="00",r="00",a="255";return 6===(e=this.validateHex(e)).length&&(e+="ff"),e.length>6?(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6),a=e.substring(6,e.length)):(e.length>4&&(t=e.substring(4,e.length),e=e.substring(0,4)),e.length>2&&(n=e.substring(2,e.length),e=e.substring(0,2)),e.length>0&&(r=e.substring(0,e.length))),{r:this.hexToInt(t),g:this.hexToInt(n),b:this.hexToInt(r),a:this.hexToInt(a)}},validateHex:function(e){return(e=e.toLowerCase().replace(/[^a-f\d]/g,"")).length>8&&(e=e.substring(0,8)),e},rgbaToHex:function(e){return this.intToHex(e.r)+this.intToHex(e.g)+this.intToHex(e.b)+this.intToHex(e.a)},intToHex:function(e){var t=(0|e).toString(16);return 1===t.length&&(t="0"+t),t.toLowerCase()},hexToInt:function(e){return Number.parseInt(e,16)},rgbToHsv:function(e){var t,n=e.r/255,r=e.g/255,a=e.b/255,i={h:0,s:0,v:0},o=0,s=0;return n>=r&&n>=a?(s=n,o=r>a?a:r):r>=a&&r>=n?(s=r,o=n>a?a:n):(s=a,o=r>n?n:r),i.v=s,i.s=s?(s-o)/s:0,i.s?(t=s-o,i.h=n===s?(r-a)/t:r===s?2+(a-n)/t:4+(n-r)/t,i.h=Number.parseInt(60*i.h),i.h<0&&(i.h+=360)):i.h=0,i.s=100*i.s|0,i.v=100*i.v|0,i},hsvToRgb:function(e){var t={r:0,g:0,b:0,a:100},n=e.h,r=e.s,a=e.v;if(0===r)t.r=t.g=t.b=0===a?0:255*a/100|0;else{360===n&&(n=0);var i=0|(n/=60),o=n-i,s=(a/=100)*(1-(r/=100)),l=a*(1-r*o),c=a*(1-r*(1-o));switch(i){case 0:t.r=a,t.g=c,t.b=s;break;case 1:t.r=l,t.g=a,t.b=s;break;case 2:t.r=s,t.g=a,t.b=c;break;case 3:t.r=s,t.g=l,t.b=a;break;case 4:t.r=c,t.g=s,t.b=a;break;case 5:t.r=a,t.g=s,t.b=l}t.r=255*t.r|0,t.g=255*t.g|0,t.b=255*t.b|0}return t}}};var i=t.jPicker,o=i.Color,s=i.List,l=i.ColorMethods;return t.fn.jPicker=function(r,i,c,u){return this.each((function(){var d=this,h=t.extend(!0,{},t.fn.jPicker.defaults,r);"input"===t(d).get(0).nodeName.toLowerCase()&&(t.extend(!0,h,{window:{bindToInput:!0,expandable:!0,input:t(d)}}),""===t(d).val()?(h.color.active=new o({hex:null}),h.color.current=new o({hex:null})):l.validateHex(t(d).val())&&(h.color.active=new o({hex:t(d).val(),a:h.color.active.val("a")}),h.color.current=new o({hex:t(d).val(),a:h.color.active.val("a")}))),h.window.expandable?t(d).after('    '):h.window.liveUpdate=!1;var f=Number.parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters;function p(e){var t,n,r=H.active,a=r.val("hex");switch(h.color.mode=e,e){case"h":if(setTimeout((function(){w.call(d,K,"transparent"),k.call(d,$,0),C.call(d,$,100),k.call(d,J,260),C.call(d,J,100),w.call(d,Z,"transparent"),k.call(d,te,0),C.call(d,te,100),k.call(d,ne,260),C.call(d,ne,100),k.call(d,re,260),C.call(d,re,100),k.call(d,ae,260),C.call(d,ae,100),k.call(d,oe,260),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:100,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:360}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("s"),y:100-r.val("v")},se),le.val("y",360-r.val("h"),le);break;case"s":if(setTimeout((function(){w.call(d,K,"transparent"),k.call(d,$,-260),k.call(d,J,-520),k.call(d,te,-260),k.call(d,ne,-520),k.call(d,oe,260),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:360,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:100}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("h"),y:100-r.val("v")},se),le.val("y",100-r.val("s"),le);break;case"v":if(setTimeout((function(){w.call(d,K,"000000"),k.call(d,$,-780),k.call(d,J,260),w.call(d,Z,a),k.call(d,te,-520),k.call(d,ne,260),C.call(d,ne,100),k.call(d,oe,260),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:360,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:100}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("h"),y:100-r.val("s")},se),le.val("y",100-r.val("v"),le);break;case"r":if(t=-1040,n=-780,se.range("all",{minX:0,maxX:255,minY:0,maxY:255}),le.range("rangeY",{minY:0,maxY:255}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("b"),y:255-r.val("g")},se),le.val("y",255-r.val("r"),le);break;case"g":if(t=-1560,n=-1820,se.range("all",{minX:0,maxX:255,minY:0,maxY:255}),le.range("rangeY",{minY:0,maxY:255}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("b"),y:255-r.val("r")},se),le.val("y",255-r.val("g"),le);break;case"b":if(t=-2080,n=-2860,se.range("all",{minX:0,maxX:255,minY:0,maxY:255}),le.range("rangeY",{minY:0,maxY:255}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("r"),y:255-r.val("g")},se),le.val("y",255-r.val("b"),le);break;case"a":if(setTimeout((function(){w.call(d,K,"transparent"),k.call(d,$,-260),k.call(d,J,-520),k.call(d,te,260),k.call(d,ne,260),C.call(d,ne,100),k.call(d,oe,0),C.call(d,oe,100)}),0),se.range("all",{minX:0,maxX:360,minY:0,maxY:100}),le.range("rangeY",{minY:0,maxY:255}),Tr(r.val("ahex")))break;se.val("xy",{x:r.val("h"),y:100-r.val("v")},se),le.val("y",255-r.val("a"),le);break;default:throw new Error("Invalid Mode")}switch(e){case"h":break;case"s":case"v":case"a":setTimeout((function(){C.call(d,$,100),C.call(d,te,100),k.call(d,re,260),C.call(d,re,100),k.call(d,ae,260),C.call(d,ae,100)}),0);break;case"r":case"g":case"b":setTimeout((function(){w.call(d,K,"transparent"),w.call(d,Z,"transparent"),C.call(d,te,100),C.call(d,$,100),k.call(d,$,t),k.call(d,J,t-260),k.call(d,te,n-780),k.call(d,ne,n-520),k.call(d,re,n),k.call(d,ae,n-260),k.call(d,oe,260),C.call(d,oe,100)}),0)}Tr(r.val("ahex"))||g.call(d,r)}function g(e,t){(Tr(t)||t!==le&&t!==se)&&y.call(d,e,t),setTimeout((function(){_.call(d,e),b.call(d,e),x.call(d,e)}),0)}function m(e,t){var n=H.active;if(t===se||!Tr(n.val())){var r=e.val("all");switch(h.color.mode){case"h":n.val("sv",{s:r.x,v:100-r.y},t);break;case"s":case"a":n.val("hv",{h:r.x,v:100-r.y},t);break;case"v":n.val("hs",{h:r.x,s:100-r.y},t);break;case"r":n.val("gb",{g:255-r.y,b:r.x},t);break;case"g":n.val("rb",{r:255-r.y,b:r.x},t);break;case"b":n.val("rg",{r:r.x,g:255-r.y},t)}}}function v(e,t){var n=H.active;if(t===le||!Tr(n.val()))switch(h.color.mode){case"h":n.val("h",{h:360-e.val("y")},t);break;case"s":n.val("s",{s:100-e.val("y")},t);break;case"v":n.val("v",{v:100-e.val("y")},t);break;case"r":n.val("r",{r:255-e.val("y")},t);break;case"g":n.val("g",{g:255-e.val("y")},t);break;case"b":n.val("b",{b:255-e.val("y")},t);break;case"a":n.val("a",255-e.val("y"),t)}}function y(e,t){if(t!==se)switch(h.color.mode){case"h":var n=e.val("sv");se.val("xy",{x:Tr(n)?100:n.s,y:100-(Tr(n)?100:n.v)},t);break;case"s":case"a":var r=e.val("hv");se.val("xy",{x:r&&r.h||0,y:100-(Tr(r)?100:r.v)},t);break;case"v":var a=e.val("hs");se.val("xy",{x:a&&a.h||0,y:100-(Tr(a)?100:a.s)},t);break;case"r":var i=e.val("bg");se.val("xy",{x:i&&i.b||0,y:255-(i&&i.g||0)},t);break;case"g":var o=e.val("br");se.val("xy",{x:o&&o.b||0,y:255-(o&&o.r||0)},t);break;case"b":var s=e.val("rg");se.val("xy",{x:s&&s.r||0,y:255-(s&&s.g||0)},t)}if(t!==le)switch(h.color.mode){case"h":le.val("y",360-(e.val("h")||0),t);break;case"s":var l=e.val("s");le.val("y",100-(Tr(l)?100:l),t);break;case"v":var c=e.val("v");le.val("y",100-(Tr(c)?100:c),t);break;case"r":le.val("y",255-(e.val("r")||0),t);break;case"g":le.val("y",255-(e.val("g")||0),t);break;case"b":le.val("y",255-(e.val("b")||0),t);break;case"a":var u=e.val("a");le.val("y",255-(Tr(u)?255:u),t)}}function _(e){try{var t=e.val("all");ue.css({backgroundColor:t&&"#"+t.hex||"transparent"}),C.call(d,ue,t&&Nr(100*t.a/255,4)||0)}catch(e){}}function b(e){switch(h.color.mode){case"h":w.call(d,K,new o({h:e.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var t=e.val("s");C.call(d,J,100-(Tr(t)?100:t));break;case"v":var n=e.val("v");C.call(d,$,Tr(n)?100:n);break;case"r":C.call(d,J,Nr((e.val("r")||0)/255*100,4));break;case"g":C.call(d,J,Nr((e.val("g")||0)/255*100,4));break;case"b":C.call(d,J,Nr((e.val("b")||0)/255*100))}var r=e.val("a");C.call(d,ee,Nr(100*(255-(r||0))/255,4))}function x(e){switch(h.color.mode){case"h":var t=e.val("a");C.call(d,ie,Nr(100*(255-(t||0))/255,4));break;case"s":var n=e.val("hva"),r=new o({h:n&&n.h||0,s:100,v:Tr(n)?100:n.v});w.call(d,Z,r.val("hex")),C.call(d,ne,100-(Tr(n)?100:n.v)),C.call(d,ie,Nr(100*(255-(n&&n.a||0))/255,4));break;case"v":var a=e.val("hsa"),i=new o({h:a&&a.h||0,s:Tr(a)?100:a.s,v:100});w.call(d,Z,i.val("hex")),C.call(d,ie,Nr(100*(255-(a&&a.a||0))/255,4));break;case"r":case"g":case"b":var s=e.val("rgba"),l=0,c=0;"r"===h.color.mode?(l=s&&s.b||0,c=s&&s.g||0):"g"===h.color.mode?(l=s&&s.b||0,c=s&&s.r||0):"b"===h.color.mode&&(l=s&&s.r||0,c=s&&s.g||0);var u=c>l?l:c;C.call(d,ne,l>c?Nr((l-c)/(255-c)*100,4):0),C.call(d,re,c>l?Nr((c-l)/(255-l)*100,4):0),C.call(d,ae,Nr(u/255*100,4)),C.call(d,ie,Nr(100*(255-(s&&s.a||0))/255,4));break;case"a":var f=e.val("a");w.call(d,Z,e.val("hex")||"000000"),C.call(d,ie,Tr(f)?100:0),C.call(d,oe,Tr(f)?0:100)}}function w(e,t){e.css({backgroundColor:t&&6===t.length&&"#"+t||"transparent"})}function S(e,t){f&&(t.includes("AlphaBar.png")||t.includes("Bars.png")||t.includes("Maps.png"))?(e.attr("pngSrc",t),e.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"', sizingMethod='scale')"})):e.css({backgroundImage:"url('"+t+"')"})}function k(e,t){e.css({top:t+"px"})}function C(e,t){if(e.css({visibility:t>0?"visible":"hidden"}),t>0&&t<100)if(f){var n=e.attr("pngSrc");!Tr(n)&&(n.includes("AlphaBar.png")||n.includes("Bars.png")||n.includes("Maps.png"))?e.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+t+")"}):e.css({opacity:Nr(t/100,4)})}else e.css({opacity:Nr(t/100,4)});else if(0===t||100===t)if(f){var r=e.attr("pngSrc");!Tr(r)&&(r.includes("AlphaBar.png")||r.includes("Bars.png")||r.includes("Maps.png"))?e.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+r+"', sizingMethod='scale')"}):e.css({opacity:""})}else e.css({opacity:""})}function A(){H.active.val("ahex",H.current.val("ahex"))}function E(){H.current.val("ahex",H.active.val("ahex"))}function G(e){t(this).parents("tbody:first").find('input:radio[value!="'+e.target.value+'"]').removeAttr("checked"),p.call(d,e.target.value)}function N(){A.call(d)}function P(){A.call(d),h.window.expandable&&D.call(d),"function"==typeof u&&u.call(d,H.active,fe)}function I(){E.call(d),h.window.expandable&&D.call(d),"function"==typeof i&&i.call(d,H.active,he)}function T(){B.call(d)}function L(e){var t=e.val("hex");de.css({backgroundColor:t&&"#"+t||"transparent"}),C.call(d,de,Nr(100*(e.val("a")||0)/255,4))}function M(e){var t=e.val("hex"),n=e.val("va");ge.css({backgroundColor:t&&"#"+t||"transparent"}),C.call(d,me,Nr(100*(255-(n&&n.a||0))/255,4)),h.window.bindToInput&&h.window.updateInputColor&&h.window.input.css({backgroundColor:t&&"#"+t||"transparent",color:Tr(n)||n.v>75?"#000000":"#ffffff"})}function O(e){q=Number.parseInt(Q.css("left")),W=Number.parseInt(Q.css("top")),X=e.pageX,Y=e.pageY,t(document).bind("mousemove",j).bind("mouseup",V),e.preventDefault()}function j(e){return Q.css({left:q-(X-e.pageX)+"px",top:W-(Y-e.pageY)+"px"}),h.window.expandable&&!t.support.boxModel&&Q.prev().css({left:Q.css("left"),top:Q.css("top")}),e.stopPropagation(),e.preventDefault(),!1}function V(e){return t(document).unbind("mousemove",j).unbind("mouseup",V),e.stopPropagation(),e.preventDefault(),!1}function R(e){return e.preventDefault(),e.stopPropagation(),H.active.val("ahex",t(this).attr("title")||null,e.target),!1}function B(){function e(){if(h.window.expandable&&!t.support.boxModel){var e=Q.find("table:first");Q.before("