forkjo/public/js/index.js.map
2019-11-14 19:58:32 +02:00

1 line
No EOL
190 KiB
Text

{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./web_src/js/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","htmlEncode","text","jQuery","html","csrf","suburl","previewFileModes","simpleMDEditor","codeMirrorEditor","initCommentPreviewTab","$form","$tabMenu","find","tab","data","click","$this","$","this","post","val","$previewPanel","emojify","run","each","hljs","highlightBlock","buttonsClickOnEnter","initEditForm","length","$previewTab","split","initEditPreviewTab","$diffPreviewPanel","initEditDiffTab","updateIssuesMeta","url","action","issueIds","elementId","Promise","resolve","ajax","type","success","reload","window","location","initImagePaste","target","field","addEventListener","event","pasteEvent","callback","clipboardData","items","indexOf","blob","getAsFile","preventDefault","stopPropagation","retrieveImageFromClipboardAsBlob","img","substr","lastIndexOf","selectionStart","startPos","endPos","selectionEnd","substring","insertAtCursor","file","xhr","XMLHttpRequest","onload","status","responseText","open","setRequestHeader","formData","FormData","append","send","uploadFile","res","JSON","parse","oldval","newval","replace","replaceAndKeepCursor","uuid","input","initCommentForm","initListSubmits","selector","outerSelector","$list","$noSelect","$listMenu","hasLabelUpdateAction","labels","dropdown","promises","keys","forEach","label","promise","push","all","then","hasClass","removeClass","addClass","listIds","parent","join","selectItem","select_id","input_id","$menu","hasUpdateAction","$selectBranch","selectedValue","css","initBranchSelector","initRepository","initFilterSearchDropdown","$dropdown","fullTextSearch","selectOnKeydown","onChange","_text","_value","$choice","href","message","noResults","$data","searchTerm","canCreateBranch","menuVisible","active","branch","tag","selected","remove","Vue","delimiters","el","beforeMount","vm","$el","getAttribute","document","body","contains","set","watch","visible","focusSearchField","computed","filteredItems","filter","item","toLowerCase","showCreateNewBranch","showNoResults","methods","prev","getSelected","createNewBranch","$refs","newBranchForm","submit","nextTick","searchField","focus","j","getSelectedIndexInFiltered","scrollToActive","Array","isArray","cont","scrollContainer","offsetTop","scrollTop","clientHeight","keydown","keyCode","keyup","$prompt","toString","show","hide","change","checked","$newLabelPanel","minicolors","color_hex","modal","onApprove","$datepicker","datetimepicker","lang","inline","timepicker","startDate","formatDate","onSelectDate","ct","dateFormat","$issueTitle","$editInput","editTitleToggle","toggle","title","$segment","next","$editContentZone","$renderContent","$rawContent","$textarea","issuesTribute","attach","emojiTribute","$dropzone","$files","filenameDict","dropzone","headers","maxFiles","maxFilesize","acceptedFiles","addRemoveLinks","dictDefaultMessage","dictInvalidFileType","dictFileTooBig","dictRemoveFile","init","on","submitted","_csrf","getJSON","drop","removeAllFiles","empty","imgSrc","emit","files","$editContentForm","attr","$attachments","map","content","$content","attachments","confirm","$statusButton","$mergeButton","e","closest","initReactionSelector","reactions","popup","done","resp","react","insertBefore","appendTo","hasEmoji","$item","addLine","delLine","addPercent","parseFloat","localStorage","setItem","select","$repoComparePull","assingMenuAttributes","menu","id","Math","floor","random","initRepositoryCollaboration","initEditor","prop","$editFilename","$section","$divider","parts","getCursorPosition","last","setSelectionRange","element","trigger","$editArea","markdownFileExts","lineWrapExtensions","spec","extension","extWithDot","dataUrl","apiCall","exec","info","CodeMirror","findModeByExtension","previewLink","mime","toTextArea","SimpleMDE","autoDownloadFontAwesome","forceSync","renderingConfig","singleLineBreaks","indentWithTabs","tabSize","spellChecker","previewRender","plainText","preview","setTimeout","innerHTML","toolbar","setSimpleMDE","fromTextArea","lineNumbers","cm","_change","getValue","setCodeMirror","setOption","autoLoadMode","editorconfig","indent_style","Tab","spaces","parseInt","getOption","replaceSelection","indent_size","tab_width","$commitButton","$editForm","areYouSure","silent","dirtyClass","fieldSelector","dirty","initUserSettings","keypress","initCodeView","$select","siblings","selectRange","shiftKey","eq","getSelection","removeAllRanges","selection","hash","match","$first","offset","top","u2fSigned","stringify","contentType","fail","u2fError","u2fRegistered","errorCode","checkError","errorType","u2fErrors","1","2","3","4","5","u2fRegisterRequest","req","registeredKeys","u2fApi","register","appId","registerRequests","catch","reason","undefined","metaData","code","changeHash","history","pushState","$from","a","b","classes","showDeletePopup","dialog","closable","redirect","showAddAllPopup","Dropzone","autoDiscover","from","toStr","isCallable","fn","maxSafeInteger","pow","toLength","len","number","Number","isNaN","isFinite","abs","toInteger","min","max","arrayLike","C","TypeError","mapFn","arguments","T","A","kValue","k","assign","_varArgs","to","index","nextSource","nextKey","writable","configurable","String","endsWith","pattern","pos","Sel","createRange","SelLength","moveStart","ready","onShow","transition","direction","accordion","checkbox","progress","showActivity","slideToggle","nodes","slice","querySelectorAll","setConfig","img_dir","ignore_emoticons","getElementsByClassName","childNodes","nodeName","clipboard","Clipboard","clearSelection","setAttribute","node","encodeURIComponent","wrap","children","dataset","issueIDs","issueId","_","first","search","minCharacters","apiSettings","onResponse","response","_i","login","full_name","image","avatar_url","results","searchFields","$searchTeamBox","permission","searchTeams","$searchRepoBox","description","searchRepositories","dbType","dbDefaults","_type","defaultHost","is","toggleMigrations","authUserName","cloneAddr","startsWith","initMigration","simplemde","codemirror","cursorPos","getCursor","setCursor","line","ch","className","getInputField","initWikiForm","updateContentType","initWebhook","removeAttr","authType","onOAuth2Change","onSecurityProtocolChange","onUsePagedSearchChange","onOAuth2UseCustomURLChange","$detailModal","$checkboxes","ids","provider","initAdmin","getElementById","component","props","searchLimit","default","required","uid","organizations","isOrganization","Boolean","canCreateOrganization","organizationsTotalCount","moreReposLink","repos","reposTotalCount","reposFilter","searchQuery","isLoading","repoTypes","count","searchMode","showMoreReposLink","searchURL","repoTypeCount","mounted","searchRepos","self","changeTab","changeReposFilter","showRepo","repo","owner","mirror","fork","searchedMode","searchedURL","searchedQuery","result","_textStatus","request","getResponseHeader","always","repoClass","private","querySelector","initVueApp","ctrlKey","altKey","metaKey","isExpanded","initNavbarContentToggle","mgrBtn","editDiv","viewDiv","saveBtn","topicDropdown","topicForm","topicPrompts","hidePrompt","prompts","countPrompt","formatPrompt","getPrompts","topics","_data","responseJSON","topicArray","invalidTopics","topicLables","form","allowAdditions","forceSelection","fields","saveRemoteData","duration","variation","blue","basic","throttle","cache","formattedResponse","query","urlData","trim","found_query","current_topics","found","topic_name","unshift","sort","onLabelCreate","contents","replaceWith","onAdd","addedValue","_addedText","$addedChoice","settings","rules","validateTopic","_values","regExp","identifier","prompt","initTopicbar","ensureSupport","sign","challenge","err","allowMultiple","repolink","repoId","crossRepoSearch","issueSearchUrl","filteredResponse","currIssueId","issue","repository","regStr","newStr","RegExp","selectedItems","initIssueList","toUpperCase","wipPrefixes","sticky","isSplit","side","idx","path","tr","ntr","after","td","commentCloud","initRepoStatusChecker","migrating","repo_name","complete","$repoTemplate","checkTemplate","$templateUnits","$nonTemplate","changeOwner","_r","initTemplateSearch","getItem","routes","$cloneAddr","$repoName","arrays","$title","timeAddManual","toggleStopwatch","cancelStopwatch","initHeatmap","appElementId","heatmapUser","locale","contributions","no_contributions","vueDelimeters","user","colorRange","endDate","values","totalContributions","getColor","Date","loadHeatmap","userName","chartRawData","chartData","date","timestamp","createElement","appendChild","color","getComputedStyle","backgroundColor","removeChild","template","toggleDeadlineForm","fadeToggle","setDeadline","deadline","updateDeadline","deadlineString","realDeadline","newDate","error","deleteDependencyModal","cancelCodeComment","btn","onOAuthLoginClick","oauthLoader","oauthNav"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,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kL,OAChClL,EAAE,oBAAoBiG,SAAS,WAE/B,IAAI+lB,EAAe,KACnB,GAAuB,KAAnBD,EAAuB,CAEvB,MAAME,EAAUrB,KAAKtmB,MAAMynB,GAE3B,GAAI5S,MAAM8S,GAGN,OAFAjsB,EAAE,oBAAoBgG,YAAY,WAClChG,EAAE,8BAA8BiL,QACzB,EAEX+gB,EAAe,IAAIpB,KAAKqB,GAG5BjsB,EAAEyB,KAAKzB,EAAE,+BAA+B2O,KAAK,UAAY,YAAa,CAClE9O,KAAMwE,KAAK4R,UAAU,CACjB,SAAY+V,IAEhB1e,QAAS,CACL,eAAgBnO,EAChB,YAAY,GAEhB+W,YAAa,mBACbxU,KAAM,OACNC,QAAS,WACLC,KAEJsqB,MAAO,WACHlsB,EAAE,oBAAoBgG,YAAY,WAClChG,EAAE,8BAA8BiL,WAK5CpJ,OAAOsqB,sBAAwB,SAASzb,EAAIhP,GACxC1B,EAAE,sBACGwL,MAAM,CACH4M,UAAU,EACV0M,SAAU,IACVrZ,UAAW,WACPzL,EAAE,uBAAuBG,IAAIuQ,GAC7B1Q,EAAE,mBAAmBG,IAAIuB,GACzB1B,EAAE,yBAAyB8J,YAEhC0B,MAAM,SAyEjB3J,OAAOuqB,kBAAoB,SAASC,GAChC,MAAM5H,EAAOzkB,EAAEqsB,GAAKhd,QAAQ,QACzBoV,EAAK7jB,OAAS,GAAK6jB,EAAK1e,SAAS,iBAChC0e,EAAKxe,SAAS,QACdwe,EAAKte,SAASxG,KAAK,6BAA6BsL,QAEhDwZ,EAAKpV,QAAQ,uBAAuBnH,UAG5CrG,OAAOyqB,kBAAoB,WACvB,MAAMC,EAAcvsB,EAAE,wBAChBwsB,EAAWxsB,EAAE,2BAEnBwsB,EAASthB,OACTqhB,EAAYvmB,YAAY,YAExBoN,YAAW,WAGPmZ,EAAYtmB,SAAS,YACrBumB,EAASvhB,SACX","file":"index.js","sourcesContent":[" \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// 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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/* globals wipPrefixes, issuesTribute, emojiTribute */\n/* exported timeAddManual, toggleStopwatch, cancelStopwatch, initHeatmap */\n/* exported toggleDeadlineForm, setDeadline, deleteDependencyModal, cancelCodeComment, onOAuthLoginClick */\n'use strict';\n\nfunction htmlEncode(text) {\n return jQuery('<div />').text(text).html()\n}\n\nlet csrf;\nlet suburl;\nlet previewFileModes;\nlet simpleMDEditor;\nlet codeMirrorEditor;\n\n// Disable Dropzone auto-discover because it's manually initialized\nif (typeof(Dropzone) !== \"undefined\") {\n Dropzone.autoDiscover = false;\n}\n\n// Polyfill for IE9+ support (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)\nif (!Array.from) {\n Array.from = (function () {\n const toStr = Object.prototype.toString;\n const isCallable = function (fn) {\n return typeof fn === 'function' || toStr.call(fn) === '[object Function]';\n };\n const toInteger = function (value) {\n const number = Number(value);\n if (isNaN(number)) { return 0; }\n if (number === 0 || !isFinite(number)) { return number; }\n return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));\n };\n const maxSafeInteger = Math.pow(2, 53) - 1;\n const toLength = function (value) {\n const len = toInteger(value);\n return Math.min(Math.max(len, 0), maxSafeInteger);\n };\n\n // The length property of the from method is 1.\n return function from(arrayLike/*, mapFn, thisArg */) {\n // 1. Let C be the this value.\n const C = this;\n\n // 2. Let items be ToObject(arrayLike).\n const items = Object(arrayLike);\n\n // 3. ReturnIfAbrupt(items).\n if (arrayLike == null) {\n throw new TypeError(\"Array.from requires an array-like object - not null or undefined\");\n }\n\n // 4. If mapfn is undefined, then let mapping be false.\n const mapFn = arguments.length > 1 ? arguments[1] : void undefined;\n let T;\n if (typeof mapFn !== 'undefined') {\n // 5. else\n // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.\n if (!isCallable(mapFn)) {\n throw new TypeError('Array.from: when provided, the second argument must be a function');\n }\n\n // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.\n if (arguments.length > 2) {\n T = arguments[2];\n }\n }\n\n // 10. Let lenValue be Get(items, \"length\").\n // 11. Let len be ToLength(lenValue).\n const len = toLength(items.length);\n\n // 13. If IsConstructor(C) is true, then\n // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len.\n // 14. a. Else, Let A be ArrayCreate(len).\n const A = isCallable(C) ? Object(new C(len)) : new Array(len);\n\n // 16. Let k be 0.\n let k = 0;\n // 17. Repeat, while k < len… (also steps a - h)\n let kValue;\n while (k < len) {\n kValue = items[k];\n if (mapFn) {\n A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);\n } else {\n A[k] = kValue;\n }\n k += 1;\n }\n // 18. Let putStatus be Put(A, \"length\", len, true).\n A.length = len;\n // 20. Return A.\n return A;\n };\n }());\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\nif (typeof Object.assign != 'function') {\n // Must be writable: true, enumerable: false, configurable: true\n Object.defineProperty(Object, \"assign\", {\n value: function assign(target, _varArgs) { // .length of function is 2\n 'use strict';\n if (target == null) { // TypeError if undefined or null\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n const to = Object(target);\n\n for (let index = 1; index < arguments.length; index++) {\n const nextSource = arguments[index];\n\n if (nextSource != null) { // Skip over if undefined or null\n for (const nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n },\n writable: true,\n configurable: true\n });\n}\n\nfunction initCommentPreviewTab($form) {\n const $tabMenu = $form.find('.tabular.menu');\n $tabMenu.find('.item').tab();\n $tabMenu.find('.item[data-tab=\"' + $tabMenu.data('preview') + '\"]').click(function () {\n const $this = $(this);\n $.post($this.data('url'), {\n \"_csrf\": csrf,\n \"mode\": \"gfm\",\n \"context\": $this.data('context'),\n \"text\": $form.find('.tab.segment[data-tab=\"' + $tabMenu.data('write') + '\"] textarea').val()\n },\n function (data) {\n const $previewPanel = $form.find('.tab.segment[data-tab=\"' + $tabMenu.data('preview') + '\"]');\n $previewPanel.html(data);\n emojify.run($previewPanel[0]);\n $('pre code', $previewPanel[0]).each(function () {\n hljs.highlightBlock(this);\n });\n }\n );\n });\n\n buttonsClickOnEnter();\n}\n\nfunction initEditPreviewTab($form) {\n const $tabMenu = $form.find('.tabular.menu');\n $tabMenu.find('.item').tab();\n const $previewTab = $tabMenu.find('.item[data-tab=\"' + $tabMenu.data('preview') + '\"]');\n if ($previewTab.length) {\n previewFileModes = $previewTab.data('preview-file-modes').split(',');\n $previewTab.click(function () {\n const $this = $(this);\n $.post($this.data('url'), {\n \"_csrf\": csrf,\n \"mode\": \"gfm\",\n \"context\": $this.data('context'),\n \"text\": $form.find('.tab.segment[data-tab=\"' + $tabMenu.data('write') + '\"] textarea').val()\n },\n function (data) {\n const $previewPanel = $form.find('.tab.segment[data-tab=\"' + $tabMenu.data('preview') + '\"]');\n $previewPanel.html(data);\n emojify.run($previewPanel[0]);\n $('pre code', $previewPanel[0]).each(function () {\n hljs.highlightBlock(this);\n });\n }\n );\n });\n }\n}\n\nfunction initEditDiffTab($form) {\n const $tabMenu = $form.find('.tabular.menu');\n $tabMenu.find('.item').tab();\n $tabMenu.find('.item[data-tab=\"' + $tabMenu.data('diff') + '\"]').click(function () {\n const $this = $(this);\n $.post($this.data('url'), {\n \"_csrf\": csrf,\n \"context\": $this.data('context'),\n \"content\": $form.find('.tab.segment[data-tab=\"' + $tabMenu.data('write') + '\"] textarea').val()\n },\n function (data) {\n const $diffPreviewPanel = $form.find('.tab.segment[data-tab=\"' + $tabMenu.data('diff') + '\"]');\n $diffPreviewPanel.html(data);\n emojify.run($diffPreviewPanel[0]);\n }\n );\n });\n}\n\n\nfunction initEditForm() {\n if ($('.edit.form').length == 0) {\n return;\n }\n\n initEditPreviewTab($('.edit.form'));\n initEditDiffTab($('.edit.form'));\n}\n\nfunction initBranchSelector() {\n const $selectBranch = $('.ui.select-branch')\n const $branchMenu = $selectBranch.find('.reference-list-menu');\n $branchMenu.find('.item:not(.no-select)').click(function () {\n const selectedValue = $(this).data('id');\n $($(this).data('id-selector')).val(selectedValue);\n $selectBranch.find('.ui .branch-name').text(selectedValue);\n });\n $selectBranch.find('.reference.column').click(function () {\n $selectBranch.find('.scrolling.reference-list-menu').css('display', 'none');\n $selectBranch.find('.reference .text').removeClass('black');\n $($(this).data('target')).css('display', 'block');\n $(this).find('.text').addClass('black');\n return false;\n });\n}\n\nfunction updateIssuesMeta(url, action, issueIds, elementId) {\n return new Promise(function(resolve) {\n $.ajax({\n type: \"POST\",\n url: url,\n data: {\n \"_csrf\": csrf,\n \"action\": action,\n \"issue_ids\": issueIds,\n \"id\": elementId\n },\n success: resolve\n })\n })\n}\n\nfunction initRepoStatusChecker() {\n const migrating = $(\"#repo_migrating\");\n $('#repo_migrating_failed').hide();\n if (migrating) {\n const repo_name = migrating.attr('repo');\n if (typeof repo_name === 'undefined') {\n return\n }\n $.ajax({\n type: \"GET\",\n url: suburl +\"/\"+repo_name+\"/status\",\n data: {\n \"_csrf\": csrf,\n },\n complete: function(xhr) {\n if (xhr.status == 200) {\n if (xhr.responseJSON) {\n if (xhr.responseJSON[\"status\"] == 0) {\n location.reload();\n return\n }\n\n setTimeout(function () {\n initRepoStatusChecker()\n }, 2000);\n return\n }\n }\n $('#repo_migrating_progress').hide();\n $('#repo_migrating_failed').show();\n }\n })\n }\n}\n\nfunction initReactionSelector(parent) {\n let reactions = '';\n if (!parent) {\n parent = $(document);\n reactions = '.reactions > ';\n }\n\n parent.find(reactions + 'a.label').popup({'position': 'bottom left', 'metadata': {'content': 'title', 'title': 'none'}});\n\n parent.find('.select-reaction > .menu > .item, ' + reactions + 'a.label').on('click', function(e){\n const vm = this;\n e.preventDefault();\n\n if ($(this).hasClass('disabled')) return;\n\n const actionURL = $(this).hasClass('item') ?\n $(this).closest('.select-reaction').data('action-url') :\n $(this).data('action-url');\n const url = actionURL + '/' + ($(this).hasClass('blue') ? 'unreact' : 'react');\n $.ajax({\n type: 'POST',\n url: url,\n data: {\n '_csrf': csrf,\n 'content': $(this).data('content')\n }\n }).done(function(resp) {\n if (resp && (resp.html || resp.empty)) {\n const content = $(vm).closest('.content');\n let react = content.find('.segment.reactions');\n if (!resp.empty && react.length > 0) {\n react.remove();\n }\n if (!resp.empty) {\n react = $('<div class=\"ui attached segment reactions\"></div>');\n const attachments = content.find('.segment.bottom:first');\n if (attachments.length > 0) {\n react.insertBefore(attachments);\n } else {\n react.appendTo(content);\n }\n react.html(resp.html);\n const hasEmoji = react.find('.has-emoji');\n for (let i = 0; i < hasEmoji.length; i++) {\n emojify.run(hasEmoji.get(i));\n }\n react.find('.dropdown').dropdown();\n initReactionSelector(react);\n }\n }\n });\n });\n}\n\nfunction insertAtCursor(field, value) {\n if (field.selectionStart || field.selectionStart === 0) {\n const startPos = field.selectionStart;\n const endPos = field.selectionEnd;\n field.value = field.value.substring(0, startPos)\n + value\n + field.value.substring(endPos, field.value.length);\n field.selectionStart = startPos + value.length;\n field.selectionEnd = startPos + value.length;\n } else {\n field.value += value;\n }\n}\n\nfunction replaceAndKeepCursor(field, oldval, newval) {\n if (field.selectionStart || field.selectionStart === 0) {\n const startPos = field.selectionStart;\n const endPos = field.selectionEnd;\n field.value = field.value.replace(oldval, newval);\n field.selectionStart = startPos + newval.length - oldval.length;\n field.selectionEnd = endPos + newval.length - oldval.length;\n } else {\n field.value = field.value.replace(oldval, newval);\n }\n}\n\nfunction retrieveImageFromClipboardAsBlob(pasteEvent, callback){\n if (!pasteEvent.clipboardData) {\n return;\n }\n\n const items = pasteEvent.clipboardData.items;\n if (typeof(items) === \"undefined\") {\n return;\n }\n\n for (let i = 0; i < items.length; i++) {\n if (items[i].type.indexOf(\"image\") === -1) continue;\n const blob = items[i].getAsFile();\n\n if (typeof(callback) === \"function\") {\n pasteEvent.preventDefault();\n pasteEvent.stopPropagation();\n callback(blob);\n }\n }\n}\n\nfunction uploadFile(file, callback) {\n const xhr = new XMLHttpRequest();\n\n xhr.onload = function() {\n if (xhr.status == 200) {\n callback(xhr.responseText);\n }\n };\n\n xhr.open(\"post\", suburl + \"/attachments\", true);\n xhr.setRequestHeader(\"X-Csrf-Token\", csrf);\n const formData = new FormData();\n formData.append('file', file, file.name);\n xhr.send(formData);\n}\n\nfunction reload() {\n window.location.reload();\n}\n\nfunction initImagePaste(target) {\n target.each(function() {\n const field = this;\n field.addEventListener('paste', function(event){\n retrieveImageFromClipboardAsBlob(event, function(img) {\n const name = img.name.substr(0, img.name.lastIndexOf('.'));\n insertAtCursor(field, '![' + name + ']()');\n uploadFile(img, function(res) {\n const data = JSON.parse(res);\n replaceAndKeepCursor(field, '![' + name + ']()', '![' + name + '](' + suburl + '/attachments/' + data.uuid + ')');\n const input = $('<input id=\"' + data.uuid + '\" name=\"files\" type=\"hidden\">').val(data.uuid);\n $('.files').append(input);\n });\n });\n }, false);\n });\n}\n\nfunction initCommentForm() {\n if ($('.comment.form').length == 0) {\n return\n }\n\n initBranchSelector();\n initCommentPreviewTab($('.comment.form'));\n initImagePaste($('.comment.form textarea'));\n\n // Listsubmit\n function initListSubmits(selector, outerSelector) {\n const $list = $('.ui.' + outerSelector + '.list');\n const $noSelect = $list.find('.no-select');\n const $listMenu = $('.' + selector + ' .menu');\n let hasLabelUpdateAction = $listMenu.data('action') == 'update';\n const labels = {};\n\n $('.' + selector).dropdown('setting', 'onHide', function(){\n hasLabelUpdateAction = $listMenu.data('action') == 'update'; // Update the var\n if (hasLabelUpdateAction) {\n const promises = [];\n Object.keys(labels).forEach(function(elementId) {\n const label = labels[elementId];\n const promise = updateIssuesMeta(\n label[\"update-url\"],\n label[\"action\"],\n label[\"issue-id\"],\n elementId\n );\n promises.push(promise);\n });\n Promise.all(promises).then(reload);\n }\n });\n\n $listMenu.find('.item:not(.no-select)').click(function () {\n\n // we don't need the action attribute when updating assignees\n if (selector == 'select-assignees-modify') {\n\n // UI magic. We need to do this here, otherwise it would destroy the functionality of\n // adding/removing labels\n if ($(this).hasClass('checked')) {\n $(this).removeClass('checked');\n $(this).find('.octicon').removeClass('octicon-check');\n } else {\n $(this).addClass('checked');\n $(this).find('.octicon').addClass('octicon-check');\n }\n\n updateIssuesMeta(\n $listMenu.data('update-url'),\n \"\",\n $listMenu.data('issue-id'),\n $(this).data('id')\n );\n $listMenu.data('action', 'update'); // Update to reload the page when we updated items\n return false;\n }\n\n if ($(this).hasClass('checked')) {\n $(this).removeClass('checked');\n $(this).find('.octicon').removeClass('octicon-check');\n if (hasLabelUpdateAction) {\n if (!($(this).data('id') in labels)) {\n labels[$(this).data('id')] = {\n \"update-url\": $listMenu.data('update-url'),\n \"action\": \"detach\",\n \"issue-id\": $listMenu.data('issue-id'),\n };\n } else {\n delete labels[$(this).data('id')];\n }\n }\n } else {\n $(this).addClass('checked');\n $(this).find('.octicon').addClass('octicon-check');\n if (hasLabelUpdateAction) {\n if (!($(this).data('id') in labels)) {\n labels[$(this).data('id')] = {\n \"update-url\": $listMenu.data('update-url'),\n \"action\": \"attach\",\n \"issue-id\": $listMenu.data('issue-id'),\n };\n } else {\n delete labels[$(this).data('id')];\n }\n }\n }\n\n const listIds = [];\n $(this).parent().find('.item').each(function () {\n if ($(this).hasClass('checked')) {\n listIds.push($(this).data('id'));\n $($(this).data('id-selector')).removeClass('hide');\n } else {\n $($(this).data('id-selector')).addClass('hide');\n }\n });\n if (listIds.length == 0) {\n $noSelect.removeClass('hide');\n } else {\n $noSelect.addClass('hide');\n }\n $($(this).parent().data('id')).val(listIds.join(\",\"));\n return false;\n });\n $listMenu.find('.no-select.item').click(function () {\n if (hasLabelUpdateAction || selector == 'select-assignees-modify') {\n updateIssuesMeta(\n $listMenu.data('update-url'),\n \"clear\",\n $listMenu.data('issue-id'),\n \"\"\n ).then(reload);\n }\n\n $(this).parent().find('.item').each(function () {\n $(this).removeClass('checked');\n $(this).find('.octicon').removeClass('octicon-check');\n });\n\n $list.find('.item').each(function () {\n $(this).addClass('hide');\n });\n $noSelect.removeClass('hide');\n $($(this).parent().data('id')).val('');\n\n });\n }\n\n // Init labels and assignees\n initListSubmits('select-label', 'labels');\n initListSubmits('select-assignees', 'assignees');\n initListSubmits('select-assignees-modify', 'assignees');\n\n function selectItem(select_id, input_id) {\n const $menu = $(select_id + ' .menu');\n const $list = $('.ui' + select_id + '.list');\n const hasUpdateAction = $menu.data('action') == 'update';\n\n $menu.find('.item:not(.no-select)').click(function () {\n $(this).parent().find('.item').each(function () {\n $(this).removeClass('selected active')\n });\n\n $(this).addClass('selected active');\n if (hasUpdateAction) {\n updateIssuesMeta(\n $menu.data('update-url'),\n \"\",\n $menu.data('issue-id'),\n $(this).data('id')\n ).then(reload);\n }\n switch (input_id) {\n case '#milestone_id':\n $list.find('.selected').html('<a class=\"item\" href=' + $(this).data('href') + '>' +\n htmlEncode($(this).text()) + '</a>');\n break;\n case '#assignee_id':\n $list.find('.selected').html('<a class=\"item\" href=' + $(this).data('href') + '>' +\n '<img class=\"ui avatar image\" src=' + $(this).data('avatar') + '>' +\n htmlEncode($(this).text()) + '</a>');\n }\n $('.ui' + select_id + '.list .no-select').addClass('hide');\n $(input_id).val($(this).data('id'));\n });\n $menu.find('.no-select.item').click(function () {\n $(this).parent().find('.item:not(.no-select)').each(function () {\n $(this).removeClass('selected active')\n });\n\n if (hasUpdateAction) {\n updateIssuesMeta(\n $menu.data('update-url'),\n \"\",\n $menu.data('issue-id'),\n $(this).data('id')\n ).then(reload);\n }\n\n $list.find('.selected').html('');\n $list.find('.no-select').removeClass('hide');\n $(input_id).val('');\n });\n }\n\n // Milestone and assignee\n selectItem('.select-milestone', '#milestone_id');\n selectItem('.select-assignee', '#assignee_id');\n}\n\nfunction initInstall() {\n if ($('.install').length == 0) {\n return;\n }\n\n if ($('#db_host').val()==\"\") {\n $('#db_host').val(\"127.0.0.1:3306\");\n $('#db_user').val(\"gitea\");\n $('#db_name').val(\"gitea\");\n }\n\n // Database type change detection.\n $(\"#db_type\").change(function () {\n const sqliteDefault = 'data/gitea.db';\n const tidbDefault = 'data/gitea_tidb';\n\n const dbType = $(this).val();\n if (dbType === \"SQLite3\") {\n $('#sql_settings').hide();\n $('#pgsql_settings').hide();\n $('#mysql_settings').hide();\n $('#sqlite_settings').show();\n\n if (dbType === \"SQLite3\" && $('#db_path').val() == tidbDefault) {\n $('#db_path').val(sqliteDefault);\n }\n return;\n }\n\n const dbDefaults = {\n \"MySQL\": \"127.0.0.1:3306\",\n \"PostgreSQL\": \"127.0.0.1:5432\",\n \"MSSQL\": \"127.0.0.1:1433\"\n };\n\n $('#sqlite_settings').hide();\n $('#sql_settings').show();\n\n $('#pgsql_settings').toggle(dbType === \"PostgreSQL\");\n $('#mysql_settings').toggle(dbType === \"MySQL\");\n $.each(dbDefaults, function(_type, defaultHost) {\n if ($('#db_host').val() == defaultHost) {\n $('#db_host').val(dbDefaults[dbType]);\n return false;\n }\n });\n });\n\n // TODO: better handling of exclusive relations.\n $('#offline-mode input').change(function () {\n if ($(this).is(':checked')) {\n $('#disable-gravatar').checkbox('check');\n $('#federated-avatar-lookup').checkbox('uncheck');\n }\n });\n $('#disable-gravatar input').change(function () {\n if ($(this).is(':checked')) {\n $('#federated-avatar-lookup').checkbox('uncheck');\n } else {\n $('#offline-mode').checkbox('uncheck');\n }\n });\n $('#federated-avatar-lookup input').change(function () {\n if ($(this).is(':checked')) {\n $('#disable-gravatar').checkbox('uncheck');\n $('#offline-mode').checkbox('uncheck');\n }\n });\n $('#enable-openid-signin input').change(function () {\n if ($(this).is(':checked')) {\n if (!$('#disable-registration input').is(':checked')) {\n $('#enable-openid-signup').checkbox('check');\n }\n } else {\n $('#enable-openid-signup').checkbox('uncheck');\n }\n });\n $('#disable-registration input').change(function () {\n if ($(this).is(':checked')) {\n $('#enable-captcha').checkbox('uncheck');\n $('#enable-openid-signup').checkbox('uncheck');\n } else {\n $('#enable-openid-signup').checkbox('check');\n }\n });\n $('#enable-captcha input').change(function () {\n if ($(this).is(':checked')) {\n $('#disable-registration').checkbox('uncheck');\n }\n });\n}\n\nfunction initRepository() {\n if ($('.repository').length == 0) {\n return;\n }\n\n function initFilterSearchDropdown(selector) {\n const $dropdown = $(selector);\n $dropdown.dropdown({\n fullTextSearch: true,\n selectOnKeydown: false,\n onChange: function (_text, _value, $choice) {\n if ($choice.data('url')) {\n window.location.href = $choice.data('url');\n }\n },\n message: {noResults: $dropdown.data('no-results')}\n });\n }\n\n // File list and commits\n if ($('.repository.file.list').length > 0 ||\n ('.repository.commits').length > 0) {\n initFilterBranchTagDropdown('.choose.reference .dropdown');\n }\n\n // Wiki\n if ($('.repository.wiki.view').length > 0) {\n initFilterSearchDropdown('.choose.page .dropdown');\n }\n\n // Options\n if ($('.repository.settings.options').length > 0) {\n $('#repo_name').keyup(function () {\n const $prompt = $('#repo-name-change-prompt');\n if ($(this).val().toString().toLowerCase() != $(this).data('name').toString().toLowerCase()) {\n $prompt.show();\n } else {\n $prompt.hide();\n }\n });\n\n // Enable or select internal/external wiki system and issue tracker.\n $('.enable-system').change(function () {\n if (this.checked) {\n $($(this).data('target')).removeClass('disabled');\n if (!$(this).data('context')) $($(this).data('context')).addClass('disabled');\n } else {\n $($(this).data('target')).addClass('disabled');\n if (!$(this).data('context')) $($(this).data('context')).removeClass('disabled');\n }\n });\n $('.enable-system-radio').change(function () {\n if (this.value == 'false') {\n $($(this).data('target')).addClass('disabled');\n if (typeof $(this).data('context') !== 'undefined') $($(this).data('context')).removeClass('disabled');\n } else if (this.value == 'true') {\n $($(this).data('target')).removeClass('disabled');\n if (typeof $(this).data('context') !== 'undefined') $($(this).data('context')).addClass('disabled');\n }\n });\n }\n\n // Labels\n if ($('.repository.labels').length > 0) {\n // Create label\n const $newLabelPanel = $('.new-label.segment');\n $('.new-label.button').click(function () {\n $newLabelPanel.show();\n });\n $('.new-label.segment .cancel').click(function () {\n $newLabelPanel.hide();\n });\n\n $('.color-picker').each(function () {\n $(this).minicolors();\n });\n $('.precolors .color').click(function () {\n const color_hex = $(this).data('color-hex');\n $('.color-picker').val(color_hex);\n $('.minicolors-swatch-color').css(\"background-color\", color_hex);\n });\n $('.edit-label-button').click(function () {\n $('#label-modal-id').val($(this).data('id'));\n $('.edit-label .new-label-input').val($(this).data('title'));\n $('.edit-label .new-label-desc-input').val($(this).data('description'));\n $('.edit-label .color-picker').val($(this).data('color'));\n $('.minicolors-swatch-color').css(\"background-color\", $(this).data('color'));\n $('.edit-label.modal').modal({\n onApprove: function () {\n $('.edit-label.form').submit();\n }\n }).modal('show');\n return false;\n });\n }\n\n // Milestones\n if ($('.repository.new.milestone').length > 0) {\n const $datepicker = $('.milestone.datepicker');\n $datepicker.datetimepicker({\n lang: $datepicker.data('lang'),\n inline: true,\n timepicker: false,\n startDate: $datepicker.data('start-date'),\n formatDate: 'Y-m-d',\n onSelectDate: function (ct) {\n $('#deadline').val(ct.dateFormat('Y-m-d'));\n }\n });\n $('#clear-date').click(function () {\n $('#deadline').val('');\n return false;\n });\n }\n\n // Issues\n if ($('.repository.view.issue').length > 0) {\n // Edit issue title\n const $issueTitle = $('#issue-title');\n const $editInput = $('#edit-title-input input');\n const editTitleToggle = function () {\n $issueTitle.toggle();\n $('.not-in-edit').toggle();\n $('#edit-title-input').toggle();\n $('.in-edit').toggle();\n $editInput.focus();\n return false;\n };\n $('#edit-title').click(editTitleToggle);\n $('#cancel-edit-title').click(editTitleToggle);\n $('#save-edit-title').click(editTitleToggle).click(function () {\n if ($editInput.val().length == 0 ||\n $editInput.val() == $issueTitle.text()) {\n $editInput.val($issueTitle.text());\n return false;\n }\n\n $.post($(this).data('update-url'), {\n \"_csrf\": csrf,\n \"title\": $editInput.val()\n },\n function (data) {\n $editInput.val(data.title);\n $issueTitle.text(data.title);\n reload();\n });\n return false;\n });\n\n // Edit issue or comment content\n $('.edit-content').click(function () {\n const $segment = $(this).parent().parent().parent().next();\n const $editContentZone = $segment.find('.edit-content-zone');\n const $renderContent = $segment.find('.render-content');\n const $rawContent = $segment.find('.raw-content');\n let $textarea;\n\n // Setup new form\n if ($editContentZone.html().length == 0) {\n $editContentZone.html($('#edit-content-form').html());\n $textarea = $editContentZone.find('textarea');\n issuesTribute.attach($textarea.get());\n emojiTribute.attach($textarea.get());\n\n const $dropzone = $editContentZone.find('.dropzone');\n $dropzone.data(\"saved\", false);\n const $files = $editContentZone.find('.comment-files');\n if ($dropzone.length > 0) {\n const filenameDict = {};\n $dropzone.dropzone({\n url: $dropzone.data('upload-url'),\n headers: {\"X-Csrf-Token\": csrf},\n maxFiles: $dropzone.data('max-file'),\n maxFilesize: $dropzone.data('max-size'),\n acceptedFiles: ($dropzone.data('accepts') === '*/*') ? null : $dropzone.data('accepts'),\n addRemoveLinks: true,\n dictDefaultMessage: $dropzone.data('default-message'),\n dictInvalidFileType: $dropzone.data('invalid-input-type'),\n dictFileTooBig: $dropzone.data('file-too-big'),\n dictRemoveFile: $dropzone.data('remove-file'),\n init: function () {\n this.on(\"success\", function (file, data) {\n filenameDict[file.name] = {\n \"uuid\": data.uuid,\n \"submitted\": false\n }\n const input = $('<input id=\"' + data.uuid + '\" name=\"files\" type=\"hidden\">').val(data.uuid);\n $files.append(input);\n });\n this.on(\"removedfile\", function (file) {\n if (!(file.name in filenameDict)) {\n return;\n }\n $('#' + filenameDict[file.name].uuid).remove();\n if ($dropzone.data('remove-url') && $dropzone.data('csrf') && !filenameDict[file.name].submitted) {\n $.post($dropzone.data('remove-url'), {\n file: filenameDict[file.name].uuid,\n _csrf: $dropzone.data('csrf')\n });\n }\n });\n this.on(\"submit\", function () {\n $.each(filenameDict, function(name){\n filenameDict[name].submitted = true;\n });\n });\n this.on(\"reload\", function (){\n $.getJSON($editContentZone.data('attachment-url'), function(data){\n const drop = $dropzone.get(0).dropzone;\n drop.removeAllFiles(true);\n $files.empty();\n $.each(data, function(){\n const imgSrc = $dropzone.data('upload-url') + \"/\" + this.uuid;\n drop.emit(\"addedfile\", this);\n drop.emit(\"thumbnail\", this, imgSrc);\n drop.emit(\"complete\", this);\n drop.files.push(this);\n filenameDict[this.name] = {\n \"submitted\": true,\n \"uuid\": this.uuid\n }\n $dropzone.find(\"img[src='\" + imgSrc + \"']\").css(\"max-width\", \"100%\");\n const input = $('<input id=\"' + this.uuid + '\" name=\"files\" type=\"hidden\">').val(this.uuid);\n $files.append(input);\n });\n });\n });\n }\n });\n $dropzone.get(0).dropzone.emit(\"reload\");\n }\n // Give new write/preview data-tab name to distinguish from others\n const $editContentForm = $editContentZone.find('.ui.comment.form');\n const $tabMenu = $editContentForm.find('.tabular.menu');\n $tabMenu.attr('data-write', $editContentZone.data('write'));\n $tabMenu.attr('data-preview', $editContentZone.data('preview'));\n $tabMenu.find('.write.item').attr('data-tab', $editContentZone.data('write'));\n $tabMenu.find('.preview.item').attr('data-tab', $editContentZone.data('preview'));\n $editContentForm.find('.write.segment').attr('data-tab', $editContentZone.data('write'));\n $editContentForm.find('.preview.segment').attr('data-tab', $editContentZone.data('preview'));\n\n initCommentPreviewTab($editContentForm);\n\n $editContentZone.find('.cancel.button').click(function () {\n $renderContent.show();\n $editContentZone.hide();\n $dropzone.get(0).dropzone.emit(\"reload\");\n });\n $editContentZone.find('.save.button').click(function () {\n $renderContent.show();\n $editContentZone.hide();\n const $attachments = $files.find(\"[name=files]\").map(function(){\n return $(this).val();\n }).get();\n $.post($editContentZone.data('update-url'), {\n \"_csrf\": csrf,\n \"content\": $textarea.val(),\n \"context\": $editContentZone.data('context'),\n \"files\": $attachments\n },\n function (data) {\n if (data.length == 0) {\n $renderContent.html($('#no-content').html());\n } else {\n $renderContent.html(data.content);\n emojify.run($renderContent[0]);\n $('pre code', $renderContent[0]).each(function () {\n hljs.highlightBlock(this);\n });\n }\n const $content = $segment.parent();\n if(!$content.find(\".ui.small.images\").length){\n if(data.attachments != \"\"){\n $content.append(\n '<div class=\"ui bottom attached segment\">' +\n ' <div class=\"ui small images\">' +\n ' </div>' +\n '</div>'\n );\n $content.find(\".ui.small.images\").html(data.attachments);\n }\n } else if (data.attachments == \"\") {\n $content.find(\".ui.small.images\").parent().remove();\n } else {\n $content.find(\".ui.small.images\").html(data.attachments);\n }\n $dropzone.get(0).dropzone.emit(\"submit\");\n $dropzone.get(0).dropzone.emit(\"reload\");\n });\n });\n } else {\n $textarea = $segment.find('textarea');\n }\n\n // Show write/preview tab and copy raw content as needed\n $editContentZone.show();\n $renderContent.hide();\n if ($textarea.val().length == 0) {\n $textarea.val($rawContent.text());\n }\n $textarea.focus();\n return false;\n });\n\n // Delete comment\n $('.delete-comment').click(function () {\n const $this = $(this);\n if (confirm($this.data('locale'))) {\n $.post($this.data('url'), {\n \"_csrf\": csrf\n }).success(function () {\n $('#' + $this.data('comment-id')).remove();\n });\n }\n return false;\n });\n\n // Change status\n const $statusButton = $('#status-button');\n $('#comment-form .edit_area').keyup(function () {\n if ($(this).val().length == 0) {\n $statusButton.text($statusButton.data('status'))\n } else {\n $statusButton.text($statusButton.data('status-and-comment'))\n }\n });\n $statusButton.click(function () {\n $('#status').val($statusButton.data('status-val'));\n $('#comment-form').submit();\n });\n\n // Pull Request merge button\n const $mergeButton = $('.merge-button > button');\n $mergeButton.on('click', function(e) {\n e.preventDefault();\n $('.' + $(this).data('do') + '-fields').show();\n $(this).parent().hide();\n });\n $('.merge-button > .dropdown').dropdown({\n onChange: function (_text, _value, $choice) {\n if ($choice.data('do')) {\n $mergeButton.find('.button-text').text($choice.text());\n $mergeButton.data('do', $choice.data('do'));\n }\n }\n });\n $('.merge-cancel').on('click', function(e) {\n e.preventDefault();\n $(this).closest('.form').hide();\n $mergeButton.parent().show();\n });\n\n initReactionSelector();\n }\n\n // Diff\n if ($('.repository.diff').length > 0) {\n $('.diff-counter').each(function () {\n const $item = $(this);\n const addLine = $item.find('span[data-line].add').data(\"line\");\n const delLine = $item.find('span[data-line].del').data(\"line\");\n const addPercent = parseFloat(addLine) / (parseFloat(addLine) + parseFloat(delLine)) * 100;\n $item.find(\".bar .add\").css(\"width\", addPercent + \"%\");\n });\n }\n\n // Quick start and repository home\n $('#repo-clone-ssh').click(function () {\n $('.clone-url').text($(this).data('link'));\n $('#repo-clone-url').val($(this).data('link'));\n $(this).addClass('blue');\n $('#repo-clone-https').removeClass('blue');\n localStorage.setItem('repo-clone-protocol', 'ssh');\n });\n $('#repo-clone-https').click(function () {\n $('.clone-url').text($(this).data('link'));\n $('#repo-clone-url').val($(this).data('link'));\n $(this).addClass('blue');\n $('#repo-clone-ssh').removeClass('blue');\n localStorage.setItem('repo-clone-protocol', 'https');\n });\n $('#repo-clone-url').click(function () {\n $(this).select();\n });\n\n // Pull request\n const $repoComparePull = $('.repository.compare.pull');\n if ($repoComparePull.length > 0) {\n initFilterSearchDropdown('.choose.branch .dropdown');\n // show pull request form\n $repoComparePull.find('button.show-form').on('click', function(e) {\n e.preventDefault();\n $repoComparePull.find('.pullrequest-form').show();\n $(this).parent().hide();\n });\n }\n\n // Branches\n if ($('.repository.settings.branches').length > 0) {\n initFilterSearchDropdown('.protected-branches .dropdown');\n $('.enable-protection, .enable-whitelist').change(function () {\n if (this.checked) {\n $($(this).data('target')).removeClass('disabled');\n } else {\n $($(this).data('target')).addClass('disabled');\n }\n });\n }\n}\n\nfunction initMigration() {\n const toggleMigrations = function() {\n const authUserName = $('#auth_username').val();\n const cloneAddr = $('#clone_addr').val();\n if (!$('#mirror').is(\":checked\") && (authUserName!=undefined && authUserName.length > 0)\n && (cloneAddr!=undefined && (cloneAddr.startsWith(\"https://github.com\") || cloneAddr.startsWith(\"http://github.com\")))) {\n $('#migrate_items').show();\n } else {\n $('#migrate_items').hide();\n }\n }\n\n toggleMigrations();\n\n $('#clone_addr').on('input', toggleMigrations)\n $('#auth_username').on('input', toggleMigrations)\n $('#mirror').on('change', toggleMigrations)\n}\n\nfunction initPullRequestReview() {\n $('.show-outdated').on('click', function (e) {\n e.preventDefault();\n const id = $(this).data('comment');\n $(this).addClass(\"hide\");\n $(\"#code-comments-\" + id).removeClass('hide');\n $(\"#code-preview-\" + id).removeClass('hide');\n $(\"#hide-outdated-\" + id).removeClass('hide');\n });\n\n $('.hide-outdated').on('click', function (e) {\n e.preventDefault();\n const id = $(this).data('comment');\n $(this).addClass(\"hide\");\n $(\"#code-comments-\" + id).addClass('hide');\n $(\"#code-preview-\" + id).addClass('hide');\n $(\"#show-outdated-\" + id).removeClass('hide');\n });\n\n $('button.comment-form-reply').on('click', function (e) {\n e.preventDefault();\n $(this).hide();\n const form = $(this).parent().find('.comment-form')\n form.removeClass('hide');\n assingMenuAttributes(form.find('.menu'));\n });\n // The following part is only for diff views\n if ($('.repository.pull.diff').length == 0) {\n return;\n }\n\n $('.diff-detail-box.ui.sticky').sticky();\n\n $('.btn-review').on('click', function(e) {\n e.preventDefault();\n $(this).closest('.dropdown').find('.menu').toggle('visible');\n }).closest('.dropdown').find('.link.close').on('click', function(e) {\n e.preventDefault();\n $(this).closest('.menu').toggle('visible');\n });\n\n $('.code-view .lines-code,.code-view .lines-num')\n .on('mouseenter', function() {\n const parent = $(this).closest('td');\n $(this).closest('tr').addClass(\n parent.hasClass('lines-num-old') || parent.hasClass('lines-code-old')\n ? 'focus-lines-old' : 'focus-lines-new'\n );\n })\n .on('mouseleave', function() {\n $(this).closest('tr').removeClass('focus-lines-new focus-lines-old');\n });\n $('.add-code-comment').on('click', function(e) {\n // https://github.com/go-gitea/gitea/issues/4745\n if ($(e.target).hasClass('btn-add-single')) {\n return;\n }\n e.preventDefault();\n const isSplit = $(this).closest('.code-diff').hasClass('code-diff-split');\n const side = $(this).data('side');\n const idx = $(this).data('idx');\n const path = $(this).data('path');\n const form = $('#pull_review_add_comment').html();\n const tr = $(this).closest('tr');\n let ntr = tr.next();\n if (!ntr.hasClass('add-comment')) {\n ntr = $('<tr class=\"add-comment\">'\n + (isSplit ? '<td class=\"lines-num\"></td><td class=\"lines-type-marker\"></td><td class=\"add-comment-left\"></td><td class=\"lines-num\"></td><td class=\"lines-type-marker\"></td><td class=\"add-comment-right\"></td>'\n : '<td class=\"lines-num\"></td><td class=\"lines-num\"></td><td class=\"lines-type-marker\"></td><td class=\"add-comment-left add-comment-right\"></td>')\n + '</tr>');\n tr.after(ntr);\n }\n const td = ntr.find('.add-comment-' + side);\n let commentCloud = td.find('.comment-code-cloud');\n if (commentCloud.length === 0) {\n td.html(form);\n commentCloud = td.find('.comment-code-cloud');\n assingMenuAttributes(commentCloud.find('.menu'));\n\n td.find(\"input[name='line']\").val(idx);\n td.find(\"input[name='side']\").val(side === \"left\" ? \"previous\":\"proposed\");\n td.find(\"input[name='path']\").val(path);\n }\n commentCloud.find('textarea').focus();\n });\n}\n\nfunction assingMenuAttributes(menu) {\n const id = Math.floor(Math.random() * Math.floor(1000000));\n menu.attr('data-write', menu.attr('data-write') + id);\n menu.attr('data-preview', menu.attr('data-preview') + id);\n menu.find('.item').each(function() {\n const tab = $(this).attr('data-tab') + id;\n $(this).attr('data-tab', tab);\n });\n menu.parent().find(\"*[data-tab='write']\").attr('data-tab', 'write' + id);\n menu.parent().find(\"*[data-tab='preview']\").attr('data-tab', 'preview' + id);\n initCommentPreviewTab(menu.parent(\".form\"));\n return id;\n}\n\nfunction initRepositoryCollaboration() {\n // Change collaborator access mode\n $('.access-mode.menu .item').click(function () {\n const $menu = $(this).parent();\n $.post($menu.data('url'), {\n \"_csrf\": csrf,\n \"uid\": $menu.data('uid'),\n \"mode\": $(this).data('value')\n })\n });\n}\n\nfunction initTeamSettings() {\n // Change team access mode\n $('.organization.new.team input[name=permission]').change(function () {\n const val = $('input[name=permission]:checked', '.organization.new.team').val()\n if (val === 'admin') {\n $('.organization.new.team .team-units').hide();\n } else {\n $('.organization.new.team .team-units').show();\n }\n });\n}\n\nfunction initWikiForm() {\n const $editArea = $('.repository.wiki textarea#edit_area');\n if ($editArea.length > 0) {\n const simplemde = new SimpleMDE({\n autoDownloadFontAwesome: false,\n element: $editArea[0],\n forceSync: true,\n previewRender: function (plainText, preview) { // Async method\n setTimeout(function () {\n // FIXME: still send render request when return back to edit mode\n $.post($editArea.data('url'), {\n \"_csrf\": csrf,\n \"mode\": \"gfm\",\n \"context\": $editArea.data('context'),\n \"text\": plainText\n },\n function (data) {\n preview.innerHTML = '<div class=\"markdown ui segment\">' + data + '</div>';\n emojify.run($('.editor-preview')[0]);\n }\n );\n }, 0);\n\n return \"Loading...\";\n },\n renderingConfig: {\n singleLineBreaks: false\n },\n indentWithTabs: false,\n tabSize: 4,\n spellChecker: false,\n toolbar: [\"bold\", \"italic\", \"strikethrough\", \"|\",\n \"heading-1\", \"heading-2\", \"heading-3\", \"heading-bigger\", \"heading-smaller\", \"|\",\n {\n name: \"code-inline\",\n action: function(e){\n const cm = e.codemirror;\n const selection = cm.getSelection();\n cm.replaceSelection(\"`\" + selection + \"`\");\n if (!selection) {\n const cursorPos = cm.getCursor();\n cm.setCursor(cursorPos.line, cursorPos.ch - 1);\n }\n cm.focus();\n },\n className: \"fa fa-angle-right\",\n title: \"Add Inline Code\",\n },\"code\", \"quote\", \"|\", {\n name: \"checkbox-empty\",\n action: function(e){\n const cm = e.codemirror;\n cm.replaceSelection(\"\\n- [ ] \" + cm.getSelection());\n cm.focus();\n },\n className: \"fa fa-square-o\",\n title: \"Add Checkbox (empty)\",\n },\n {\n name: \"checkbox-checked\",\n action: function(e){\n const cm = e.codemirror;\n cm.replaceSelection(\"\\n- [x] \" + cm.getSelection());\n cm.focus();\n },\n className: \"fa fa-check-square-o\",\n title: \"Add Checkbox (checked)\",\n }, \"|\",\n \"unordered-list\", \"ordered-list\", \"|\",\n \"link\", \"image\", \"table\", \"horizontal-rule\", \"|\",\n \"clean-block\", \"preview\", \"fullscreen\"]\n })\n $(simplemde.codemirror.getInputField()).addClass(\"js-quick-submit\");\n }\n}\n\n// For IE\nString.prototype.endsWith = function (pattern) {\n const d = this.length - pattern.length;\n return d >= 0 && this.lastIndexOf(pattern) === d;\n};\n\n// Adding function to get the cursor position in a text field to jQuery object.\n$.fn.getCursorPosition = function () {\n const el = $(this).get(0);\n let pos = 0;\n if ('selectionStart' in el) {\n pos = el.selectionStart;\n } else if ('selection' in document) {\n el.focus();\n const Sel = document.selection.createRange();\n const SelLength = document.selection.createRange().text.length;\n Sel.moveStart('character', -el.value.length);\n pos = Sel.text.length - SelLength;\n }\n return pos;\n}\n\nfunction setSimpleMDE($editArea) {\n if (codeMirrorEditor) {\n codeMirrorEditor.toTextArea();\n codeMirrorEditor = null;\n }\n\n if (simpleMDEditor) {\n return true;\n }\n\n simpleMDEditor = new SimpleMDE({\n autoDownloadFontAwesome: false,\n element: $editArea[0],\n forceSync: true,\n renderingConfig: {\n singleLineBreaks: false\n },\n indentWithTabs: false,\n tabSize: 4,\n spellChecker: false,\n previewRender: function (plainText, preview) { // Async method\n setTimeout(function () {\n // FIXME: still send render request when return back to edit mode\n $.post($editArea.data('url'), {\n \"_csrf\": csrf,\n \"mode\": \"gfm\",\n \"context\": $editArea.data('context'),\n \"text\": plainText\n },\n function (data) {\n preview.innerHTML = '<div class=\"markdown ui segment\">' + data + '</div>';\n emojify.run($('.editor-preview')[0]);\n }\n );\n }, 0);\n\n return \"Loading...\";\n },\n toolbar: [\"bold\", \"italic\", \"strikethrough\", \"|\",\n \"heading-1\", \"heading-2\", \"heading-3\", \"heading-bigger\", \"heading-smaller\", \"|\",\n \"code\", \"quote\", \"|\",\n \"unordered-list\", \"ordered-list\", \"|\",\n \"link\", \"image\", \"table\", \"horizontal-rule\", \"|\",\n \"clean-block\", \"preview\", \"fullscreen\", \"side-by-side\"]\n });\n\n return true;\n}\n\nfunction setCodeMirror($editArea) {\n if (simpleMDEditor) {\n simpleMDEditor.toTextArea();\n simpleMDEditor = null;\n }\n\n if (codeMirrorEditor) {\n return true;\n }\n\n codeMirrorEditor = CodeMirror.fromTextArea($editArea[0], {\n lineNumbers: true\n });\n codeMirrorEditor.on(\"change\", function (cm, _change) {\n $editArea.val(cm.getValue());\n });\n\n return true;\n}\n\nfunction initEditor() {\n $('.js-quick-pull-choice-option').change(function () {\n if ($(this).val() == 'commit-to-new-branch') {\n $('.quick-pull-branch-name').show();\n $('.quick-pull-branch-name input').prop('required',true);\n } else {\n $('.quick-pull-branch-name').hide();\n $('.quick-pull-branch-name input').prop('required',false);\n }\n $('#commit-button').text($(this).attr('button_text'));\n });\n\n const $editFilename = $(\"#file-name\");\n $editFilename.keyup(function (e) {\n const $section = $('.breadcrumb span.section');\n const $divider = $('.breadcrumb div.divider');\n let value;\n let parts;\n\n if (e.keyCode == 8) {\n if ($(this).getCursorPosition() == 0) {\n if ($section.length > 0) {\n value = $section.last().find('a').text();\n $(this).val(value + $(this).val());\n $(this)[0].setSelectionRange(value.length, value.length);\n $section.last().remove();\n $divider.last().remove();\n }\n }\n }\n if (e.keyCode == 191) {\n parts = $(this).val().split('/');\n for (let i = 0; i < parts.length; ++i) {\n value = parts[i];\n if (i < parts.length - 1) {\n if (value.length) {\n $('<span class=\"section\"><a href=\"#\">' + value + '</a></span>').insertBefore($(this));\n $('<div class=\"divider\"> / </div>').insertBefore($(this));\n }\n }\n else {\n $(this).val(value);\n }\n $(this)[0].setSelectionRange(0, 0);\n }\n }\n parts = [];\n $('.breadcrumb span.section').each(function () {\n const element = $(this);\n if (element.find('a').length) {\n parts.push(element.find('a').text());\n } else {\n parts.push(element.text());\n }\n });\n if ($(this).val())\n parts.push($(this).val());\n $('#tree_path').val(parts.join('/'));\n }).trigger('keyup');\n\n const $editArea = $('.repository.editor textarea#edit_area');\n if (!$editArea.length)\n return;\n\n const markdownFileExts = $editArea.data(\"markdown-file-exts\").split(\",\");\n const lineWrapExtensions = $editArea.data(\"line-wrap-extensions\").split(\",\");\n\n $editFilename.on(\"keyup\", function () {\n const val = $editFilename.val();\n let mode, spec, extension, extWithDot, dataUrl, apiCall;\n\n extension = extWithDot = \"\";\n const m = /.+\\.([^.]+)$/.exec(val);\n if (m) {\n extension = m[1];\n extWithDot = \".\" + extension;\n }\n\n const info = CodeMirror.findModeByExtension(extension);\n const previewLink = $('a[data-tab=preview]');\n if (info) {\n mode = info.mode;\n spec = info.mime;\n apiCall = mode;\n }\n else {\n apiCall = extension\n }\n\n if (previewLink.length && apiCall && previewFileModes && previewFileModes.length && previewFileModes.indexOf(apiCall) >= 0) {\n dataUrl = previewLink.data('url');\n previewLink.data('url', dataUrl.replace(/(.*)\\/.*/i, '$1/' + mode));\n previewLink.show();\n }\n else {\n previewLink.hide();\n }\n\n // If this file is a Markdown extensions, we will load that editor and return\n if (markdownFileExts.indexOf(extWithDot) >= 0) {\n if (setSimpleMDE($editArea)) {\n return;\n }\n }\n\n // Else we are going to use CodeMirror\n if (!codeMirrorEditor && !setCodeMirror($editArea)) {\n return;\n }\n\n if (mode) {\n codeMirrorEditor.setOption(\"mode\", spec);\n CodeMirror.autoLoadMode(codeMirrorEditor, mode);\n }\n\n if (lineWrapExtensions.indexOf(extWithDot) >= 0) {\n codeMirrorEditor.setOption(\"lineWrapping\", true);\n }\n else {\n codeMirrorEditor.setOption(\"lineWrapping\", false);\n }\n\n // get the filename without any folder\n let value = $editFilename.val();\n if (value.length === 0) {\n return;\n }\n value = value.split('/');\n value = value[value.length - 1];\n\n $.getJSON($editFilename.data('ec-url-prefix')+value, function(editorconfig) {\n if (editorconfig.indent_style === 'tab') {\n codeMirrorEditor.setOption(\"indentWithTabs\", true);\n codeMirrorEditor.setOption('extraKeys', {});\n } else {\n codeMirrorEditor.setOption(\"indentWithTabs\", false);\n // required because CodeMirror doesn't seems to use spaces correctly for {\"indentWithTabs\": false}:\n // - https://github.com/codemirror/CodeMirror/issues/988\n // - https://codemirror.net/doc/manual.html#keymaps\n codeMirrorEditor.setOption('extraKeys', {\n Tab: function(cm) {\n const spaces = Array(parseInt(cm.getOption(\"indentUnit\")) + 1).join(\" \");\n cm.replaceSelection(spaces);\n }\n });\n }\n codeMirrorEditor.setOption(\"indentUnit\", editorconfig.indent_size || 4);\n codeMirrorEditor.setOption(\"tabSize\", editorconfig.tab_width || 4);\n });\n }).trigger('keyup');\n\n // Using events from https://github.com/codedance/jquery.AreYouSure#advanced-usage\n // to enable or disable the commit button\n const $commitButton = $('#commit-button');\n const $editForm = $('.ui.edit.form');\n const dirtyFileClass = 'dirty-file';\n\n // Disabling the button at the start\n $commitButton.prop('disabled', true);\n\n // Registering a custom listener for the file path and the file content\n $editForm.areYouSure({\n silent: true,\n dirtyClass: dirtyFileClass,\n fieldSelector: ':input:not(.commit-form-wrapper :input)',\n change: function () {\n const dirty = $(this).hasClass(dirtyFileClass);\n $commitButton.prop('disabled', !dirty);\n }\n });\n\n $commitButton.click(function (event) {\n // A modal which asks if an empty file should be committed\n if ($editArea.val().length === 0) {\n $('#edit-empty-content-modal').modal({\n onApprove: function () {\n $('.edit.form').submit();\n }\n }).modal('show');\n event.preventDefault();\n }\n });\n}\n\nfunction initOrganization() {\n if ($('.organization').length == 0) {\n return;\n }\n\n // Options\n if ($('.organization.settings.options').length > 0) {\n $('#org_name').keyup(function () {\n const $prompt = $('#org-name-change-prompt');\n if ($(this).val().toString().toLowerCase() != $(this).data('org-name').toString().toLowerCase()) {\n $prompt.show();\n } else {\n $prompt.hide();\n }\n });\n }\n}\n\nfunction initUserSettings() {\n // Options\n if ($('.user.settings.profile').length > 0) {\n $('#username').keyup(function () {\n const $prompt = $('#name-change-prompt');\n if ($(this).val().toString().toLowerCase() != $(this).data('name').toString().toLowerCase()) {\n $prompt.show();\n } else {\n $prompt.hide();\n }\n });\n }\n}\n\nfunction initWebhook() {\n if ($('.new.webhook').length == 0) {\n return;\n }\n\n $('.events.checkbox input').change(function () {\n if ($(this).is(':checked')) {\n $('.events.fields').show();\n }\n });\n $('.non-events.checkbox input').change(function () {\n if ($(this).is(':checked')) {\n $('.events.fields').hide();\n }\n });\n\n const updateContentType = function () {\n const visible = $('#http_method').val() === 'POST';\n $('#content_type').parent().parent()[visible ? 'show' : 'hide']();\n };\n updateContentType();\n $('#http_method').change(function () {\n updateContentType();\n });\n\n // Test delivery\n $('#test-delivery').click(function () {\n const $this = $(this);\n $this.addClass('loading disabled');\n $.post($this.data('link'), {\n \"_csrf\": csrf\n }).done(\n setTimeout(function () {\n window.location.href = $this.data('redirect');\n }, 5000)\n )\n });\n}\n\nfunction initAdmin() {\n if ($('.admin').length == 0) {\n return;\n }\n\n // New user\n if ($('.admin.new.user').length > 0 ||\n $('.admin.edit.user').length > 0) {\n $('#login_type').change(function () {\n if ($(this).val().substring(0, 1) == '0') {\n $('#login_name').removeAttr('required');\n $('.non-local').hide();\n $('.local').show();\n $('#user_name').focus();\n\n if ($(this).data('password') == \"required\") {\n $('#password').attr('required', 'required');\n }\n\n } else {\n $('#login_name').attr('required', 'required');\n $('.non-local').show();\n $('.local').hide();\n $('#login_name').focus();\n\n $('#password').removeAttr('required');\n }\n });\n }\n\n function onSecurityProtocolChange() {\n if ($('#security_protocol').val() > 0) {\n $('.has-tls').show();\n } else {\n $('.has-tls').hide();\n }\n }\n\n function onUsePagedSearchChange() {\n if ($('#use_paged_search').prop('checked')) {\n $('.search-page-size').show()\n .find('input').attr('required', 'required');\n } else {\n $('.search-page-size').hide()\n .find('input').removeAttr('required');\n }\n }\n\n function onOAuth2Change() {\n $('.open_id_connect_auto_discovery_url, .oauth2_use_custom_url').hide();\n $('.open_id_connect_auto_discovery_url input[required]').removeAttr('required');\n\n const provider = $('#oauth2_provider').val();\n switch (provider) {\n case 'github':\n case 'gitlab':\n case 'gitea':\n $('.oauth2_use_custom_url').show();\n break;\n case 'openidConnect':\n $('.open_id_connect_auto_discovery_url input').attr('required', 'required');\n $('.open_id_connect_auto_discovery_url').show();\n break;\n }\n onOAuth2UseCustomURLChange();\n }\n\n function onOAuth2UseCustomURLChange() {\n const provider = $('#oauth2_provider').val();\n $('.oauth2_use_custom_url_field').hide();\n $('.oauth2_use_custom_url_field input[required]').removeAttr('required');\n\n if ($('#oauth2_use_custom_url').is(':checked')) {\n if (!$('#oauth2_token_url').val()) {\n $('#oauth2_token_url').val($('#' + provider + '_token_url').val());\n }\n if (!$('#oauth2_auth_url').val()) {\n $('#oauth2_auth_url').val($('#' + provider + '_auth_url').val());\n }\n if (!$('#oauth2_profile_url').val()) {\n $('#oauth2_profile_url').val($('#' + provider + '_profile_url').val());\n }\n if (!$('#oauth2_email_url').val()) {\n $('#oauth2_email_url').val($('#' + provider + '_email_url').val());\n }\n switch (provider) {\n case 'github':\n $('.oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input, .oauth2_email_url input').attr('required', 'required');\n $('.oauth2_token_url, .oauth2_auth_url, .oauth2_profile_url, .oauth2_email_url').show();\n break;\n case 'gitea':\n case 'gitlab':\n $('.oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input').attr('required', 'required');\n $('.oauth2_token_url, .oauth2_auth_url, .oauth2_profile_url').show();\n $('#oauth2_email_url').val('');\n break;\n }\n }\n }\n\n // New authentication\n if ($('.admin.new.authentication').length > 0) {\n $('#auth_type').change(function () {\n $('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls .search-page-size').hide();\n\n $('.ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required]').removeAttr('required');\n $('.binddnrequired').removeClass(\"required\");\n\n const authType = $(this).val();\n switch (authType) {\n case '2': // LDAP\n $('.ldap').show();\n $('.binddnrequired input, .ldap div.required:not(.dldap) input').attr('required', 'required');\n $('.binddnrequired').addClass(\"required\");\n break;\n case '3': // SMTP\n $('.smtp').show();\n $('.has-tls').show();\n $('.smtp div.required input, .has-tls').attr('required', 'required');\n break;\n case '4': // PAM\n $('.pam').show();\n $('.pam input').attr('required', 'required');\n break;\n case '5': // LDAP\n $('.dldap').show();\n $('.dldap div.required:not(.ldap) input').attr('required', 'required');\n break;\n case '6': // OAuth2\n $('.oauth2').show();\n $('.oauth2 div.required:not(.oauth2_use_custom_url,.oauth2_use_custom_url_field,.open_id_connect_auto_discovery_url) input').attr('required', 'required');\n onOAuth2Change();\n break;\n }\n if (authType == '2' || authType == '5') {\n onSecurityProtocolChange()\n }\n if (authType == '2') {\n onUsePagedSearchChange();\n }\n });\n $('#auth_type').change();\n $('#security_protocol').change(onSecurityProtocolChange);\n $('#use_paged_search').change(onUsePagedSearchChange);\n $('#oauth2_provider').change(onOAuth2Change);\n $('#oauth2_use_custom_url').change(onOAuth2UseCustomURLChange);\n }\n // Edit authentication\n if ($('.admin.edit.authentication').length > 0) {\n const authType = $('#auth_type').val();\n if (authType == '2' || authType == '5') {\n $('#security_protocol').change(onSecurityProtocolChange);\n if (authType == '2') {\n $('#use_paged_search').change(onUsePagedSearchChange);\n }\n } else if (authType == '6') {\n $('#oauth2_provider').change(onOAuth2Change);\n $('#oauth2_use_custom_url').change(onOAuth2UseCustomURLChange);\n onOAuth2Change();\n }\n }\n\n // Notice\n if ($('.admin.notice')) {\n const $detailModal = $('#detail-modal');\n\n // Attach view detail modals\n $('.view-detail').click(function () {\n $detailModal.find('.content p').text($(this).data('content'));\n $detailModal.modal('show');\n return false;\n });\n\n // Select actions\n const $checkboxes = $('.select.table .ui.checkbox');\n $('.select.action').click(function () {\n switch ($(this).data('action')) {\n case 'select-all':\n $checkboxes.checkbox('check');\n break;\n case 'deselect-all':\n $checkboxes.checkbox('uncheck');\n break;\n case 'inverse':\n $checkboxes.checkbox('toggle');\n break;\n }\n });\n $('#delete-selection').click(function () {\n const $this = $(this);\n $this.addClass(\"loading disabled\");\n const ids = [];\n $checkboxes.each(function () {\n if ($(this).checkbox('is checked')) {\n ids.push($(this).data('id'));\n }\n });\n $.post($this.data('link'), {\n \"_csrf\": csrf,\n \"ids\": ids\n }).done(function () {\n window.location.href = $this.data('redirect');\n });\n });\n }\n}\n\nfunction buttonsClickOnEnter() {\n $('.ui.button').keypress(function (e) {\n if (e.keyCode == 13 || e.keyCode == 32) // enter key or space bar\n $(this).click();\n });\n}\n\nfunction searchUsers() {\n const $searchUserBox = $('#search-user-box');\n $searchUserBox.search({\n minCharacters: 2,\n apiSettings: {\n url: suburl + '/api/v1/users/search?q={query}',\n onResponse: function(response) {\n const items = [];\n $.each(response.data, function (_i, item) {\n let title = item.login;\n if (item.full_name && item.full_name.length > 0) {\n title += ' (' + htmlEncode(item.full_name) + ')';\n }\n items.push({\n title: title,\n image: item.avatar_url\n })\n });\n\n return { results: items }\n }\n },\n searchFields: ['login', 'full_name'],\n showNoResults: false\n });\n}\n\nfunction searchTeams() {\n const $searchTeamBox = $('#search-team-box');\n $searchTeamBox.search({\n minCharacters: 2,\n apiSettings: {\n url: suburl + '/api/v1/orgs/' + $searchTeamBox.data('org') + '/teams/search?q={query}',\n headers: {\"X-Csrf-Token\": csrf},\n onResponse: function(response) {\n const items = [];\n $.each(response.data, function (_i, item) {\n const title = item.name + ' (' + item.permission + ' access)';\n items.push({\n title: title,\n })\n });\n\n return { results: items }\n }\n },\n searchFields: ['name', 'description'],\n showNoResults: false\n });\n}\n\nfunction searchRepositories() {\n const $searchRepoBox = $('#search-repo-box');\n $searchRepoBox.search({\n minCharacters: 2,\n apiSettings: {\n url: suburl + '/api/v1/repos/search?q={query}&uid=' + $searchRepoBox.data('uid'),\n onResponse: function(response) {\n const items = [];\n $.each(response.data, function (_i, item) {\n items.push({\n title: item.full_name.split(\"/\")[1],\n description: item.full_name\n })\n });\n\n return { results: items }\n }\n },\n searchFields: ['full_name'],\n showNoResults: false\n });\n}\n\nfunction initCodeView() {\n if ($('.code-view .linenums').length > 0) {\n $(document).on('click', '.lines-num span', function (e) {\n const $select = $(this);\n const $list = $select.parent().siblings('.lines-code').find('ol.linenums > li');\n selectRange($list, $list.filter('[rel=' + $select.attr('id') + ']'), (e.shiftKey ? $list.filter('.active').eq(0) : null));\n deSelect();\n });\n\n $(window).on('hashchange', function () {\n let m = window.location.hash.match(/^#(L\\d+)-(L\\d+)$/);\n const $list = $('.code-view ol.linenums > li');\n let $first;\n if (m) {\n $first = $list.filter('.' + m[1]);\n selectRange($list, $first, $list.filter('.' + m[2]));\n $(\"html, body\").scrollTop($first.offset().top - 200);\n return;\n }\n m = window.location.hash.match(/^#(L|n)(\\d+)$/);\n if (m) {\n $first = $list.filter('.L' + m[2]);\n selectRange($list, $first);\n $(\"html, body\").scrollTop($first.offset().top - 200);\n }\n }).trigger('hashchange');\n }\n}\n\nfunction initU2FAuth() {\n if($('#wait-for-key').length === 0) {\n return\n }\n u2fApi.ensureSupport()\n .then(function () {\n $.getJSON(suburl + '/user/u2f/challenge').success(function(req) {\n u2fApi.sign(req.appId, req.challenge, req.registeredKeys, 30)\n .then(u2fSigned)\n .catch(function (err) {\n if(err === undefined) {\n u2fError(1);\n return\n }\n u2fError(err.metaData.code);\n });\n });\n }).catch(function () {\n // Fallback in case browser do not support U2F\n window.location.href = suburl + \"/user/two_factor\"\n })\n}\nfunction u2fSigned(resp) {\n $.ajax({\n url: suburl + '/user/u2f/sign',\n type: \"POST\",\n headers: {\"X-Csrf-Token\": csrf},\n data: JSON.stringify(resp),\n contentType: \"application/json; charset=utf-8\",\n }).done(function(res){\n window.location.replace(res);\n }).fail(function () {\n u2fError(1);\n });\n}\n\nfunction u2fRegistered(resp) {\n if (checkError(resp)) {\n return;\n }\n $.ajax({\n url: suburl + '/user/settings/security/u2f/register',\n type: \"POST\",\n headers: {\"X-Csrf-Token\": csrf},\n data: JSON.stringify(resp),\n contentType: \"application/json; charset=utf-8\",\n success: function(){\n reload();\n },\n fail: function () {\n u2fError(1);\n }\n });\n}\n\nfunction checkError(resp) {\n if (!('errorCode' in resp)) {\n return false;\n }\n if (resp.errorCode === 0) {\n return false;\n }\n u2fError(resp.errorCode);\n return true;\n}\n\n\nfunction u2fError(errorType) {\n const u2fErrors = {\n 'browser': $('#unsupported-browser'),\n 1: $('#u2f-error-1'),\n 2: $('#u2f-error-2'),\n 3: $('#u2f-error-3'),\n 4: $('#u2f-error-4'),\n 5: $('.u2f-error-5')\n };\n u2fErrors[errorType].removeClass('hide');\n for(const type in u2fErrors){\n if(type != errorType){\n u2fErrors[type].addClass('hide');\n }\n }\n $('#u2f-error').modal('show');\n}\n\nfunction initU2FRegister() {\n $('#register-device').modal({allowMultiple: false});\n $('#u2f-error').modal({allowMultiple: false});\n $('#register-security-key').on('click', function(e) {\n e.preventDefault();\n u2fApi.ensureSupport()\n .then(u2fRegisterRequest)\n .catch(function() {\n u2fError('browser');\n })\n })\n}\n\nfunction u2fRegisterRequest() {\n $.post(suburl + \"/user/settings/security/u2f/request_register\", {\n \"_csrf\": csrf,\n \"name\": $('#nickname').val()\n }).success(function(req) {\n $(\"#nickname\").closest(\"div.field\").removeClass(\"error\");\n $('#register-device').modal('show');\n if(req.registeredKeys === null) {\n req.registeredKeys = []\n }\n u2fApi.register(req.appId, req.registerRequests, req.registeredKeys, 30)\n .then(u2fRegistered)\n .catch(function (reason) {\n if(reason === undefined) {\n u2fError(1);\n return\n }\n u2fError(reason.metaData.code);\n });\n }).fail(function(xhr) {\n if(xhr.status === 409) {\n $(\"#nickname\").closest(\"div.field\").addClass(\"error\");\n }\n });\n}\n\nfunction initWipTitle() {\n $(\".title_wip_desc > a\").click(function (e) {\n e.preventDefault();\n\n const $issueTitle = $(\"#issue_title\");\n $issueTitle.focus();\n const value = $issueTitle.val().trim().toUpperCase();\n\n for (const i in wipPrefixes) {\n if (value.startsWith(wipPrefixes[i].toUpperCase())) {\n return;\n }\n }\n\n $issueTitle.val(wipPrefixes[0] + \" \" + $issueTitle.val());\n });\n}\n\nfunction initTemplateSearch() {\n const $repoTemplate = $(\"#repo_template\");\n const checkTemplate = function() {\n const $templateUnits = $(\"#template_units\");\n const $nonTemplate = $(\"#non_template\");\n if ($repoTemplate.val() !== \"\") {\n $templateUnits.show();\n $nonTemplate.hide();\n } else {\n $templateUnits.hide();\n $nonTemplate.show();\n }\n };\n $repoTemplate.change(checkTemplate);\n checkTemplate();\n\n const changeOwner = function() {\n $(\"#repo_template_search\")\n .dropdown({\n apiSettings: {\n url: suburl + '/api/v1/repos/search?q={query}&template=true&priority_owner_id=' + $(\"#uid\").val(),\n onResponse: function(response) {\n const filteredResponse = {'success': true, 'results': []};\n filteredResponse.results.push({\n 'name': '',\n 'value': ''\n });\n // Parse the response from the api to work with our dropdown\n $.each(response.data, function(_r, repo) {\n filteredResponse.results.push({\n 'name' : htmlEncode(repo.full_name) ,\n 'value' : repo.id\n });\n });\n return filteredResponse;\n },\n cache: false,\n },\n\n fullTextSearch: true\n });\n };\n $(\"#uid\").change(changeOwner);\n changeOwner();\n}\n\n$(document).ready(function () {\n csrf = $('meta[name=_csrf]').attr(\"content\");\n suburl = $('meta[name=_suburl]').attr(\"content\");\n\n // Show exact time\n $('.time-since').each(function () {\n $(this).addClass('poping up').attr('data-content', $(this).attr('title')).attr('data-variation', 'inverted tiny').attr('title', '');\n });\n\n // Semantic UI modules.\n $('.dropdown:not(.custom)').dropdown();\n $('.jump.dropdown').dropdown({\n action: 'hide',\n onShow: function () {\n $('.poping.up').popup('hide');\n }\n });\n $('.slide.up.dropdown').dropdown({\n transition: 'slide up'\n });\n $('.upward.dropdown').dropdown({\n direction: 'upward'\n });\n $('.ui.accordion').accordion();\n $('.ui.checkbox').checkbox();\n $('.ui.progress').progress({\n showActivity: false\n });\n $('.poping.up').popup();\n $('.top.menu .poping.up').popup({\n onShow: function () {\n if ($('.top.menu .menu.transition').hasClass('visible')) {\n return false;\n }\n }\n });\n $('.tabular.menu .item').tab();\n $('.tabable.menu .item').tab();\n\n $('.toggle.button').click(function () {\n $($(this).data('target')).slideToggle(100);\n });\n\n // make table <tr> element clickable like a link\n $('tr[data-href]').click(function() {\n window.location = $(this).data('href');\n });\n\n // Highlight JS\n if (typeof hljs != 'undefined') {\n const nodes = [].slice.call(document.querySelectorAll('pre code') || []);\n for (let i = 0; i < nodes.length; i++) {\n hljs.highlightBlock(nodes[i]);\n }\n }\n\n // Dropzone\n const $dropzone = $('#dropzone');\n if ($dropzone.length > 0) {\n const filenameDict = {};\n\n new Dropzone(\"#dropzone\", {\n url: $dropzone.data('upload-url'),\n headers: {\"X-Csrf-Token\": csrf},\n maxFiles: $dropzone.data('max-file'),\n maxFilesize: $dropzone.data('max-size'),\n acceptedFiles: ($dropzone.data('accepts') === '*/*') ? null : $dropzone.data('accepts'),\n addRemoveLinks: true,\n dictDefaultMessage: $dropzone.data('default-message'),\n dictInvalidFileType: $dropzone.data('invalid-input-type'),\n dictFileTooBig: $dropzone.data('file-too-big'),\n dictRemoveFile: $dropzone.data('remove-file'),\n init: function () {\n this.on(\"success\", function (file, data) {\n filenameDict[file.name] = data.uuid;\n const input = $('<input id=\"' + data.uuid + '\" name=\"files\" type=\"hidden\">').val(data.uuid);\n $('.files').append(input);\n });\n this.on(\"removedfile\", function (file) {\n if (file.name in filenameDict) {\n $('#' + filenameDict[file.name]).remove();\n }\n if ($dropzone.data('remove-url') && $dropzone.data('csrf')) {\n $.post($dropzone.data('remove-url'), {\n file: filenameDict[file.name],\n _csrf: $dropzone.data('csrf')\n });\n }\n })\n },\n });\n }\n\n // Emojify\n emojify.setConfig({\n img_dir: suburl + '/vendor/plugins/emojify/images',\n ignore_emoticons: true\n });\n const hasEmoji = document.getElementsByClassName('has-emoji');\n for (let i = 0; i < hasEmoji.length; i++) {\n emojify.run(hasEmoji[i]);\n for (let j = 0; j < hasEmoji[i].childNodes.length; j++) {\n if (hasEmoji[i].childNodes[j].nodeName === \"A\") {\n emojify.run(hasEmoji[i].childNodes[j])\n }\n }\n }\n\n // Clipboard JS\n const clipboard = new Clipboard('.clipboard');\n clipboard.on('success', function (e) {\n e.clearSelection();\n\n $('#' + e.trigger.getAttribute('id')).popup('destroy');\n e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-success'))\n $('#' + e.trigger.getAttribute('id')).popup('show');\n e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original'))\n });\n\n clipboard.on('error', function (e) {\n $('#' + e.trigger.getAttribute('id')).popup('destroy');\n e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-error'))\n $('#' + e.trigger.getAttribute('id')).popup('show');\n e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original'))\n });\n\n // Helpers.\n $('.delete-button').click(showDeletePopup);\n $('.add-all-button').click(showAddAllPopup);\n\n $('.delete-branch-button').click(showDeletePopup);\n\n $('.undo-button').click(function() {\n const $this = $(this);\n $.post($this.data('url'), {\n \"_csrf\": csrf,\n \"id\": $this.data(\"id\")\n }).done(function(data) {\n window.location.href = data.redirect;\n });\n });\n $('.show-panel.button').click(function () {\n $($(this).data('panel')).show();\n });\n $('.show-modal.button').click(function () {\n $($(this).data('modal')).modal('show');\n });\n $('.delete-post.button').click(function () {\n const $this = $(this);\n $.post($this.data('request-url'), {\n \"_csrf\": csrf\n }).done(function () {\n window.location.href = $this.data('done-url');\n });\n });\n\n // Set anchor.\n $('.markdown').each(function () {\n const headers = {};\n $(this).find('h1, h2, h3, h4, h5, h6').each(function () {\n let node = $(this);\n const val = encodeURIComponent(node.text().toLowerCase().replace(/[^\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w\\- ]/g, '').replace(/[ ]/g, '-'));\n let name = val;\n if (headers[val] > 0) {\n name = val + '-' + headers[val];\n }\n if (headers[val] == undefined) {\n headers[val] = 1;\n } else {\n headers[val] += 1;\n }\n node = node.wrap('<div id=\"' + name + '\" class=\"anchor-wrap\" ></div>');\n node.append('<a class=\"anchor\" href=\"#' + name + '\"><span class=\"octicon octicon-link\"></span></a>');\n });\n });\n\n $('.issue-checkbox').click(function() {\n const numChecked = $('.issue-checkbox').children('input:checked').length;\n if (numChecked > 0) {\n $('#issue-filters').addClass(\"hide\");\n $('#issue-actions').removeClass(\"hide\");\n } else {\n $('#issue-filters').removeClass(\"hide\");\n $('#issue-actions').addClass(\"hide\");\n }\n });\n\n $('.issue-action').click(function () {\n let action = this.dataset.action;\n let elementId = this.dataset.elementId;\n const issueIDs = $('.issue-checkbox').children('input:checked').map(function() {\n return this.dataset.issueId;\n }).get().join();\n const url = this.dataset.url;\n if (elementId === '0' && url.substr(-9) === '/assignee'){\n elementId = '';\n action = 'clear';\n }\n updateIssuesMeta(url, action, issueIDs, elementId).then(function() {\n // NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the checkboxes stay checked after reload\n if (action === \"close\" || action === \"open\" ){\n //uncheck all checkboxes\n $('.issue-checkbox input[type=\"checkbox\"]').each(function(_,e){ e.checked = false; });\n }\n reload();\n });\n });\n\n // NOTICE: This event trigger targets Firefox caching behaviour, as the checkboxes stay checked after reload\n // trigger ckecked event, if checkboxes are checked on load\n $('.issue-checkbox input[type=\"checkbox\"]:checked').first().each(function(_,e) {\n e.checked = false;\n $(e).click();\n });\n\n buttonsClickOnEnter();\n searchUsers();\n searchTeams();\n searchRepositories();\n\n initCommentForm();\n initInstall();\n initRepository();\n initMigration();\n initWikiForm();\n initEditForm();\n initEditor();\n initOrganization();\n initWebhook();\n initAdmin();\n initCodeView();\n initVueApp();\n initTeamSettings();\n initCtrlEnterSubmit();\n initNavbarContentToggle();\n initTopicbar();\n initU2FAuth();\n initU2FRegister();\n initIssueList();\n initWipTitle();\n initPullRequestReview();\n initRepoStatusChecker();\n initTemplateSearch();\n\n // Repo clone url.\n if ($('#repo-clone-url').length > 0) {\n switch (localStorage.getItem('repo-clone-protocol')) {\n case 'ssh':\n if ($('#repo-clone-ssh').click().length === 0) {\n $('#repo-clone-https').click();\n }\n break;\n default:\n $('#repo-clone-https').click();\n break;\n }\n }\n\n const routes = {\n 'div.user.settings': initUserSettings,\n 'div.repository.settings.collaboration': initRepositoryCollaboration\n };\n\n let selector;\n for (selector in routes) {\n if ($(selector).length > 0) {\n routes[selector]();\n break;\n }\n }\n\n const $cloneAddr = $('#clone_addr');\n $cloneAddr.change(function() {\n const $repoName = $('#repo_name');\n if ($cloneAddr.val().length > 0 && $repoName.val().length === 0) { // Only modify if repo_name input is blank\n $repoName.val($cloneAddr.val().match(/^(.*\\/)?((.+?)(\\.git)?)$/)[3]);\n }\n });\n});\n\nfunction changeHash(hash) {\n if (history.pushState) {\n history.pushState(null, null, hash);\n }\n else {\n location.hash = hash;\n }\n}\n\nfunction deSelect() {\n if (window.getSelection) {\n window.getSelection().removeAllRanges();\n } else {\n document.selection.empty();\n }\n}\n\nfunction selectRange($list, $select, $from) {\n $list.removeClass('active');\n if ($from) {\n let a = parseInt($select.attr('rel').substr(1));\n let b = parseInt($from.attr('rel').substr(1));\n let c;\n if (a != b) {\n if (a > b) {\n c = a;\n a = b;\n b = c;\n }\n const classes = [];\n for (let i = a; i <= b; i++) {\n classes.push('.L' + i);\n }\n $list.filter(classes.join(',')).addClass('active');\n changeHash('#L' + a + '-' + 'L' + b);\n return\n }\n }\n $select.addClass('active');\n changeHash('#' + $select.attr('rel'));\n}\n\n$(function () {\n // Warn users that try to leave a page after entering data into a form.\n // Except on sign-in pages, and for forms marked as 'ignore-dirty'.\n if ($('.user.signin').length === 0) {\n $('form:not(.ignore-dirty)').areYouSure();\n }\n\n // Parse SSH Key\n $(\"#ssh-key-content\").on('change paste keyup',function(){\n const arrays = $(this).val().split(\" \");\n const $title = $(\"#ssh-key-title\")\n if ($title.val() === \"\" && arrays.length === 3 && arrays[2] !== \"\") {\n $title.val(arrays[2]);\n }\n });\n});\n\nfunction showDeletePopup() {\n const $this = $(this);\n let filter = \"\";\n if ($this.attr(\"id\")) {\n filter += \"#\" + $this.attr(\"id\")\n }\n\n const dialog = $('.delete.modal' + filter);\n dialog.find('.name').text($this.data('name'));\n\n dialog.modal({\n closable: false,\n onApprove: function() {\n if ($this.data('type') == \"form\") {\n $($this.data('form')).submit();\n return;\n }\n\n $.post($this.data('url'), {\n \"_csrf\": csrf,\n \"id\": $this.data(\"id\")\n }).done(function(data) {\n window.location.href = data.redirect;\n });\n }\n }).modal('show');\n return false;\n}\n\nfunction showAddAllPopup() {\n const $this = $(this);\n let filter = \"\";\n if ($this.attr(\"id\")) {\n filter += \"#\" + $this.attr(\"id\")\n }\n\n const dialog = $('.addall.modal' + filter);\n dialog.find('.name').text($this.data('name'));\n\n dialog.modal({\n closable: false,\n onApprove: function() {\n if ($this.data('type') == \"form\") {\n $($this.data('form')).submit();\n return;\n }\n\n $.post($this.data('url'), {\n \"_csrf\": csrf,\n \"id\": $this.data(\"id\")\n }).done(function(data) {\n window.location.href = data.redirect;\n });\n }\n }).modal('show');\n return false;\n}\n\nfunction initVueComponents(){\n const vueDelimeters = ['${', '}'];\n\n Vue.component('repo-search', {\n delimiters: vueDelimeters,\n\n props: {\n searchLimit: {\n type: Number,\n default: 10\n },\n suburl: {\n type: String,\n required: true\n },\n uid: {\n type: Number,\n required: true\n },\n organizations: {\n type: Array,\n default: []\n },\n isOrganization: {\n type: Boolean,\n default: true\n },\n canCreateOrganization: {\n type: Boolean,\n default: false\n },\n organizationsTotalCount: {\n type: Number,\n default: 0\n },\n moreReposLink: {\n type: String,\n default: ''\n }\n },\n\n data: function() {\n return {\n tab: 'repos',\n repos: [],\n reposTotalCount: 0,\n reposFilter: 'all',\n searchQuery: '',\n isLoading: false,\n repoTypes: {\n 'all': {\n count: 0,\n searchMode: '',\n },\n 'forks': {\n count: 0,\n searchMode: 'fork',\n },\n 'mirrors': {\n count: 0,\n searchMode: 'mirror',\n },\n 'sources': {\n count: 0,\n searchMode: 'source',\n },\n 'collaborative': {\n count: 0,\n searchMode: 'collaborative',\n },\n }\n }\n },\n\n computed: {\n showMoreReposLink: function() {\n return this.repos.length > 0 && this.repos.length < this.repoTypes[this.reposFilter].count;\n },\n searchURL: function() {\n return this.suburl + '/api/v1/repos/search?sort=updated&order=desc&uid=' + this.uid + '&q=' + this.searchQuery\n + '&limit=' + this.searchLimit + '&mode=' + this.repoTypes[this.reposFilter].searchMode\n + (this.reposFilter !== 'all' ? '&exclusive=1' : '');\n },\n repoTypeCount: function() {\n return this.repoTypes[this.reposFilter].count;\n }\n },\n\n mounted: function() {\n this.searchRepos(this.reposFilter);\n\n const self = this;\n Vue.nextTick(function() {\n self.$refs.search.focus();\n });\n },\n\n methods: {\n changeTab: function(t) {\n this.tab = t;\n },\n\n changeReposFilter: function(filter) {\n this.reposFilter = filter;\n this.repos = [];\n this.repoTypes[filter].count = 0;\n this.searchRepos(filter);\n },\n\n showRepo: function(repo, filter) {\n switch (filter) {\n case 'sources':\n return repo.owner.id == this.uid && !repo.mirror && !repo.fork;\n case 'forks':\n return repo.owner.id == this.uid && !repo.mirror && repo.fork;\n case 'mirrors':\n return repo.mirror;\n case 'collaborative':\n return repo.owner.id != this.uid && !repo.mirror;\n default:\n return true;\n }\n },\n\n searchRepos: function(reposFilter) {\n const self = this;\n\n this.isLoading = true;\n\n const searchedMode = this.repoTypes[reposFilter].searchMode;\n const searchedURL = this.searchURL;\n const searchedQuery = this.searchQuery;\n\n $.getJSON(searchedURL, function(result, _textStatus, request) {\n if (searchedURL == self.searchURL) {\n self.repos = result.data;\n const count = request.getResponseHeader('X-Total-Count');\n if (searchedQuery === '' && searchedMode === '') {\n self.reposTotalCount = count;\n }\n self.repoTypes[reposFilter].count = count;\n }\n }).always(function() {\n if (searchedURL == self.searchURL) {\n self.isLoading = false;\n }\n });\n },\n\n repoClass: function(repo) {\n if (repo.fork) {\n return 'octicon octicon-repo-forked';\n } else if (repo.mirror) {\n return 'octicon octicon-repo-clone';\n } else if (repo.private) {\n return 'octicon octicon-lock';\n } else {\n return 'octicon octicon-repo';\n }\n }\n }\n })\n}\n\nfunction initCtrlEnterSubmit() {\n $(\".js-quick-submit\").keydown(function(e) {\n if (((e.ctrlKey && !e.altKey) || e.metaKey) && (e.keyCode == 13 || e.keyCode == 10)) {\n $(this).closest(\"form\").submit();\n }\n });\n}\n\nfunction initVueApp() {\n const el = document.getElementById('app');\n if (!el) {\n return;\n }\n\n initVueComponents();\n\n new Vue({\n delimiters: ['${', '}'],\n el: el,\n\n data: {\n searchLimit: document.querySelector('meta[name=_search_limit]').content,\n suburl: document.querySelector('meta[name=_suburl]').content,\n uid: document.querySelector('meta[name=_context_uid]').content,\n },\n });\n}\n\nwindow.timeAddManual = function() {\n $('.mini.modal')\n .modal({\n duration: 200,\n onApprove: function() {\n $('#add_time_manual_form').submit();\n }\n }).modal('show')\n ;\n}\n\nwindow.toggleStopwatch = function() {\n $(\"#toggle_stopwatch_form\").submit();\n}\nwindow.cancelStopwatch = function() {\n $(\"#cancel_stopwatch_form\").submit();\n}\n\nwindow.initHeatmap = function(appElementId, heatmapUser, locale) {\n const el = document.getElementById(appElementId);\n if (!el) {\n return;\n }\n\n locale = locale || {};\n\n locale.contributions = locale.contributions || 'contributions';\n locale.no_contributions = locale.no_contributions || 'No contributions';\n\n const vueDelimeters = ['${', '}'];\n\n Vue.component('activity-heatmap', {\n delimiters: vueDelimeters,\n\n props: {\n user: {\n type: String,\n required: true\n },\n suburl: {\n type: String,\n required: true\n },\n locale: {\n type: Object,\n required: true\n }\n },\n\n data: function () {\n return {\n isLoading: true,\n colorRange: [],\n endDate: null,\n values: [],\n totalContributions: 0,\n };\n },\n\n mounted: function() {\n this.colorRange = [\n this.getColor(0),\n this.getColor(1),\n this.getColor(2),\n this.getColor(3),\n this.getColor(4),\n this.getColor(5)\n ];\n this.endDate = new Date();\n this.loadHeatmap(this.user);\n },\n\n methods: {\n loadHeatmap: function(userName) {\n const self = this;\n $.get(this.suburl + '/api/v1/users/' + userName + '/heatmap', function(chartRawData) {\n const chartData = [];\n for (let i = 0; i < chartRawData.length; i++) {\n self.totalContributions += chartRawData[i].contributions;\n chartData[i] = { date: new Date(chartRawData[i].timestamp * 1000), count: chartRawData[i].contributions };\n }\n self.values = chartData;\n self.isLoading = false;\n });\n },\n\n getColor: function(idx) {\n const el = document.createElement('div');\n el.className = 'heatmap-color-' + idx;\n document.body.appendChild(el);\n\n const color = getComputedStyle(el).backgroundColor;\n\n document.body.removeChild(el);\n\n return color;\n }\n },\n\n template: '<div><div v-show=\"isLoading\"><slot name=\"loading\"></slot></div><h4 class=\"total-contributions\" v-if=\"!isLoading\"><span v-html=\"totalContributions\"></span> total contributions in the last 12 months</h4><calendar-heatmap v-show=\"!isLoading\" :locale=\"locale\" :no-data-text=\"locale.no_contributions\" :tooltip-unit=\"locale.contributions\" :end-date=\"endDate\" :values=\"values\" :range-color=\"colorRange\" />'\n });\n\n new Vue({\n delimiters: vueDelimeters,\n el: el,\n\n data: {\n suburl: document.querySelector('meta[name=_suburl]').content,\n heatmapUser: heatmapUser,\n locale: locale\n },\n });\n}\n\nfunction initFilterBranchTagDropdown(selector) {\n $(selector).each(function() {\n const $dropdown = $(this);\n const $data = $dropdown.find('.data');\n const data = {\n items: [],\n mode: $data.data('mode'),\n searchTerm: '',\n noResults: '',\n canCreateBranch: false,\n menuVisible: false,\n active: 0\n };\n $data.find('.item').each(function() {\n data.items.push({\n name: $(this).text(),\n url: $(this).data('url'),\n branch: $(this).hasClass('branch'),\n tag: $(this).hasClass('tag'),\n selected: $(this).hasClass('selected')\n });\n });\n $data.remove();\n new Vue({\n delimiters: ['${', '}'],\n el: this,\n data: data,\n\n beforeMount: function () {\n const vm = this;\n\n this.noResults = vm.$el.getAttribute('data-no-results');\n this.canCreateBranch = vm.$el.getAttribute('data-can-create-branch') === 'true';\n\n document.body.addEventListener('click', function(event) {\n if (vm.$el.contains(event.target)) {\n return;\n }\n if (vm.menuVisible) {\n Vue.set(vm, 'menuVisible', false);\n }\n });\n },\n\n watch: {\n menuVisible: function(visible) {\n if (visible) {\n this.focusSearchField();\n }\n }\n },\n\n computed: {\n filteredItems: function() {\n const vm = this;\n\n const items = vm.items.filter(function (item) {\n return ((vm.mode === 'branches' && item.branch)\n || (vm.mode === 'tags' && item.tag))\n && (!vm.searchTerm\n || item.name.toLowerCase().indexOf(vm.searchTerm.toLowerCase()) >= 0);\n });\n\n vm.active = (items.length === 0 && vm.showCreateNewBranch ? 0 : -1);\n\n return items;\n },\n showNoResults: function() {\n return this.filteredItems.length === 0\n && !this.showCreateNewBranch;\n },\n showCreateNewBranch: function() {\n const vm = this;\n if (!this.canCreateBranch || !vm.searchTerm || vm.mode === 'tags') {\n return false;\n }\n\n return vm.items.filter(function (item) {\n return item.name.toLowerCase() === vm.searchTerm.toLowerCase()\n }).length === 0;\n }\n },\n\n methods: {\n selectItem: function(item) {\n const prev = this.getSelected();\n if (prev !== null) {\n prev.selected = false;\n }\n item.selected = true;\n window.location.href = item.url;\n },\n createNewBranch: function() {\n if (!this.showCreateNewBranch) {\n return;\n }\n this.$refs.newBranchForm.submit();\n },\n focusSearchField: function() {\n const vm = this;\n Vue.nextTick(function() {\n vm.$refs.searchField.focus();\n });\n },\n getSelected: function() {\n for (let i = 0, j = this.items.length; i < j; ++i) {\n if (this.items[i].selected)\n return this.items[i];\n }\n return null;\n },\n getSelectedIndexInFiltered: function() {\n for (let i = 0, j = this.filteredItems.length; i < j; ++i) {\n if (this.filteredItems[i].selected)\n return i;\n }\n return -1;\n },\n scrollToActive: function() {\n let el = this.$refs['listItem' + this.active];\n if (!el || el.length === 0) {\n return;\n }\n if (Array.isArray(el)) {\n el = el[0];\n }\n\n const cont = this.$refs.scrollContainer;\n\n if (el.offsetTop < cont.scrollTop) {\n cont.scrollTop = el.offsetTop;\n }\n else if (el.offsetTop + el.clientHeight > cont.scrollTop + cont.clientHeight) {\n cont.scrollTop = el.offsetTop + el.clientHeight - cont.clientHeight;\n }\n },\n keydown: function(event) {\n const vm = this;\n if (event.keyCode === 40) {\n // arrow down\n event.preventDefault();\n\n if (vm.active === -1) {\n vm.active = vm.getSelectedIndexInFiltered();\n }\n\n if (vm.active + (vm.showCreateNewBranch ? 0 : 1) >= vm.filteredItems.length) {\n return;\n }\n vm.active++;\n vm.scrollToActive();\n }\n if (event.keyCode === 38) {\n // arrow up\n event.preventDefault();\n\n if (vm.active === -1) {\n vm.active = vm.getSelectedIndexInFiltered();\n }\n\n if (vm.active <= 0) {\n return;\n }\n vm.active--;\n vm.scrollToActive();\n }\n if (event.keyCode == 13) {\n // enter\n event.preventDefault();\n\n if (vm.active >= vm.filteredItems.length) {\n vm.createNewBranch();\n } else if (vm.active >= 0) {\n vm.selectItem(vm.filteredItems[vm.active]);\n }\n }\n if (event.keyCode == 27) {\n // escape\n event.preventDefault();\n vm.menuVisible = false;\n }\n }\n }\n });\n });\n}\n\n$(\".commit-button\").click(function(e) {\n e.preventDefault();\n $(this).parent().find('.commit-body').toggle();\n});\n\nfunction initNavbarContentToggle() {\n const content = $('#navbar');\n const toggle = $('#navbar-expand-toggle');\n let isExpanded = false;\n toggle.click(function() {\n isExpanded = !isExpanded;\n if (isExpanded) {\n content.addClass('shown');\n toggle.addClass('active');\n }\n else {\n content.removeClass('shown');\n toggle.removeClass('active');\n }\n });\n}\n\nfunction initTopicbar() {\n const mgrBtn = $(\"#manage_topic\");\n const editDiv = $(\"#topic_edit\");\n const viewDiv = $(\"#repo-topics\");\n const saveBtn = $(\"#save_topic\");\n const topicDropdown = $('#topic_edit .dropdown');\n const topicForm = $('#topic_edit.ui.form');\n const topicPrompts = getPrompts();\n\n mgrBtn.click(function() {\n viewDiv.hide();\n editDiv.css('display', ''); // show Semantic UI Grid\n });\n\n function getPrompts() {\n const hidePrompt = $(\"div.hide#validate_prompt\"),\n prompts = {\n countPrompt: hidePrompt.children('#count_prompt').text(),\n formatPrompt: hidePrompt.children('#format_prompt').text()\n };\n hidePrompt.remove();\n return prompts;\n }\n\n saveBtn.click(function() {\n const topics = $(\"input[name=topics]\").val();\n\n $.post(saveBtn.data('link'), {\n \"_csrf\": csrf,\n \"topics\": topics\n }, function(_data, _textStatus, xhr){\n if (xhr.responseJSON.status === 'ok') {\n viewDiv.children(\".topic\").remove();\n if (topics.length) {\n const topicArray = topics.split(\",\");\n\n const last = viewDiv.children(\"a\").last();\n for (let i=0; i < topicArray.length; i++) {\n $('<div class=\"ui small label topic\" style=\"cursor:pointer;\">'+topicArray[i]+'</div>').insertBefore(last)\n }\n }\n editDiv.css('display', 'none');\n viewDiv.show();\n }\n }).fail(function(xhr){\n if (xhr.status === 422) {\n if (xhr.responseJSON.invalidTopics.length > 0) {\n topicPrompts.formatPrompt = xhr.responseJSON.message;\n\n const invalidTopics = xhr.responseJSON.invalidTopics,\n topicLables = topicDropdown.children('a.ui.label');\n\n topics.split(',').forEach(function(value, index) {\n for (let i=0; i < invalidTopics.length; i++) {\n if (invalidTopics[i] === value) {\n topicLables.eq(index).removeClass(\"green\").addClass(\"red\");\n }\n }\n });\n } else {\n topicPrompts.countPrompt = xhr.responseJSON.message;\n }\n }\n }).always(function() {\n topicForm.form('validate form');\n });\n });\n\n topicDropdown.dropdown({\n allowAdditions: true,\n forceSelection: false,\n fields: { name: \"description\", value: \"data-value\" },\n saveRemoteData: false,\n label: {\n transition : 'horizontal flip',\n duration : 200,\n variation : false,\n blue : true,\n basic: true,\n },\n className: {\n label: 'ui small label'\n },\n apiSettings: {\n url: suburl + '/api/v1/topics/search?q={query}',\n throttle: 500,\n cache: false,\n onResponse: function(res) {\n const formattedResponse = {\n success: false,\n results: [],\n };\n const stripTags = function (text) {\n return text.replace(/<[^>]*>?/gm, \"\");\n };\n\n const query = stripTags(this.urlData.query.trim());\n let found_query = false;\n const current_topics = [];\n topicDropdown.find('div.label.visible.topic,a.label.visible').each(function(_,e){ current_topics.push(e.dataset.value); });\n\n if (res.topics) {\n let found = false;\n for (let i=0;i < res.topics.length;i++) {\n // skip currently added tags\n if (current_topics.indexOf(res.topics[i].topic_name) != -1){\n continue;\n }\n\n if (res.topics[i].topic_name.toLowerCase() === query.toLowerCase()){\n found_query = true;\n }\n formattedResponse.results.push({\"description\": res.topics[i].topic_name, \"data-value\": res.topics[i].topic_name});\n found = true;\n }\n formattedResponse.success = found;\n }\n\n if (query.length > 0 && !found_query){\n formattedResponse.success = true;\n formattedResponse.results.unshift({\"description\": query, \"data-value\": query});\n } else if (query.length > 0 && found_query) {\n formattedResponse.results.sort(function(a, b){\n if (a.description.toLowerCase() === query.toLowerCase()) return -1;\n if (b.description.toLowerCase() === query.toLowerCase()) return 1;\n if (a.description > b.description) return -1;\n if (a.description < b.description) return 1;\n return 0;\n });\n }\n\n\n return formattedResponse;\n },\n },\n onLabelCreate: function(value) {\n value = value.toLowerCase().trim();\n this.attr(\"data-value\", value).contents().first().replaceWith(value);\n return $(this);\n },\n onAdd: function(addedValue, _addedText, $addedChoice) {\n addedValue = addedValue.toLowerCase().trim();\n $($addedChoice).attr('data-value', addedValue);\n $($addedChoice).attr('data-text', addedValue);\n }\n });\n\n $.fn.form.settings.rules.validateTopic = function(_values, regExp) {\n const topics = topicDropdown.children('a.ui.label'),\n status = topics.length === 0 || topics.last().attr(\"data-value\").match(regExp);\n if (!status) {\n topics.last().removeClass(\"green\").addClass(\"red\");\n }\n return status && topicDropdown.children('a.ui.label.red').length === 0;\n };\n\n topicForm.form({\n on: 'change',\n inline : true,\n fields: {\n topics: {\n identifier: 'topics',\n rules: [\n {\n type: 'validateTopic',\n value: /^[a-z0-9][a-z0-9-]{1,35}$/,\n prompt: topicPrompts.formatPrompt\n },\n {\n type: 'maxCount[25]',\n prompt: topicPrompts.countPrompt\n }\n ]\n },\n }\n });\n}\nwindow.toggleDeadlineForm = function() {\n $('#deadlineForm').fadeToggle(150);\n}\n\nwindow.setDeadline = function() {\n const deadline = $('#deadlineDate').val();\n window.updateDeadline(deadline);\n}\n\nwindow.updateDeadline = function(deadlineString) {\n $('#deadline-err-invalid-date').hide();\n $('#deadline-loader').addClass('loading');\n\n let realDeadline = null;\n if (deadlineString !== '') {\n\n const newDate = Date.parse(deadlineString)\n\n if (isNaN(newDate)) {\n $('#deadline-loader').removeClass('loading');\n $('#deadline-err-invalid-date').show();\n return false;\n }\n realDeadline = new Date(newDate);\n }\n\n $.ajax($('#update-issue-deadline-form').attr('action') + '/deadline', {\n data: JSON.stringify({\n 'due_date': realDeadline,\n }),\n headers: {\n 'X-Csrf-Token': csrf,\n 'X-Remote': true,\n },\n contentType: 'application/json',\n type: 'POST',\n success: function () {\n reload();\n },\n error: function () {\n $('#deadline-loader').removeClass('loading');\n $('#deadline-err-invalid-date').show();\n }\n });\n}\n\nwindow.deleteDependencyModal = function(id, type) {\n $('.remove-dependency')\n .modal({\n closable: false,\n duration: 200,\n onApprove: function () {\n $('#removeDependencyID').val(id);\n $('#dependencyType').val(type);\n $('#removeDependencyForm').submit();\n }\n }).modal('show')\n ;\n}\n\nfunction initIssueList() {\n const repolink = $('#repolink').val();\n const repoId = $('#repoId').val();\n const crossRepoSearch = $('#crossRepoSearch').val();\n let issueSearchUrl = suburl + '/api/v1/repos/' + repolink + '/issues?q={query}';\n if (crossRepoSearch === 'true') {\n issueSearchUrl = suburl + '/api/v1/repos/issues/search?q={query}&priority_repo_id=' + repoId;\n }\n $('#new-dependency-drop-list')\n .dropdown({\n apiSettings: {\n url: issueSearchUrl,\n onResponse: function(response) {\n const filteredResponse = {'success': true, 'results': []};\n const currIssueId = $('#new-dependency-drop-list').data('issue-id');\n // Parse the response from the api to work with our dropdown\n $.each(response, function(_i, issue) {\n // Don't list current issue in the dependency list.\n if(issue.id === currIssueId) {\n return;\n }\n filteredResponse.results.push({\n 'name' : '#' + issue.number + ' ' + htmlEncode(issue.title) +\n '<div class=\"text small dont-break-out\">' + htmlEncode(issue.repository.full_name) + '</div>',\n 'value' : issue.id\n });\n });\n return filteredResponse;\n },\n cache: false,\n },\n\n fullTextSearch: true\n });\n\n $(\".menu a.label-filter-item\").each(function() {\n $(this).click(function(e) {\n if (e.altKey) {\n e.preventDefault();\n\n const href = $(this).attr(\"href\");\n const id = $(this).data(\"label-id\");\n\n const regStr = \"labels=(-?[0-9]+%2c)*(\" + id + \")(%2c-?[0-9]+)*&\";\n const newStr = \"labels=$1-$2$3&\";\n\n window.location = href.replace(new RegExp(regStr), newStr);\n }\n });\n });\n\n $(\".menu .ui.dropdown.label-filter\").keydown(function(e) {\n if (e.altKey && e.keyCode == 13) {\n const selectedItems = $(\".menu .ui.dropdown.label-filter .menu .item.selected\");\n\n if (selectedItems.length > 0) {\n const item = $(selectedItems[0]);\n\n const href = item.attr(\"href\");\n const id = item.data(\"label-id\");\n\n const regStr = \"labels=(-?[0-9]+%2c)*(\" + id + \")(%2c-?[0-9]+)*&\";\n const newStr = \"labels=$1-$2$3&\";\n\n window.location = href.replace(new RegExp(regStr), newStr);\n }\n }\n });\n}\nwindow.cancelCodeComment = function(btn) {\n const form = $(btn).closest(\"form\");\n if(form.length > 0 && form.hasClass('comment-form')) {\n form.addClass('hide');\n form.parent().find('button.comment-form-reply').show();\n } else {\n form.closest('.comment-code-cloud').remove()\n }\n}\nwindow.onOAuthLoginClick = function() {\n const oauthLoader = $('#oauth2-login-loader');\n const oauthNav = $('#oauth2-login-navigator');\n\n oauthNav.hide();\n oauthLoader.removeClass('disabled');\n\n setTimeout(function(){\n // recover previous content to let user try again\n // usually redirection will be performed before this action\n oauthLoader.addClass('disabled');\n oauthNav.show();\n },5000);\n}\n"],"sourceRoot":""}