-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rough out plugin-standalone logic #10672
- Loading branch information
Showing
4 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineAsyncComponent } from 'vue'; | ||
import createVueApplication from 'utils/create-vue-application'; | ||
|
||
const pluginData = require('views/plugin-data'); | ||
|
||
// workaround for webpack failures surrounding dynamic imports | ||
const vuePluginPath = pluginData['component'].replace('src/', '').replace('.vue', ''); | ||
const AsyncComponent = defineAsyncComponent(() => import(`@/${vuePluginPath}.vue`)); | ||
|
||
const pluginMountingPoint = document.querySelector('#plugin-mounting-point'); | ||
pluginMountingPoint.setAttribute("id", pluginData['slug']); | ||
|
||
createVueApplication(AsyncComponent).then(vueApp => { | ||
vueApp.mount(`#${pluginData['slug']}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!-- | ||
ARCHES - a program developed to inventory and manage immovable cultural heritage. | ||
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
{% load static %} | ||
{% load webpack_static from webpack_loader %} | ||
|
||
|
||
<!DOCTYPE html> | ||
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> | ||
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]--> | ||
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> | ||
|
||
<head> | ||
<title> | ||
{% block title %} {{ app_settings.APP_NAME }} - {{ plugin.name }} {% endblock title %} | ||
</title> | ||
|
||
<!-- Meta --> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
<link rel="shortcut icon" href="{% webpack_static 'favicons/favicon.ico' %}" type="image/x-icon" /> | ||
<link rel="apple-touch-icon" href="{% webpack_static 'favicons/apple-touch-icon.png' %}" /> | ||
<link rel="apple-touch-icon" sizes="76x76" href="{% webpack_static 'favicons/apple-touch-icon-76x76.png' %}" /> | ||
<link rel="apple-touch-icon" sizes="120x120" href="{% webpack_static 'favicons/apple-touch-icon-120x120.png' %}" /> | ||
<link rel="apple-touch-icon" sizes="152x152" href="{% webpack_static 'favicons/apple-touch-icon-152x152.png' %}" /> | ||
<link rel="apple-touch-icon" sizes="180x180" href="{% webpack_static 'favicons/apple-touch-icon-180x180.png' %}" /> | ||
|
||
{% block css %} | ||
<!-- POC rough out of PrimeVue theme switcher --> | ||
<link rel="stylesheet" href="{% webpack_static 'node_modules/primevue/resources/themes/mdc-light-indigo/theme.css' %}" /> | ||
{% endblock css %} | ||
</head> | ||
|
||
<body> | ||
{% block main_content %} | ||
<div id="plugin-mounting-point"></div> | ||
{% endblock main_content %} | ||
</body> | ||
|
||
{% block javascript %} | ||
<script src="{% webpack_static 'node_modules/requirejs/require.js' %}"></script> | ||
|
||
{% block pre_require_js %} | ||
<div | ||
id="pluginData" | ||
style="display: none;" | ||
pluginData='{{ plugin_json }}' | ||
></div> | ||
{% endblock pre_require_js %} | ||
|
||
{% if main_script %} | ||
<script src="{% webpack_static '' %}build/js/{{main_script}}.js"></script> | ||
{% endif %} | ||
|
||
{% if app_settings.GOOGLE_ANALYTICS_TRACKING_ID != None %} | ||
<script> | ||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | ||
|
||
ga('create', '{{app_settings.GOOGLE_ANALYTICS_TRACKING_ID}}', 'auto'); | ||
ga('send', 'pageview'); | ||
</script> | ||
{% endif %} | ||
{% endblock javascript %} | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters