/[suikacvs]/webroot/swe/scripts/sw.js
Suika

Diff of /webroot/swe/scripts/sw.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wakaba, Sat Mar 14 01:01:55 2009 UTC revision 1.7 by wakaba, Sun Jul 12 06:04:22 2009 UTC
# Line 1  Line 1 
1    (function () {
2      var samiURL = 'http://suika.fam.cx/www/js/sami/script/sami-core.js';
3      var swSamiURL = 'http://suika.fam.cx/swe/scripts/sw-sami.js';
4      
5      var script = document.createElement ('script');
6      script.src = samiURL;
7      script.defer = true;
8      script.async = true;
9      document.body.appendChild (script);
10    
11      if (!self.SAMI) self.SAMI = {};
12      SAMI.onLoadFunctions = SAMI.onLoadFunctions || [];
13      SAMI.onLoadFunctions.push (function () {
14        SAMI.Script.loadScripts (new SAMI.List([swSamiURL]), function () {
15          SW.init ();
16        });
17      });
18    }) ();
19    
20  window.onload = function () {  window.onload = function () {
21    createToolbar ();    createToolbar ();
22    initializeHatenaStar();    initializeHatenaStar();
# Line 69  function createToolbar () { Line 88  function createToolbar () {
88        ta.focus ();        ta.focus ();
89      }; // insertText      }; // insertText
90            
91      var addButton = function (labelHTML, onclick) {      var addButton = function (labelHTML, title, onclick) {
92        var button = document.createElement ('button');        var button = document.createElement ('button');
93        button.setAttribute ('type', 'button');        button.setAttribute ('type', 'button');
94        button.innerHTML = labelHTML;        button.innerHTML = labelHTML;
95          button.title = title;
96        button.onclick = onclick;        button.onclick = onclick;
97        container.appendChild (button);        container.appendChild (button);
98      }; // addButton      }; // addButton
99    
100      addButton ('[#]', function () {      addButton ('[#]', 'Insert a new anchor number', function () {
101        var added = '[' + getNextAnchorNumber (ta.value) + '] ';        var added = '[' + getNextAnchorNumber (ta.value) + '] ';
102        insertText (added);        insertText (added);
103      });      });
104    
105      addButton ('Now', function () {      addButton ('Now', 'Insert a timestamp', function () {
106        var added = '[TIME[' + getGlobalDateAndTimeString (new Date) + ']]';        var added = '[TIME[' + getGlobalDateAndTimeString (new Date) + ']]';
107        insertText (added);        insertText (added);
108      });      });

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24