Skip to content

Commit

Permalink
use module script
Browse files Browse the repository at this point in the history
  • Loading branch information
hueitan committed Nov 13, 2023
1 parent 38408ee commit d6e27d1
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions demo/articles/arabic.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../index.html">
Expand Down Expand Up @@ -52,8 +52,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'ar'
});
Expand Down
6 changes: 3 additions & 3 deletions demo/articles/bahasaIndonesia.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../index.html">
Expand Down Expand Up @@ -49,8 +49,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'id',
detectLinks: true
Expand Down
10 changes: 5 additions & 5 deletions demo/articles/english.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../../dist/style.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../../index.html">
<a href="../index.html">
<div class="header">Wikipedia Preview demo</div>
</a>
<div class="container">
<div class="cover" style="background-image: url('../img/english-pic.png');">
<a href="../../index.html">
<a href="../index.html">
<div class="close-btn">
<div class="outer">
<img alt="Image/" src="../img/oval.png" class="oval" />
Expand Down Expand Up @@ -52,8 +52,8 @@
</p>
</div>
<!-- Scripts -->
<script type="module" src="../../dist/wikipedia-preview.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'en',
detectLinks: true,
Expand Down
6 changes: 3 additions & 3 deletions demo/articles/french.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../index.html">
Expand Down Expand Up @@ -52,8 +52,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'fr'
});
Expand Down
6 changes: 3 additions & 3 deletions demo/articles/hindi.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../index.html">
Expand Down Expand Up @@ -55,8 +55,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'hi'
});
Expand Down
6 changes: 3 additions & 3 deletions demo/articles/spanish.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
<style>
@media screen and (max-width: 650px) {
.customize-background-position {
Expand Down Expand Up @@ -64,8 +64,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'es'
});
Expand Down
6 changes: 3 additions & 3 deletions demo/articles/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../index.html">
Expand Down Expand Up @@ -52,8 +52,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'en',
events: {
Expand Down
6 changes: 3 additions & 3 deletions demo/articles/thai.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="../css/header.css" rel="stylesheet" type="text/css"/>
<link href="../css/footer.css" rel="stylesheet" type="text/css"/>
<link href="../css/article.css" rel="stylesheet" type="text/css"/>
<link href="../wikipedia-preview.css" rel="stylesheet" type="text/css"/>
<link href="../../style/link.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<a href="../index.html">
Expand Down Expand Up @@ -49,8 +49,8 @@
</p>
</div>
<!-- Scripts -->
<script src="../wikipedia-preview.development.js"></script>
<script>
<script type="module">
import wikipediaPreview from '/src/index.js' ;
wikipediaPreview.init({
lang: 'th'
});
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ function init( {

// version()

export { init, version, getPreviewHtml }
export default { init, version, getPreviewHtml }
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
// plugins: [
// vue(),
// ],
base: './',
base: '/',
resolve: {
alias: {
'@': fileURLToPath(new URL('./demo', import.meta.url))
Expand Down

0 comments on commit d6e27d1

Please sign in to comment.