web-interface.assets.7d64980faff5b041a461fd0ba3e2f3f5.js.map Maven / Gradle / Ivy
{"version":3,"sources":["webpack://graylog-web-interface/7d64980faff5b041a461fd0ba3e2f3f5.js"],"sourcesContent":["ace.define(\"ace/ext/code_lens\",[\"require\",\"exports\",\"module\",\"ace/line_widgets\",\"ace/lib/event\",\"ace/lib/lang\",\"ace/lib/dom\",\"ace/editor\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar LineWidgets = require(\"../line_widgets\").LineWidgets;\nvar event = require(\"../lib/event\");\nvar lang = require(\"../lib/lang\");\nvar dom = require(\"../lib/dom\");\nfunction clearLensElements(renderer) {\n var textLayer = renderer.$textLayer;\n var lensElements = textLayer.$lenses;\n if (lensElements)\n lensElements.forEach(function (el) { el.remove(); });\n textLayer.$lenses = null;\n}\nfunction renderWidgets(changes, renderer) {\n var changed = changes & renderer.CHANGE_LINES\n || changes & renderer.CHANGE_FULL\n || changes & renderer.CHANGE_SCROLL\n || changes & renderer.CHANGE_TEXT;\n if (!changed)\n return;\n var session = renderer.session;\n var lineWidgets = renderer.session.lineWidgets;\n var textLayer = renderer.$textLayer;\n var lensElements = textLayer.$lenses;\n if (!lineWidgets) {\n if (lensElements)\n clearLensElements(renderer);\n return;\n }\n var textCells = renderer.$textLayer.$lines.cells;\n var config = renderer.layerConfig;\n var padding = renderer.$padding;\n if (!lensElements)\n lensElements = textLayer.$lenses = [];\n var index = 0;\n for (var i = 0; i < textCells.length; i++) {\n var row = textCells[i].row;\n var widget = lineWidgets[row];\n var lenses = widget && widget.lenses;\n if (!lenses || !lenses.length)\n continue;\n var lensContainer = lensElements[index];\n if (!lensContainer) {\n lensContainer = lensElements[index]\n = dom.buildDom([\"div\", { class: \"ace_codeLens\" }], renderer.container);\n }\n lensContainer.style.height = config.lineHeight + \"px\";\n index++;\n for (var j = 0; j < lenses.length; j++) {\n var el = lensContainer.childNodes[2 * j];\n if (!el) {\n if (j != 0)\n lensContainer.appendChild(dom.createTextNode(\"\\xa0|\\xa0\"));\n el = dom.buildDom([\"a\"], lensContainer);\n }\n el.textContent = lenses[j].title;\n el.lensCommand = lenses[j];\n }\n while (lensContainer.childNodes.length > 2 * j - 1)\n lensContainer.lastChild.remove();\n var top = renderer.$cursorLayer.getPixelPosition({\n row: row,\n column: 0\n }, true).top - config.lineHeight * widget.rowsAbove - config.offset;\n lensContainer.style.top = top + \"px\";\n var left = renderer.gutterWidth;\n var indent = session.getLine(row).search(/\\S|$/);\n if (indent == -1)\n indent = 0;\n left += indent * config.characterWidth;\n lensContainer.style.paddingLeft = padding + left + \"px\";\n }\n while (index < lensElements.length)\n lensElements.pop().remove();\n}\nfunction clearCodeLensWidgets(session) {\n if (!session.lineWidgets)\n return;\n var widgetManager = session.widgetManager;\n session.lineWidgets.forEach(function (widget) {\n if (widget && widget.lenses)\n widgetManager.removeLineWidget(widget);\n });\n}\nexports.setLenses = function (session, lenses) {\n var firstRow = Number.MAX_VALUE;\n clearCodeLensWidgets(session);\n lenses && lenses.forEach(function (lens) {\n var row = lens.start.row;\n var column = lens.start.column;\n var widget = session.lineWidgets && session.lineWidgets[row];\n if (!widget || !widget.lenses) {\n widget = session.widgetManager.$registerLineWidget({\n rowCount: 1,\n rowsAbove: 1,\n row: row,\n column: column,\n lenses: []\n });\n }\n widget.lenses.push(lens.command);\n if (row < firstRow)\n firstRow = row;\n });\n session._emit(\"changeFold\", { data: { start: { row: firstRow } } });\n return firstRow;\n};\nfunction attachToEditor(editor) {\n editor.codeLensProviders = [];\n editor.renderer.on(\"afterRender\", renderWidgets);\n if (!editor.$codeLensClickHandler) {\n editor.$codeLensClickHandler = function (e) {\n var command = e.target.lensCommand;\n if (!command)\n return;\n editor.execCommand(command.id, command.arguments);\n editor._emit(\"codeLensClick\", e);\n };\n event.addListener(editor.container, \"click\", editor.$codeLensClickHandler, editor);\n }\n editor.$updateLenses = function () {\n var session = editor.session;\n if (!session)\n return;\n if (!session.widgetManager) {\n session.widgetManager = new LineWidgets(session);\n session.widgetManager.attach(editor);\n }\n var providersToWaitNum = editor.codeLensProviders.length;\n var lenses = [];\n editor.codeLensProviders.forEach(function (provider) {\n provider.provideCodeLenses(session, function (err, payload) {\n if (err)\n return;\n payload.forEach(function (lens) {\n lenses.push(lens);\n });\n providersToWaitNum--;\n if (providersToWaitNum == 0) {\n applyLenses();\n }\n });\n });\n function applyLenses() {\n var cursor = session.selection.cursor;\n var oldRow = session.documentToScreenRow(cursor);\n var scrollTop = session.getScrollTop();\n var firstRow = exports.setLenses(session, lenses);\n var lastDelta = session.$undoManager && session.$undoManager.$lastDelta;\n if (lastDelta && lastDelta.action == \"remove\" && lastDelta.lines.length > 1)\n return;\n var row = session.documentToScreenRow(cursor);\n var lineHeight = editor.renderer.layerConfig.lineHeight;\n var top = session.getScrollTop() + (row - oldRow) * lineHeight;\n if (firstRow == 0 && scrollTop < lineHeight / 4 && scrollTop > -lineHeight / 4) {\n top = -lineHeight;\n }\n session.setScrollTop(top);\n }\n };\n var updateLenses = lang.delayedCall(editor.$updateLenses);\n editor.$updateLensesOnInput = function () {\n updateLenses.delay(250);\n };\n editor.on(\"input\", editor.$updateLensesOnInput);\n}\nfunction detachFromEditor(editor) {\n editor.off(\"input\", editor.$updateLensesOnInput);\n editor.renderer.off(\"afterRender\", renderWidgets);\n if (editor.$codeLensClickHandler)\n editor.container.removeEventListener(\"click\", editor.$codeLensClickHandler);\n}\nexports.registerCodeLensProvider = function (editor, codeLensProvider) {\n editor.setOption(\"enableCodeLens\", true);\n editor.codeLensProviders.push(codeLensProvider);\n editor.$updateLensesOnInput();\n};\nexports.clear = function (session) {\n exports.setLenses(session, null);\n};\nvar Editor = require(\"../editor\").Editor;\nrequire(\"../config\").defineOptions(Editor.prototype, \"editor\", {\n enableCodeLens: {\n set: function (val) {\n if (val) {\n attachToEditor(this);\n }\n else {\n detachFromEditor(this);\n }\n }\n }\n});\ndom.importCssString(\"\\n.ace_codeLens {\\n position: absolute;\\n color: #aaa;\\n font-size: 88%;\\n background: inherit;\\n width: 100%;\\n display: flex;\\n align-items: flex-end;\\n pointer-events: none;\\n}\\n.ace_codeLens > a {\\n cursor: pointer;\\n pointer-events: auto;\\n}\\n.ace_codeLens > a:hover {\\n color: #0000ff;\\n text-decoration: underline;\\n}\\n.ace_dark > .ace_codeLens > a:hover {\\n color: #4e94ce;\\n}\\n\", \"codelense.css\", false);\n\n}); (function() {\n ace.require([\"ace/ext/code_lens\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n "],"mappings":"oEAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,KAAI,OAAO,oBAAoB,CAAC,UAAU,UAAU,SAAS,mBAAmB,gBAAgB,eAAe,cAAc,aAAa,YAAY,EAAG,SAASC,EAASF,EAASC,EAAO,CAAC,aAC5L,IAAIE,EAAcD,EAAQ,iBAAiB,EAAE,YACzCE,EAAQF,EAAQ,cAAc,EAC9BG,EAAOH,EAAQ,aAAa,EAC5BI,EAAMJ,EAAQ,YAAY,EAC9B,SAASK,EAAkBC,EAAU,CACjC,IAAIC,EAAYD,EAAS,WACrBE,EAAeD,EAAU,QACzBC,GACAA,EAAa,QAAQ,SAAUC,EAAI,CAAEA,EAAG,OAAO,CAAG,CAAC,EACvDF,EAAU,QAAU,IACxB,CACA,SAASG,EAAcC,EAASL,EAAU,CACtC,IAAIM,EAAUD,EAAUL,EAAS,cAC1BK,EAAUL,EAAS,aACnBK,EAAUL,EAAS,eACnBK,EAAUL,EAAS,YAC1B,GAAKM,EAEL,KAAIC,EAAUP,EAAS,QACnBQ,EAAcR,EAAS,QAAQ,YAC/BC,EAAYD,EAAS,WACrBE,EAAeD,EAAU,QAC7B,GAAI,CAACO,EAAa,CACVN,GACAH,EAAkBC,CAAQ,EAC9B,MACJ,CACA,IAAIS,EAAYT,EAAS,WAAW,OAAO,MACvCU,EAASV,EAAS,YAClBW,EAAUX,EAAS,SAClBE,IACDA,EAAeD,EAAU,QAAU,CAAC,GAExC,QADIW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AAO,qBAAqB,CAChC,EACApC,EAAQ,MAAQ,SAAUe,EAAS,CAC/Bf,EAAQ,UAAUe,EAAS,IAAI,CACnC,EACA,IAAIqC,EAASlD,EAAQ,WAAW,EAAE,OAClCA,EAAQ,WAAW,EAAE,cAAckD,EAAO,UAAW,SAAU,CAC3D,eAAgB,CACZ,IAAK,SAAUC,EAAK,CACZA,EACAlB,EAAe,IAAI,EAGnBe,EAAiB,IAAI,CAE7B,CACJ,CACJ,CAAC,EACD5C,EAAI,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA6a,gBAAiB,EAAK,CAEvd,CAAC,GAAmB,UAAW,CACX,IAAI,QAAQ,CAAC,mBAAmB,EAAG,SAASgD,EAAG,CACvC,OAAOrD,GAAU,UAAY,OAAOD,GAAW,UAAYC,IAC3DA,EAAO,QAAUqD,EAEzB,CAAC,CACL,GAAG","names":["require_d64980faff5b041a461fd0ba3e2f3f5","__commonJSMin","exports","module","require","LineWidgets","event","lang","dom","clearLensElements","renderer","textLayer","lensElements","el","renderWidgets","changes","changed","session","lineWidgets","textCells","config","padding","index","i","row","widget","lenses","lensContainer","j","top","left","indent","clearCodeLensWidgets","widgetManager","firstRow","lens","column","attachToEditor","editor","e","command","providersToWaitNum","provider","err","payload","applyLenses","cursor","oldRow","scrollTop","lastDelta","lineHeight","updateLenses","detachFromEditor","codeLensProvider","Editor","val","m"],"sourceRoot":"","file":"7d64980faff5b041a461fd0ba3e2f3f5.js"}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy