summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorMax Wu2016-11-03 14:17:10 +0800
committerGitHub2016-11-03 14:17:10 +0800
commit11faadb6842cacce7572526f533cb9351fc5f562 (patch)
treef466289e42547a163058a29f4e573061b3fb8abf /public
parent734d475c0e2dc467a657d350d8a37ec8aa800da7 (diff)
parent689b1dc4d6f438a6e58ee354d71ee4f2def11eae (diff)
Merge pull request #242 from Yukaii/webpack-stylesheet
Use webpack to bundle stylesheet
Diffstat (limited to '')
-rw-r--r--public/js/cover.js3
-rw-r--r--public/js/extra.js2
-rw-r--r--public/js/htmlExport.js5
-rw-r--r--public/js/index.js7
-rw-r--r--public/js/pretty.js4
-rw-r--r--public/js/slide.js3
-rw-r--r--public/views/head.ejs6
-rw-r--r--public/views/index.ejs2
-rw-r--r--public/views/pretty.ejs3
-rw-r--r--public/views/slide.ejs5
10 files changed, 26 insertions, 14 deletions
diff --git a/public/js/cover.js b/public/js/cover.js
index c02f6c81..6bc55dd9 100644
--- a/public/js/cover.js
+++ b/public/js/cover.js
@@ -1,5 +1,8 @@
require('./locale');
+require('../css/cover.css');
+require('../css/site.css');
+
var common = require('./common');
var checkIfAuth = common.checkIfAuth;
var urlpath = common.urlpath;
diff --git a/public/js/extra.js b/public/js/extra.js
index 01363886..81dd4a28 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -588,7 +588,7 @@ function exportToHTML(view) {
var tocAffix = $('#ui-toc-affix').clone();
tocAffix.find('*').removeClass('active').find("a[href^='#'][smoothhashscroll]").removeAttr('smoothhashscroll');
//generate html via template
- $.get(serverurl + '/css/html.min.css', function (css) {
+ $.get(serverurl + '/build/html.min.css', function (css) {
$.get(serverurl + '/views/html.hbs', function (data) {
var template = Handlebars.compile(data);
var context = {
diff --git a/public/js/htmlExport.js b/public/js/htmlExport.js
new file mode 100644
index 00000000..e9fc41c6
--- /dev/null
+++ b/public/js/htmlExport.js
@@ -0,0 +1,5 @@
+require('../css/github-extract.css');
+require('../css/markdown.css');
+require('../css/extra.css');
+require('../css/slide-preview.css');
+require('../css/site.css');
diff --git a/public/js/index.js b/public/js/index.js
index bb2a31f6..9c77ba8d 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1,6 +1,11 @@
/* jquery and jquery plugins */
require('../vendor/showup/showup');
+require('../css/index.css');
+require('../css/extra.css');
+require('../css/slide-preview.css');
+require('../css/site.css');
+
var toMarkdown = require('to-markdown');
var saveAs = require('file-saver').saveAs;
@@ -2306,7 +2311,7 @@ socket.on('delete', function () {
saveHistory(newnotehistory);
location.href = serverurl;
});
- }
+ }
});
var retryTimer = null;
socket.on('maintenance', function () {
diff --git a/public/js/pretty.js b/public/js/pretty.js
index 59403586..f7d31902 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -1,3 +1,7 @@
+require('../css/extra.css');
+require('../css/slide-preview.css');
+require('../css/site.css');
+
/* other vendors plugin */
var S = require('string');
diff --git a/public/js/slide.js b/public/js/slide.js
index 16ea6b8f..b9521e64 100644
--- a/public/js/slide.js
+++ b/public/js/slide.js
@@ -1,3 +1,6 @@
+require('../css/extra.css');
+require('../css/site.css');
+require('../css/slide.css');
/* other vendors plugin */
var S = require('string');
diff --git a/public/views/head.ejs b/public/views/head.ejs
index 00571186..77cc1cf0 100644
--- a/public/views/head.ejs
+++ b/public/views/head.ejs
@@ -35,11 +35,9 @@
<link rel="stylesheet" href="<%- url %>/vendor/showup/showup.css">
<link rel="stylesheet" href="<%- url %>/css/mermaid.css">
<link rel="stylesheet" href="<%- url %>/css/markdown.css">
+
<%- include build/index-header %>
-<link rel="stylesheet" href="<%- url %>/css/index.css">
-<link rel="stylesheet" href="<%- url %>/css/extra.css">
-<link rel="stylesheet" href="<%- url %>/css/slide-preview.css">
-<link rel="stylesheet" href="<%- url %>/css/site.css">
+
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
diff --git a/public/views/index.ejs b/public/views/index.ejs
index 9b411bb8..1b04886a 100644
--- a/public/views/index.ejs
+++ b/public/views/index.ejs
@@ -30,8 +30,6 @@
<% } %>
<!-- Custom styles for this template -->
<%- include build/cover-header %>
- <link rel="stylesheet" href="<%- url %>/css/cover.css">
- <link rel="stylesheet" href="<%- url %>/css/site.css">
</head>
<body>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index d03be9c4..c70553be 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -32,9 +32,6 @@
<link rel="stylesheet" href='<%- url %>/css/markdown.css'>
<link rel="stylesheet" href='<%- url %>/vendor/emojify.js/dist/css/basic/emojify.min.css'>
<%- include build/pretty-header %>
- <link rel="stylesheet" href='<%- url %>/css/extra.css'>
- <link rel="stylesheet" href="<%- url %>/css/slide-preview.css">
- <link rel="stylesheet" href='<%- url %>/css/site.css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index 1fdb7f8f..4545ade7 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -36,9 +36,8 @@
<link rel="stylesheet" href="<%- url %>/css/mermaid.css">
<link rel="stylesheet" href='<%- url %>/css/markdown.css'>
<link rel="stylesheet" href='<%- url %>/vendor/emojify.js/dist/css/basic/emojify.min.css'>
- <link rel="stylesheet" href='<%- url %>/css/extra.css'>
- <link rel="stylesheet" href="<%- url %>/css/site.css">
- <link rel="stylesheet" href="<%- url %>/css/slide.css">
+
+ <%- include build/slide-header %>
<!-- Printing and PDF exports -->
<script>