diff options
| author | anekos | 2008-12-11 15:14:27 +0000 | 
|---|---|---|
| committer | anekos | 2008-12-11 15:14:27 +0000 | 
| commit | 6d7e9e8b65741ef29e01f5d4d05d42c9f3b705c5 (patch) | |
| tree | 61658fc9e1cd22bab49709206857a11e33dc0432 | |
| parent | c7ab122c30ac83db4d18d77314c55ac4ec2301d5 (diff) | |
| download | vimperator-plugins-6d7e9e8b65741ef29e01f5d4d05d42c9f3b705c5.tar.bz2 | |
見えなくなる問題について、対処。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26421 d0d07461-0603-4401-acd4-de1884942a52
| -rw-r--r-- | clock.js | 38 | 
1 files changed, 10 insertions, 28 deletions
| @@ -4,7 +4,7 @@   * @description     clock.
   * @description-ja  とけい。
   * @author          janus_wel <janus_wel@fb3.so-net.ne.jp>
 - * @version         0.13
 + * @version         0.14
   * @minversion      2.0pre
   * @maxversion      2.0pre
   * ==/VimperatorPlugin==
 @@ -52,8 +52,6 @@  // definitions ---
  // default settings
  const format   = liberator.globalVariables.clock_format   || '[%t]';
 -const position = liberator.globalVariables.clock_position || 'liberator-commandline-command';
 -const after    = stringToBoolean(liberator.globalVariables.clock_after, true);
  // class definitions
  function Clock() {
 @@ -212,21 +210,19 @@ Clock.prototype = {  };
 -// main ---
 -let insertBase = window.document.getElementById(position);
 -if (!insertBase) {
 -    let errmsg = 'clock.js: not found the element that id is "' + position + '". check variable clock_position.';
 -    liberator.log(errmsg, 0);
 -    liberator.echoerr(errmsg, 0);
 -}
 -
  let clock = new Clock(format);
  clock.generate();
  // insert
 -after
 -    ? insertNodeAfterSpecified(clock.instance, insertBase)
 -    : insertNodeBeforeSpecified(clock.instance, insertBase);
 +{
 +  let msg = window.document.getElementById('liberator-message');
 +  let stack = msg.parentNode;
 +  let box = window.document.createElement('hbox');
 +  stack.replaceChild(box, msg);
 +  box.appendChild(msg);
 +  box.appendChild(clock.instance);
 +  msg.inputField.QueryInterface(Components.interfaces.nsIDOMNSEditableElement);
 +}
  // register command
  [
 @@ -264,20 +260,6 @@ function year() {      return new Date().getFullYear().toString(10);
  }
 -// node control
 -function insertNodeBeforeSpecified(inserted, specified) {
 -    return specified.parentNode.insertBefore(inserted, specified);
 -}
 -function insertNodeAfterSpecified(inserted, specified) {
 -    var next = specified.nextSibling;
 -    if(next) {
 -        return specified.parentNode.insertBefore(inserted, next);
 -    }
 -    else {
 -        return specified.parentNode.appendChild(inserted);
 -    }
 -}
 -
  // type conversion
  function stringToBoolean(str, defaultValue) {
  return !str                          ? (defaultValue ? true : false)
 | 
