{"version":3,"sources":["webpack:////opt/gitlab/embedded/service/gitlab-rails/node_modules/mousetrap/plugins/pause/mousetrap-pause.js","webpack:///./task_list.js","webpack:///./vue_shared/components/skeleton_loading_container.vue?aff0","webpack:///./vue_shared/components/skeleton_loading_container.vue?e519","webpack:///vue_shared/components/skeleton_loading_container.vue","webpack:///./vue_shared/components/skeleton_loading_container.vue","webpack:///./droplab/plugins/input_setter.js","webpack:///./comment_type_toggle.js","webpack:///./notes.js","webpack:///./blob/viewer/index.js","webpack:////opt/gitlab/embedded/service/gitlab-rails/node_modules/deckar01-task_list/dist/task_list.js","webpack:///./init_notes.js","webpack:///./line_highlighter.js","webpack:///./snippet/snippet_embed.js","webpack:///./dropzone_input.js","webpack:///./lib/utils/text_markdown.js","webpack:///./gl_form.js","webpack:///./pages/snippets/show/index.js","webpack:///./zen_mode.js","webpack:///./autosave.js"],"names":["Mousetrap","self","_originalStopCallback","stopCallback","enabled","e","element","combo","pause","unpause","TaskList","options","arguments","length","undefined","_classCallCheck","this","selector","dataType","fieldName","onSuccess","onError","errorMessages","response","data","_typeof","errors","join","_flash__WEBPACK_IMPORTED_MODULE_3__","init","disable","jquery__WEBPACK_IMPORTED_MODULE_0___default","taskList","document","on","update","bind","off","_this","$target","target","patchData","val","_lib_utils_axios_utils__WEBPACK_IMPORTED_MODULE_2__","patch","attr","then","_ref","catch","err","components_skeleton_loading_containervue_type_script_lang_js","props","small","type","Boolean","required","default","lines","Number","computed","lineClasses","Array","fill","map","_","i","component","Object","componentNormalizer","_h","$createElement","_c","_self","staticClass","class","animation-container-small","_l","css","index","key","__webpack_exports__","InputSetter","hook","destroyed","config","eventWrapper","addEvents","setInputs","list","addEventListener","removeEvents","removeEventListener","selectedItem","detail","selected","isArray","forEach","setInput","input","trigger","newValue","getAttribute","valueAttribute","inputAttribute","hasAttribute","setAttribute","tagName","value","textContent","destroy","assign","input_setter","comment_type_toggle","CommentTypeToggle","opts","dropdownTrigger","dropdownList","noteTypeInput","submitButton","closeButton","reopenButton","droplab","drop_lab","setConfig","push","normalizeNewlines","str","replace","window","autosize","autosize_default","a","REGEX_QUICK_ACTIONS","notes_Notes","Notes","notes_url","note_ids","last_fetched_at","view","enableGFM","notes_classCallCheck","updateTargetButtons","updateComment","visibilityChange","cancelDiscussionForm","onAddDiffNote","onAddImageDiffNote","setupDiscussionNoteForm","onReplyToDiscussionNote","removeNote","cancelEdit","updateNote","addDiscussionNote","addNoteError","addNote","resetMainTargetForm","refresh","keydownNoteText","toggleCommitList","postComment","clearFlashWrapper","clearFlash","onHashChange","updatedNotesTrackingMap","noteable_url","URL","notesCountBadge","jquery_default","find","basePollingInterval","maxPollingSteps","$wrapperEl","common_utils","cleanBinding","addBinding","setPollingInterval","setupMainTargetNoteForm","task_list","collapseLongCommitList","setViewType","clone","addClass","insertAfter","hash","url_utility","$anchor","getElementById","loadLazyDiff","currentTarget","instance","js_cookie_default","get","showEditForm","removeAttachment","updateFormAttachment","onClickRetryLazyLoad","reenableTargetFormSubmitButton","boundGetContent","getContent","$textarea","discussionNoteForm","editNote","myLastNote","which","$","gon","current_user_id","closest","confirm","removeDiscussionNoteForm","removeNoteEditForm","interval","clearInterval","setInterval","pollingInterval","hidden","_this2","refreshing","axios_utils","headers","X-Last-Fetched-At","notes","each","note","renderNote","shouldReset","nthInterval","Math","pow","initRefresh","noteEntity","votesBlock","commands_changes","checkMergeRequestStatus","eq","awards_handler","awardsHandler","addAwardToEmojiBar","emoji_award","scrollToAwards","$note","datetime_utility","updateNoteTargetSelector","$noteToCleanHighlight","$form","$notesList","discussion_html","renderDiscussionNote","valid","id","isNewNote","remove","$newNote","animateAppendNote","html","setupNewNote","updateNotesCount","isUpdatedNote","isEditing","hasClass","initialContent","text","trim","currentContent","sanitizedNoteNote","isTextareaUntouched","putConflictEditWarningInPlace","$updatedNote","animateUpdateNote","refreshVueNotes","commands_only","keys","addFlash","parentTimeline","discussionContainer","form","row","lineType","diffAvatarContainer","discussion_id","discussion_line_code","on_image","isParallelView","prevAll","first","diff_discussion_html","$discussion","renderGFM","after","$notes","contentContainerClass","split","append","children","page","indexOf","gl","diffNotesCompileComponents","discussion_resolvable","renderDiscussionAvatar","changesDiscussionContainer","avatarHolder","createElement","click","reset","event","createEvent","initEvent","dispatchEvent","formClone","setupNoteForm","removeClass","parents","initCommentTypeToggle","textarea","glForm","gl_form","autosave","formParentTimeline","$parentTimeline","flash","isNewDiffComment","discussionId","mergeRequestId","ResolveService","toggleResolveForDiscussion","$targetNote","$noteEntityEl","revertNoteEditForm","replaceWith","$el","isAllowed","show","scrollTo","preventDefault","$editForm","getEditFormSelector","$currentlyEditing","checkContentToAllowEditing","putEditFormInPlace","noteId","hide","insertBefore","enable","noteElId","prev","el","diffNoteApps","$destroy","notesTr","$diffFile","removeBadgeEvent","CustomEvent","badgeNumber","replyToDiscussionNote","replyLink","cleanForm","dataHolder","diffFileData","discussionID","focus","link","$link","showReplyInput","toggleDiffNote","dataset","clickEvent","newForm","$noteContainer","appendTo","addForm","hasNotes","replyButton","rowCssToAdd","_ref2","forceShow","_ref2$showReplyInput","nextRow","next","targetRow","is","lineTypeSelector","notesContentSelector","notesContent","isCurrentlyShown","showNow","toggleClass","blurEvent","filename","closebtn","closetext","discardbtn","reopenbtn","reopentext","$originalContentEl","originalContent","postUrl","targetId","targetType","updateCount","parseInt","$retryButton","prop","$container","renderPlaceholderComponent","url","$errorContainer","$successContainer","_ref3","renderDiffContent","Promise","resolve","$element","$closestSystemCommitList","siblings","systemNotes","has","systemNote","$systemNote","headerMessage","_len","flashParams","_key","flashContainer","Function","prototype","apply","concat","style","display","content","formData","serialize","formContent","underscore_default","escape","formAction","formContentOriginal","test","tempFormContent","executedCommands","filter","command","RegExp","name","description","toLowerCase","_ref4","uniqueId","isDiscussionNote","currentUsername","currentUserFullname","currentUserAvatar","discussionClass","$tempNote","_ref5","_this3","$submitBtn","$closeBtn","parent","isMainForm","isDiscussionForm","isDiscussionResolve","_getFormData","getFormData","noteUniqueId","systemNoteUniqueId","hasQuickActions","$notesContainer","stripQuickActions","createPlaceholderNote","current_username","current_user_fullname","current_user_avatar_url","createPlaceholderSystemNote","getQuickActionDescription","ajax_cache","GfmAutoComplete","dataSources","commands","post","res","notePosition","_JSON$parse","JSON","parse","x","y","width","height","addBadgeEvent","handleQuickActions","closestDiffFile","_this4","$editingNote","$noteBodyText","_getFormData2","cachedNoteBodyText","_ref6","updateNoteError","querySelector","initDroplab","addTargetClass","vue_esm","components","SkeletonLoadingContainer","skeleton_loading_container","render","prepend","fileHolder","syntax_highlight","noteIds","inArray","mrWidget","checkStatus","noteHtml","BlobViewer","initAuxiliaryViewer","initRichViewer","initMainViewers","$fileHolder","switcher","switcherBtns","querySelectorAll","copySourceBtn","simpleViewer","richViewer","initBindings","switchToInitialViewer","initialViewerName","location","switchToViewer","from","switchViewHandler","classList","contains","blur","activeViewer","add","tooltip","newViewer","oldButton","newButton","oldViewer","toggleCopyButtonState","loadViewer","viewer","_lib_utils_common_utils__WEBPACK_IMPORTED_MODULE_2__","_flash__WEBPACK_IMPORTED_MODULE_1__","auxiliaryViewer","richType","initViewer","promise","module","error","all","__webpack_require__","viewerParam","_lib_utils_axios_utils__WEBPACK_IMPORTED_MODULE_3__","innerHTML","jQuery","factory","modules","installedModules","moduleId","exports","l","call","m","c","d","getter","o","defineProperty","configurable","enumerable","n","__esModule","object","property","hasOwnProperty","p","s","NodeArray","item","nodeList","slice","className","parentNode","eventName","Event","bubbles","cancelable","initCustomEvent","el1","container","field","updateTaskList","checkbox","disabled","changeEvent","changedEvent","checkboxes","checked","defaultPrevented","updateSource","incomplete","complete","escapePattern","incompletePattern","completePattern","itemPattern","startFencesPattern","endFencesPattern","itemsInParasPattern","source","itemIndex","clean","inCodeBlock","line","len","ref","results","match","fn","method","dataEl","notesUrl","notesIds","now","diffView","autocomplete","_notes__WEBPACK_IMPORTED_MODULE_0__","initialize","jquery__WEBPACK_IMPORTED_MODULE_0__","LineHighlighter","highlightLineClass","fileHolderSelector","scrollFileHolder","_hash","setHash","highlightLine","clickHandler","highlightHash","bindEvents","newHash","range","clearHighlight","hashToRange","highlightRange","lineSelector","scrollOptions","offset","current","lineNumber","shiftKey","matches","ref1","firstLineNumber","lastLineNumber","__setLocationHash__","history","pushState","title","_location","protocol","host","pathname","shareBtn","embedBtn","snippetUrlArea","embedAction","innerText","scriptTag","dropzoneInput","$attachButton","$attachingFileMessage","$cancelButton","$retryLink","$uploadProgress","$uploadingErrorContainer","$uploadingErrorMessage","$uploadingProgressContainer","uploadsPath","uploads_path","maxFileSize","max_file_size","formTextarea","handlePaste","pasteText","addFileToForm","updateAttachingMessage","isImage","getFilename","uploadFile","wrap","$mdArea","setupMarkdownPreview","$formDropzone","dropzone","dictDefaultMessage","clickable","paramName","maxFilesize","uploadMultiple","csrf","previewContainer","processing","alert","dragover","dragleave","drop","success","header","processingFileCount","getQueuedFiles","getUploadingFiles","shouldPad","markdown","file","errorMessage","xhr","message","responseText","totaluploadprogress","totalUploadProgress","files","round","sending","removedfile","queuecomplete","child","stopPropagation","dropzone_default","forElement","removeAllFiles","dropzoneInstance","failedFiles","failedFile","status","ERROR","accepted","addFile","pasteEvent","originalEvent","clipboardData","items","image","getAsFile","formattedText","caretStart","selectionStart","caretEnd","selectionEnd","textEnd","beforeSelection","substring","afterSelection","setSelectionRange","scrollHeight","path","getData","closeSpinner","FormData","md","$child","insertToTextArea","messageContainer","attachingMessage","filesCount","autoDiscover","updateText","textArea","tag","blockTag","$textArea","selectedText","textToInsert","selectedSplit","startChar","removedLastNewLine","removedFirstNewLine","currentLineEmpty","lastNewLine","substr","lastIndexOf","before","lineBefore","lineAfter","blockTagText","wrapped","pos","moveCursor","insertMarkdownText","gl_form_GLForm","GLForm","setupForm","clearEventListeners","autoComplete","isNewForm","utils","disableButtonIfEmptyField","gfm_auto_complete","setup","emojis","members","issues","milestones","mergeRequests","labels","addEventListeners","$this","isAutosizeable","setupAutosize","setHeightData","destroyAutosize","setTimeout","outerHeight","_line_highlighter__WEBPACK_IMPORTED_MODULE_0__","_blob_viewer__WEBPACK_IMPORTED_MODULE_1__","_init_notes__WEBPACK_IMPORTED_MODULE_3__","_zen_mode__WEBPACK_IMPORTED_MODULE_2__","_snippet_snippet_embed__WEBPACK_IMPORTED_MODULE_4__","dropzone__WEBPACK_IMPORTED_MODULE_2___default","ZenMode","active_backdrop","active_textarea","enter","exit","keyCode","backdrop","mousetrap__WEBPACK_IMPORTED_MODULE_3___default","removeAttr","$dropzone","zen_area","Autosave","isLocalStorageAvailable","_lib_utils_accessor__WEBPACK_IMPORTED_MODULE_0__","isLocalStorageAccessSafe","restore","save","localStorage","getItem","setItem","removeItem"],"mappings":"wEAMAA,UAAA,SAAAA,GACA,IAAAC,EAAAD,EACAE,EAAAD,EAAAE,aACAC,GAAA,EAkBA,OAhBAH,EAAAE,aAAA,SAAAE,EAAAC,EAAAC,GACA,OAAAH,GAIAF,EAAAG,EAAAC,EAAAC,IAGAN,EAAAO,MAAA,WACAJ,GAAA,GAGAH,EAAAQ,QAAA,WACAL,GAAA,GAGAH,EArBA,CAsBCD,6hBCvBoBU,aACnB,SAAAA,IAA0B,IAAdC,EAAcC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,mGAAAG,CAAAC,KAAAN,GACxBM,KAAKC,SAAWN,EAAQM,SACxBD,KAAKE,SAAWP,EAAQO,SACxBF,KAAKG,UAAYR,EAAQQ,UACzBH,KAAKI,UAAYT,EAAQS,WAAc,aACvCJ,KAAKK,QAAU,SAAmBhB,GAChC,IAAIiB,EAAgB,GAMpB,OAJIjB,EAAEkB,SAASC,MAAmC,WAA3BC,EAAOpB,EAAEkB,SAASC,QACvCF,EAAgBjB,EAAEkB,SAASC,KAAKE,OAAOC,KAAK,MAGvC,IAAIC,EAAA,EAAMN,GAAiB,gBAAiB,UAGrDN,KAAKa,gDAKLb,KAAKc,UACLC,IAAKf,KAAKC,SAAV,4BAA8Ce,SAAS,UACvDD,IAAEE,UAAUC,GAAG,mBAAuBlB,KAAKC,SA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wP,EAAOrI,OAAOysB,aAAaC,QAAQ1zB,KAAK+D,MAEjC,MAARsL,EAAeA,EAAKxP,YAAS,GAAU,GAC1CG,KAAKokB,MAAM1iB,IAAI2N,GAGjBrP,KAAKokB,MAAMjf,QAAQ,SAGnB,IAAM8M,EAAQ,IAAI6R,MAAM,UAAYC,SAAS,EAAMC,YAAY,IACjDhkB,KAAKokB,MAAMrZ,IAAI,GACvBqH,cAAcH,mCAIpB,GAAKjS,KAAKokB,MAAMvkB,OAAhB,CAEA,IAAMwP,EAAOrP,KAAKokB,MAAM1iB,MAExB,OAAI1B,KAAKozB,0BAAoC,MAAR/jB,EAAeA,EAAKxP,YAAS,GAAU,EACnEmH,OAAOysB,aAAaE,QAAQ3zB,KAAK+D,IAAKsL,GAGxCrP,KAAKgS,yCAIZ,GAAKhS,KAAKozB,wBAEV,OAAOpsB,OAAOysB,aAAaG,WAAW5zB,KAAK+D","file":"pages.snippets.show.5530252b.chunk.js","sourcesContent":["/**\n * adds a pause and unpause method to Mousetrap\n * this allows you to enable or disable keyboard shortcuts\n * without having to reset Mousetrap and rebind everything\n */\n/* global Mousetrap:true */\nMousetrap = (function(Mousetrap) {\n var self = Mousetrap,\n _originalStopCallback = self.stopCallback,\n enabled = true;\n\n self.stopCallback = function(e, element, combo) {\n if (!enabled) {\n return true;\n }\n\n return _originalStopCallback(e, element, combo);\n };\n\n self.pause = function() {\n enabled = false;\n };\n\n self.unpause = function() {\n enabled = true;\n };\n\n return self;\n}) (Mousetrap);\n","import $ from 'jquery';\nimport 'deckar01-task_list';\nimport axios from './lib/utils/axios_utils';\nimport Flash from './flash';\n\nexport default class TaskList {\n constructor(options = {}) {\n this.selector = options.selector;\n this.dataType = options.dataType;\n this.fieldName = options.fieldName;\n this.onSuccess = options.onSuccess || (() => {});\n this.onError = function showFlash(e) {\n let errorMessages = '';\n\n if (e.response.data && typeof e.response.data === 'object') {\n errorMessages = e.response.data.errors.join(' ');\n }\n\n return new Flash(errorMessages || 'Update failed', 'alert');\n };\n\n this.init();\n }\n\n init() {\n // Prevent duplicate event bindings\n this.disable();\n $(`${this.selector} .js-task-list-container`).taskList('enable');\n $(document).on('tasklist:changed', `${this.selector} .js-task-list-container`, this.update.bind(this));\n }\n\n disable() {\n $(`${this.selector} .js-task-list-container`).taskList('disable');\n $(document).off('tasklist:changed', `${this.selector} .js-task-list-container`);\n }\n\n update(e) {\n const $target = $(e.target);\n const patchData = {};\n patchData[this.dataType] = {\n [this.fieldName]: $target.val(),\n };\n\n return axios.patch($target.data('updateUrl') || $('form.js-issuable-update').attr('action'), patchData)\n .then(({ data }) => this.onSuccess(data))\n .catch(err => this.onError(err));\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"animation-container\",class:{\n 'animation-container-small': _vm.small,\n }},_vm._l((_vm.lineClasses),function(css,index){return _c('div',{key:index,class:css})}))}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../node_modules/babel-loader/lib/index.js??ref--0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./skeleton_loading_container.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../node_modules/babel-loader/lib/index.js??ref--0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./skeleton_loading_container.vue?vue&type=script&lang=js\"","\n\n\n","import { render, staticRenderFns } from \"./skeleton_loading_container.vue?vue&type=template&id=993aae32\"\nimport script from \"./skeleton_loading_container.vue?vue&type=script&lang=js\"\nexport * from \"./skeleton_loading_container.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","/* eslint-disable */\n\nconst InputSetter = {\n init(hook) {\n this.hook = hook;\n this.destroyed = false;\n this.config = hook.config.InputSetter || (this.hook.config.InputSetter = {});\n\n this.eventWrapper = {};\n\n this.addEvents();\n },\n\n addEvents() {\n this.eventWrapper.setInputs = this.setInputs.bind(this);\n this.hook.list.list.addEventListener('click.dl', this.eventWrapper.setInputs);\n },\n\n removeEvents() {\n this.hook.list.list.removeEventListener('click.dl', this.eventWrapper.setInputs);\n },\n\n setInputs(e) {\n if (this.destroyed) return;\n\n const selectedItem = e.detail.selected;\n\n if (!Array.isArray(this.config)) this.config = [this.config];\n\n this.config.forEach(config => this.setInput(config, selectedItem));\n },\n\n setInput(config, selectedItem) {\n const input = config.input || this.hook.trigger;\n const newValue = selectedItem.getAttribute(config.valueAttribute);\n const inputAttribute = config.inputAttribute;\n\n if (input.hasAttribute(inputAttribute)) return input.setAttribute(inputAttribute, newValue);\n if (input.tagName === 'INPUT') return input.value = newValue;\n return input.textContent = newValue;\n },\n\n destroy() {\n this.destroyed = true;\n\n this.removeEvents();\n },\n};\n\nexport default InputSetter;\n","import DropLab from './droplab/drop_lab';\nimport ISetter from './droplab/plugins/input_setter';\n\n// Todo: Remove this when fixing issue in input_setter plugin\nconst InputSetter = Object.assign({}, ISetter);\n\nclass CommentTypeToggle {\n constructor(opts = {}) {\n this.dropdownTrigger = opts.dropdownTrigger;\n this.dropdownList = opts.dropdownList;\n this.noteTypeInput = opts.noteTypeInput;\n this.submitButton = opts.submitButton;\n this.closeButton = opts.closeButton;\n this.reopenButton = opts.reopenButton;\n }\n\n initDroplab() {\n this.droplab = new DropLab();\n\n const config = this.setConfig();\n\n this.droplab.init(this.dropdownTrigger, this.dropdownList, [InputSetter], config);\n }\n\n setConfig() {\n const config = {\n InputSetter: [{\n input: this.noteTypeInput,\n valueAttribute: 'data-value',\n },\n {\n input: this.submitButton,\n valueAttribute: 'data-submit-text',\n }],\n };\n\n if (this.closeButton) {\n config.InputSetter.push({\n input: this.closeButton,\n valueAttribute: 'data-close-text',\n }, {\n input: this.closeButton,\n valueAttribute: 'data-close-text',\n inputAttribute: 'data-alternative-text',\n });\n }\n\n if (this.reopenButton) {\n config.InputSetter.push({\n input: this.reopenButton,\n valueAttribute: 'data-reopen-text',\n }, {\n input: this.reopenButton,\n valueAttribute: 'data-reopen-text',\n inputAttribute: 'data-alternative-text',\n });\n }\n\n return config;\n }\n}\n\nexport default CommentTypeToggle;\n","/* eslint-disable no-restricted-properties, func-names, space-before-function-paren,\nno-var, prefer-rest-params, wrap-iife, no-use-before-define, camelcase,\nno-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line,\ndefault-case, prefer-template, consistent-return, no-alert, no-return-assign,\nno-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new,\nbrace-style, no-lonely-if, vars-on-top, no-unused-vars, no-sequences, no-shadow,\nnewline-per-chained-call, no-useless-escape, class-methods-use-this */\n\n/* global ResolveService */\n/* global mrRefreshWidgetUrl */\n\nimport $ from 'jquery';\nimport _ from 'underscore';\nimport Cookies from 'js-cookie';\nimport Autosize from 'autosize';\nimport 'vendor/jquery.caret'; // required by jquery.atwho\nimport 'vendor/jquery.atwho';\nimport AjaxCache from '~/lib/utils/ajax_cache';\nimport Vue from 'vue';\nimport syntaxHighlight from '~/syntax_highlight';\nimport SkeletonLoadingContainer from '~/vue_shared/components/skeleton_loading_container.vue';\nimport axios from './lib/utils/axios_utils';\nimport { getLocationHash } from './lib/utils/url_utility';\nimport Flash from './flash';\nimport CommentTypeToggle from './comment_type_toggle';\nimport GLForm from './gl_form';\nimport loadAwardsHandler from './awards_handler';\nimport Autosave from './autosave';\nimport TaskList from './task_list';\nimport {\n isInViewport,\n getPagePath,\n scrollToElement,\n isMetaKey,\n hasVueMRDiscussionsCookie,\n} from './lib/utils/common_utils';\nimport imageDiffHelper from './image_diff/helpers/index';\nimport { localTimeAgo } from './lib/utils/datetime_utility';\n\nwindow.autosize = Autosize;\n\nfunction normalizeNewlines(str) {\n return str.replace(/\\r\\n/g, '\\n');\n}\n\nconst MAX_VISIBLE_COMMIT_LIST_COUNT = 3;\nconst REGEX_QUICK_ACTIONS = /^\\/\\w+.*$/gm;\n\nexport default class Notes {\n static initialize(\n notes_url,\n note_ids,\n last_fetched_at,\n view,\n enableGFM = true,\n ) {\n if (!this.instance) {\n this.instance = new Notes(\n notes_url,\n note_ids,\n last_fetched_at,\n view,\n enableGFM,\n );\n }\n }\n\n static getInstance() {\n return this.instance;\n }\n\n constructor(notes_url, note_ids, last_fetched_at, view, enableGFM = true) {\n this.updateTargetButtons = this.updateTargetButtons.bind(this);\n this.updateComment = this.updateComment.bind(this);\n this.visibilityChange = this.visibilityChange.bind(this);\n this.cancelDiscussionForm = this.cancelDiscussionForm.bind(this);\n this.onAddDiffNote = this.onAddDiffNote.bind(this);\n this.onAddImageDiffNote = this.onAddImageDiffNote.bind(this);\n this.setupDiscussionNoteForm = this.setupDiscussionNoteForm.bind(this);\n this.onReplyToDiscussionNote = this.onReplyToDiscussionNote.bind(this);\n this.removeNote = this.removeNote.bind(this);\n this.cancelEdit = this.cancelEdit.bind(this);\n this.updateNote = this.updateNote.bind(this);\n this.addDiscussionNote = this.addDiscussionNote.bind(this);\n this.addNoteError = this.addNoteError.bind(this);\n this.addNote = this.addNote.bind(this);\n this.resetMainTargetForm = this.resetMainTargetForm.bind(this);\n this.refresh = this.refresh.bind(this);\n this.keydownNoteText = this.keydownNoteText.bind(this);\n this.toggleCommitList = this.toggleCommitList.bind(this);\n this.postComment = this.postComment.bind(this);\n this.clearFlashWrapper = this.clearFlash.bind(this);\n this.onHashChange = this.onHashChange.bind(this);\n\n this.notes_url = notes_url;\n this.note_ids = note_ids;\n this.enableGFM = enableGFM;\n // Used to keep track of updated notes while people are editing things\n this.updatedNotesTrackingMap = {};\n this.last_fetched_at = last_fetched_at;\n this.noteable_url = document.URL;\n this.notesCountBadge ||\n (this.notesCountBadge = $('.issuable-details').find('.notes-tab .badge'));\n this.basePollingInterval = 15000;\n this.maxPollingSteps = 4;\n\n this.$wrapperEl = hasVueMRDiscussionsCookie()\n ? $(document).find('.diffs')\n : $(document);\n this.cleanBinding();\n this.addBinding();\n this.setPollingInterval();\n this.setupMainTargetNoteForm();\n this.taskList = new TaskList({\n dataType: 'note',\n fieldName: 'note',\n selector: '.notes',\n });\n this.collapseLongCommitList();\n this.setViewType(view);\n\n // We are in the Merge Requests page so we need another edit form for Changes tab\n if (getPagePath(1) === 'merge_requests') {\n $('.note-edit-form')\n .clone()\n .addClass('mr-note-edit-form')\n .insertAfter('.note-edit-form');\n }\n\n const hash = getLocationHash();\n const $anchor = hash && document.getElementById(hash);\n\n if ($anchor) {\n this.loadLazyDiff({ currentTarget: $anchor });\n }\n }\n\n setViewType(view) {\n this.view = Cookies.get('diff_view') || view;\n }\n\n addBinding() {\n // Edit note link\n this.$wrapperEl.on('click', '.js-note-edit', this.showEditForm.bind(this));\n this.$wrapperEl.on('click', '.note-edit-cancel', this.cancelEdit);\n // Reopen and close actions for Issue/MR combined with note form submit\n this.$wrapperEl.on('click', '.js-comment-submit-button', this.postComment);\n this.$wrapperEl.on('click', '.js-comment-save-button', this.updateComment);\n this.$wrapperEl.on(\n 'keyup input',\n '.js-note-text',\n this.updateTargetButtons,\n );\n // resolve a discussion\n this.$wrapperEl.on('click', '.js-comment-resolve-button', this.postComment);\n // remove a note (in general)\n this.$wrapperEl.on('click', '.js-note-delete', this.removeNote);\n // delete note attachment\n this.$wrapperEl.on(\n 'click',\n '.js-note-attachment-delete',\n this.removeAttachment,\n );\n // reset main target form when clicking discard\n this.$wrapperEl.on('click', '.js-note-discard', this.resetMainTargetForm);\n // update the file name when an attachment is selected\n this.$wrapperEl.on(\n 'change',\n '.js-note-attachment-input',\n this.updateFormAttachment,\n );\n // reply to diff/discussion notes\n this.$wrapperEl.on(\n 'click',\n '.js-discussion-reply-button',\n this.onReplyToDiscussionNote,\n );\n // add diff note\n this.$wrapperEl.on('click', '.js-add-diff-note-button', this.onAddDiffNote);\n // add diff note for images\n this.$wrapperEl.on(\n 'click',\n '.js-add-image-diff-note-button',\n this.onAddImageDiffNote,\n );\n // hide diff note form\n this.$wrapperEl.on(\n 'click',\n '.js-close-discussion-note-form',\n this.cancelDiscussionForm,\n );\n // toggle commit list\n this.$wrapperEl.on(\n 'click',\n '.system-note-commit-list-toggler',\n this.toggleCommitList,\n );\n\n this.$wrapperEl.on('click', '.js-toggle-lazy-diff', this.loadLazyDiff);\n this.$wrapperEl.on('click', '.js-toggle-lazy-diff-retry-button', this.onClickRetryLazyLoad.bind(this));\n\n // fetch notes when tab becomes visible\n this.$wrapperEl.on('visibilitychange', this.visibilityChange);\n // when issue status changes, we need to refresh data\n this.$wrapperEl.on('issuable:change', this.refresh);\n // ajax:events that happen on Form when actions like Reopen, Close are performed on Issues and MRs.\n this.$wrapperEl.on('ajax:success', '.js-main-target-form', this.addNote);\n this.$wrapperEl.on(\n 'ajax:success',\n '.js-discussion-note-form',\n this.addDiscussionNote,\n );\n this.$wrapperEl.on(\n 'ajax:success',\n '.js-main-target-form',\n this.resetMainTargetForm,\n );\n this.$wrapperEl.on(\n 'ajax:complete',\n '.js-main-target-form',\n this.reenableTargetFormSubmitButton,\n );\n // when a key is clicked on the notes\n this.$wrapperEl.on('keydown', '.js-note-text', this.keydownNoteText);\n // When the URL fragment/hash has changed, `#note_xxx`\n $(window).on('hashchange', this.onHashChange);\n this.boundGetContent = this.getContent.bind(this);\n document.addEventListener('refreshLegacyNotes', this.boundGetContent);\n }\n\n cleanBinding() {\n this.$wrapperEl.off('click', '.js-note-edit');\n this.$wrapperEl.off('click', '.note-edit-cancel');\n this.$wrapperEl.off('click', '.js-note-delete');\n this.$wrapperEl.off('click', '.js-note-attachment-delete');\n this.$wrapperEl.off('click', '.js-discussion-reply-button');\n this.$wrapperEl.off('click', '.js-add-diff-note-button');\n this.$wrapperEl.off('click', '.js-add-image-diff-note-button');\n this.$wrapperEl.off('visibilitychange');\n this.$wrapperEl.off('keyup input', '.js-note-text');\n this.$wrapperEl.off('click', '.js-note-target-reopen');\n this.$wrapperEl.off('click', '.js-note-target-close');\n this.$wrapperEl.off('click', '.js-note-discard');\n this.$wrapperEl.off('keydown', '.js-note-text');\n this.$wrapperEl.off('click', '.js-comment-resolve-button');\n this.$wrapperEl.off('click', '.system-note-commit-list-toggler');\n this.$wrapperEl.off('click', '.js-toggle-lazy-diff');\n this.$wrapperEl.off('click', '.js-toggle-lazy-diff-retry-button');\n this.$wrapperEl.off('ajax:success', '.js-main-target-form');\n this.$wrapperEl.off('ajax:success', '.js-discussion-note-form');\n this.$wrapperEl.off('ajax:complete', '.js-main-target-form');\n document.removeEventListener('refreshLegacyNotes', this.boundGetContent);\n $(window).off('hashchange', this.onHashChange);\n }\n\n static initCommentTypeToggle(form) {\n const dropdownTrigger = form.querySelector(\n '.js-comment-type-dropdown .dropdown-toggle',\n );\n const dropdownList = form.querySelector(\n '.js-comment-type-dropdown .dropdown-menu',\n );\n const noteTypeInput = form.querySelector('#note_type');\n const submitButton = form.querySelector(\n '.js-comment-type-dropdown .js-comment-submit-button',\n );\n const closeButton = form.querySelector('.js-note-target-close');\n const reopenButton = form.querySelector('.js-note-target-reopen');\n\n const commentTypeToggle = new CommentTypeToggle({\n dropdownTrigger,\n dropdownList,\n noteTypeInput,\n submitButton,\n closeButton,\n reopenButton,\n });\n\n commentTypeToggle.initDroplab();\n }\n\n keydownNoteText(e) {\n var $textarea,\n discussionNoteForm,\n editNote,\n myLastNote,\n myLastNoteEditBtn,\n newText,\n originalText;\n if (isMetaKey(e)) {\n return;\n }\n\n $textarea = $(e.target);\n // Edit previous note when UP arrow is hit\n switch (e.which) {\n case 38:\n if ($textarea.val() !== '') {\n return;\n }\n myLastNote = $(\n `li.note[data-author-id='${\n gon.current_user_id\n }'][data-editable]:last`,\n $textarea.closest('.note, .notes_holder, #notes'),\n );\n if (myLastNote.length) {\n myLastNoteEditBtn = myLastNote.find('.js-note-edit');\n return myLastNoteEditBtn.trigger('click', [true, myLastNote]);\n }\n break;\n // Cancel creating diff note or editing any note when ESCAPE is hit\n case 27:\n discussionNoteForm = $textarea.closest('.js-discussion-note-form');\n if (discussionNoteForm.length) {\n if ($textarea.val() !== '') {\n if (\n !confirm('您确定要取消发表评论?')\n ) {\n return;\n }\n }\n this.removeDiscussionNoteForm(discussionNoteForm);\n return;\n }\n editNote = $textarea.closest('.note');\n if (editNote.length) {\n originalText = $textarea.closest('form').data('originalNote');\n newText = $textarea.val();\n if (originalText !== newText) {\n if (\n !confirm('您确定要取消编辑评论?')\n ) {\n return;\n }\n }\n return this.removeNoteEditForm(editNote);\n }\n }\n }\n\n initRefresh() {\n if (Notes.interval) {\n clearInterval(Notes.interval);\n }\n return (Notes.interval = setInterval(\n (function(_this) {\n return function() {\n return _this.refresh();\n };\n })(this),\n this.pollingInterval,\n ));\n }\n\n refresh() {\n if (!document.hidden) {\n return this.getContent();\n }\n }\n\n getContent() {\n if (this.refreshing) {\n return;\n }\n\n this.refreshing = true;\n\n axios\n .get(`${this.notes_url}?html=true`, {\n headers: {\n 'X-Last-Fetched-At': this.last_fetched_at,\n },\n })\n .then(({ data }) => {\n const notes = data.notes;\n this.last_fetched_at = data.last_fetched_at;\n this.setPollingInterval(data.notes.length);\n $.each(notes, (i, note) => this.renderNote(note));\n\n this.refreshing = false;\n })\n .catch(() => {\n this.refreshing = false;\n });\n }\n\n /**\n * Increase @pollingInterval up to 120 seconds on every function call,\n * if `shouldReset` has a truthy value, 'null' or 'undefined' the variable\n * will reset to @basePollingInterval.\n *\n * Note: this function is used to gradually increase the polling interval\n * if there aren't new notes coming from the server\n */\n setPollingInterval(shouldReset) {\n var nthInterval;\n if (shouldReset == null) {\n shouldReset = true;\n }\n nthInterval =\n this.basePollingInterval * Math.pow(2, this.maxPollingSteps - 1);\n if (shouldReset) {\n this.pollingInterval = this.basePollingInterval;\n } else if (this.pollingInterval < nthInterval) {\n this.pollingInterval *= 2;\n }\n return this.initRefresh();\n }\n\n handleQuickActions(noteEntity) {\n var votesBlock;\n if (noteEntity.commands_changes) {\n if ('merge' in noteEntity.commands_changes) {\n Notes.checkMergeRequestStatus();\n }\n\n if ('emoji_award' in noteEntity.commands_changes) {\n votesBlock = $('.js-awards-block').eq(0);\n\n loadAwardsHandler()\n .then(awardsHandler => {\n awardsHandler.addAwardToEmojiBar(\n votesBlock,\n noteEntity.commands_changes.emoji_award,\n );\n awardsHandler.scrollToAwards();\n })\n .catch(() => {\n // ignore\n });\n }\n }\n }\n\n setupNewNote($note) {\n // Update datetime format on the recent note\n localTimeAgo($note.find('.js-timeago'), false);\n\n this.collapseLongCommitList();\n this.taskList.init();\n\n // This stops the note highlight, #note_xxx`, from being removed after real time update\n // The `:target` selector does not re-evaluate after we replace element in the DOM\n Notes.updateNoteTargetSelector($note);\n this.$noteToCleanHighlight = $note;\n }\n\n onHashChange() {\n if (this.$noteToCleanHighlight) {\n Notes.updateNoteTargetSelector(this.$noteToCleanHighlight);\n }\n\n this.$noteToCleanHighlight = null;\n }\n\n static updateNoteTargetSelector($note) {\n const hash = getLocationHash();\n // Needs to be an explicit true/false for the jQuery `toggleClass(force)`\n const addTargetClass = Boolean(hash && $note.filter(`#${hash}`).length > 0);\n $note.toggleClass('target', addTargetClass);\n }\n\n /**\n * Render note in main comments area.\n *\n * Note: for rendering inline notes use renderDiscussionNote\n */\n renderNote(noteEntity, $form, $notesList = $('.main-notes-list')) {\n if (noteEntity.discussion_html) {\n return this.renderDiscussionNote(noteEntity, $form);\n }\n\n if (!noteEntity.valid) {\n if (noteEntity.errors && noteEntity.errors.commands_only) {\n if (\n noteEntity.commands_changes &&\n Object.keys(noteEntity.commands_changes).length > 0\n ) {\n $notesList.find('.system-note.being-posted').remove();\n }\n this.addFlash(\n noteEntity.errors.commands_only,\n 'notice',\n this.parentTimeline.get(0),\n );\n this.refresh();\n }\n return;\n }\n\n const $note = $notesList.find(`#note_${noteEntity.id}`);\n if (Notes.isNewNote(noteEntity, this.note_ids)) {\n if (hasVueMRDiscussionsCookie()) {\n return;\n }\n\n this.note_ids.push(noteEntity.id);\n\n if ($notesList.length) {\n $notesList.find('.system-note.being-posted').remove();\n }\n const $newNote = Notes.animateAppendNote(noteEntity.html, $notesList);\n\n this.setupNewNote($newNote);\n this.refresh();\n return this.updateNotesCount(1);\n } else if (Notes.isUpdatedNote(noteEntity, $note)) {\n // The server can send the same update multiple times so we need to make sure to only update once per actual update.\n const isEditing = $note.hasClass('is-editing');\n const initialContent = normalizeNewlines(\n $note\n .find('.original-note-content')\n .text()\n .trim(),\n );\n const $textarea = $note.find('.js-note-text');\n const currentContent = $textarea.val();\n // There can be CRLF vs LF mismatches if we don't sanitize and compare the same way\n const sanitizedNoteNote = normalizeNewlines(noteEntity.note);\n const isTextareaUntouched =\n currentContent === initialContent ||\n currentContent === sanitizedNoteNote;\n\n if (isEditing && isTextareaUntouched) {\n $textarea.val(noteEntity.note);\n this.updatedNotesTrackingMap[noteEntity.id] = noteEntity;\n } else if (isEditing && !isTextareaUntouched) {\n this.putConflictEditWarningInPlace(noteEntity, $note);\n this.updatedNotesTrackingMap[noteEntity.id] = noteEntity;\n } else {\n const $updatedNote = Notes.animateUpdateNote(noteEntity.html, $note);\n this.setupNewNote($updatedNote);\n }\n }\n\n Notes.refreshVueNotes();\n }\n\n isParallelView() {\n return Cookies.get('diff_view') === 'parallel';\n }\n\n /**\n * Render note in discussion area. To render inline notes use renderDiscussionNote.\n */\n renderDiscussionNote(noteEntity, $form) {\n var discussionContainer, form, row, lineType, diffAvatarContainer;\n\n if (!Notes.isNewNote(noteEntity, this.note_ids)) {\n return;\n }\n this.note_ids.push(noteEntity.id);\n\n form =\n $form ||\n $(\n `.js-discussion-note-form[data-discussion-id=\"${\n noteEntity.discussion_id\n }\"]`,\n );\n row =\n form.length || !noteEntity.discussion_line_code\n ? form.closest('tr')\n : $(`#${noteEntity.discussion_line_code}`);\n\n if (noteEntity.on_image) {\n row = form;\n }\n\n lineType = this.isParallelView() ? form.find('#line_type').val() : 'old';\n diffAvatarContainer = row\n .prevAll('.line_holder')\n .first()\n .find('.js-avatar-container.' + lineType + '_line');\n // is this the first note of discussion?\n discussionContainer = $(\n `.notes[data-discussion-id=\"${noteEntity.discussion_id}\"]`,\n );\n if (!discussionContainer.length) {\n discussionContainer = form.closest('.discussion').find('.notes');\n }\n if (discussionContainer.length === 0) {\n if (noteEntity.diff_discussion_html) {\n var $discussion = $(noteEntity.diff_discussion_html).renderGFM();\n\n if (\n !this.isParallelView() ||\n row.hasClass('js-temp-notes-holder') ||\n noteEntity.on_image\n ) {\n // insert the note and the reply button after the temp row\n row.after($discussion);\n } else {\n // Merge new discussion HTML in\n var $notes = $discussion.find(\n `.notes[data-discussion-id=\"${noteEntity.discussion_id}\"]`,\n );\n var contentContainerClass =\n '.' +\n $notes\n .closest('.notes_content')\n .attr('class')\n .split(' ')\n .join('.');\n\n row\n .find(contentContainerClass + ' .content')\n .append($notes.closest('.content').children());\n }\n }\n // Init discussion on 'Discussion' page if it is merge request page\n const page = $('body').attr('data-page');\n if (\n (page && page.indexOf('projects:merge_request') !== -1) ||\n !noteEntity.diff_discussion_html\n ) {\n if (!hasVueMRDiscussionsCookie()) {\n Notes.animateAppendNote(\n noteEntity.discussion_html,\n $('.main-notes-list'),\n );\n }\n }\n } else {\n // append new note to all matching discussions\n Notes.animateAppendNote(noteEntity.html, discussionContainer);\n }\n\n if (\n typeof gl.diffNotesCompileComponents !== 'undefined' &&\n noteEntity.discussion_resolvable\n ) {\n gl.diffNotesCompileComponents();\n\n this.renderDiscussionAvatar(diffAvatarContainer, noteEntity);\n }\n\n localTimeAgo($('.js-timeago'), false);\n Notes.checkMergeRequestStatus();\n return this.updateNotesCount(1);\n }\n\n getLineHolder(changesDiscussionContainer) {\n return $(changesDiscussionContainer)\n .closest('.notes_holder')\n .prevAll('.line_holder')\n .first()\n .get(0);\n }\n\n renderDiscussionAvatar(diffAvatarContainer, noteEntity) {\n var avatarHolder = diffAvatarContainer.find('.diff-comment-avatar-holders');\n\n if (!avatarHolder.length) {\n avatarHolder = document.createElement('diff-note-avatars');\n avatarHolder.setAttribute('discussion-id', noteEntity.discussion_id);\n\n diffAvatarContainer.append(avatarHolder);\n\n gl.diffNotesCompileComponents();\n }\n }\n\n /**\n * Called in response the main target form has been successfully submitted.\n *\n * Removes any errors.\n * Resets text and preview.\n * Resets buttons.\n */\n resetMainTargetForm(e) {\n var form;\n form = $('.js-main-target-form');\n // remove validation errors\n form.find('.js-errors').remove();\n // reset text and preview\n form.find('.js-md-write-button').click();\n form\n .find('.js-note-text')\n .val('')\n .trigger('input');\n form\n .find('.js-note-text')\n .data('autosave')\n .reset();\n\n var event = document.createEvent('Event');\n event.initEvent('autosize:update', true, false);\n form.find('.js-autosize')[0].dispatchEvent(event);\n\n this.updateTargetButtons(e);\n }\n\n reenableTargetFormSubmitButton() {\n var form;\n form = $('.js-main-target-form');\n return form.find('.js-note-text').trigger('input');\n }\n\n /**\n * Shows the main form and does some setup on it.\n *\n * Sets some hidden fields in the form.\n */\n setupMainTargetNoteForm() {\n var form;\n // find the form\n form = $('.js-new-note-form');\n // Set a global clone of the form for later cloning\n this.formClone = form.clone();\n // show the form\n this.setupNoteForm(form);\n // fix classes\n form.removeClass('js-new-note-form');\n form.addClass('js-main-target-form');\n form.find('#note_line_code').remove();\n form.find('#note_position').remove();\n form.find('#note_type').val('');\n form.find('#note_project_id').remove();\n form.find('#in_reply_to_discussion_id').remove();\n form\n .find('.js-comment-resolve-button')\n .closest('comment-and-resolve-btn')\n .remove();\n this.parentTimeline = form.parents('.timeline');\n\n if (form.length) {\n Notes.initCommentTypeToggle(form.get(0));\n }\n }\n\n /**\n * General note form setup.\n *\n * deactivates the submit button when text is empty\n * hides the preview button when text is empty\n * setup GFM auto complete\n * show the form\n */\n setupNoteForm(form) {\n var textarea, key;\n this.glForm = new GLForm(form, this.enableGFM);\n textarea = form.find('.js-note-text');\n key = [\n 'Note',\n form.find('#note_noteable_type').val(),\n form.find('#note_noteable_id').val(),\n form.find('#note_commit_id').val(),\n form.find('#note_type').val(),\n form.find('#note_project_id').val(),\n form.find('#in_reply_to_discussion_id').val(),\n\n // LegacyDiffNote\n form.find('#note_line_code').val(),\n\n // DiffNote\n form.find('#note_position').val(),\n ];\n return new Autosave(textarea, key);\n }\n\n /**\n * Called in response to the new note form being submitted\n *\n * Adds new note to list.\n */\n addNote($form, note) {\n return this.renderNote(note);\n }\n\n addNoteError($form) {\n let formParentTimeline;\n if ($form.hasClass('js-main-target-form')) {\n formParentTimeline = $form.parents('.timeline');\n } else if ($form.hasClass('js-discussion-note-form')) {\n formParentTimeline = $form.closest('.discussion-notes').find('.notes');\n }\n return this.addFlash(\n 'Your comment could not be submitted! Please check your network connection and try again.',\n 'alert',\n formParentTimeline.get(0),\n );\n }\n\n updateNoteError($parentTimeline) {\n new Flash(\n 'Your comment could not be updated! Please check your network connection and try again.',\n );\n }\n\n /**\n * Called in response to the new note form being submitted\n *\n * Adds new note to list.\n */\n addDiscussionNote($form, note, isNewDiffComment) {\n if ($form.attr('data-resolve-all') != null) {\n var projectPath = $form.data('projectPath');\n var discussionId = $form.data('discussionId');\n var mergeRequestId = $form.data('noteableIid');\n\n if (ResolveService != null) {\n ResolveService.toggleResolveForDiscussion(mergeRequestId, discussionId);\n }\n }\n\n this.renderNote(note, $form);\n // cleanup after successfully creating a diff/discussion note\n if (isNewDiffComment) {\n this.removeDiscussionNoteForm($form);\n }\n }\n\n /**\n * Called in response to the edit note form being submitted\n *\n * Updates the current note field.\n */\n updateNote(noteEntity, $targetNote) {\n var $noteEntityEl, $note_li;\n // Convert returned HTML to a jQuery object so we can modify it further\n $noteEntityEl = $(noteEntity.html);\n this.revertNoteEditForm($targetNote);\n $noteEntityEl.renderGFM();\n // Find the note's `li` element by ID and replace it with the updated HTML\n $note_li = $('.note-row-' + noteEntity.id);\n\n $note_li.replaceWith($noteEntityEl);\n this.setupNewNote($noteEntityEl);\n\n if (typeof gl.diffNotesCompileComponents !== 'undefined') {\n gl.diffNotesCompileComponents();\n }\n }\n\n checkContentToAllowEditing($el) {\n var initialContent = $el\n .find('.original-note-content')\n .text()\n .trim();\n var currentContent = $el.find('.js-note-text').val();\n var isAllowed = true;\n\n if (currentContent === initialContent) {\n this.removeNoteEditForm($el);\n } else {\n var $buttons = $el.find('.note-form-actions');\n var isWidgetVisible = isInViewport($el.get(0));\n\n if (!isWidgetVisible) {\n scrollToElement($el);\n }\n\n $el.find('.js-finish-edit-warning').show();\n isAllowed = false;\n }\n\n return isAllowed;\n }\n\n /**\n * Called in response to clicking the edit note link\n *\n * Replaces the note text with the note edit form\n * Adds a data attribute to the form with the original content of the note for cancellations\n */\n showEditForm(e, scrollTo, myLastNote) {\n e.preventDefault();\n\n var $target = $(e.target);\n var $editForm = $(this.getEditFormSelector($target));\n var $note = $target.closest('.note');\n var $currentlyEditing = $('.note.is-editing:visible');\n\n if ($currentlyEditing.length) {\n var isEditAllowed = this.checkContentToAllowEditing($currentlyEditing);\n\n if (!isEditAllowed) {\n return;\n }\n }\n\n $note.find('.js-note-attachment-delete').show();\n $editForm.addClass('current-note-edit-form');\n $note.addClass('is-editing');\n this.putEditFormInPlace($target);\n }\n\n /**\n * Called in response to clicking the edit note link\n *\n * Hides edit form and restores the original note text to the editor textarea.\n */\n cancelEdit(e) {\n e.preventDefault();\n const $target = $(e.target);\n const $note = $target.closest('.note');\n const noteId = $note.attr('data-note-id');\n\n this.revertNoteEditForm($target);\n\n if (this.updatedNotesTrackingMap[noteId]) {\n const $newNote = $(this.updatedNotesTrackingMap[noteId].html);\n $note.replaceWith($newNote);\n this.setupNewNote($newNote);\n // Now that we have taken care of the update, clear it out\n delete this.updatedNotesTrackingMap[noteId];\n } else {\n $note.find('.js-finish-edit-warning').hide();\n this.removeNoteEditForm($note);\n }\n }\n\n revertNoteEditForm($target) {\n $target = $target || $('.note.is-editing:visible');\n var selector = this.getEditFormSelector($target);\n var $editForm = $(selector);\n\n $editForm.insertBefore('.diffs');\n $editForm.find('.js-comment-save-button').enable();\n $editForm.find('.js-finish-edit-warning').hide();\n }\n\n getEditFormSelector($el) {\n var selector = '.note-edit-form:not(.mr-note-edit-form)';\n\n if ($el.parents('#diffs').length) {\n selector = '.note-edit-form.mr-note-edit-form';\n }\n\n return selector;\n }\n\n removeNoteEditForm($note) {\n var form = $note.find('.diffs .current-note-edit-form');\n\n $note.removeClass('is-editing');\n form.removeClass('current-note-edit-form');\n form.find('.js-finish-edit-warning').hide();\n // Replace markdown textarea text with original note text.\n return form\n .find('.js-note-text')\n .val(form.find('form.edit-note').data('originalNote'));\n }\n\n /**\n * Called in response to deleting a note of any kind.\n *\n * Removes the actual note from view.\n * Removes the whole discussion if the last note is being removed.\n */\n removeNote(e) {\n var noteElId, noteId, dataNoteId, $note, lineHolder;\n $note = $(e.currentTarget).closest('.note');\n noteElId = $note.attr('id');\n noteId = $note.attr('data-note-id');\n lineHolder = $(e.currentTarget)\n .closest('.notes[data-discussion-id]')\n .closest('.notes_holder')\n .prev('.line_holder');\n $(`.note[id=\"${noteElId}\"]`).each(\n (function(_this) {\n // A same note appears in the \"Discussion\" and in the \"Changes\" tab, we have\n // to remove all. Using $('.note[id='noteId']') ensure we get all the notes,\n // where $('#noteId') would return only one.\n return function(i, el) {\n var $note, $notes;\n $note = $(el);\n $notes = $note.closest('.discussion-notes');\n const discussionId = $('.notes', $notes).data('discussionId');\n\n if (typeof gl.diffNotesCompileComponents !== 'undefined') {\n if (gl.diffNoteApps[noteElId]) {\n gl.diffNoteApps[noteElId].$destroy();\n }\n }\n\n $note.remove();\n\n // check if this is the last note for this line\n if ($notes.find('.note').length === 0) {\n var notesTr = $notes.closest('tr');\n\n // \"Discussions\" tab\n $notes.closest('.timeline-entry').remove();\n\n $(`.js-diff-avatars-${discussionId}`).trigger('remove.vue');\n\n // The notes tr can contain multiple lists of notes, like on the parallel diff\n // notesTr does not exist for image diffs\n if (\n notesTr.find('.discussion-notes').length > 1 ||\n notesTr.length === 0\n ) {\n const $diffFile = $notes.closest('.diff-file');\n if ($diffFile.length > 0) {\n const removeBadgeEvent = new CustomEvent(\n 'removeBadge.imageDiff',\n {\n detail: {\n // badgeNumber's start with 1 and index starts with 0\n badgeNumber: $notes.index() + 1,\n },\n },\n );\n\n $diffFile[0].dispatchEvent(removeBadgeEvent);\n }\n\n $notes.remove();\n } else if (notesTr.length > 0) {\n notesTr.remove();\n }\n }\n };\n })(this),\n );\n\n Notes.refreshVueNotes();\n Notes.checkMergeRequestStatus();\n return this.updateNotesCount(-1);\n }\n\n /**\n * Called in response to clicking the delete attachment link\n *\n * Removes the attachment wrapper view, including image tag if it exists\n * Resets the note editing form\n */\n removeAttachment() {\n const $note = $(this).closest('.note');\n $note.find('.note-attachment').remove();\n $note.find('.note-body > .note-text').show();\n $note.find('.note-header').show();\n return $note.find('.current-note-edit-form').remove();\n }\n\n /**\n * Called when clicking on the \"reply\" button for a diff line.\n *\n * Shows the note form below the notes.\n */\n onReplyToDiscussionNote(e) {\n this.replyToDiscussionNote(e.target);\n }\n\n replyToDiscussionNote(target) {\n var form, replyLink;\n form = this.cleanForm(this.formClone.clone());\n replyLink = $(target).closest('.js-discussion-reply-button');\n // insert the form after the button\n replyLink\n .closest('.discussion-reply-holder')\n .hide()\n .after(form);\n // show the form\n return this.setupDiscussionNoteForm(replyLink, form);\n }\n\n /**\n * Shows the diff or discussion form and does some setup on it.\n *\n * Sets some hidden fields in the form.\n *\n * Note: dataHolder must have the \"discussionId\" and \"lineCode\" data attributes set.\n */\n setupDiscussionNoteForm(dataHolder, form) {\n // setup note target\n let diffFileData = dataHolder.closest('.text-file');\n\n if (diffFileData.length === 0) {\n diffFileData = dataHolder.closest('.image');\n }\n\n var discussionID = dataHolder.data('discussionId');\n\n if (discussionID) {\n form.attr('data-discussion-id', discussionID);\n form.find('#in_reply_to_discussion_id').val(discussionID);\n }\n\n form.find('#note_project_id').val(dataHolder.data('discussionProjectId'));\n\n form.attr('data-line-code', dataHolder.data('lineCode'));\n form.find('#line_type').val(dataHolder.data('lineType'));\n\n form.find('#note_noteable_type').val(diffFileData.data('noteableType'));\n form.find('#note_noteable_id').val(diffFileData.data('noteableId'));\n form.find('#note_commit_id').val(diffFileData.data('commitId'));\n\n form.find('#note_type').val(dataHolder.data('noteType'));\n\n // LegacyDiffNote\n form.find('#note_line_code').val(dataHolder.data('lineCode'));\n\n // DiffNote\n form.find('#note_position').val(dataHolder.attr('data-position'));\n\n form\n .find('.js-note-discard')\n .show()\n .removeClass('js-note-discard')\n .addClass('js-close-discussion-note-form')\n .text(form.find('.js-close-discussion-note-form').data('cancelText'));\n form.find('.js-note-target-close').remove();\n form.find('.js-note-new-discussion').remove();\n this.setupNoteForm(form);\n\n form\n .removeClass('js-main-target-form')\n .addClass('discussion-form js-discussion-note-form');\n\n if (typeof gl.diffNotesCompileComponents !== 'undefined') {\n var $commentBtn = form.find('comment-and-resolve-btn');\n $commentBtn.attr(':discussion-id', `'${discussionID}'`);\n\n gl.diffNotesCompileComponents();\n }\n\n form.find('.js-note-text').focus();\n form\n .find('.js-comment-resolve-button')\n .attr('data-discussion-id', discussionID);\n }\n\n /**\n * Called when clicking on the \"add a comment\" button on the side of a diff line.\n *\n * Inserts a temporary row for the form below the line.\n * Sets up the form and shows it.\n */\n onAddDiffNote(e) {\n e.preventDefault();\n const link = e.currentTarget || e.target;\n const $link = $(link);\n const showReplyInput = !$link.hasClass('js-diff-comment-avatar');\n this.toggleDiffNote({\n target: $link,\n lineType: link.dataset.lineType,\n showReplyInput,\n });\n }\n\n onAddImageDiffNote(e) {\n const $link = $(e.currentTarget || e.target);\n const $diffFile = $link.closest('.diff-file');\n\n const clickEvent = new CustomEvent('click.imageDiff', {\n detail: e,\n });\n\n $diffFile[0].dispatchEvent(clickEvent);\n\n // Setup comment form\n let newForm;\n const $noteContainer = $link\n .closest('.diff-viewer')\n .find('.note-container');\n const $form = $noteContainer.find('> .discussion-form');\n\n if ($form.length === 0) {\n newForm = this.cleanForm(this.formClone.clone());\n newForm.appendTo($noteContainer);\n } else {\n newForm = $form;\n }\n\n this.setupDiscussionNoteForm($link, newForm);\n }\n\n toggleDiffNote({ target, lineType, forceShow, showReplyInput = false }) {\n var $link,\n addForm,\n hasNotes,\n newForm,\n noteForm,\n replyButton,\n row,\n rowCssToAdd,\n targetContent,\n isDiffCommentAvatar;\n $link = $(target);\n row = $link.closest('tr');\n const nextRow = row.next();\n let targetRow = row;\n if (nextRow.is('.notes_holder')) {\n targetRow = nextRow;\n }\n\n hasNotes = nextRow.is('.notes_holder');\n addForm = false;\n let lineTypeSelector = '';\n rowCssToAdd =\n '
';\n // In parallel view, look inside the correct left/right pane\n if (this.isParallelView()) {\n lineTypeSelector = `.${lineType}`;\n rowCssToAdd =\n '
';\n }\n const notesContentSelector = `.notes_content${lineTypeSelector} .content`;\n let notesContent = targetRow.find(notesContentSelector);\n\n if (hasNotes && showReplyInput) {\n targetRow.show();\n notesContent = targetRow.find(notesContentSelector);\n if (notesContent.length) {\n notesContent.show();\n replyButton = notesContent.find('.js-discussion-reply-button:visible');\n if (replyButton.length) {\n this.replyToDiscussionNote(replyButton[0]);\n } else {\n // In parallel view, the form may not be present in one of the panes\n noteForm = notesContent.find('.js-discussion-note-form');\n if (noteForm.length === 0) {\n addForm = true;\n }\n }\n }\n } else if (showReplyInput) {\n // add a notes row and insert the form\n row.after(rowCssToAdd);\n targetRow = row.next();\n notesContent = targetRow.find(notesContentSelector);\n addForm = true;\n } else {\n const isCurrentlyShown = targetRow\n .find('.content:not(:empty)')\n .is(':visible');\n const isForced = forceShow === true || forceShow === false;\n const showNow = forceShow === true || (!isCurrentlyShown && !isForced);\n\n targetRow.toggleClass('hide', !showNow);\n notesContent.toggleClass('hide', !showNow);\n }\n\n if (addForm) {\n newForm = this.cleanForm(this.formClone.clone());\n newForm.appendTo(notesContent);\n // show the form\n return this.setupDiscussionNoteForm($link, newForm);\n }\n }\n\n /**\n * Called in response to \"cancel\" on a diff note form.\n *\n * Shows the reply button again.\n * Removes the form and if necessary it's temporary row.\n */\n removeDiscussionNoteForm(form) {\n var glForm, row;\n row = form.closest('tr');\n glForm = form.data('glForm');\n glForm.destroy();\n form\n .find('.js-note-text')\n .data('autosave')\n .reset();\n // show the reply button (will only work for replies)\n form.prev('.discussion-reply-holder').show();\n if (row.is('.js-temp-notes-holder')) {\n // remove temporary row for diff lines\n return row.remove();\n } else {\n // only remove the form\n return form.remove();\n }\n }\n\n cancelDiscussionForm(e) {\n e.preventDefault();\n const $form = $(e.target).closest('.js-discussion-note-form');\n const $discussionNote = $(e.target).closest('.discussion-notes');\n\n if ($discussionNote.length === 0) {\n // Only send blur event when the discussion form\n // is not part of a discussion note\n const $diffFile = $form.closest('.diff-file');\n\n if ($diffFile.length > 0) {\n const blurEvent = new CustomEvent('blur.imageDiff', {\n detail: e,\n });\n\n $diffFile[0].dispatchEvent(blurEvent);\n }\n }\n\n return this.removeDiscussionNoteForm($form);\n }\n\n /**\n * Called after an attachment file has been selected.\n *\n * Updates the file name for the selected attachment.\n */\n updateFormAttachment() {\n var filename, form;\n form = $(this).closest('form');\n // get only the basename\n filename = $(this)\n .val()\n .replace(/^.*[\\\\\\/]/, '');\n return form.find('.js-attachment-filename').text(filename);\n }\n\n /**\n * Called when the tab visibility changes\n */\n visibilityChange() {\n return this.refresh();\n }\n\n updateTargetButtons(e) {\n var closebtn, closetext, discardbtn, form, reopenbtn, reopentext, textarea;\n textarea = $(e.target);\n form = textarea.parents('form');\n reopenbtn = form.find('.js-note-target-reopen');\n closebtn = form.find('.js-note-target-close');\n discardbtn = form.find('.js-note-discard');\n\n if (textarea.val().trim().length > 0) {\n reopentext = reopenbtn.attr('data-alternative-text');\n closetext = closebtn.attr('data-alternative-text');\n if (reopenbtn.text() !== reopentext) {\n reopenbtn.text(reopentext);\n }\n if (closebtn.text() !== closetext) {\n closebtn.text(closetext);\n }\n if (reopenbtn.is(':not(.btn-comment-and-reopen)')) {\n reopenbtn.addClass('btn-comment-and-reopen');\n }\n if (closebtn.is(':not(.btn-comment-and-close)')) {\n closebtn.addClass('btn-comment-and-close');\n }\n if (discardbtn.is(':hidden')) {\n return discardbtn.show();\n }\n } else {\n reopentext = reopenbtn.data('originalText');\n closetext = closebtn.data('originalText');\n if (reopenbtn.text() !== reopentext) {\n reopenbtn.text(reopentext);\n }\n if (closebtn.text() !== closetext) {\n closebtn.text(closetext);\n }\n if (reopenbtn.is('.btn-comment-and-reopen')) {\n reopenbtn.removeClass('btn-comment-and-reopen');\n }\n if (closebtn.is('.btn-comment-and-close')) {\n closebtn.removeClass('btn-comment-and-close');\n }\n if (discardbtn.is(':visible')) {\n return discardbtn.hide();\n }\n }\n }\n\n putEditFormInPlace($el) {\n var $editForm = $(this.getEditFormSelector($el));\n var $note = $el.closest('.note');\n\n $editForm.insertAfter($note.find('.note-text'));\n\n var $originalContentEl = $note.find('.original-note-content');\n var originalContent = $originalContentEl.text().trim();\n var postUrl = $originalContentEl.data('postUrl');\n var targetId = $originalContentEl.data('targetId');\n var targetType = $originalContentEl.data('targetType');\n\n this.glForm = new GLForm($editForm.find('form'), this.enableGFM);\n\n $editForm\n .find('form')\n .attr('action', `${postUrl}?html=true`)\n .attr('data-remote', 'true');\n $editForm.find('.js-form-target-id').val(targetId);\n $editForm.find('.js-form-target-type').val(targetType);\n $editForm\n .find('.js-note-text')\n .focus()\n .val(originalContent);\n $editForm.find('.js-md-write-button').trigger('click');\n $editForm.find('.referenced-users').hide();\n }\n\n putConflictEditWarningInPlace(noteEntity, $note) {\n if ($note.find('.js-conflict-edit-warning').length === 0) {\n const $alert = $(`
\n This comment has changed since you started editing, please review the\n \n updated comment\n \n to ensure information is not lost\n
`);\n $alert.insertAfter($note.find('.note-text'));\n }\n }\n\n updateNotesCount(updateCount) {\n return this.notesCountBadge.text(\n parseInt(this.notesCountBadge.text(), 10) + updateCount,\n );\n }\n\n static renderPlaceholderComponent($container) {\n const el = $container.find('.js-code-placeholder').get(0);\n new Vue({\n // eslint-disable-line no-new\n el,\n components: {\n SkeletonLoadingContainer,\n },\n render(createElement) {\n return createElement('skeleton-loading-container');\n },\n });\n }\n\n static renderDiffContent($container, data) {\n const { discussion_html } = data;\n const lines = $(discussion_html).find('.line_holder');\n lines.addClass('fade-in');\n $container.find('.diff-content > table > tbody').prepend(lines);\n const fileHolder = $container.find('.file-holder');\n $container.find('.line-holder-placeholder').remove();\n syntaxHighlight(fileHolder);\n }\n\n onClickRetryLazyLoad(e) {\n const $retryButton = $(e.currentTarget);\n\n $retryButton.prop('disabled', true);\n\n return this.loadLazyDiff(e)\n .then(() => {\n $retryButton.prop('disabled', false);\n });\n }\n\n loadLazyDiff(e) {\n const $container = $(e.currentTarget).closest('.js-toggle-container');\n Notes.renderPlaceholderComponent($container);\n\n $container.find('.js-toggle-lazy-diff').removeClass('js-toggle-lazy-diff');\n\n const $tableEl = $container.find('tbody');\n if ($tableEl.length === 0) return;\n\n const fileHolder = $container.find('.file-holder');\n const url = fileHolder.data('linesPath');\n\n const $errorContainer = $container.find('.js-error-lazy-load-diff');\n const $successContainer = $container.find('.js-success-lazy-load');\n\n /**\n * We only fetch resolved discussions.\n * Unresolved discussions don't have an endpoint being provided.\n */\n if (url) {\n return axios\n .get(url)\n .then(({ data }) => {\n // Reset state in case last request returned error\n $successContainer.removeClass('hidden');\n $errorContainer.addClass('hidden');\n\n Notes.renderDiffContent($container, data);\n })\n .catch(() => {\n $successContainer.addClass('hidden');\n $errorContainer.removeClass('hidden');\n });\n }\n return Promise.resolve();\n }\n\n toggleCommitList(e) {\n const $element = $(e.currentTarget);\n const $closestSystemCommitList = $element.siblings(\n '.system-note-commit-list',\n );\n\n $element\n .find('.fa')\n .toggleClass('fa-angle-down')\n .toggleClass('fa-angle-up');\n $closestSystemCommitList.toggleClass('hide-shade');\n }\n\n /**\n * Scans system notes with `ul` elements in system note body\n * then collapse long commit list pushed by user to make it less\n * intrusive.\n */\n collapseLongCommitList() {\n const systemNotes = $('#notes-list')\n .find('li.system-note')\n .has('ul');\n\n $.each(systemNotes, function(index, systemNote) {\n const $systemNote = $(systemNote);\n const headerMessage = $systemNote\n .find('.note-text')\n .find('p:first')\n .text()\n .replace(':', '');\n\n $systemNote.find('.note-header .system-note-message').html(headerMessage);\n\n if ($systemNote.find('li').length > MAX_VISIBLE_COMMIT_LIST_COUNT) {\n $systemNote.find('.note-text').addClass('system-note-commit-list');\n $systemNote.find('.system-note-commit-list-toggler').show();\n } else {\n $systemNote\n .find('.note-text')\n .addClass('system-note-commit-list hide-shade');\n }\n });\n }\n\n addFlash(...flashParams) {\n this.flashContainer = new Flash(...flashParams);\n }\n\n clearFlash() {\n if (this.flashContainer) {\n this.flashContainer.style.display = 'none';\n this.flashContainer = null;\n }\n }\n\n cleanForm($form) {\n // Remove JS classes that are not needed here\n $form.find('.js-comment-type-dropdown').removeClass('btn-group');\n\n // Remove dropdown\n $form.find('.dropdown-menu').remove();\n\n return $form;\n }\n\n /**\n * Check if note does not exists on page\n */\n static isNewNote(noteEntity, noteIds) {\n return $.inArray(noteEntity.id, noteIds) === -1;\n }\n\n /**\n * Check if $note already contains the `noteEntity` content\n */\n static isUpdatedNote(noteEntity, $note) {\n // There can be CRLF vs LF mismatches if we don't sanitize and compare the same way\n const sanitizedNoteEntityText = normalizeNewlines(noteEntity.note.trim());\n const currentNoteText = normalizeNewlines(\n $note\n .find('.original-note-content')\n .first()\n .text()\n .trim(),\n );\n return sanitizedNoteEntityText !== currentNoteText;\n }\n\n static checkMergeRequestStatus() {\n if (getPagePath(1) === 'merge_requests' && gl.mrWidget) {\n gl.mrWidget.checkStatus();\n }\n }\n\n static animateAppendNote(noteHtml, $notesList) {\n const $note = $(noteHtml);\n\n $note.addClass('fade-in-full').renderGFM();\n $notesList.append($note);\n return $note;\n }\n\n static animateUpdateNote(noteHtml, $note) {\n const $updatedNote = $(noteHtml);\n\n $updatedNote.addClass('fade-in').renderGFM();\n $note.replaceWith($updatedNote);\n return $updatedNote;\n }\n\n static refreshVueNotes() {\n document.dispatchEvent(new CustomEvent('refreshVueNotes'));\n }\n\n /**\n * Get data from Form attributes to use for saving/submitting comment.\n */\n getFormData($form) {\n const content = $form.find('.js-note-text').val();\n return {\n formData: $form.serialize(),\n formContent: _.escape(content),\n formAction: $form.attr('action'),\n formContentOriginal: content,\n };\n }\n\n /**\n * Identify if comment has any quick actions\n */\n hasQuickActions(formContent) {\n return REGEX_QUICK_ACTIONS.test(formContent);\n }\n\n /**\n * Remove quick actions and leave comment with pure message\n */\n stripQuickActions(formContent) {\n return formContent.replace(REGEX_QUICK_ACTIONS, '').trim();\n }\n\n /**\n * Gets appropriate description from quick actions found in provided `formContent`\n */\n getQuickActionDescription(formContent, availableQuickActions = []) {\n let tempFormContent;\n\n // Identify executed quick actions from `formContent`\n const executedCommands = availableQuickActions.filter((command, index) => {\n const commandRegex = new RegExp(`/${command.name}`);\n return commandRegex.test(formContent);\n });\n\n if (executedCommands && executedCommands.length) {\n if (executedCommands.length > 1) {\n tempFormContent = 'Applying multiple commands';\n } else {\n const commandDescription = executedCommands[0].description.toLowerCase();\n tempFormContent = `Applying command to ${commandDescription}`;\n }\n } else {\n tempFormContent = 'Applying command';\n }\n\n return tempFormContent;\n }\n\n /**\n * Create placeholder note DOM element populated with comment body\n * that we will show while comment is being posted.\n * Once comment is _actually_ posted on server, we will have final element\n * in response that we will show in place of this temporary element.\n */\n createPlaceholderNote({\n formContent,\n uniqueId,\n isDiscussionNote,\n currentUsername,\n currentUserFullname,\n currentUserAvatar,\n }) {\n const discussionClass = isDiscussionNote ? 'discussion' : '';\n const $tempNote = $(\n `
  • \n
    \n
    \n \n \n \n
    \n \n
    \n
  • `,\n );\n\n $tempNote.find('.d-none.d-sm-inline-block').text(_.escape(currentUserFullname));\n $tempNote\n .find('.note-headline-light')\n .text(`@${_.escape(currentUsername)}`);\n\n return $tempNote;\n }\n\n /**\n * Create Placeholder System Note DOM element populated with quick action description\n */\n createPlaceholderSystemNote({ formContent, uniqueId }) {\n const $tempNote = $(\n `
  • \n
    \n
    \n ${formContent}\n
    \n
    \n
  • `,\n );\n\n return $tempNote;\n }\n\n /**\n * This method does following tasks step-by-step whenever a new comment\n * is submitted by user (both main thread comments as well as discussion comments).\n *\n * 1) Get Form metadata\n * 2) Identify comment type; a) Main thread b) Discussion thread c) Discussion resolve\n * 3) Build temporary placeholder element (using `createPlaceholderNote`)\n * 4) Show placeholder note on UI\n * 5) Perform network request to submit the note using `axios.post`\n * a) If request is successfully completed\n * 1. Remove placeholder element\n * 2. Show submitted Note element\n * 3. Perform post-submit errands\n * a. Mark discussion as resolved if comment submission was for resolve.\n * b. Reset comment form to original state.\n * b) If request failed\n * 1. Remove placeholder element\n * 2. Show error Flash message about failure\n */\n postComment(e) {\n e.preventDefault();\n\n // Get Form metadata\n const $submitBtn = $(e.target);\n $submitBtn.prop('disabled', true);\n let $form = $submitBtn.parents('form');\n const $closeBtn = $form.find('.js-note-target-close');\n const isDiscussionNote =\n $submitBtn\n .parent()\n .find('li.droplab-item-selected')\n .attr('id') === 'discussion';\n const isMainForm = $form.hasClass('js-main-target-form');\n const isDiscussionForm = $form.hasClass('js-discussion-note-form');\n const isDiscussionResolve = $submitBtn.hasClass(\n 'js-comment-resolve-button',\n );\n const {\n formData,\n formContent,\n formAction,\n formContentOriginal,\n } = this.getFormData($form);\n let noteUniqueId;\n let systemNoteUniqueId;\n let hasQuickActions = false;\n let $notesContainer;\n let tempFormContent;\n\n // Get reference to notes container based on type of comment\n if (isDiscussionForm) {\n $notesContainer = $form.parent('.discussion-notes').find('.notes');\n } else if (isMainForm) {\n $notesContainer = $('ul.main-notes-list');\n }\n\n // If comment is to resolve discussion, disable submit buttons while\n // comment posting is finished.\n if (isDiscussionResolve) {\n $form.find('.js-comment-submit-button').disable();\n }\n\n tempFormContent = formContent;\n if (this.hasQuickActions(formContent)) {\n tempFormContent = this.stripQuickActions(formContent);\n hasQuickActions = true;\n }\n\n // Show placeholder note\n if (tempFormContent) {\n noteUniqueId = _.uniqueId('tempNote_');\n $notesContainer.append(\n this.createPlaceholderNote({\n formContent: tempFormContent,\n uniqueId: noteUniqueId,\n isDiscussionNote,\n currentUsername: gon.current_username,\n currentUserFullname: gon.current_user_fullname,\n currentUserAvatar: gon.current_user_avatar_url,\n }),\n );\n }\n\n // Show placeholder system note\n if (hasQuickActions) {\n systemNoteUniqueId = _.uniqueId('tempSystemNote_');\n $notesContainer.append(\n this.createPlaceholderSystemNote({\n formContent: this.getQuickActionDescription(\n formContent,\n AjaxCache.get(gl.GfmAutoComplete.dataSources.commands),\n ),\n uniqueId: systemNoteUniqueId,\n }),\n );\n }\n\n // Clear the form textarea\n if ($notesContainer.length) {\n if (isMainForm) {\n this.resetMainTargetForm(e);\n } else if (isDiscussionForm) {\n this.removeDiscussionNoteForm($form);\n }\n }\n\n $closeBtn.text($closeBtn.data('originalText'));\n\n /* eslint-disable promise/catch-or-return */\n // Make request to submit comment on server\n return axios\n .post(`${formAction}?html=true`, formData)\n .then(res => {\n const note = res.data;\n\n $submitBtn.prop('disabled', false);\n // Submission successful! remove placeholder\n $notesContainer.find(`#${noteUniqueId}`).remove();\n\n const $diffFile = $form.closest('.diff-file');\n if ($diffFile.length > 0) {\n const blurEvent = new CustomEvent('blur.imageDiff', {\n detail: e,\n });\n\n $diffFile[0].dispatchEvent(blurEvent);\n }\n\n // Reset cached commands list when command is applied\n if (hasQuickActions) {\n $form\n .find('textarea.js-note-text')\n .trigger('clear-commands-cache.atwho');\n }\n\n // Clear previous form errors\n this.clearFlashWrapper();\n\n // Check if this was discussion comment\n if (isDiscussionForm) {\n // Remove flash-container\n $notesContainer.find('.flash-container').remove();\n\n // If comment intends to resolve discussion, do the same.\n if (isDiscussionResolve) {\n $form\n .attr('data-discussion-id', $submitBtn.data('discussionId'))\n .attr('data-resolve-all', 'true')\n .attr('data-project-path', $submitBtn.data('projectPath'));\n }\n\n // Show final note element on UI\n const isNewDiffComment = $notesContainer.length === 0;\n this.addDiscussionNote($form, note, isNewDiffComment);\n\n if (isNewDiffComment) {\n // Add image badge, avatar badge and toggle discussion badge for new image diffs\n const notePosition = $form.find('#note_position').val();\n if ($diffFile.length > 0 && notePosition.length > 0) {\n const { x, y, width, height } = JSON.parse(notePosition);\n const addBadgeEvent = new CustomEvent('addBadge.imageDiff', {\n detail: {\n x,\n y,\n width,\n height,\n noteId: `note_${note.id}`,\n discussionId: note.discussion_id,\n },\n });\n\n $diffFile[0].dispatchEvent(addBadgeEvent);\n }\n }\n\n // append flash-container to the Notes list\n if ($notesContainer.length) {\n $notesContainer.append(\n '
    ',\n );\n }\n\n Notes.refreshVueNotes();\n } else if (isMainForm) {\n // Check if this was main thread comment\n // Show final note element on UI and perform form and action buttons cleanup\n this.addNote($form, note);\n this.reenableTargetFormSubmitButton(e);\n }\n\n if (note.commands_changes) {\n this.handleQuickActions(note);\n }\n\n $form.trigger('ajax:success', [note]);\n })\n .catch(() => {\n // Submission failed, remove placeholder note and show Flash error message\n $notesContainer.find(`#${noteUniqueId}`).remove();\n $submitBtn.prop('disabled', false);\n const blurEvent = new CustomEvent('blur.imageDiff', {\n detail: e,\n });\n\n const closestDiffFile = $form.closest('.diff-file');\n\n if (closestDiffFile.length) {\n closestDiffFile[0].dispatchEvent(blurEvent);\n }\n\n if (hasQuickActions) {\n $notesContainer.find(`#${systemNoteUniqueId}`).remove();\n }\n\n // Show form again on UI on failure\n if (isDiscussionForm && $notesContainer.length) {\n const replyButton = $notesContainer\n .parent()\n .find('.js-discussion-reply-button');\n this.replyToDiscussionNote(replyButton[0]);\n $form = $notesContainer.parent().find('form');\n }\n\n $form.find('.js-note-text').val(formContentOriginal);\n this.reenableTargetFormSubmitButton(e);\n this.addNoteError($form);\n });\n }\n\n /**\n * This method does following tasks step-by-step whenever an existing comment\n * is updated by user (both main thread comments as well as discussion comments).\n *\n * 1) Get Form metadata\n * 2) Update note element with new content\n * 3) Perform network request to submit the updated note using `axios.post`\n * a) If request is successfully completed\n * 1. Show submitted Note element\n * b) If request failed\n * 1. Revert Note element to original content\n * 2. Show error Flash message about failure\n */\n updateComment(e) {\n e.preventDefault();\n\n // Get Form metadata\n const $submitBtn = $(e.target);\n const $form = $submitBtn.parents('form');\n const $closeBtn = $form.find('.js-note-target-close');\n const $editingNote = $form.parents('.note.is-editing');\n const $noteBody = $editingNote.find('.js-task-list-container');\n const $noteBodyText = $noteBody.find('.note-text');\n const { formData, formContent, formAction } = this.getFormData($form);\n const $diffFile = $form.closest('.diff-file');\n const $notesContainer = $form.closest('.notes');\n\n // Cache original comment content\n const cachedNoteBodyText = $noteBodyText.html();\n\n // Show updated comment content temporarily\n $noteBodyText.html(formContent);\n $editingNote\n .removeClass('is-editing fade-in-full')\n .addClass('being-posted fade-in-half');\n $editingNote\n .find('.note-headline-meta a')\n .html(\n '',\n );\n\n /* eslint-disable promise/catch-or-return */\n // Make request to update comment on server\n axios\n .post(`${formAction}?html=true`, formData)\n .then(({ data }) => {\n // Submission successful! render final note element\n this.updateNote(data, $editingNote);\n })\n .catch(() => {\n // Submission failed, revert back to original note\n $noteBodyText.html(_.escape(cachedNoteBodyText));\n $editingNote.removeClass('being-posted fade-in');\n $editingNote.find('.fa.fa-spinner').remove();\n\n // Show Flash message about failure\n this.updateNoteError();\n });\n\n return $closeBtn.text($closeBtn.data('originalText'));\n }\n}\n\nwindow.Notes = Notes;\n","import $ from 'jquery';\nimport Flash from '../../flash';\nimport { handleLocationHash } from '../../lib/utils/common_utils';\nimport axios from '../../lib/utils/axios_utils';\n\nexport default class BlobViewer {\n constructor() {\n BlobViewer.initAuxiliaryViewer();\n BlobViewer.initRichViewer();\n\n this.initMainViewers();\n }\n\n static initAuxiliaryViewer() {\n const auxiliaryViewer = document.querySelector('.blob-viewer[data-type=\"auxiliary\"]');\n if (!auxiliaryViewer) return;\n\n BlobViewer.loadViewer(auxiliaryViewer);\n }\n\n static initRichViewer() {\n const viewer = document.querySelector('.blob-viewer[data-type=\"rich\"]');\n if (!viewer || !viewer.dataset.richType) return;\n\n const initViewer = promise => promise\n .then(module => module.default(viewer))\n .catch((error) => {\n Flash('Error loading file viewer.');\n throw error;\n });\n\n switch (viewer.dataset.richType) {\n case 'balsamiq':\n initViewer(import(/* webpackChunkName: 'balsamiq_viewer' */ '../balsamiq_viewer'));\n break;\n case 'notebook':\n initViewer(import(/* webpackChunkName: 'notebook_viewer' */ '../notebook_viewer'));\n break;\n case 'pdf':\n initViewer(import(/* webpackChunkName: 'pdf_viewer' */ '../pdf_viewer'));\n break;\n case 'sketch':\n initViewer(import(/* webpackChunkName: 'sketch_viewer' */ '../sketch_viewer'));\n break;\n case 'stl':\n initViewer(import(/* webpackChunkName: 'stl_viewer' */ '../stl_viewer'));\n break;\n default:\n break;\n }\n }\n\n initMainViewers() {\n this.$fileHolder = $('.file-holder');\n if (!this.$fileHolder.length) return;\n\n this.switcher = document.querySelector('.js-blob-viewer-switcher');\n this.switcherBtns = document.querySelectorAll('.js-blob-viewer-switch-btn');\n this.copySourceBtn = document.querySelector('.js-copy-blob-source-btn');\n\n this.simpleViewer = this.$fileHolder[0].querySelector('.blob-viewer[data-type=\"simple\"]');\n this.richViewer = this.$fileHolder[0].querySelector('.blob-viewer[data-type=\"rich\"]');\n\n this.initBindings();\n\n this.switchToInitialViewer();\n }\n\n switchToInitialViewer() {\n const initialViewer = this.$fileHolder[0].querySelector('.blob-viewer:not(.hidden)');\n let initialViewerName = initialViewer.getAttribute('data-type');\n\n if (this.switcher && location.hash.indexOf('#L') === 0) {\n initialViewerName = 'simple';\n }\n\n this.switchToViewer(initialViewerName);\n }\n\n initBindings() {\n if (this.switcherBtns.length) {\n Array.from(this.switcherBtns)\n .forEach((el) => {\n el.addEventListener('click', this.switchViewHandler.bind(this));\n });\n }\n\n if (this.copySourceBtn) {\n this.copySourceBtn.addEventListener('click', () => {\n if (this.copySourceBtn.classList.contains('disabled')) return this.copySourceBtn.blur();\n\n return this.switchToViewer('simple');\n });\n }\n }\n\n switchViewHandler(e) {\n const target = e.currentTarget;\n\n e.preventDefault();\n\n this.switchToViewer(target.getAttribute('data-viewer'));\n }\n\n toggleCopyButtonState() {\n if (!this.copySourceBtn) return;\n\n if (this.simpleViewer.getAttribute('data-loaded')) {\n this.copySourceBtn.setAttribute('title', '复制源码到剪贴板');\n this.copySourceBtn.classList.remove('disabled');\n } else if (this.activeViewer === this.simpleViewer) {\n this.copySourceBtn.setAttribute('title', '等待源码加载以将其复制到剪贴板');\n this.copySourceBtn.classList.add('disabled');\n } else {\n this.copySourceBtn.setAttribute('title', '切换到源码以将其复制到剪贴板');\n this.copySourceBtn.classList.add('disabled');\n }\n\n $(this.copySourceBtn).tooltip('_fixTitle');\n }\n\n switchToViewer(name) {\n const newViewer = this.$fileHolder[0].querySelector(`.blob-viewer[data-type='${name}']`);\n if (this.activeViewer === newViewer) return;\n\n const oldButton = document.querySelector('.js-blob-viewer-switch-btn.active');\n const newButton = document.querySelector(`.js-blob-viewer-switch-btn[data-viewer='${name}']`);\n const oldViewer = this.$fileHolder[0].querySelector(`.blob-viewer:not([data-type='${name}'])`);\n\n if (oldButton) {\n oldButton.classList.remove('active');\n }\n\n if (newButton) {\n newButton.classList.add('active');\n newButton.blur();\n }\n\n if (oldViewer) {\n oldViewer.classList.add('hidden');\n }\n\n newViewer.classList.remove('hidden');\n\n this.activeViewer = newViewer;\n\n this.toggleCopyButtonState();\n\n BlobViewer.loadViewer(newViewer)\n .then((viewer) => {\n $(viewer).renderGFM();\n\n this.$fileHolder.trigger('highlight:line');\n handleLocationHash();\n\n this.toggleCopyButtonState();\n })\n .catch(() => new Flash('Error loading viewer'));\n }\n\n static loadViewer(viewerParam) {\n const viewer = viewerParam;\n const url = viewer.getAttribute('data-url');\n\n if (!url || viewer.getAttribute('data-loaded') || viewer.getAttribute('data-loading')) {\n return Promise.resolve(viewer);\n }\n\n viewer.setAttribute('data-loading', 'true');\n\n return axios.get(url)\n .then(({ data }) => {\n viewer.innerHTML = data.html;\n viewer.setAttribute('data-loaded', 'true');\n\n return viewer;\n });\n }\n}\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TaskList\"] = factory();\n\telse\n\t\troot[\"TaskList\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nvar NodeArray, TaskList, closest, createEvent,\n indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\nNodeArray = function(nodeList) {\n return Array.prototype.slice.apply(nodeList);\n};\n\nclosest = function(el, className) {\n while (el && !el.classList.contains(className)) {\n el = el.parentNode;\n }\n return el;\n};\n\ncreateEvent = function(eventName, detail) {\n var event;\n if (typeof Event === 'function') {\n event = new Event(eventName, {\n bubbles: true,\n cancelable: true\n });\n event.detail = detail;\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(eventName, true, true, detail);\n }\n return event;\n};\n\nTaskList = (function() {\n function TaskList(el1) {\n this.el = el1;\n this.container = closest(this.el, 'js-task-list-container');\n this.field = this.container.querySelector('.js-task-list-field');\n this.container.addEventListener('change', (function(_this) {\n return function(event) {\n if (event.target.classList.contains('task-list-item-checkbox')) {\n return _this.updateTaskList(event.target);\n }\n };\n })(this));\n this.enable();\n }\n\n TaskList.prototype.enable = function() {\n var event;\n if (this.container.querySelectorAll('.js-task-list-field').length > 0) {\n NodeArray(this.container.querySelectorAll('.task-list-item')).forEach(function(item) {\n return item.classList.add('enabled');\n });\n NodeArray(this.container.querySelectorAll('.task-list-item-checkbox')).forEach(function(checkbox) {\n return checkbox.disabled = false;\n });\n this.container.classList.add('is-task-list-enabled');\n event = createEvent('tasklist:enabled');\n return this.container.dispatchEvent(event);\n }\n };\n\n TaskList.prototype.disable = function() {\n var event;\n NodeArray(this.container.querySelectorAll('.task-list-item')).forEach(function(item) {\n return item.classList.remove('enabled');\n });\n NodeArray(this.container.querySelectorAll('.task-list-item-checkbox')).forEach(function(checkbox) {\n return checkbox.disabled = true;\n });\n this.container.classList.remove('is-task-list-enabled');\n event = createEvent('tasklist:disabled');\n return this.container.dispatchEvent(event);\n };\n\n TaskList.prototype.updateTaskList = function(item) {\n var changeEvent, changedEvent, checkboxes, index;\n checkboxes = this.container.querySelectorAll('.task-list-item-checkbox');\n index = 1 + NodeArray(checkboxes).indexOf(item);\n changeEvent = createEvent('tasklist:change', {\n index: index,\n checked: item.checked\n });\n this.field.dispatchEvent(changeEvent);\n if (!changeEvent.defaultPrevented) {\n this.field.value = TaskList.updateSource(this.field.value, index, item.checked);\n changeEvent = createEvent('change');\n this.field.dispatchEvent(changeEvent);\n changedEvent = createEvent('tasklist:changed', {\n index: index,\n checked: item.checked\n });\n return this.field.dispatchEvent(changedEvent);\n }\n };\n\n TaskList.incomplete = \"[ ]\";\n\n TaskList.complete = \"[x]\";\n\n TaskList.escapePattern = function(str) {\n return str.replace(/([\\[\\]])/g, \"\\\\$1\").replace(/\\s/, \"\\\\s\").replace(\"x\", \"[xX]\");\n };\n\n TaskList.incompletePattern = RegExp(\"\" + (TaskList.escapePattern(TaskList.incomplete)));\n\n TaskList.completePattern = RegExp(\"\" + (TaskList.escapePattern(TaskList.complete)));\n\n TaskList.itemPattern = RegExp(\"^(?:\\\\s*(?:>\\\\s*)*(?:[-+*]|(?:\\\\d+\\\\.)))\\\\s*(\" + (TaskList.escapePattern(TaskList.complete)) + \"|\" + (TaskList.escapePattern(TaskList.incomplete)) + \")\\\\s+(?!\\\\(.*?\\\\))(?=(?:\\\\[.*?\\\\]\\\\s*(?:\\\\[.*?\\\\]|\\\\(.*?\\\\))\\\\s*)*(?:[^\\\\[]|$))\");\n\n TaskList.startFencesPattern = /^`{3}.*$/;\n\n TaskList.endFencesPattern = /^`{3}$/;\n\n TaskList.itemsInParasPattern = RegExp(\"^(\" + (TaskList.escapePattern(TaskList.complete)) + \"|\" + (TaskList.escapePattern(TaskList.incomplete)) + \").+$\", \"g\");\n\n TaskList.updateSource = function(source, itemIndex, checked) {\n var clean, inCodeBlock, index, line, result;\n clean = source.replace(/\\r/g, '').replace(this.itemsInParasPattern, '').split(\"\\n\");\n index = 0;\n inCodeBlock = false;\n result = (function() {\n var i, len, ref, results;\n ref = source.split(\"\\n\");\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n line = ref[i];\n if (inCodeBlock) {\n if (line.match(this.endFencesPattern)) {\n inCodeBlock = false;\n }\n } else if (line.match(this.startFencesPattern)) {\n inCodeBlock = true;\n } else if (indexOf.call(clean, line) >= 0 && line.match(this.itemPattern)) {\n index += 1;\n if (index === itemIndex) {\n line = checked ? line.replace(this.incompletePattern, this.complete) : line.replace(this.completePattern, this.incomplete);\n }\n }\n results.push(line);\n }\n return results;\n }).call(this);\n return result.join(\"\\n\");\n };\n\n return TaskList;\n\n})();\n\nif (typeof jQuery !== 'undefined') {\n jQuery.fn.taskList = function(method) {\n return this.each(function(index, el) {\n var taskList;\n taskList = jQuery(el).data('task-list');\n if (!taskList) {\n taskList = new TaskList(el);\n jQuery(el).data('task-list', taskList);\n if (!method || method === 'enable') {\n return;\n }\n }\n return taskList[method || 'enable']();\n });\n };\n}\n\nmodule.exports = TaskList;\n\n\n/***/ })\n/******/ ]);\n});","import Notes from './notes';\n\nexport default () => {\n const dataEl = document.querySelector('.js-notes-data');\n const {\n notesUrl,\n notesIds,\n now,\n diffView,\n autocomplete,\n } = JSON.parse(dataEl.innerHTML);\n\n // Create a singleton so that we don't need to assign\n // into the window object, we can just access the current isntance with Notes.instance\n Notes.initialize(notesUrl, notesIds, now, diffView, autocomplete);\n};\n","/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-underscore-dangle, no-param-reassign, prefer-template, quotes, comma-dangle, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, no-else-return, max-len */\n\nimport $ from 'jquery';\n\n// LineHighlighter\n//\n// Handles single- and multi-line selection and highlight for blob views.\n//\n//\n// ### Example Markup\n//\n//
    \n//
    \n//
    \n// 1\n// 2\n// 3\n// 4\n// 5\n//
    \n//
    \n//         \n//           ...\n//           ...\n//           ...\n//           ...\n//           ...\n//         \n//       
    \n//
    \n//
    \n//\n\nconst LineHighlighter = function(options = {}) {\n options.highlightLineClass = options.highlightLineClass || 'hll';\n options.fileHolderSelector = options.fileHolderSelector || '.file-holder';\n options.scrollFileHolder = options.scrollFileHolder || false;\n options.hash = options.hash || location.hash;\n\n this.options = options;\n this._hash = options.hash;\n this.highlightLineClass = options.highlightLineClass;\n this.setHash = this.setHash.bind(this);\n this.highlightLine = this.highlightLine.bind(this);\n this.clickHandler = this.clickHandler.bind(this);\n this.highlightHash = this.highlightHash.bind(this);\n\n this.bindEvents();\n this.highlightHash();\n};\n\nLineHighlighter.prototype.bindEvents = function() {\n const $fileHolder = $(this.options.fileHolderSelector);\n\n $fileHolder.on('click', 'a[data-line-number]', this.clickHandler);\n $fileHolder.on('highlight:line', this.highlightHash);\n};\n\nLineHighlighter.prototype.highlightHash = function(newHash) {\n let range;\n if (newHash && typeof newHash === 'string') this._hash = newHash;\n\n this.clearHighlight();\n\n if (this._hash !== '') {\n range = this.hashToRange(this._hash);\n if (range[0]) {\n this.highlightRange(range);\n const lineSelector = `#L${range[0]}`;\n const scrollOptions = {\n // Scroll to the first highlighted line on initial load\n // Offset -50 for the sticky top bar, and another -100 for some context\n offset: -150\n };\n if (this.options.scrollFileHolder) {\n $(this.options.fileHolderSelector).scrollTo(lineSelector, scrollOptions);\n } else {\n $.scrollTo(lineSelector, scrollOptions);\n }\n }\n }\n};\n\nLineHighlighter.prototype.clickHandler = function(event) {\n var current, lineNumber, range;\n event.preventDefault();\n this.clearHighlight();\n lineNumber = $(event.target).closest('a').data('lineNumber');\n current = this.hashToRange(this._hash);\n if (!(current[0] && event.shiftKey)) {\n // If there's no current selection, or there is but Shift wasn't held,\n // treat this like a single-line selection.\n this.setHash(lineNumber);\n return this.highlightLine(lineNumber);\n } else if (event.shiftKey) {\n if (lineNumber < current[0]) {\n range = [lineNumber, current[0]];\n } else {\n range = [current[0], lineNumber];\n }\n this.setHash(range[0], range[1]);\n return this.highlightRange(range);\n }\n};\n\nLineHighlighter.prototype.clearHighlight = function() {\n return $(\".\" + this.highlightLineClass).removeClass(this.highlightLineClass);\n};\n\n// Convert a URL hash String into line numbers\n//\n// hash - Hash String\n//\n// Examples:\n//\n// hashToRange('#L5') # => [5, null]\n// hashToRange('#L5-15') # => [5, 15]\n// hashToRange('#foo') # => [null, null]\n//\n// Returns an Array\nLineHighlighter.prototype.hashToRange = function(hash) {\n var first, last, matches;\n // ?L(\\d+)(?:-(\\d+))?$/)\n matches = hash.match(/^#?L(\\d+)(?:-(\\d+))?$/);\n if (matches && matches.length) {\n first = parseInt(matches[1], 10);\n last = matches[2] ? parseInt(matches[2], 10) : null;\n return [first, last];\n } else {\n return [null, null];\n }\n};\n\n// Highlight a single line\n//\n// lineNumber - Line number to highlight\nLineHighlighter.prototype.highlightLine = function(lineNumber) {\n return $(\"#LC\" + lineNumber).addClass(this.highlightLineClass);\n};\n\n// Highlight all lines within a range\n//\n// range - Array containing the starting and ending line numbers\nLineHighlighter.prototype.highlightRange = function(range) {\n var i, lineNumber, ref, ref1, results;\n if (range[1]) {\n results = [];\n for (lineNumber = i = ref = range[0], ref1 = range[1]; ref <= ref1 ? i <= ref1 : i >= ref1; lineNumber = ref <= ref1 ? (i += 1) : (i -= 1)) {\n results.push(this.highlightLine(lineNumber));\n }\n return results;\n } else {\n return this.highlightLine(range[0]);\n }\n};\n\n// Set the URL hash string\nLineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) {\n var hash;\n if (lastLineNumber) {\n hash = \"#L\" + firstLineNumber + \"-\" + lastLineNumber;\n } else {\n hash = \"#L\" + firstLineNumber;\n }\n this._hash = hash;\n return this.__setLocationHash__(hash);\n};\n\n// Make the actual hash change in the browser\n//\n// This method is stubbed in tests.\nLineHighlighter.prototype.__setLocationHash__ = function(value) {\n return history.pushState({\n url: value\n // We're using pushState instead of assigning location.hash directly to\n // prevent the page from scrolling on the hashchange event\n }, document.title, value);\n};\n\nexport default LineHighlighter;\n","export default () => {\n const { protocol, host, pathname } = location;\n const shareBtn = document.querySelector('.js-share-btn');\n const embedBtn = document.querySelector('.js-embed-btn');\n const snippetUrlArea = document.querySelector('.js-snippet-url-area');\n const embedAction = document.querySelector('.js-embed-action');\n const url = `${protocol}//${host + pathname}`;\n\n shareBtn.addEventListener('click', () => {\n shareBtn.classList.add('is-active');\n embedBtn.classList.remove('is-active');\n snippetUrlArea.value = url;\n embedAction.innerText = 'Share';\n });\n\n embedBtn.addEventListener('click', () => {\n embedBtn.classList.add('is-active');\n shareBtn.classList.remove('is-active');\n const scriptTag = ``;\n snippetUrlArea.value = scriptTag;\n embedAction.innerText = 'Embed';\n });\n};\n","import $ from 'jquery';\nimport Dropzone from 'dropzone';\nimport _ from 'underscore';\nimport './preview_markdown';\nimport csrf from './lib/utils/csrf';\nimport axios from './lib/utils/axios_utils';\n\nDropzone.autoDiscover = false;\n\nexport default function dropzoneInput(form) {\n const divHover = '
    ';\n const iconPaperclip = '';\n const $attachButton = form.find('.button-attach-file');\n const $attachingFileMessage = form.find('.attaching-file-message');\n const $cancelButton = form.find('.button-cancel-uploading-files');\n const $retryLink = form.find('.retry-uploading-link');\n const $uploadProgress = form.find('.uploading-progress');\n const $uploadingErrorContainer = form.find('.uploading-error-container');\n const $uploadingErrorMessage = form.find('.uploading-error-message');\n const $uploadingProgressContainer = form.find('.uploading-progress-container');\n const uploadsPath = window.uploads_path || null;\n const maxFileSize = gon.max_file_size || 10;\n const formTextarea = form.find('.js-gfm-input');\n let handlePaste;\n let pasteText;\n let addFileToForm;\n let updateAttachingMessage;\n let isImage;\n let getFilename;\n let uploadFile;\n\n formTextarea.wrap('
    ');\n formTextarea.on('paste', event => handlePaste(event));\n\n // Add dropzone area to the form.\n const $mdArea = formTextarea.closest('.md-area');\n form.setupMarkdownPreview();\n const $formDropzone = form.find('.div-dropzone');\n $formDropzone.parent().addClass('div-dropzone-wrapper');\n $formDropzone.append(divHover);\n $formDropzone.find('.div-dropzone-hover').append(iconPaperclip);\n\n if (!uploadsPath) {\n $formDropzone.addClass('js-invalid-dropzone');\n return;\n }\n\n const dropzone = $formDropzone.dropzone({\n url: uploadsPath,\n dictDefaultMessage: '',\n clickable: true,\n paramName: 'file',\n maxFilesize: maxFileSize,\n uploadMultiple: false,\n headers: csrf.headers,\n previewContainer: false,\n processing: () => $('.div-dropzone-alert').alert('close'),\n dragover: () => {\n $mdArea.addClass('is-dropzone-hover');\n form.find('.div-dropzone-hover').css('opacity', 0.7);\n },\n dragleave: () => {\n $mdArea.removeClass('is-dropzone-hover');\n form.find('.div-dropzone-hover').css('opacity', 0);\n },\n drop: () => {\n $mdArea.removeClass('is-dropzone-hover');\n form.find('.div-dropzone-hover').css('opacity', 0);\n formTextarea.focus();\n },\n success(header, response) {\n const processingFileCount = this.getQueuedFiles().length + this.getUploadingFiles().length;\n const shouldPad = processingFileCount >= 1;\n\n pasteText(response.link.markdown, shouldPad);\n // Show 'Attach a file' link only when all files have been uploaded.\n if (!processingFileCount) $attachButton.removeClass('hide');\n addFileToForm(response.link.url);\n },\n error: (file, errorMessage = 'Attaching the file failed.', xhr) => {\n // If 'error' event is fired by dropzone, the second parameter is error message.\n // If the 'errorMessage' parameter is empty, the default error message is set.\n // If the 'error' event is fired by backend (xhr) error response, the third parameter is\n // xhr object (xhr.responseText is error message).\n // On error we hide the 'Attach' and 'Cancel' buttons\n // and show an error.\n\n // If there's xhr error message, let's show it instead of dropzone's one.\n const message = xhr ? xhr.responseText : errorMessage;\n\n $uploadingErrorContainer.removeClass('hide');\n $uploadingErrorMessage.html(message);\n $attachButton.addClass('hide');\n $cancelButton.addClass('hide');\n },\n totaluploadprogress(totalUploadProgress) {\n updateAttachingMessage(this.files, $attachingFileMessage);\n $uploadProgress.text(`${Math.round(totalUploadProgress)}%`);\n },\n sending: () => {\n // DOM elements already exist.\n // Instead of dynamically generating them,\n // we just either hide or show them.\n $attachButton.addClass('hide');\n $uploadingErrorContainer.addClass('hide');\n $uploadingProgressContainer.removeClass('hide');\n $cancelButton.removeClass('hide');\n },\n removedfile: () => {\n $attachButton.removeClass('hide');\n $cancelButton.addClass('hide');\n $uploadingProgressContainer.addClass('hide');\n $uploadingErrorContainer.addClass('hide');\n },\n queuecomplete: () => {\n $('.dz-preview').remove();\n $('.markdown-area').trigger('input');\n\n $uploadingProgressContainer.addClass('hide');\n $cancelButton.addClass('hide');\n },\n });\n\n const child = $(dropzone[0]).children('textarea');\n\n // removeAllFiles(true) stops uploading files (if any)\n // and remove them from dropzone files queue.\n $cancelButton.on('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n Dropzone.forElement($formDropzone.get(0)).removeAllFiles(true);\n });\n\n // If 'error' event is fired, we store a failed files,\n // clear dropzone files queue, change status of failed files to undefined,\n // and add that files to the dropzone files queue again.\n // addFile() adds file to dropzone files queue and upload it.\n $retryLink.on('click', (e) => {\n const dropzoneInstance = Dropzone.forElement(e.target.closest('.js-main-target-form').querySelector('.div-dropzone'));\n const failedFiles = dropzoneInstance.files;\n\n e.preventDefault();\n\n // 'true' parameter of removeAllFiles() cancels\n // uploading of files that are being uploaded at the moment.\n dropzoneInstance.removeAllFiles(true);\n\n failedFiles.map((failedFile) => {\n const file = failedFile;\n\n if (file.status === Dropzone.ERROR) {\n file.status = undefined;\n file.accepted = undefined;\n }\n\n return dropzoneInstance.addFile(file);\n });\n });\n // eslint-disable-next-line consistent-return\n handlePaste = (event) => {\n const pasteEvent = event.originalEvent;\n if (pasteEvent.clipboardData && pasteEvent.clipboardData.items) {\n const image = isImage(pasteEvent);\n if (image) {\n event.preventDefault();\n const filename = getFilename(pasteEvent) || 'image.png';\n const text = `{{${filename}}}`;\n pasteText(text);\n return uploadFile(image.getAsFile(), filename);\n }\n }\n };\n\n isImage = (data) => {\n let i = 0;\n while (i < data.clipboardData.items.length) {\n const item = data.clipboardData.items[i];\n if (item.type.indexOf('image') !== -1) {\n return item;\n }\n i += 1;\n }\n return false;\n };\n\n pasteText = (text, shouldPad) => {\n let formattedText = text;\n if (shouldPad) {\n formattedText += '\\n\\n';\n }\n const textarea = child.get(0);\n const caretStart = textarea.selectionStart;\n const caretEnd = textarea.selectionEnd;\n const textEnd = $(child).val().length;\n const beforeSelection = $(child).val().substring(0, caretStart);\n const afterSelection = $(child).val().substring(caretEnd, textEnd);\n $(child).val(beforeSelection + formattedText + afterSelection);\n textarea.setSelectionRange(caretStart + formattedText.length, caretEnd + formattedText.length);\n textarea.style.height = `${textarea.scrollHeight}px`;\n formTextarea.get(0).dispatchEvent(new Event('input'));\n return formTextarea.trigger('input');\n };\n\n addFileToForm = (path) => {\n $(form).append(``);\n };\n\n getFilename = (e) => {\n let value;\n if (window.clipboardData && window.clipboardData.getData) {\n value = window.clipboardData.getData('Text');\n } else if (e.clipboardData && e.clipboardData.getData) {\n value = e.clipboardData.getData('text/plain');\n }\n value = value.split('\\r');\n return value[0];\n };\n\n const showSpinner = () => $uploadingProgressContainer.removeClass('hide');\n\n const closeSpinner = () => $uploadingProgressContainer.addClass('hide');\n\n const showError = (message) => {\n $uploadingErrorContainer.removeClass('hide');\n $uploadingErrorMessage.html(message);\n };\n\n const closeAlertMessage = () => form.find('.div-dropzone-alert').alert('close');\n\n const insertToTextArea = (filename, url) => {\n const $child = $(child);\n $child.val((index, val) => val.replace(`{{${filename}}}`, url));\n\n $child.trigger('change');\n };\n\n uploadFile = (item, filename) => {\n const formData = new FormData();\n formData.append('file', item, filename);\n\n showSpinner();\n closeAlertMessage();\n\n axios.post(uploadsPath, formData)\n .then(({ data }) => {\n const md = data.link.markdown;\n\n insertToTextArea(filename, md);\n closeSpinner();\n })\n .catch((e) => {\n showError(e.response.data.message);\n closeSpinner();\n });\n };\n\n updateAttachingMessage = (files, messageContainer) => {\n let attachingMessage;\n const filesCount = files.filter(file => file.status === 'uploading' || file.status === 'queued').length;\n\n // Dinamycally change uploading files text depending on files number in\n // dropzone files queue.\n if (filesCount > 1) {\n attachingMessage = `Attaching ${filesCount} files -`;\n } else {\n attachingMessage = 'Attaching a file -';\n }\n\n messageContainer.text(attachingMessage);\n };\n\n form.find('.markdown-selector').click(function onMarkdownClick(e) {\n e.preventDefault();\n $(this).closest('.gfm-form').find('.div-dropzone').click();\n formTextarea.focus();\n });\n}\n","/* eslint-disable import/prefer-default-export, func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len, vars-on-top */\nimport $ from 'jquery';\nimport { insertText } from '~/lib/utils/common_utils';\n\nfunction selectedText(text, textarea) {\n return text.substring(textarea.selectionStart, textarea.selectionEnd);\n}\n\nfunction lineBefore(text, textarea) {\n var split;\n split = text.substring(0, textarea.selectionStart).trim().split('\\n');\n return split[split.length - 1];\n}\n\nfunction lineAfter(text, textarea) {\n return text.substring(textarea.selectionEnd).trim().split('\\n')[0];\n}\n\nfunction blockTagText(text, textArea, blockTag, selected) {\n const before = lineBefore(text, textArea);\n const after = lineAfter(text, textArea);\n if (before === blockTag && after === blockTag) {\n // To remove the block tag we have to select the line before & after\n if (blockTag != null) {\n textArea.selectionStart = textArea.selectionStart - (blockTag.length + 1);\n textArea.selectionEnd = textArea.selectionEnd + (blockTag.length + 1);\n }\n return selected;\n } else {\n return blockTag + \"\\n\" + selected + \"\\n\" + blockTag;\n }\n}\n\nfunction moveCursor(textArea, tag, wrapped, removedLastNewLine) {\n var pos;\n if (!textArea.setSelectionRange) {\n return;\n }\n if (textArea.selectionStart === textArea.selectionEnd) {\n if (wrapped) {\n pos = textArea.selectionStart - tag.length;\n } else {\n pos = textArea.selectionStart;\n }\n\n if (removedLastNewLine) {\n pos -= 1;\n }\n\n return textArea.setSelectionRange(pos, pos);\n }\n}\n\nexport function insertMarkdownText(textArea, text, tag, blockTag, selected, wrap) {\n var textToInsert, inserted, selectedSplit, startChar, removedLastNewLine, removedFirstNewLine, currentLineEmpty, lastNewLine;\n removedLastNewLine = false;\n removedFirstNewLine = false;\n currentLineEmpty = false;\n\n // Remove the first newline\n if (selected.indexOf('\\n') === 0) {\n removedFirstNewLine = true;\n selected = selected.replace(/\\n+/, '');\n }\n\n // Remove the last newline\n if (textArea.selectionEnd - textArea.selectionStart > selected.replace(/\\n$/, '').length) {\n removedLastNewLine = true;\n selected = selected.replace(/\\n$/, '');\n }\n\n selectedSplit = selected.split('\\n');\n\n if (!wrap) {\n lastNewLine = textArea.value.substr(0, textArea.selectionStart).lastIndexOf('\\n');\n\n // Check whether the current line is empty or consists only of spaces(=handle as empty)\n if (/^\\s*$/.test(textArea.value.substring(lastNewLine, textArea.selectionStart))) {\n currentLineEmpty = true;\n }\n }\n\n startChar = !wrap && !currentLineEmpty && textArea.selectionStart > 0 ? '\\n' : '';\n\n if (selectedSplit.length > 1 && (!wrap || (blockTag != null && blockTag !== ''))) {\n if (blockTag != null && blockTag !== '') {\n textToInsert = blockTagText(text, textArea, blockTag, selected);\n } else {\n textToInsert = selectedSplit.map(function(val) {\n if (val.indexOf(tag) === 0) {\n return \"\" + (val.replace(tag, ''));\n } else {\n return \"\" + tag + val;\n }\n }).join('\\n');\n }\n } else {\n textToInsert = \"\" + startChar + tag + selected + (wrap ? tag : ' ');\n }\n\n if (removedFirstNewLine) {\n textToInsert = '\\n' + textToInsert;\n }\n\n if (removedLastNewLine) {\n textToInsert += '\\n';\n }\n\n insertText(textArea, textToInsert);\n return moveCursor(textArea, tag, wrap, removedLastNewLine);\n}\n\nfunction updateText(textArea, tag, blockTag, wrap) {\n var $textArea, selected, text;\n $textArea = $(textArea);\n textArea = $textArea.get(0);\n text = $textArea.val();\n selected = selectedText(text, textArea);\n $textArea.focus();\n return insertMarkdownText(textArea, text, tag, blockTag, selected, wrap);\n}\n\nfunction replaceRange(s, start, end, substitute) {\n return s.substring(0, start) + substitute + s.substring(end);\n}\n\nexport function addMarkdownListeners(form) {\n return $('.js-md', form).off('click').on('click', function() {\n const $this = $(this);\n return updateText($this.closest('.md-area').find('textarea'), $this.data('mdTag'), $this.data('mdBlock'), !$this.data('mdPrepend'));\n });\n}\n\nexport function removeMarkdownListeners(form) {\n return $('.js-md', form).off('click');\n}\n","import $ from 'jquery';\nimport autosize from 'autosize';\nimport GfmAutoComplete from './gfm_auto_complete';\nimport dropzoneInput from './dropzone_input';\nimport { addMarkdownListeners, removeMarkdownListeners } from './lib/utils/text_markdown';\n\nexport default class GLForm {\n constructor(form, enableGFM = false) {\n this.form = form;\n this.textarea = this.form.find('textarea.js-gfm-input');\n this.enableGFM = enableGFM;\n // Before we start, we should clean up any previous data for this form\n this.destroy();\n // Setup the form\n this.setupForm();\n this.form.data('glForm', this);\n }\n\n destroy() {\n // Clean form listeners\n this.clearEventListeners();\n if (this.autoComplete) {\n this.autoComplete.destroy();\n }\n this.form.data('glForm', null);\n }\n\n setupForm() {\n const isNewForm = this.form.is(':not(.gfm-form)');\n this.form.removeClass('js-new-note-form');\n if (isNewForm) {\n this.form.find('.div-dropzone').remove();\n this.form.addClass('gfm-form');\n // remove notify commit author checkbox for non-commit notes\n gl.utils.disableButtonIfEmptyField(this.form.find('.js-note-text'), this.form.find('.js-comment-button, .js-note-new-discussion'));\n this.autoComplete = new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources);\n this.autoComplete.setup(this.form.find('.js-gfm-input'), {\n emojis: true,\n members: this.enableGFM,\n issues: this.enableGFM,\n milestones: this.enableGFM,\n mergeRequests: this.enableGFM,\n labels: this.enableGFM,\n });\n dropzoneInput(this.form);\n autosize(this.textarea);\n }\n // form and textarea event listeners\n this.addEventListeners();\n addMarkdownListeners(this.form);\n // hide discard button\n this.form.find('.js-note-discard').hide();\n this.form.show();\n if (this.isAutosizeable) this.setupAutosize();\n }\n\n setupAutosize() {\n this.textarea.off('autosize:resized')\n .on('autosize:resized', this.setHeightData.bind(this));\n\n this.textarea.off('mouseup.autosize')\n .on('mouseup.autosize', this.destroyAutosize.bind(this));\n\n setTimeout(() => {\n autosize(this.textarea);\n this.textarea.css('resize', 'vertical');\n }, 0);\n }\n\n setHeightData() {\n this.textarea.data('height', this.textarea.outerHeight());\n }\n\n destroyAutosize() {\n const outerHeight = this.textarea.outerHeight();\n\n if (this.textarea.data('height') === outerHeight) return;\n\n autosize.destroy(this.textarea);\n\n this.textarea.data('height', outerHeight);\n this.textarea.outerHeight(outerHeight);\n this.textarea.css('max-height', window.outerHeight);\n }\n\n clearEventListeners() {\n this.textarea.off('focus');\n this.textarea.off('blur');\n removeMarkdownListeners(this.form);\n }\n\n addEventListeners() {\n this.textarea.on('focus', function focusTextArea() {\n $(this).closest('.md-area').addClass('is-focused');\n });\n this.textarea.on('blur', function blurTextArea() {\n $(this).closest('.md-area').removeClass('is-focused');\n });\n }\n}\n","import LineHighlighter from '~/line_highlighter';\nimport BlobViewer from '~/blob/viewer';\nimport ZenMode from '~/zen_mode';\nimport initNotes from '~/init_notes';\nimport snippetEmbed from '~/snippet/snippet_embed';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n new LineHighlighter(); // eslint-disable-line no-new\n new BlobViewer(); // eslint-disable-line no-new\n initNotes();\n new ZenMode(); // eslint-disable-line no-new\n snippetEmbed();\n});\n","/* eslint-disable func-names, space-before-function-paren, wrap-iife, prefer-arrow-callback, no-unused-vars, consistent-return, camelcase, comma-dangle, max-len, class-methods-use-this */\n\n// Zen Mode (full screen) textarea\n//\n/*= provides zen_mode:enter */\n/*= provides zen_mode:leave */\n\nimport $ from 'jquery';\nimport 'vendor/jquery.scrollTo';\nimport Dropzone from 'dropzone';\nimport Mousetrap from 'mousetrap';\nimport 'mousetrap/plugins/pause/mousetrap-pause';\n\nDropzone.autoDiscover = false;\n\n//\n// ### Events\n//\n// `zen_mode:enter`\n//\n// Fired when the \"Edit in fullscreen\" link is clicked.\n//\n// **Synchronicity** Sync\n// **Bubbles** Yes\n// **Cancelable** No\n// **Target** a.js-zen-enter\n//\n// `zen_mode:leave`\n//\n// Fired when the \"Leave Fullscreen\" link is clicked.\n//\n// **Synchronicity** Sync\n// **Bubbles** Yes\n// **Cancelable** No\n// **Target** a.js-zen-leave\n//\n\nexport default class ZenMode {\n constructor() {\n this.active_backdrop = null;\n this.active_textarea = null;\n $(document).on('click', '.js-zen-enter', function(e) {\n e.preventDefault();\n return $(e.currentTarget).trigger('zen_mode:enter');\n });\n $(document).on('click', '.js-zen-leave', function(e) {\n e.preventDefault();\n return $(e.currentTarget).trigger('zen_mode:leave');\n });\n $(document).on('zen_mode:enter', (function(_this) {\n return function(e) {\n return _this.enter($(e.target).closest('.md-area').find('.zen-backdrop'));\n };\n })(this));\n $(document).on('zen_mode:leave', (function(_this) {\n return function(e) {\n return _this.exit();\n };\n })(this));\n $(document).on('keydown', function(e) {\n // Esc\n if (e.keyCode === 27) {\n e.preventDefault();\n return $(document).trigger('zen_mode:leave');\n }\n });\n }\n\n enter(backdrop) {\n Mousetrap.pause();\n this.active_backdrop = $(backdrop);\n this.active_backdrop.addClass('fullscreen');\n this.active_textarea = this.active_backdrop.find('textarea');\n // Prevent a user-resized textarea from persisting to fullscreen\n this.active_textarea.removeAttr('style');\n this.active_textarea.focus();\n }\n\n exit() {\n if (this.active_textarea) {\n Mousetrap.unpause();\n this.active_textarea.closest('.zen-backdrop').removeClass('fullscreen');\n this.scrollTo(this.active_textarea);\n this.active_textarea = null;\n this.active_backdrop = null;\n\n const $dropzone = $('.div-dropzone');\n if ($dropzone && !$dropzone.hasClass('js-invalid-dropzone')) {\n Dropzone.forElement('.div-dropzone').enable();\n }\n }\n }\n\n scrollTo(zen_area) {\n return $.scrollTo(zen_area, 0, {\n offset: -150\n });\n }\n}\n","/* eslint-disable no-param-reassign, prefer-template, no-var, no-void, consistent-return */\n\nimport AccessorUtilities from './lib/utils/accessor';\n\nexport default class Autosave {\n constructor(field, key) {\n this.field = field;\n\n this.isLocalStorageAvailable = AccessorUtilities.isLocalStorageAccessSafe();\n if (key.join != null) {\n key = key.join('/');\n }\n this.key = 'autosave/' + key;\n this.field.data('autosave', this);\n this.restore();\n this.field.on('input', () => this.save());\n }\n\n restore() {\n if (!this.isLocalStorageAvailable) return;\n if (!this.field.length) return;\n\n const text = window.localStorage.getItem(this.key);\n\n if ((text != null ? text.length : void 0) > 0) {\n this.field.val(text);\n }\n\n this.field.trigger('input');\n // v-model does not update with jQuery trigger\n // https://github.com/vuejs/vue/issues/2804#issuecomment-216968137\n const event = new Event('change', { bubbles: true, cancelable: false });\n const field = this.field.get(0);\n field.dispatchEvent(event);\n }\n\n save() {\n if (!this.field.length) return;\n\n const text = this.field.val();\n\n if (this.isLocalStorageAvailable && (text != null ? text.length : void 0) > 0) {\n return window.localStorage.setItem(this.key, text);\n }\n\n return this.reset();\n }\n\n reset() {\n if (!this.isLocalStorageAvailable) return;\n\n return window.localStorage.removeItem(this.key);\n }\n}\n"],"sourceRoot":""}