PageSourceSearch

https://local-heritage-list.org.uk/cr/js/summernote/plugin/elementpath/summernote-ext-elementpath.min.js

js local-heritage-list.org.uk collected 2026-10-01 12:38:01 UTC 5,881 bytes, 1 lines download raw bytes

1!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(window.jQuery)}((function(e){e.extend(!0,e.summernote.lang,{"en-US":{elementPath:{tooltip:"Element Path"}}}),e.extend(e.summernote.plugins,{elementpath:function(t){var n=this,o=(e.summernote.ui,t.layoutInfo.editor),a=t.layoutInfo.editable,l=t.layoutInfo.statusbar,s=t.options,i=(s.langInfo,{enabled:!0,separator:"  ",clickToSelect:!0,showTags:["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE","LI","OL","UL","TD","TH","TR","TABLE","DIV","STRONG","B","EM","I","U","S","STRIKE","SUP","SUB","A","CODE","SPAN","IMG","SMALL","CITE","CAPTION","THEAD","TBODY","TFOOT","ARTICLE","DL","DT","DD","HEADER","FOOTER","MAIN","SECTION","ASIDE","NAV","FIGURE","FIGCAPTION","MARK","HR","FIELDSET","LEGEND","LABEL","ADDRESS","INPUT","DETAILS","SUMMARY","IFRAME","AUDIO","VIDEO","SOURCE","DIALOG","PROGRESS","METER","OUTPUT","CANVAS","SVG"]}),r=e.extend({},i,s.elementPath||{}),g=null;this.initialize=function(){if(console.log("[ElementPath] Initializing plugin, enabled:",r.enabled),r.enabled&&l.length>0){if(l.find(".note-element-path").length>0)return;0===e("#summernote-elementpath-styles").length&&e("head").append(e('<style id="summernote-elementpath-styles">.note-element-path{display:inline-block;margin-right:10px;padding-left:8px;padding-top:5px;color:#666;font-size:12px}.note-element-path-body{color:#999;padding-right:4px}.note-element-path-separator{color:#999}.note-element-path-item{color:#303030;font-weight:600;text-decoration:none;padding:2px 4px;border-radius:2px}.note-element-path-item:hover{background-color:#e0e8f0!important}.note-element-path-static{color:#303030;font-weight:600}</style>'));var t=l.find(".note-status-output");0===t.length&&(t=e('<div class="note-status-output"></div>'),l.prepend(t));var n=a.attr("id")||Math.random().toString(36).substr(2,9);g=e('<div class="note-element-path" data-editor-id="'+n+'"></div>'),t.append(g),this.bindEvents()}},this.getElementPath=function(){var n=[],o=window.getSelection();if(o.rangeCount>0){var l=o.getRangeAt(0),s=l.startContainer;if(!a[0].contains(s)){var i=t.invoke("editor.getLastRange");if(!i||!i.sc)return n;s=i.sc}for(3===s.nodeType&&(s=s.parentElement),this.lastClickedElement&&"IMG"===this.lastClickedElement.nodeName&&-1!==r.showTags.indexOf("IMG")&&e(this.lastClickedElement).closest(a).length>0&&function(){var t={node:this.lastClickedElement,name:"img",displayName:"img"};if(this.lastClickedElement.id)t.displayName+="#"+this.lastClickedElement.id;else if(this.lastClickedElement.className&&"string"==typeof this.lastClickedElement.className){var o=this.lastClickedElement.className.split(" ").filter((function(e){return e&&!e.startsWith("note-")}));o.length>0&&(t.displayName+="."+o[0])}n.unshift(t)}.call(this);s&&s!==a[0]&&!e(s).hasClass("note-editable");){var g=s.nodeName.toUpperCase();if(-1!==r.showTags.indexOf(g)){var c={node:s,name:g.toLowerCase(),displayName:g.toLowerCase()};if(s.id)c.displayName+="#"+s.id;else if(s.className&&"string"==typeof s.className){var p=s.className.split(" ").filter((function(e){return e&&!e.startsWith("note-")}));p.length>0&&(c.displayName+="."+p[0])}n.unshift(c)}s=s.parentElement}}return n},this.updateDisplay=function(){if(g){if(o.hasClass("codeview"))return void g.css("visibility","hidden");g.css("visibility","visible");var pathArray=this.getElementPath(),t=['<span class="note-element-path-body">body</span>'];pathArray.length>0&&pathArray.forEach((function(pathItem,idx){r.clickToSelect?t.push('<a href="#" class="note-element-path-item" data-element-index="'+idx+'">'+pathItem.displayName+"</a>"):t.push('<span class="note-element-path-static">'+pathItem.displayName+"</span>")})),g.html(t.join('<span class="note-element-path-separator">'+r.separator+"</span>")),r.clickToSelect&&g.find(".note-element-path-item").on("click",(function(clickEvent){clickEvent.preventDefault();var clickedIndex=parseInt(e(this).data("element-index"));clickedIndex>=0&&clickedIndex<pathArray.length?n.selectElement(pathArray[clickedIndex].node):void 0}))}},this.selectElement=function(element){if(element)try{a.focus();var range=document.createRange();range.selectNodeContents(element);var selection=window.getSelection();selection.removeAllRanges(),selection.addRange(range),t.invoke("editor.saveRange")}catch(error){}},this.bindEvents=function(){["keyup","mouseup","focus","blur"].forEach((function(eventName){a.on(eventName,(function(evt){"mouseup"===eventName?setTimeout((function(){n.updateDisplay()}),10):n.updateDisplay()}))})),a.on("click",(function(clickEvt){n.lastClickedElement=clickEvt.target;setTimeout((function(){n.updateDisplay()}),20)})),a[0].addEventListener("click",(function(captureEvt){"IMG"===captureEvt.target.nodeName&&(n.lastClickedElement=captureEvt.target)}),!0),["summernote.keyup","summernote.mouseup","summernote.change"].forEach((function(eventName){o.on(eventName,(function(){n.updateDisplay()}))})),o.on("summernote.image.upload summernote.image.inserted summernote.change",(function(){setTimeout((function(){var t=a.find("img.note-selected, img:focus");t.length>0&&(n.lastClickedElement=t[0]);n.updateDisplay()}),100)})),a[0].addEventListener("mousedown",(function(mouseEvt){"IMG"===mouseEvt.target.nodeName&&(n.lastClickedElement=mouseEvt.target,setTimeout((function(){n.updateDisplay()}),50))}),!0),o.on("click",".note-toolbar .note-btn",(function(toolbarEvent){setTimeout((function(){n.updateDisplay()}),50)})),o.on("click",".dropdown-style .dropdown-item",(function(dropdownEvent){setTimeout((function(){n.updateDisplay()}),100)})),["summernote.paste","summernote.enter"].forEach((function(eventName){o.on(eventName,(function(){setTimeout((function(){n.updateDisplay()}),100)}))})),setTimeout((function(){n.updateDisplay()}),100)},this.destroy=function(){g&&(g.remove(),g=null)}}})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.