{"version":3,"sources":["webpack:///./pager.js","webpack:///./blob/viewer/index.js","webpack:///./activities.js","webpack:///./notifications_form.js","webpack:///./notifications_dropdown.js","webpack:///./user_callout.js","webpack:///./tree.js","webpack:///./star.js","webpack:///./pages/projects/show/index.js"],"names":["__webpack_exports__","init","limit","arguments","length","undefined","preload","disable","prepareData","jquery__WEBPACK_IMPORTED_MODULE_0___default","a","noop","callback","this","url","data","Object","_lib_utils_url_utility__WEBPACK_IMPORTED_MODULE_3__","offset","parseInt","_lib_utils_common_utils__WEBPACK_IMPORTED_MODULE_1__","loading","first","getOld","initLoadMore","_this","show","_lib_utils_axios_utils__WEBPACK_IMPORTED_MODULE_2__","get","params","then","_ref","append","count","html","isScrollable","hide","catch","$w","window","document","height","scrollTop","_this2","off","endlessScroll","bottomPixels","fireDelay","fireOnce","ceaseFire","is","BlobViewer","_classCallCheck","initAuxiliaryViewer","initRichViewer","initMainViewers","$fileHolder","switcher","querySelector","switcherBtns","querySelectorAll","copySourceBtn","simpleViewer","richViewer","initBindings","switchToInitialViewer","initialViewerName","getAttribute","location","hash","indexOf","switchToViewer","Array","from","forEach","el","addEventListener","switchViewHandler","bind","classList","contains","blur","e","target","currentTarget","preventDefault","setAttribute","remove","activeViewer","add","tooltip","name","newViewer","oldButton","newButton","oldViewer","toggleCopyButtonState","loadViewer","viewer","renderGFM","trigger","_lib_utils_common_utils__WEBPACK_IMPORTED_MODULE_2__","_flash__WEBPACK_IMPORTED_MODULE_1__","auxiliaryViewer","dataset","richType","initViewer","promise","module","default","error","Promise","all","__webpack_require__","viewerParam","resolve","_lib_utils_axios_utils__WEBPACK_IMPORTED_MODULE_3__","innerHTML","Activities","_pager__WEBPACK_IMPORTED_MODULE_2__","updateTooltips","on","toggleFilter","reloadActivities","_lib_utils_datetime_utility__WEBPACK_IMPORTED_MODULE_3__","sender","$sender","filter","attr","split","removeClass","js_cookie__WEBPACK_IMPORTED_MODULE_1___default","set","closest","toggleClass","NotificationsForm","toggleCheckbox","initEventListeners","$checkbox","$parent","saveEvent","addClass","find","form","parents","showCheckboxLoadingSpinner","serialize","enable","saved","setTimeout","_flash__WEBPACK_IMPORTED_MODULE_3__","_locale__WEBPACK_IMPORTED_MODULE_1__","notificationsDropdown","notificationLevel","val","submit","replaceWith","UserCallout","options","className","userCalloutBody","$","cookieName","isCalloutDismissed","dismissCallout","$currentTarget","setCalloutPerProject","expires","path","hasClass","TreeView","initKeyNav","$clickedEl","metaKey","which","open","_lib_utils_url_utility__WEBPACK_IMPORTED_MODULE_1__","li","liSelected","keydown","next","eq","focus","prev","last","Star","jquery_default","$this","$starSpan","$startIcon","axios_utils","post","isStarred","parent","text","star_count","locale","prepend","common_utils","flash","star","notifications_dropdown","shortcuts_navigation","notifications_form","user_callout","treeSlider","tree","blob_bundle","activities","waitForImages","logsPath"],"mappings":"mIAQAA,EAAA,GACEC,KADa,WAC8E,IAAtFC,EAAsFC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAA9E,EAAGG,EAA2EH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAA1DI,EAA0DJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAAzCK,EAAyCL,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAA3BM,EAAAC,EAAEC,KAAMC,EAAmBT,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAARM,EAAAC,EAAEC,KACnFE,KAAKC,IAAML,IAAE,iBAAiBM,KAAK,SAAWC,OAAAC,EAAA,EAAAD,EAAc,QAAS,WACrEH,KAAKX,MAAQA,EACbW,KAAKK,OAASC,SAASH,OAAAI,EAAA,EAAAJ,CAAmB,UAAW,KAAOH,KAAKX,MACjEW,KAAKN,QAAUA,EACfM,KAAKL,YAAcA,EACnBK,KAAKD,SAAWA,EAChBC,KAAKQ,QAAUZ,IAAE,YAAYa,QACzBhB,IACFO,KAAKK,OAAS,EACdL,KAAKU,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AS,WAAWqD,KAAKlL,OAAAoL,EAAA,EAAApL,CAAG,WACtC6K,EAAWtG,SACXoG,EAAMU,QAAQrL,OAAAsL,EAAA,EAAAtL,CAAW,YAG5BqB,MAAM,kBAAMrB,OAAAuL,EAAA,EAAAvL,CAAM,sDChB3BwB,SAASoC,iBAAiB,mBAAoB,WAC5C,IAAI4H,EACJxL,OAAAyL,EAAA,EAAAzL,GACA,IAAI0L,EAAA,EACJ,IAAIC,EAAA,EACJ,IAAIC,EAAA,GACFtC,sBAAsB,EACtBP,UAAW,yBAIb,IAAM8C,EAAarK,SAASkB,cAAc,gBACtCmJ,IACF,IAAIC,EAAA,EACJ9L,OAAA+L,EAAA,EAAA/L,IAGEwB,SAASkB,cAAc,iBACzB,IAAIwC,EAAA,EAGF1D,SAASkB,cAAc,2BACzB,IAAIsJ,EAAA,EAGNtB,IAAEmB,GAAYI,cAAc,WAC1BjM,OAAAsL,EAAA,EAAAtL,CAAQwB,SAASkB,cAAc,oBAAoB8C,QAAQ0G","file":"pages.projects.show.29e0323d.chunk.js","sourcesContent":["import $ from 'jquery';\nimport { getParameterByName } from '~/lib/utils/common_utils';\nimport axios from './lib/utils/axios_utils';\nimport { removeParams } from './lib/utils/url_utility';\n\nconst ENDLESS_SCROLL_BOTTOM_PX = 400;\nconst ENDLESS_SCROLL_FIRE_DELAY_MS = 1000;\n\nexport default {\n init(limit = 0, preload = false, disable = false, prepareData = $.noop, callback = $.noop) {\n this.url = $('.content_list').data('href') || removeParams(['limit', 'offset']);\n this.limit = limit;\n this.offset = parseInt(getParameterByName('offset'), 10) || this.limit;\n this.disable = disable;\n this.prepareData = prepareData;\n this.callback = callback;\n this.loading = $('.loading').first();\n if (preload) {\n this.offset = 0;\n this.getOld();\n }\n this.initLoadMore();\n },\n\n getOld() {\n this.loading.show();\n axios.get(this.url, {\n params: {\n limit: this.limit,\n offset: this.offset,\n },\n }).then(({ data }) => {\n this.append(data.count, this.prepareData(data.html));\n this.callback();\n\n // keep loading until we've filled the viewport height\n if (!this.disable && !this.isScrollable()) {\n this.getOld();\n } else {\n this.loading.hide();\n }\n }).catch(() => this.loading.hide());\n },\n\n append(count, html) {\n $('.content_list').append(html);\n if (count > 0) {\n this.offset += count;\n } else {\n this.disable = true;\n }\n },\n\n isScrollable() {\n const $w = $(window);\n return $(document).height() > $w.height() + $w.scrollTop() + ENDLESS_SCROLL_BOTTOM_PX;\n },\n\n initLoadMore() {\n $(document).off('scroll');\n $(document).endlessScroll({\n bottomPixels: ENDLESS_SCROLL_BOTTOM_PX,\n fireDelay: ENDLESS_SCROLL_FIRE_DELAY_MS,\n fireOnce: true,\n ceaseFire: () => this.disable === true,\n callback: () => {\n if (!this.loading.is(':visible')) {\n this.loading.show();\n this.getOld();\n }\n },\n });\n },\n};\n","import $ from 'jquery';\nimport Flash from '../../flash';\nimport { handleLocationHash } from '../../lib/utils/common_utils';\nimport axios from '../../lib/utils/axios_utils';\n\nexport default class BlobViewer {\n constructor() {\n BlobViewer.initAuxiliaryViewer();\n BlobViewer.initRichViewer();\n\n this.initMainViewers();\n }\n\n static initAuxiliaryViewer() {\n const auxiliaryViewer = document.querySelector('.blob-viewer[data-type=\"auxiliary\"]');\n if (!auxiliaryViewer) return;\n\n BlobViewer.loadViewer(auxiliaryViewer);\n }\n\n static initRichViewer() {\n const viewer = document.querySelector('.blob-viewer[data-type=\"rich\"]');\n if (!viewer || !viewer.dataset.richType) return;\n\n const initViewer = promise => promise\n .then(module => module.default(viewer))\n .catch((error) => {\n Flash('Error loading file viewer.');\n throw error;\n });\n\n switch (viewer.dataset.richType) {\n case 'balsamiq':\n initViewer(import(/* webpackChunkName: 'balsamiq_viewer' */ '../balsamiq_viewer'));\n break;\n case 'notebook':\n initViewer(import(/* webpackChunkName: 'notebook_viewer' */ '../notebook_viewer'));\n break;\n case 'pdf':\n initViewer(import(/* webpackChunkName: 'pdf_viewer' */ '../pdf_viewer'));\n break;\n case 'sketch':\n initViewer(import(/* webpackChunkName: 'sketch_viewer' */ '../sketch_viewer'));\n break;\n case 'stl':\n initViewer(import(/* webpackChunkName: 'stl_viewer' */ '../stl_viewer'));\n break;\n default:\n break;\n }\n }\n\n initMainViewers() {\n this.$fileHolder = $('.file-holder');\n if (!this.$fileHolder.length) return;\n\n this.switcher = document.querySelector('.js-blob-viewer-switcher');\n this.switcherBtns = document.querySelectorAll('.js-blob-viewer-switch-btn');\n this.copySourceBtn = document.querySelector('.js-copy-blob-source-btn');\n\n this.simpleViewer = this.$fileHolder[0].querySelector('.blob-viewer[data-type=\"simple\"]');\n this.richViewer = this.$fileHolder[0].querySelector('.blob-viewer[data-type=\"rich\"]');\n\n this.initBindings();\n\n this.switchToInitialViewer();\n }\n\n switchToInitialViewer() {\n const initialViewer = this.$fileHolder[0].querySelector('.blob-viewer:not(.hidden)');\n let initialViewerName = initialViewer.getAttribute('data-type');\n\n if (this.switcher && location.hash.indexOf('#L') === 0) {\n initialViewerName = 'simple';\n }\n\n this.switchToViewer(initialViewerName);\n }\n\n initBindings() {\n if (this.switcherBtns.length) {\n Array.from(this.switcherBtns)\n .forEach((el) => {\n el.addEventListener('click', this.switchViewHandler.bind(this));\n });\n }\n\n if (this.copySourceBtn) {\n this.copySourceBtn.addEventListener('click', () => {\n if (this.copySourceBtn.classList.contains('disabled')) return this.copySourceBtn.blur();\n\n return this.switchToViewer('simple');\n });\n }\n }\n\n switchViewHandler(e) {\n const target = e.currentTarget;\n\n e.preventDefault();\n\n this.switchToViewer(target.getAttribute('data-viewer'));\n }\n\n toggleCopyButtonState() {\n if (!this.copySourceBtn) return;\n\n if (this.simpleViewer.getAttribute('data-loaded')) {\n this.copySourceBtn.setAttribute('title', '复制源码到剪贴板');\n this.copySourceBtn.classList.remove('disabled');\n } else if (this.activeViewer === this.simpleViewer) {\n this.copySourceBtn.setAttribute('title', '等待源码加载以将其复制到剪贴板');\n this.copySourceBtn.classList.add('disabled');\n } else {\n this.copySourceBtn.setAttribute('title', '切换到源码以将其复制到剪贴板');\n this.copySourceBtn.classList.add('disabled');\n }\n\n $(this.copySourceBtn).tooltip('_fixTitle');\n }\n\n switchToViewer(name) {\n const newViewer = this.$fileHolder[0].querySelector(`.blob-viewer[data-type='${name}']`);\n if (this.activeViewer === newViewer) return;\n\n const oldButton = document.querySelector('.js-blob-viewer-switch-btn.active');\n const newButton = document.querySelector(`.js-blob-viewer-switch-btn[data-viewer='${name}']`);\n const oldViewer = this.$fileHolder[0].querySelector(`.blob-viewer:not([data-type='${name}'])`);\n\n if (oldButton) {\n oldButton.classList.remove('active');\n }\n\n if (newButton) {\n newButton.classList.add('active');\n newButton.blur();\n }\n\n if (oldViewer) {\n oldViewer.classList.add('hidden');\n }\n\n newViewer.classList.remove('hidden');\n\n this.activeViewer = newViewer;\n\n this.toggleCopyButtonState();\n\n BlobViewer.loadViewer(newViewer)\n .then((viewer) => {\n $(viewer).renderGFM();\n\n this.$fileHolder.trigger('highlight:line');\n handleLocationHash();\n\n this.toggleCopyButtonState();\n })\n .catch(() => new Flash('Error loading viewer'));\n }\n\n static loadViewer(viewerParam) {\n const viewer = viewerParam;\n const url = viewer.getAttribute('data-url');\n\n if (!url || viewer.getAttribute('data-loaded') || viewer.getAttribute('data-loading')) {\n return Promise.resolve(viewer);\n }\n\n viewer.setAttribute('data-loading', 'true');\n\n return axios.get(url)\n .then(({ data }) => {\n viewer.innerHTML = data.html;\n viewer.setAttribute('data-loaded', 'true');\n\n return viewer;\n });\n }\n}\n","/* eslint-disable no-param-reassign, class-methods-use-this */\n\nimport $ from 'jquery';\nimport Cookies from 'js-cookie';\nimport Pager from './pager';\nimport { localTimeAgo } from './lib/utils/datetime_utility';\n\nexport default class Activities {\n constructor() {\n Pager.init(20, true, false, data => data, this.updateTooltips);\n\n $('.event-filter-link').on('click', (e) => {\n e.preventDefault();\n this.toggleFilter(e.currentTarget);\n this.reloadActivities();\n });\n }\n\n updateTooltips() {\n localTimeAgo($('.js-timeago', '.content_list'));\n }\n\n reloadActivities() {\n $('.content_list').html('');\n Pager.init(20, true, false, data => data, this.updateTooltips);\n }\n\n toggleFilter(sender) {\n const $sender = $(sender);\n const filter = $sender.attr('id').split('_')[0];\n\n $('.event-filter .active').removeClass('active');\n Cookies.set('event_filter', filter);\n\n $sender.closest('li').toggleClass('active');\n }\n}\n","import $ from 'jquery';\nimport { __ } from './locale';\nimport axios from './lib/utils/axios_utils';\nimport flash from './flash';\n\nexport default class NotificationsForm {\n constructor() {\n this.toggleCheckbox = this.toggleCheckbox.bind(this);\n this.initEventListeners();\n }\n\n initEventListeners() {\n $(document).on('change', '.js-custom-notification-event', this.toggleCheckbox);\n }\n\n toggleCheckbox(e) {\n const $checkbox = $(e.currentTarget);\n const $parent = $checkbox.closest('.form-check');\n\n this.saveEvent($checkbox, $parent);\n }\n\n // eslint-disable-next-line class-methods-use-this\n showCheckboxLoadingSpinner($parent) {\n $parent.addClass('is-loading')\n .find('.custom-notification-event-loading')\n .removeClass('fa-check')\n .addClass('fa-spin fa-spinner')\n .removeClass('is-done');\n }\n\n saveEvent($checkbox, $parent) {\n const form = $parent.parents('form:first');\n\n this.showCheckboxLoadingSpinner($parent);\n\n axios[form.attr('method')](form.attr('action'), form.serialize())\n .then(({ data }) => {\n $checkbox.enable();\n if (data.saved) {\n $parent.find('.custom-notification-event-loading').toggleClass('fa-spin fa-spinner fa-check is-done');\n setTimeout(() => {\n $parent.removeClass('is-loading')\n .find('.custom-notification-event-loading')\n .toggleClass('fa-spin fa-spinner fa-check is-done');\n }, 2000);\n }\n })\n .catch(() => flash(__('There was an error saving your notification settings.')));\n }\n}\n","import $ from 'jquery';\nimport Flash from './flash';\n\nexport default function notificationsDropdown() {\n $(document).on('click', '.update-notification', function updateNotificationCallback(e) {\n e.preventDefault();\n if ($(this).is('.is-active') && $(this).data('notificationLevel') === 'custom') {\n return;\n }\n\n const notificationLevel = $(this).data('notificationLevel');\n const form = $(this).parents('.notification-form:first');\n\n form.find('.js-notification-loading').toggleClass('fa-bell fa-spin fa-spinner');\n form.find('#notification_setting_level').val(notificationLevel);\n form.submit();\n });\n\n $(document).on('ajax:success', '.notification-form', (e, data) => {\n if (data.saved) {\n $(e.currentTarget).closest('.js-notification-dropdown').replaceWith(data.html);\n } else {\n Flash('Failed to save new settings', 'alert');\n }\n });\n}\n","import $ from 'jquery';\nimport Cookies from 'js-cookie';\n\nexport default class UserCallout {\n constructor(options = {}) {\n this.options = options;\n\n const className = this.options.className || 'user-callout';\n\n this.userCalloutBody = $(`.${className}`);\n this.cookieName = this.userCalloutBody.data('uid');\n this.isCalloutDismissed = Cookies.get(this.cookieName);\n this.init();\n }\n\n init() {\n if (!this.isCalloutDismissed || this.isCalloutDismissed === 'false') {\n this.userCalloutBody.find('.js-close-callout').on('click', e => this.dismissCallout(e));\n }\n }\n\n dismissCallout(e) {\n const $currentTarget = $(e.currentTarget);\n\n if (this.options.setCalloutPerProject) {\n Cookies.set(this.cookieName, 'true', {\n expires: 365,\n path: this.userCalloutBody.data('projectPath'),\n });\n } else {\n Cookies.set(this.cookieName, 'true', { expires: 365 });\n }\n\n if ($currentTarget.hasClass('close') || $currentTarget.hasClass('js-close')) {\n this.userCalloutBody.remove();\n }\n }\n}\n","/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, quotes, consistent-return, no-var, one-var, one-var-declaration-per-line, no-else-return, prefer-arrow-callback, class-methods-use-this */\n\nimport $ from 'jquery';\nimport { visitUrl } from './lib/utils/url_utility';\n\nexport default class TreeView {\n constructor() {\n this.initKeyNav();\n // Code browser tree slider\n // Make the entire tree-item row clickable, but not if clicking another link (like a commit message)\n $(\".tree-content-holder .tree-item\").on('click', function(e) {\n var $clickedEl, path;\n $clickedEl = $(e.target);\n path = $('.tree-item-file-name a', this).attr('href');\n if (!$clickedEl.is('a') && !$clickedEl.is('.str-truncated')) {\n if (e.metaKey || e.which === 2) {\n e.preventDefault();\n return window.open(path, '_blank');\n } else {\n return visitUrl(path);\n }\n }\n });\n // Show the \"Loading commit data\" for only the first element\n $('span.log_loading:first').removeClass('hide');\n }\n\n initKeyNav() {\n var li, liSelected;\n li = $(\"tr.tree-item\");\n liSelected = null;\n return $('body').keydown(function(e) {\n var next, path;\n if ($(\"input:focus\").length > 0 && (e.which === 38 || e.which === 40)) {\n return false;\n }\n if (e.which === 40) {\n if (liSelected) {\n next = liSelected.next();\n if (next.length > 0) {\n liSelected.removeClass(\"selected\");\n liSelected = next.addClass(\"selected\");\n }\n } else {\n liSelected = li.eq(0).addClass(\"selected\");\n }\n return $(liSelected).focus();\n } else if (e.which === 38) {\n if (liSelected) {\n next = liSelected.prev();\n if (next.length > 0) {\n liSelected.removeClass(\"selected\");\n liSelected = next.addClass(\"selected\");\n }\n } else {\n liSelected = li.last().addClass(\"selected\");\n }\n return $(liSelected).focus();\n } else if (e.which === 13) {\n path = $('.tree-item.selected .tree-item-file-name a').attr('href');\n if (path) {\n return visitUrl(path);\n }\n }\n });\n }\n}\n","import $ from 'jquery';\nimport Flash from './flash';\nimport { __, s__ } from './locale';\nimport { spriteIcon } from './lib/utils/common_utils';\nimport axios from './lib/utils/axios_utils';\n\nexport default class Star {\n constructor() {\n $('.project-home-panel .toggle-star').on('click', function toggleStarClickCallback() {\n const $this = $(this);\n const $starSpan = $this.find('span');\n const $startIcon = $this.find('svg');\n\n axios.post($this.data('endpoint'))\n .then(({ data }) => {\n const isStarred = $starSpan.hasClass('starred');\n $this.parent().find('.star-count').text(data.star_count);\n\n if (isStarred) {\n $starSpan.removeClass('starred').text(s__('StarProject|Star'));\n $startIcon.remove();\n $this.prepend(spriteIcon('star-o'));\n } else {\n $starSpan.addClass('starred').text(__('Unstar'));\n $startIcon.remove();\n $this.prepend(spriteIcon('star'));\n }\n })\n .catch(() => Flash('Star toggle failed. Try again later.'));\n });\n }\n}\n","import $ from 'jquery';\nimport initBlob from '~/blob_edit/blob_bundle';\nimport ShortcutsNavigation from '~/shortcuts_navigation';\nimport NotificationsForm from '~/notifications_form';\nimport UserCallout from '~/user_callout';\nimport TreeView from '~/tree';\nimport BlobViewer from '~/blob/viewer/index';\nimport Activities from '~/activities';\nimport { ajaxGet } from '~/lib/utils/common_utils';\nimport Star from '../../../star';\nimport notificationsDropdown from '../../../notifications_dropdown';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n new Star(); // eslint-disable-line no-new\n notificationsDropdown();\n new ShortcutsNavigation(); // eslint-disable-line no-new\n new NotificationsForm(); // eslint-disable-line no-new\n new UserCallout({ // eslint-disable-line no-new\n setCalloutPerProject: true,\n className: 'js-autodevops-banner',\n });\n\n // Project show page loads different overview content based on user preferences\n const treeSlider = document.querySelector('#tree-slider');\n if (treeSlider) {\n new TreeView(); // eslint-disable-line no-new\n initBlob();\n }\n\n if (document.querySelector('.blob-viewer')) {\n new BlobViewer(); // eslint-disable-line no-new\n }\n\n if (document.querySelector('.project-show-activity')) {\n new Activities(); // eslint-disable-line no-new\n }\n\n $(treeSlider).waitForImages(() => {\n ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath);\n });\n});\n"],"sourceRoot":""}