summaryrefslogtreecommitdiff
path: root/public/js/index.js
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-06-21 21:44:06 +0800
committerCheng-Han, Wu2016-06-21 21:44:06 +0800
commit3424cdd7713421d3fc88a501c1cd7606c943a05e (patch)
tree9dbdda181307dfe9903bdd05aedee1a0c070ede1 /public/js/index.js
parent558304ff62a648e604b03afe3372ef9566aea850 (diff)
Add support of embed pdf
Diffstat (limited to 'public/js/index.js')
-rw-r--r--public/js/index.js18
1 files changed, 4 insertions, 14 deletions
diff --git a/public/js/index.js b/public/js/index.js
index dc5f928c..43296af4 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -152,6 +152,10 @@ var supportExternals = [
{
text: '{%speakerdeck speakerdeckid %}',
search: 'speakerdeck'
+ },
+ {
+ text: '{%pdf pdfurl %}',
+ search: 'pdf'
}
];
var supportExtraTags = [
@@ -1836,20 +1840,6 @@ function importFromUrl(url) {
});
}
-function isValidURL(str) {
- var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
- '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
- '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
- '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
- '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
- '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
- if (!pattern.test(str)) {
- return false;
- } else {
- return true;
- }
-}
-
//mode
ui.toolbar.mode.click(function () {
toggleMode();