From 60c60e307c13f857f6d3e7dc60ceaf2fb0d8aed0 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Thu, 8 Aug 2019 21:59:47 +0200 Subject: [PATCH] baculum: Change Font Awesome SVG icons into web fonts icons --- gui/baculum/LICENSE | 24 +- .../protected/Web/JavaScript/bacula-config.js | 2 +- .../Web/JavaScript/fontawesome-all.min.js | 5 - .../Web/JavaScript/fontawesome.min.js | 5 + gui/baculum/protected/Web/Layouts/Main.tpl | 2 +- .../protected/Web/Layouts/MessageBox.tpl | 2 +- gui/baculum/protected/Web/Layouts/Wizard.tpl | 2 +- .../Web/Portlets/BaculaConfigResources.tpl | 2 +- gui/baculum/themes/Baculum-v2/css/baculum.css | 12 +- .../Baculum-v2/css/fa-svg-with-js.min.css | 5 - .../Baculum-v2/css/fontawesome-all.min.css | 5 + .../Baculum-v2/webfonts/fa-brands-400.eot | Bin 0 -> 129734 bytes .../Baculum-v2/webfonts/fa-brands-400.svg | 3451 ++++++++++++ .../Baculum-v2/webfonts/fa-brands-400.ttf | Bin 0 -> 129428 bytes .../Baculum-v2/webfonts/fa-brands-400.woff | Bin 0 -> 87644 bytes .../Baculum-v2/webfonts/fa-brands-400.woff2 | Bin 0 -> 74680 bytes .../Baculum-v2/webfonts/fa-regular-400.eot | Bin 0 -> 34394 bytes .../Baculum-v2/webfonts/fa-regular-400.svg | 803 +++ .../Baculum-v2/webfonts/fa-regular-400.ttf | Bin 0 -> 34096 bytes .../Baculum-v2/webfonts/fa-regular-400.woff | Bin 0 -> 16804 bytes .../Baculum-v2/webfonts/fa-regular-400.woff2 | Bin 0 -> 13596 bytes .../Baculum-v2/webfonts/fa-solid-900.eot | Bin 0 -> 192122 bytes .../Baculum-v2/webfonts/fa-solid-900.svg | 4649 +++++++++++++++++ .../Baculum-v2/webfonts/fa-solid-900.ttf | Bin 0 -> 191836 bytes .../Baculum-v2/webfonts/fa-solid-900.woff | Bin 0 -> 98020 bytes .../Baculum-v2/webfonts/fa-solid-900.woff2 | Bin 0 -> 75356 bytes 26 files changed, 8944 insertions(+), 25 deletions(-) delete mode 100644 gui/baculum/protected/Web/JavaScript/fontawesome-all.min.js create mode 100644 gui/baculum/protected/Web/JavaScript/fontawesome.min.js delete mode 100644 gui/baculum/themes/Baculum-v2/css/fa-svg-with-js.min.css create mode 100644 gui/baculum/themes/Baculum-v2/css/fontawesome-all.min.css create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-brands-400.eot create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-brands-400.svg create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-brands-400.ttf create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-brands-400.woff create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-brands-400.woff2 create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-regular-400.eot create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-regular-400.svg create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-regular-400.ttf create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-regular-400.woff create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-regular-400.woff2 create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-solid-900.eot create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-solid-900.svg create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-solid-900.ttf create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-solid-900.woff create mode 100644 gui/baculum/themes/Baculum-v2/webfonts/fa-solid-900.woff2 diff --git a/gui/baculum/LICENSE b/gui/baculum/LICENSE index 97fe92f2b..b38fa7fb8 100644 --- a/gui/baculum/LICENSE +++ b/gui/baculum/LICENSE @@ -870,7 +870,25 @@ THE SOFTWARE. Baculum uses Font Awesome Free for icons. Files: - protected/Web/JavaScript/fontawesome-all.min.js - themes/Baculum-v2/css/fa-svg-with-js.min.css + protected/Web/JavaScript/fontawesome.min.js + themes/Baculum-v2/css/fontawesome-all.min.css + themes/Baculum-v2/webfonts/fa-brands-400.eot + themes/Baculum-v2/webfonts/fa-brands-400.svg + themes/Baculum-v2/webfonts/fa-brands-400.ttf + themes/Baculum-v2/webfonts/fa-brands-400.woff + themes/Baculum-v2/webfonts/fa-brands-400.woff2 + themes/Baculum-v2/webfonts/fa-regular-400.eot + themes/Baculum-v2/webfonts/fa-regular-400.svg + themes/Baculum-v2/webfonts/fa-regular-400.ttf + themes/Baculum-v2/webfonts/fa-regular-400.woff + themes/Baculum-v2/webfonts/fa-regular-400.woff2 + themes/Baculum-v2/webfonts/fa-solid-900.eot + themes/Baculum-v2/webfonts/fa-solid-900.svg + themes/Baculum-v2/webfonts/fa-solid-900.ttf + themes/Baculum-v2/webfonts/fa-solid-900.woff + themes/Baculum-v2/webfonts/fa-solid-900.woff2 + +License - https://fontawesome.com/license/free + +Icons: CC BY 4.0 License, Code: MIT License, Fonts: SIL OFL 1.1 License -License - https://fontawesome.com/license - Icons: CC BY 4.0, Code: MIT License diff --git a/gui/baculum/protected/Web/JavaScript/bacula-config.js b/gui/baculum/protected/Web/JavaScript/bacula-config.js index 7ae5d6251..843136eb0 100644 --- a/gui/baculum/protected/Web/JavaScript/bacula-config.js +++ b/gui/baculum/protected/Web/JavaScript/bacula-config.js @@ -76,7 +76,7 @@ var BaculaConfigClass = jQuery.klass({ return send; }, get_loader: function(id) { - var loader = $('#' + id).next('svg'); + var loader = $('#' + id).next('I'); return loader; }, loader_start: function(id) { diff --git a/gui/baculum/protected/Web/JavaScript/fontawesome-all.min.js b/gui/baculum/protected/Web/JavaScript/fontawesome-all.min.js deleted file mode 100644 index 2b5f15212..000000000 --- a/gui/baculum/protected/Web/JavaScript/fontawesome-all.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Font Awesome Free 5.9.0 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ -!function(){"use strict";var c={},l={};try{"undefined"!=typeof window&&(c=window),"undefined"!=typeof document&&(l=document)}catch(c){}var h=(c.navigator||{}).userAgent,z=void 0===h?"":h,v=c,a=l,m=(v.document,!!a.documentElement&&!!a.head&&"function"==typeof a.addEventListener&&a.createElement,~z.indexOf("MSIE")||z.indexOf("Trident/"),"___FONT_AWESOME___"),s=function(){try{return!0}catch(c){return!1}}();var e=v||{};e[m]||(e[m]={}),e[m].styles||(e[m].styles={}),e[m].hooks||(e[m].hooks={}),e[m].shims||(e[m].shims=[]);var t=e[m];function M(c,z){var l=(2>>0;h--;)l[h]=c[h];return l}function bc(c){return c.classList?pc(c.classList):(c.getAttribute("class")||"").split(" ").filter(function(c){return c})}function gc(c,l){var h,z=l.split("-"),v=z[0],a=z.slice(1).join("-");return v!==c||""===a||(h=a,~T.indexOf(h))?null:a}function Sc(c){return"".concat(c).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function yc(h){return Object.keys(h||{}).reduce(function(c,l){return c+"".concat(l,": ").concat(h[l],";")},"")}function wc(c){return c.size!==Cc.size||c.x!==Cc.x||c.y!==Cc.y||c.rotate!==Cc.rotate||c.flipX||c.flipY}function Ac(c){var l=c.transform,h=c.containerWidth,z=c.iconWidth,v={transform:"translate(".concat(h/2," 256)")},a="translate(".concat(32*l.x,", ").concat(32*l.y,") "),m="scale(".concat(l.size/16*(l.flipX?-1:1),", ").concat(l.size/16*(l.flipY?-1:1),") "),s="rotate(".concat(l.rotate," 0 0)");return{outer:v,inner:{transform:"".concat(a," ").concat(m," ").concat(s)},path:{transform:"translate(".concat(z/2*-1," -256)")}}}var kc={x:0,y:0,width:"100%",height:"100%"};function xc(c){var l=c.icons,h=l.main,z=l.mask,v=c.prefix,a=c.iconName,m=c.transform,s=c.symbol,e=c.title,t=c.extra,M=c.watchable,f=void 0!==M&&M,r=z.found?z:h,n=r.width,H=r.height,i="fa-w-".concat(Math.ceil(n/H*16)),o=[U.replacementClass,a?"".concat(U.familyPrefix,"-").concat(a):"",i].filter(function(c){return-1===t.classes.indexOf(c)}).concat(t.classes).join(" "),V={children:[],attributes:X({},t.attributes,{"data-prefix":v,"data-icon":a,class:o,role:t.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(n," ").concat(H)})};f&&(V.attributes[B]=""),e&&V.children.push({tag:"title",attributes:{id:V.attributes["aria-labelledby"]||"title-".concat(dc())},children:[e]});var C,L,u,d,p,b,g,S,y,w,A,k,x,q,j,O,E,P,N,_,T,R,F,I=X({},V,{prefix:v,iconName:a,main:h,mask:z,transform:m,symbol:s,styles:t.styles}),D=z.found&&h.found?(L=(C=I).children,u=C.attributes,d=C.main,p=C.mask,b=C.transform,g=d.width,S=d.icon,y=p.width,w=p.icon,A=Ac({transform:b,containerWidth:y,iconWidth:g}),k={tag:"rect",attributes:X({},kc,{fill:"white"})},x={tag:"g",attributes:X({},A.inner),children:[{tag:"path",attributes:X({},S.attributes,A.path,{fill:"black"})}]},q={tag:"g",attributes:X({},A.outer),children:[x]},j="mask-".concat(dc()),O="clip-".concat(dc()),E={tag:"defs",children:[{tag:"clipPath",attributes:{id:O},children:[w]},{tag:"mask",attributes:X({},kc,{id:j,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[k,q]}]},L.push(E,{tag:"rect",attributes:X({fill:"currentColor","clip-path":"url(#".concat(O,")"),mask:"url(#".concat(j,")")},kc)}),{children:L,attributes:u}):function(c){var l=c.children,h=c.attributes,z=c.main,v=c.transform,a=yc(c.styles);if(0").concat(m.map(Gc).join(""),"")}var Jc=function(){};function Zc(c){return"string"==typeof(c.getAttribute?c.getAttribute(B):null)}var $c={replace:function(c){var l=c[0],h=c[1].map(function(c){return Gc(c)}).join("\n");if(l.parentNode&&l.outerHTML)l.outerHTML=h+(U.keepOriginalSource&&"svg"!==l.tagName.toLowerCase()?"\x3c!-- ".concat(l.outerHTML," --\x3e"):"");else if(l.parentNode){var z=document.createElement("span");l.parentNode.replaceChild(z,l),z.outerHTML=h}},nest:function(c){var l=c[0],h=c[1];if(~bc(l).indexOf(U.replacementClass))return $c.replace(c);var z=new RegExp("".concat(U.familyPrefix,"-.*"));delete h[0].attributes.style;var v=h[0].attributes.class.split(" ").reduce(function(c,l){return l===U.replacementClass||l.match(z)?c.toSvg.push(l):c.toNode.push(l),c},{toNode:[],toSvg:[]});h[0].attributes.class=v.toSvg.join(" ");var a=h.map(function(c){return Gc(c)}).join("\n");l.setAttribute("class",v.toNode.join(" ")),l.setAttribute(B,""),l.innerHTML=a}};function cl(c){c()}function ll(h,c){var z="function"==typeof c?c:Jc;if(0===h.length)z();else{var l=cl;U.mutateApproach===w&&(l=o.requestAnimationFrame||cl),l(function(){var c=!0===U.autoReplaceSvg?$c.replace:$c[U.autoReplaceSvg]||$c.replace,l=Nc.begin("mutate");h.map(c),l(),z()})}}var hl=!1;function zl(){hl=!1}var vl=null;function al(c){if(t&&U.observeMutations){var v=c.treeCallback,a=c.nodeCallback,m=c.pseudoElementsCallback,l=c.observeMutationsRoot,h=void 0===l?V:l;vl=new t(function(c){hl||pc(c).forEach(function(c){if("childList"===c.type&&0>>0;n--;)e[n]=t[n];return e}function Ct(t){return t.classList?At(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(t){return t})}function Ot(t,e){var n,a=e.split("-"),r=a[0],i=a.slice(1).join("-");return r!==t||""===i||(n=i,~H.indexOf(n))?null:i}function St(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Pt(n){return Object.keys(n||{}).reduce(function(t,e){return t+"".concat(e,": ").concat(n[e],";")},"")}function Nt(t){return t.size!==yt.size||t.x!==yt.x||t.y!==yt.y||t.rotate!==yt.rotate||t.flipX||t.flipY}function Mt(t){var e=t.transform,n=t.containerWidth,a=t.iconWidth,r={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*e.x,", ").concat(32*e.y,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),c="rotate(".concat(e.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(i," ").concat(o," ").concat(c)},path:{transform:"translate(".concat(a/2*-1," -256)")}}}var zt={x:0,y:0,width:"100%",height:"100%"};function Et(t){var e=!(1").concat(o.map(Zt).join(""),"")}var $t=function(){};function te(t){return"string"==typeof(t.getAttribute?t.getAttribute(K):null)}var ee={replace:function(t){var e=t[0],n=t[1].map(function(t){return Zt(t)}).join("\n");if(e.parentNode&&e.outerHTML)e.outerHTML=n+(J.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," --\x3e"):"");else if(e.parentNode){var a=document.createElement("span");e.parentNode.replaceChild(a,e),a.outerHTML=n}},nest:function(t){var e=t[0],n=t[1];if(~Ct(e).indexOf(J.replacementClass))return ee.replace(t);var a=new RegExp("".concat(J.familyPrefix,"-.*"));delete n[0].attributes.style;var r=n[0].attributes.class.split(" ").reduce(function(t,e){return e===J.replacementClass||e.match(a)?t.toSvg.push(e):t.toNode.push(e),t},{toNode:[],toSvg:[]});n[0].attributes.class=r.toSvg.join(" ");var i=n.map(function(t){return Zt(t)}).join("\n");e.setAttribute("class",r.toNode.join(" ")),e.setAttribute(K,""),e.innerHTML=i}};function ne(t){t()}function ae(n,t){var a="function"==typeof t?t:$t;if(0===n.length)a();else{var e=ne;J.mutateApproach===P&&(e=g.requestAnimationFrame||ne),e(function(){var t=!0===J.autoReplaceSvg?ee.replace:ee[J.autoReplaceSvg]||ee.replace,e=Yt.begin("mutate");n.map(t),e(),a()})}}var re=!1;function ie(){re=!1}var oe=null;function ce(t){if(l&&J.observeMutations){var r=t.treeCallback,i=t.nodeCallback,o=t.pseudoElementsCallback,e=t.observeMutationsRoot,n=void 0===e?v:e;oe=new l(function(t){re||At(t).forEach(function(t){if("childList"===t.type&&0 /> - /> + /> /> /> /> diff --git a/gui/baculum/protected/Web/Layouts/MessageBox.tpl b/gui/baculum/protected/Web/Layouts/MessageBox.tpl index 98a808235..70a8a1907 100644 --- a/gui/baculum/protected/Web/Layouts/MessageBox.tpl +++ b/gui/baculum/protected/Web/Layouts/MessageBox.tpl @@ -3,7 +3,7 @@ - /> + /> diff --git a/gui/baculum/protected/Web/Layouts/Wizard.tpl b/gui/baculum/protected/Web/Layouts/Wizard.tpl index 29e764731..80176c05d 100644 --- a/gui/baculum/protected/Web/Layouts/Wizard.tpl +++ b/gui/baculum/protected/Web/Layouts/Wizard.tpl @@ -11,7 +11,7 @@ - /> + /> /> /> /> diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigResources.tpl b/gui/baculum/protected/Web/Portlets/BaculaConfigResources.tpl index 00f1a98ef..8598d99b0 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigResources.tpl +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigResources.tpl @@ -38,7 +38,7 @@ Text="<%=$this->Data['resource_type']%>: <%=$this->Data['resource_name']%>" Style="text-decoration: none" /> -