[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/plg_system_shortcut/js/ -> shortcut.min.js (source)

   1  ((t,e)=>{if(!e)throw new Error("Joomla API is not properly initialised");e.addShortcut=(t,e)=>{hotkeys(t,"joomla",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.call()}))},e.addClickShortcut=(o,s)=>{e.addShortcut(o,(()=>{const e=t.querySelector(s);e&&e.click()}))},e.addFocusShortcut=(o,s)=>{e.addShortcut(o,(()=>{const e=t.querySelector(s);e&&e.focus()}))},e.addLinkShortcut=(t,o)=>{e.addShortcut(t,(()=>{window.location.href=o}))};t.addEventListener("DOMContentLoaded",(()=>{const o=e.getOptions("plg_system_shortcut.shortcuts");Object.values(o).forEach((t=>{t.shortcut&&t.selector&&(t.selector.startsWith("/")||t.selector.startsWith("http://")||t.selector.startsWith("www.")?e.addLinkShortcut(t.shortcut,t.selector):t.selector.includes("input")?e.addFocusShortcut(t.shortcut,t.selector):e.addClickShortcut(t.shortcut,t.selector))})),t.querySelector("nav")&&((o=>{const s=new Map;Object.values(o).forEach((t=>{if(!t.shortcut||!t.title)return;let e=[];s.has(t.shortcut)?(e=s.get(t.shortcut),e.push(t.title)):e=[t.title],s.set(t.shortcut,e)}));let a="<dl>";s.forEach(((t,e)=>{a+="<dt><kbd>J</kbd>",e.split("+").forEach((t=>{a+=` <kbd>$t.trim()}</kbd>`})),a+="</dt>",t.forEach((t=>{a+=`<dd>$t}</dd>`}))})),a+="</dl>";const c=`\n      <div class="modal fade" id="shortcutOverviewModal" tabindex="-1" role="dialog" data-bs-backdrop="static" aria-labelledby="shortcutOverviewModalLabel" aria-hidden="true">\n        <div class="modal-dialog" role="document">\n          <div class="modal-content">\n            <div class="modal-header">\n              <h3 id="shortcutOverviewModalLabel" class="modal-title">\n                $e.Text._("PLG_SYSTEM_SHORTCUT_OVERVIEW_TITLE")}\n              </h3>\n              <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="$e.Text._("JCLOSE")}"></button>\n            </div>\n            <div class="modal-body p-3">\n              <p>$e.Text._("PLG_SYSTEM_SHORTCUT_OVERVIEW_DESC")}</p>\n              <div class="mb-3">\n                $a}\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    `;t.body.insertAdjacentHTML("beforeend",c);const d=new bootstrap.Modal(t.getElementById("shortcutOverviewModal"),{keyboard:!0,backdrop:!0});hotkeys("X","joomla",(()=>d.show()))})(o),(()=>{const o=t.querySelector(".com_cpanel .container-main");if(o){const s=t.createElement("section");s.className="content pt-4",s.insertAdjacentHTML("beforeend",e.Text._("PLG_SYSTEM_SHORTCUT_OVERVIEW_HINT")),o.appendChild(s)}})()),hotkeys.filter=t=>{const e=t.target||t.srcElement,{tagName:o}=e;return"checkbox"===e.type||!(e.isContentEditable||"INPUT"===o||"SELECT"===o||"TEXTAREA"===o)},hotkeys("J",(t=>{"joomla"!==hotkeys.getScope()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),hotkeys.setScope("joomla"),setTimeout((()=>{hotkeys.setScope(!1)}),e.getOptions("plg_system_shortcut.timeout",2e3)))}))}))})(document,Joomla);


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer