From e8ca892a98f55a1d72769c1049d43a96e978bfef Mon Sep 17 00:00:00 2001
From: drry
Date: Sun, 21 Dec 2008 15:43:28 +0000
Subject: * fixed regexes. * et cetera.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27172 d0d07461-0603-4401-acd4-de1884942a52
---
takahashiPresentation.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'takahashiPresentation.js')
diff --git a/takahashiPresentation.js b/takahashiPresentation.js
index 161445f..7bb33a3 100644
--- a/takahashiPresentation.js
+++ b/takahashiPresentation.js
@@ -13,7 +13,7 @@ var PLUGIN_INFO =
presentation:
start presentation
== HOWTO ==
-open html file includes
....
+open HTML file includes
...
and
...
.
start :presentation.
]]>
;
@@ -71,16 +71,17 @@ start :presentation.
loadPage(curpage);
}
function parsePages(text) {
- if(/:backgroundImage:(.+)\n/.test(text)) {
+ if(/:backgroundImage:(.+)(?:\r\n|[\r\n])/.test(text)) {
doc.body.style.backgroundImage = RegExp.$1;
doc.body.style.backgroundRepeat = 'repeat';
}
- text = text.replace(/:.+\n/g, '');
- return text.split('----').map(function(txt) txt.replace(/^\n/, '').replace(/\n$/, ''));
+ return text.replace(/(?::.+(?:\r\n|[\r\n]))+/g, '')
+ .split('----')
+ .map(function(txt) txt.replace(/^(?:\r\n|[\r\n])|(?:\r\n|[\r\n])$/g, ''));
}
function start() {
options.fullscreen = true;
- options.guioptions = "";
+ options.guioptions = '';
win = window.content;
doc = win.document;
let text = buffer.evaluateXPath('//div[@id="text"]').snapshotItem(0);
@@ -88,9 +89,8 @@ start :presentation.
addKeys();
div = doc.createElement('div');
- head = doc.createElement('div');
+ head = doc.body.appendChild(doc.createElement('div'));
head.style.textAlign = 'right';
- doc.body.appendChild(head);
pre = buffer.evaluateXPath('//pre[@id="page"]').snapshotItem(0);
pre.style.fontSize = fontSize+'px';
--
cgit v1.2.3