OSDN Git Service

tab option of wiki textarea.
authorvisor <visor@users.sourceforge.jp>
Sat, 29 Oct 2011 13:32:59 +0000 (22:32 +0900)
committervisor <visor@users.sourceforge.jp>
Sat, 29 Oct 2011 13:32:59 +0000 (22:32 +0900)
wiki/wikiattrib.cc
wiki/wikiattrib.h

index 43ba094..7041c5d 100644 (file)
@@ -463,6 +463,8 @@ bool  WikiAttribInput::readAttribMore2 (const ustring& key, WikiMotorObjVec& cel
        pdefault = true;
     } else if ((selector2 & SEL_CHECK) && match (key, CharConst ("checked"))) {
        pchecked = true;
+    } else if ((selector2 & SEL_TEXTAREA) && match (key, CharConst ("tab"))) {
+       ftab = true;
     } else {
        return false;
     }
@@ -498,6 +500,23 @@ void  WikiAttribInput::outputMore (MotorOutput* out) {
            //  out->out_raw (CharConst (" wrap=\"physical\""));
            break;
        }
+       if (ftab) {
+           out->out_raw (uSPC)
+               ->out_raw (CharConst ("onkeypress"))
+               ->out_raw (CharConst ("=\""))
+               ->out_toHTML (ustring (CharConst ("return insertTab(event,this);")))
+               ->out_raw ("\"");
+           out->out_raw (uSPC)
+               ->out_raw (CharConst ("onkeydown"))
+               ->out_raw (CharConst ("=\""))
+               ->out_toHTML (ustring (CharConst ("return insertTab(event,this);")))
+               ->out_raw ("\"");
+           out->out_raw (uSPC)
+               ->out_raw (CharConst ("onkeyup"))
+               ->out_raw (CharConst ("=\""))
+               ->out_toHTML (ustring (CharConst ("return insertTab(event,this);")))
+               ->out_raw ("\"");
+       }
     }
 }
 
index ba26c7e..5491888 100644 (file)
@@ -154,14 +154,15 @@ class  WikiAttribInput: public WikiAttrib1 {
     enum {
        W_OFF, W_SOFT, W_HARD,
     }  pwrap;
+    bool  ftab;
 
-//    WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, true) {
     WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, M_ATTRIB) {
        selector2 = _sel2;
        elsize = 0;
        pdefault = false;
        pchecked = false;
        pwrap = W_SOFT;
+       ftab = false;
     };
     virtual  ~WikiAttribInput () {};
  private: