Files
roi24/European, Middle Eastern & African Stocks - Bloomberg - Bloomberg Markets_files/spritz_05Q6.js
T
neo 932ec3ac8f KPI cards: Bloomberg stock ticker style
- Redesign KPI cards to look like stock tickers
- Add ticker ID (e.g. ВЫРУЧК:KPI, AOV:KPI)
- Arrow up/down SVG indicators for change direction
- Mini trend-line (50px) inside each card
- Change color: green (#16a34a) for up, red (#e21d1d) for down
- Remove sparkline background area, keep only line
- Fix duplicate arrowUp variable naming (bArrowUp/bArrowDown/bArrowNeutral)
2026-06-21 18:14:08 +05:00

1 line
3.0 KiB
JavaScript

(()=>{"use strict";const e=/^http(.*)$/;function t(t){let r=t;e.test(r)||(r=location.protocol+r);const n=new URL(r),o=n.pathname.split("/").slice(-1)[0];return`${n.host}:${o}`}function r(e){return new Promise(((t,r)=>setTimeout(r,e)))}const n="script[src]";function o(e){const t={childList:!0},r=new MutationObserver(i.bind(null,e));r.observe(document.head,t),r.observe(document.body,t)}function i(e,r){r.forEach((r=>{Array.from(r.addedNodes).forEach((r=>{if(1!==r.nodeType||!r.matches(n))return;const o=t(r.src);e.add(o)})),Array.from(r.removedNodes).forEach((r=>{if(1!==r.nodeType||!r.matches(n))return;const o=t(r.src);e.delete(o)}))}))}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof e||Array.isArray(e))return null;const t=Object.getPrototypeOf(e);return Object.getOwnPropertyNames(t).sort().join(":")}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c{constructor(e){u(this,"requestQueue",new Map),u(this,"loadedScripts",new Set),u(this,"version","1.2.0"),u(this,"cmd",[]);if(s(e)===s(this))return e;Array.from(document.scripts).forEach((e=>{if(!e.matches("script[src]"))return;const r=t(e.src);this.loadedScripts.add(r)})),o(this.loadedScripts),this.cmd=e&&e.cmd||[],this.cmd.push=e=>{"function"==typeof e&&e()}}isLoaded(e){const r=t(e);return this.loadedScripts.has(r)&&!this.requestQueue.has(r)}isRequested(e){const r=t(e);return this.requestQueue.has(r)}inject(e){let{timeout:n,ordered:o=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=t(e);return this.isRequested(e)?this.requestQueue.get(i):this.isLoaded(e)?Promise.resolve(e):(this.requestQueue.set(i,c.injectScript(e,document.head,o).then((e=>(this.requestQueue.delete(i),e)))),n?Promise.race([r(n),this.requestQueue.get(i)]).catch((()=>{throw this.requestQueue.delete(i),this.loadedScripts.delete(i),new Error(`ScriptInjector: Timed out loading "${e}" after ${n} ms`)})):this.requestQueue.get(i))}_flushQueue(){if(Array.isArray(this.cmd))for(;this.cmd.length;){const e=this.cmd.pop();"function"==typeof e&&e()}}static injectScript(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createElement("script");return n.src=e,n.async=!r,new Promise(((r,o)=>{void 0!==n.onreadystatechange?n.onreadystatechange=function(){"loaded"===this.readyState&&(n.onreadystatechange=null,n=null,r(e))}:n.onload=n.onerror=function(i){if("error"===i.type)return o(`ScriptInjector: Error loading script "${e}"`),t.removeChild(n),n.onload=null,n.onerror=null,void(n=null);n.onload=null,n.onerror=null,n=null,r(e)},t.appendChild(n)}))}}const d=c;window.Spritz=new d(window.Spritz),window.Spritz._flushQueue()})();