mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	@@ -1,5 +1,5 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import Vue from 'vue';
 | 
			
		||||
import {createApp} from 'vue';
 | 
			
		||||
import ContextPopup from '../components/ContextPopup.vue';
 | 
			
		||||
import {parseIssueHref} from '../utils.js';
 | 
			
		||||
import {createTippy} from '../modules/tippy.js';
 | 
			
		||||
@@ -17,17 +17,12 @@ export default function initContextPopups() {
 | 
			
		||||
    if (!owner) return;
 | 
			
		||||
 | 
			
		||||
    const el = document.createElement('div');
 | 
			
		||||
    el.innerHTML = '<div></div>';
 | 
			
		||||
    this.parentNode.insertBefore(el, this.nextSibling);
 | 
			
		||||
 | 
			
		||||
    const View = Vue.extend({
 | 
			
		||||
      render: (createElement) => createElement(ContextPopup),
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const view = new View();
 | 
			
		||||
    const view = createApp(ContextPopup);
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
      view.$mount(el.firstChild);
 | 
			
		||||
      view.mount(el);
 | 
			
		||||
    } catch (err) {
 | 
			
		||||
      console.error(err);
 | 
			
		||||
      el.textContent = 'ContextPopup failed to load';
 | 
			
		||||
@@ -37,7 +32,7 @@ export default function initContextPopups() {
 | 
			
		||||
      content: el,
 | 
			
		||||
      interactive: true,
 | 
			
		||||
      onShow: () => {
 | 
			
		||||
        view.$emit('load-context-popup', {owner, repo, index});
 | 
			
		||||
        el.firstChild.dispatchEvent(new CustomEvent('us-load-context-popup', {detail: {owner, repo, index}}));
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
import Vue from 'vue';
 | 
			
		||||
import {createApp} from 'vue';
 | 
			
		||||
import ActivityHeatmap from '../components/ActivityHeatmap.vue';
 | 
			
		||||
 | 
			
		||||
export default function initHeatmap() {
 | 
			
		||||
@@ -17,11 +17,9 @@ export default function initHeatmap() {
 | 
			
		||||
      return {date: new Date(v), count: heatmap[v]};
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const View = Vue.extend({
 | 
			
		||||
      render: (createElement) => createElement(ActivityHeatmap, {props: {values}}),
 | 
			
		||||
    });
 | 
			
		||||
    const View = createApp(ActivityHeatmap, {values});
 | 
			
		||||
 | 
			
		||||
    new View().$mount(el);
 | 
			
		||||
    View.mount(el);
 | 
			
		||||
  } catch (err) {
 | 
			
		||||
    console.error('Heatmap failed to load', err);
 | 
			
		||||
    el.textContent = 'Heatmap failed to load';
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,17 @@
 | 
			
		||||
import Vue from 'vue';
 | 
			
		||||
import {createApp} from 'vue';
 | 
			
		||||
import DiffFileTree from '../components/DiffFileTree.vue';
 | 
			
		||||
import DiffFileList from '../components/DiffFileList.vue';
 | 
			
		||||
 | 
			
		||||
export default function initDiffFileTree() {
 | 
			
		||||
  const el = document.getElementById('diff-file-tree-container');
 | 
			
		||||
  const el = document.getElementById('diff-file-tree');
 | 
			
		||||
  if (!el) return;
 | 
			
		||||
 | 
			
		||||
  const View = Vue.extend({
 | 
			
		||||
    render: (createElement) => createElement(DiffFileTree),
 | 
			
		||||
  });
 | 
			
		||||
  new View().$mount(el);
 | 
			
		||||
  const fileTreeView = createApp(DiffFileTree);
 | 
			
		||||
  fileTreeView.mount(el);
 | 
			
		||||
 | 
			
		||||
  const fileListElement = document.getElementById('diff-file-list-container');
 | 
			
		||||
  const fileListElement = document.getElementById('diff-file-list');
 | 
			
		||||
  if (!fileListElement) return;
 | 
			
		||||
 | 
			
		||||
  const fileListView = Vue.extend({
 | 
			
		||||
    render: (createElement) => createElement(DiffFileList),
 | 
			
		||||
  });
 | 
			
		||||
  new fileListView().$mount(fileListElement);
 | 
			
		||||
  const fileListView = createApp(DiffFileList);
 | 
			
		||||
  fileListView.mount(fileListElement);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,10 @@
 | 
			
		||||
import Vue from 'vue';
 | 
			
		||||
import {createApp} from 'vue';
 | 
			
		||||
import PullRequestMergeForm from '../components/PullRequestMergeForm.vue';
 | 
			
		||||
 | 
			
		||||
export default function initPullRequestMergeForm() {
 | 
			
		||||
  const el = document.getElementById('pull-request-merge-form');
 | 
			
		||||
  if (!el) return;
 | 
			
		||||
 | 
			
		||||
  const View = Vue.extend({
 | 
			
		||||
    render: (createElement) => createElement(PullRequestMergeForm),
 | 
			
		||||
  });
 | 
			
		||||
  new View().$mount(el);
 | 
			
		||||
  const view = createApp(PullRequestMergeForm);
 | 
			
		||||
  view.mount(el);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user