diff --git a/README.md b/README.md
index 6cd384e67..08d66b493 100644
--- a/README.md
+++ b/README.md
@@ -58,9 +58,9 @@ More info about that can be found in the configuration docs above.
To use HedgeDoc, your browser should match or exceed these versions:
-  Chrome >= 47,  Chrome for Android >= 47
--  Safari >= 9,  iOS Safari >= 8.4
+-  Safari >= 10.1,  iOS Safari >= 10.3
-  Firefox >= 44
--  Edge >= 12
+-  Edge >= 14
-  Opera >=
34, 
Opera Mini not supported
diff --git a/app.js b/app.js
index 45e70c8b5..878c85729 100644
--- a/app.js
+++ b/app.js
@@ -191,7 +191,6 @@ app.engine('ejs', ejs.renderFile)
// set view engine
app.set('view engine', 'ejs')
// set generally available variables for all views
-app.locals.useCDN = config.useCDN
app.locals.serverURL = config.serverURL
app.locals.sourceURL = config.sourceURL
app.locals.allowAnonymous = config.allowAnonymous
diff --git a/docs/content/configuration.md b/docs/content/configuration.md
index 51f82581a..36f253148 100644
--- a/docs/content/configuration.md
+++ b/docs/content/configuration.md
@@ -100,7 +100,6 @@ these are rarely used for various reasons.
| config file | environment | **default** and example value | description |
| --------------- | -------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allowGravatar` | `CMD_ALLOW_GRAVATAR` | **`true`** or `false` | set to `false` to disable [Libravatar](https://www.libravatar.org/) as profile picture source on your instance. Libravatar is a federated open-source alternative to Gravatar. |
-| `useCDN` | `CMD_USECDN` | **`false`** or `true` | set to use CDN resources or not (default is `false`) |
## Users and Privileges
diff --git a/lib/config/default.js b/lib/config/default.js
index c687e4841..89de46727 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -31,7 +31,6 @@ module.exports = {
},
cookiePolicy: 'lax',
protocolUseSSL: false,
- useCDN: false,
allowAnonymous: true,
allowAnonymousEdits: false,
allowFreeURL: false,
diff --git a/lib/config/environment.js b/lib/config/environment.js
index cd83dc12f..8c161341e 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -29,7 +29,6 @@ module.exports = {
cookiePolicy: process.env.CMD_COOKIE_POLICY,
protocolUseSSL: toBooleanConfig(process.env.CMD_PROTOCOL_USESSL),
allowOrigin: toArrayConfig(process.env.CMD_ALLOW_ORIGIN),
- useCDN: toBooleanConfig(process.env.CMD_USECDN),
allowAnonymous: toBooleanConfig(process.env.CMD_ALLOW_ANONYMOUS),
allowAnonymousEdits: toBooleanConfig(process.env.CMD_ALLOW_ANONYMOUS_EDITS),
allowFreeURL: toBooleanConfig(process.env.CMD_ALLOW_FREEURL),
diff --git a/lib/config/hackmdEnvironment.js b/lib/config/hackmdEnvironment.js
index 76e413612..c40ffc961 100644
--- a/lib/config/hackmdEnvironment.js
+++ b/lib/config/hackmdEnvironment.js
@@ -20,7 +20,6 @@ module.exports = {
},
protocolUseSSL: toBooleanConfig(process.env.HMD_PROTOCOL_USESSL),
allowOrigin: toArrayConfig(process.env.HMD_ALLOW_ORIGIN),
- useCDN: toBooleanConfig(process.env.HMD_USECDN),
allowAnonymous: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS),
allowAnonymousEdits: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS_EDITS),
allowFreeURL: toBooleanConfig(process.env.HMD_ALLOW_FREEURL),
diff --git a/lib/config/oldDefault.js b/lib/config/oldDefault.js
index 738ad9f7d..c9af50988 100644
--- a/lib/config/oldDefault.js
+++ b/lib/config/oldDefault.js
@@ -6,7 +6,6 @@ module.exports = {
alloworigin: undefined,
usessl: undefined,
protocolusessl: undefined,
- usecdn: undefined,
allowanonymous: undefined,
allowanonymousedits: undefined,
allowfreeurl: undefined,
diff --git a/lib/csp.js b/lib/csp.js
index 52a8d4b8a..00a9a5a7f 100644
--- a/lib/csp.js
+++ b/lib/csp.js
@@ -26,12 +26,6 @@ const defaultDirectives = {
mediaSrc: ['*']
}
-const cdnDirectives = {
- scriptSrc: ['https://cdnjs.cloudflare.com', 'https://cdn.mathjax.org'],
- styleSrc: ['https://cdnjs.cloudflare.com', 'https://fonts.googleapis.com'],
- fontSrc: ['https://cdnjs.cloudflare.com', 'https://fonts.gstatic.com']
-}
-
const disqusDirectives = {
scriptSrc: ['https://disqus.com', 'https://*.disqus.com', 'https://*.disquscdn.com'],
styleSrc: ['https://*.disquscdn.com'],
@@ -59,7 +53,6 @@ CspStrategy.computeDirectives = function () {
const directives = {}
mergeDirectives(directives, config.csp.directives)
mergeDirectivesIf(config.csp.addDefaults, directives, defaultDirectives)
- mergeDirectivesIf(config.useCDN, directives, cdnDirectives)
mergeDirectivesIf(config.csp.addDisqus, directives, disqusDirectives)
mergeDirectivesIf(config.csp.addGoogleAnalytics, directives, googleAnalyticsDirectives)
mergeDirectivesIf(config.dropbox.appKey, directives, dropboxDirectives)
diff --git a/public/css/google-font.css b/public/css/google-font.css
deleted file mode 100644
index 02c1b103e..000000000
--- a/public/css/google-font.css
+++ /dev/null
@@ -1 +0,0 @@
-@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,600italic,300italic,300|Source+Serif+Pro|Source+Code+Pro:400,300,500&subset=latin,latin-ext);
diff --git a/public/js/extra.js b/public/js/extra.js
index 616d43a32..52879e1a8 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -620,6 +620,18 @@ export function removeDOMEvents (view) {
}
window.removeDOMEvents = removeDOMEvents
+function toDataURL (url, callback) {
+ fetch(url).then(response => {
+ const fr = new FileReader()
+ fr.onload = function () {
+ callback(this.result)
+ }
+ response.blob().then(blob => {
+ fr.readAsDataURL(blob)
+ })
+ })
+}
+
function generateCleanHTML (view) {
const src = view.clone()
const eles = src.find('*')
@@ -634,10 +646,9 @@ function generateCleanHTML (view) {
src.find('input.task-list-item-checkbox').attr('disabled', '')
// replace emoji image path
src.find('img.emoji').each((key, value) => {
- let name = $(value).attr('alt')
- name = name.substr(1)
- name = name.slice(0, name.length - 1)
- $(value).attr('src', `https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/images/basic/${name}.png`)
+ toDataURL($(value).attr('src'), dataURL => {
+ $(value).attr('src', dataURL)
+ })
})
// replace video to iframe
src.find('div[data-videoid]').each((key, value) => {
@@ -681,21 +692,18 @@ export function exportToHTML (view) {
const tocAffix = $('#ui-toc-affix').clone()
tocAffix.find('*').removeClass('active').find("a[href^='#'][smoothhashscroll]").removeAttr('smoothhashscroll')
// generate html via template
- $.get(`${serverurl}/build/html.min.css`, css => {
- $.get(`${serverurl}/views/html.hbs`, template => {
- let html = template.replace('{{{url}}}', serverurl)
- html = html.replace('{{title}}', title)
- html = html.replace('{{{css}}}', css)
- html = html.replace('{{{html}}}', src[0].outerHTML)
- html = html.replace('{{{ui-toc}}}', toc.html())
- html = html.replace('{{{ui-toc-affix}}}', tocAffix.html())
- html = html.replace('{{{lang}}}', (md && md.meta && md.meta.lang) ? `lang="${md.meta.lang}"` : '')
- html = html.replace('{{{dir}}}', (md && md.meta && md.meta.dir) ? `dir="${md.meta.dir}"` : '')
- const blob = new Blob([html], {
- type: 'text/html;charset=utf-8'
- })
- saveAs(blob, filename, true)
+ $.get(`${serverurl}/build/htmlexport.html`, template => {
+ let html = template.replace('{{{url}}}', serverurl)
+ html = html.replace('{{title}}', title)
+ html = html.replace('{{{html}}}', src[0].outerHTML)
+ html = html.replace('{{{ui-toc}}}', toc.html())
+ html = html.replace('{{{ui-toc-affix}}}', tocAffix.html())
+ html = html.replace('{{{lang}}}', (md && md.meta && md.meta.lang) ? `lang="${md.meta.lang}"` : '')
+ html = html.replace('{{{dir}}}', (md && md.meta && md.meta.dir) ? `dir="${md.meta.dir}"` : '')
+ const blob = new Blob([html], {
+ type: 'text/html;charset=utf-8'
})
+ saveAs(blob, filename, true)
})
}
diff --git a/public/js/htmlExport.js b/public/js/htmlExport.js
index 1a873aca0..676e2b1bc 100644
--- a/public/js/htmlExport.js
+++ b/public/js/htmlExport.js
@@ -1,6 +1,25 @@
+require('bootstrap/dist/css/bootstrap.min.css')
+require('fork-awesome/css/fork-awesome.min.css')
+require('ionicons/css/ionicons.min.css')
+require('prismjs/prism')
+require('prismjs/themes/prism.css')
+require('prismjs/components/prism-wiki')
+require('prismjs/components/prism-haskell')
+require('prismjs/components/prism-go')
+require('prismjs/components/prism-typescript')
+require('prismjs/components/prism-jsx')
+require('prismjs/components/prism-makefile')
+require('prismjs/components/prism-gherkin')
+require('highlight.js/styles/github-gist.css')
+require('emojify.js/dist/css/basic/emojify.min.css')
require('../css/github-extract.css')
require('../css/markdown.css')
require('../css/extra.css')
require('../css/slide-preview.css')
-require('../css/google-font.css')
+require('../css/font.css')
require('../css/site.css')
+const $ = require('jquery')
+window.jQuery = $
+window.$ = $
+require('bootstrap')
+require('gist-embed/gist-embed.min')
diff --git a/public/views/hedgedoc/footer.ejs b/public/views/hedgedoc/footer.ejs
index 86572091e..c3927db77 100644
--- a/public/views/hedgedoc/footer.ejs
+++ b/public/views/hedgedoc/footer.ejs
@@ -1,28 +1,5 @@
-<% if(useCDN) { %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<%- include('../build/index-scripts') %>
-<% } else { %>
<%- include('../build/index-pack-scripts') %>
-<% } %>
diff --git a/public/views/hedgedoc/head.ejs b/public/views/hedgedoc/head.ejs
index 419d5dcc7..c2321fccf 100644
--- a/public/views/hedgedoc/head.ejs
+++ b/public/views/hedgedoc/head.ejs
@@ -15,15 +15,5 @@
<% } %>