diff options
author | drry | 2009-01-04 16:33:27 +0000 |
---|---|---|
committer | drry | 2009-01-04 16:33:27 +0000 |
commit | 274755d24c7024b110ec67d4a86699e16db09ae7 (patch) | |
tree | 6a321e3254f9b473e72a918f9602e6698126b826 | |
parent | 5ec0e082f413bd515af62afc250ae9a161c34892 (diff) | |
download | vimperator-plugins-274755d24c7024b110ec67d4a86699e16db09ae7.tar.bz2 |
* fixed a regex.
* et cetera.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27922 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | alert.js | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -11,7 +11,7 @@ let PLUGIN_INFO = <VimperatorPlugin> <name>Alert</name> <name lang="ja">アラート</name> - <description>Display an alert after the specified time.</description> + <description>Displays an alert after the specified time.</description> <description lang="ja">指定時間後にアラートダイアログを出したりする。タイマー。</description> <version>1.01</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> @@ -275,7 +275,7 @@ let PLUGIN_INFO = let gv = liberator.globalVariables; let defaults = { - methods: (gv.alert_default_methods || 'alert').split(/[^\w]+/), + methods: (gv.alert_default_methods || 'alert').split(/\W+/), time: parseFloat(gv.alert_default_time || '3'), message: gv.alert_default_message || 'Time out!', }; @@ -358,18 +358,17 @@ let PLUGIN_INFO = let times = parseInt(arg || '10', 10); let colors = ['red', 'blue', 'yellow']; let elem = content.document.body; - let indicator = elem.ownerDocument.createElement('div'); + let indicator = elem.appendChild(elem.ownerDocument.createElement('div')); let rect = elem.getBoundingClientRect(); indicator.id = 'nyantoro-element-indicator'; let style = 'background-color: ' + colors[0] + ';' + 'opacity: 0.5; z-index: 999;' + - 'position: fixed; ' + - 'top: ' + 0 + 'px;' + - 'height:' + content.innerHeight + 'px;' + - 'left: ' + 0 + 'px;' + - 'width: ' + content.innerWidth + 'px'; + 'position: fixed;' + + 'top: ' + 0 + 'px;' + + 'height: ' + content.innerHeight + 'px;' + + 'left: ' + 0 + 'px;' + + 'width: ' + content.innerWidth + 'px'; indicator.setAttribute('style', style); - elem.appendChild(indicator); let (count = 0) { let handle = setInterval( function () { |