bool ferr = false;
if (cell->size () == 0) {
-// if (fwhole)
if (mode == M_ATTRIB || mode == M_ATTRIB_TEXT)
return true;
else
wiki->paramTargetBody (key, vval.textOut (wiki), target, ferr);
} else if (readAttribMore (key, vval, ferr)) {
} else {
-// if (fwhole) {
if (mode == M_ATTRIB) {
wiki->errorMsg.append (cell->dump ()).append (CharConst (": bad attribute.\n"));
rc = false;
} else if ((selector & SEL_SCRIPT2) && checkScript (*cell, script, ferr)) {
} else if (readAttribMore2 (key, *cell, ferr)) {
} else {
-// if (fwhole) {
if (mode == M_ATTRIB) {
wiki->errorMsg.append (cell->dump ()).append (CharConst (": bad attribute.\n"));
rc = false;
WikiMotorObjVec cell;
v2 = WikiMotorObjVecPtr (new WikiMotorObjVec);
-// if (vec->splitChar (':', cell, *v2) || fwhole) {
if (vec->splitChar (':', cell, *v2) || mode == M_ATTRIB || mode == M_ATTRIB_TEXT) {
if (! readAttrib1 (&cell, rc))
return rc;
void WikiAttrib1::output (MotorOutput* out) {
wiki->outputID (out, id);
wiki->outputClass (out, classlist);
- wiki->outputSubmitScript (out, CharConst ("onclick"), onclick);
- wiki->outputSubmitScript (out, CharConst ("onfocus"), onfocus);
- wiki->outputSubmitScript (out, CharConst ("onblur"), onblur);
- wiki->outputSubmitScript (out, CharConst ("onchange"), onchange);
+ wiki->outputSubmitScript (out, CharConst ("onclick"), onclick, scriptcut);
+ wiki->outputSubmitScript (out, CharConst ("onfocus"), onfocus, scriptcut);
+ wiki->outputSubmitScript (out, CharConst ("onblur"), onblur, scriptcut);
+ wiki->outputSubmitScript (out, CharConst ("onchange"), onchange, scriptcut);
wiki->outputName (out, CharConst ("target"), target);
-// wiki->outputName (out, CharConst ("size"), elsize);
wiki->outputFlag (out, CharConst ("multiple"), fmultiple);
// no fdefault
outputMore (out);
if (b < e) {
WikiMotorObjVec* cell = b->get ();
-// bool bf = fwhole;
-// fwhole = false;
mode_t bm = mode;
mode = M_NORMAL;
if (! readAttrib1 (cell, rc)) {
name = cell->textOut (wiki);
}
-// fwhole = bf;
mode = bm;
b ++;
}
} mode_t;
uint32_t selector;
-// bool fwhole;
mode_t mode;
WikiFormat* wiki;
bool ferr;
ustring onfocus;
ustring onblur;
ustring onchange;
+ bool scriptcut;
ustring target;
-// int32_t elsize;
bool fmultiple;
bool fdefault; /* no output */
ustring script; /* no output */
-// WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, bool _fwhole = false) {
- WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, mode_t _mode = M_NORMAL) {
+ WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, bool _scriptcut, mode_t _mode = M_NORMAL) {
wiki = _wiki;
selector = _selector;
-// fwhole = _fwhole;
mode = _mode;
-// elsize = 0;
+ scriptcut = _scriptcut;
fdefault = false;
fmultiple = false;
};
int cellspacing;
int cellpadding;
bool fpadding;
-// halign_t halign;
bool fnowhite;
bool fturn;
-// WikiAttribTable (WikiFormat* _wiki, selector_t _selector2, bool _inheader): WikiAttrib1 (_wiki, SEL_ID, _inheader) {
- WikiAttribTable (WikiFormat* _wiki, selector_t _selector2, mode_t _mode): WikiAttrib1 (_wiki, SEL_ID, _mode) {
+ WikiAttribTable (WikiFormat* _wiki, selector_t _selector2, mode_t _mode): WikiAttrib1 (_wiki, SEL_ID, false, _mode) {
selector2 = _selector2;
init ();
};
ustring height;
ustring alt;
-// WikiAttribImg (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_ID, true) {};
- WikiAttribImg (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_ID, M_ATTRIB) {};
+ WikiAttribImg (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_ID, false, M_ATTRIB) {};
virtual ~WikiAttribImg () {};
private:
virtual bool readAttribMore (const ustring& key, WikiMotorObjVec& vval, bool& ferr);
} pwrap;
bool ftab;
- WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, M_ATTRIB) {
+ WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, false, M_ATTRIB) {
selector2 = _sel2;
elsize = 0;
pdefault = false;
public:
ustring name;
-// WikiAttribButton (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_SCRIPT2, true) {};
- WikiAttribButton (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_SCRIPT2, M_ATTRIB) {};
+ WikiAttribButton (WikiFormat* _wiki, bool _scriptcut): WikiAttrib1 (_wiki, SEL_SCRIPT2, _scriptcut, M_ATTRIB) {};
virtual ~WikiAttribButton () {};
virtual bool readAttrib (WikiMotorObjVecVec::const_iterator& b, const WikiMotorObjVecVec::const_iterator& e);
};
インライン要素の解釈は行われない。
*/
-bool WikiBlockPreformat::nextLine (uiterator b, uiterator e) {
+bool WikiBlockPreformatRaw::nextLine (uiterator b, uiterator e) {
if (*b == markup) {
addLine (b, e);
return true;
}
}
-void WikiBlockPreformat::addLine (uiterator b, uiterator e) {
+void WikiBlockPreformatRaw::addLine (uiterator b, uiterator e) {
markup = *b;
#ifdef WIKIMOTORPRE
if (markup == ' ') {
#endif
}
-void WikiBlockPreformat::output (MotorOutput* out) {
+void WikiBlockPreformatRaw::output (MotorOutput* out) {
#ifdef WIKIMOTORPRE
out->out_raw (CharConst ("<pre>"))->out_toText (text)->out_raw (CharConst ("</pre>\n"));
#else
}
void WikiBlockItemDL::addLine (uiterator b, uiterator e) {
-// WikiMotor motor (b + 1, e, wiki);
WikiMotorObjVec objs;
-// ustring def, desc;
WikiMotorObjVec* def;
WikiMotorObjVec* desc;
-// motor.compile (objs);
wiki->wikiMotorInline (b + 1, e, objs);
-// objs.splitChar (wiki, ':', def, desc);
-// html1.push_back (def);
-// html2.push_back (desc);
def = new WikiMotorObjVec;
desc = new WikiMotorObjVec;
objv1.push_back (def);
int i;
out->out_raw (CharConst ("<dl>\n"));
-// for (i = 0; i < html1.size (); i ++) {
-// out->out_raw (CharConst ("<dt>"))->out_toText (html1[i])->out_raw (CharConst ("</dt>\n"));
-// out->out_raw (CharConst ("<dd>"))->out_toText (html2[i])->out_raw (CharConst ("</dd>\n"));
for (i = 0; i < objv1.size (); i ++) {
out->out_raw (CharConst ("<dt>"))->out_toText (objv1[i].htmlOut (wiki))->out_raw (CharConst ("</dt>\n"));
out->out_raw (CharConst ("<dd>"))->out_toText (objv2[i].htmlOut (wiki))->out_raw (CharConst ("</dd>\n"));
|onclick=''fn(arg1,arg2,...)''||onClick属性を出力する。''name''はdefun-wiki-linkで定義したもの。|
|nowhite|nw||
|turn||セルの並びの横方向と縦方向を交換する。|
+|toptitle|tt|class=toptitleと同じ。|
+|bottomtitle|bt|class=bottomtitleと同じ。|
+・行オプション
|row:bgcolor=#ff0|&[;&[;Name]]|&[;&[;Value]]|
objvv.pop_back ();
attrib.shiftAttrib (objvv[0]);
-// cell = new TableCell (wiki, false);
cell = new TableCell (wiki, WikiAttrib1::M_NORMAL);
cell->cellBody (objvv[0].get (), this, 0);
captionHtml = cell->html;
delete cell;
for (i = 1; i < objvv.size (); i ++) {
-// cell = new TableCell (wiki, true);
cell = new TableCell (wiki, WikiAttrib1::M_ATTRIB);
cell->cellattrib.shiftAttrib (objvv[i]);
defaultList.push_back (cell);
cont = false;
cols = &ary.back ();
} else {
-// cols = new CellList_t;
cols = new CellList_t (wiki);
ary.push_back (cols);
}
}
WikiBlockTable::TableCell* WikiBlockTable::newCell (int idx) {
-// TableCell* ans = new TableCell (wiki, false);
TableCell* ans = new TableCell (wiki, WikiAttrib1::M_NORMAL);
if (idx < defaultList.size ())
}
WikiBlockTable::TableCell* WikiBlockTable::newCell (WikiAttribTable& rowattrib) {
-// TableCell* ans = new TableCell (wiki, false);
TableCell* ans = new TableCell (wiki, WikiAttrib1::M_NORMAL);
ans->cellattrib.copyFrom (rowattrib);
}
if (fscript) {
wiki->outputName (out, CharConst ("action"), ustring (CharConst ("#")), false);
- wiki->outputSubmitScript (out, CharConst ("onsubmit"), url);
+ wiki->outputSubmitScript (out, CharConst ("onsubmit"), url, true);
} else {
wiki->outputName (out, CharConst ("action"), url, false);
}
|| b[0] == kWikiPRE2) { // TAB
if (cur)
cur->close ();
- cur = new WikiBlockPreformat (this);
+ cur = new WikiBlockPreformatRaw (this);
blockp->push_back (cur);
cur->addLine (b, e);
} else if (b[0] == kWikiUL) { // *
}
}
-void WikiFormat::outputSubmitScript (MotorOutput* out, const char* name, size_t len, const ustring& onclick) {
- if (onclick.length () > 0)
+void WikiFormat::outputSubmitScript (MotorOutput* out, const char* name, size_t len, const ustring& onclick, bool scriptcut) {
+ if (onclick.length () > 0) {
out->out_raw (uSPC)
->out_raw (name, len)
->out_raw (CharConst ("=\""))
- ->out_toHTML_noCtrl (onclick)
- ->out_raw ("return false;\"");
-// ->out_raw ("\"");
+ ->out_toHTML_noCtrl (onclick);
+ if (scriptcut)
+ out->out_raw (CharConst ("return false;\""));
+ else
+ out->out_raw (CharConst ("\""));
+ }
}
void WikiFormat::wikiMotor (uiterator b, uiterator e, WikiMotorObjVec& ans) {
}
return ans.release ();
-#if 0
- MNode* ans = NULL;
- MNode* a;
-
- if (b < e) {
- ans = a = new MNode;
- a->set_car (newMNode_str (new ustring ((*b)->textOut (this))));
- for (b ++; b < e; b ++) {
- newMNodeCdr (a);
- a->set_car (newMNode_str (new ustring ((*b)->textOut (this))));
- }
- }
- return ans;
-#endif
}
void WikiFormat::logLispFunctionError (const ustring& msg, const ustring& cmd) {
BlockNone,
BlockParagraph,
BlockH,
- BlockPreformat,
+ BlockPreformatRaw,
BlockItemText,
BlockItemUL,
BlockItemOL,
int count;
bool singleTag;
bool pflag;
-// ustring html;
WikiMotorObjVec objv;
WikiBlockParagraph (WikiFormat* w): WikiBlock (BlockParagraph, w) {
virtual bool checkEmpty ();
};
-class WikiBlockPreformat: public WikiBlock {
+class WikiBlockPreformatRaw: public WikiBlock {
public:
ustring text;
char markup;
- WikiBlockPreformat (WikiFormat* w): WikiBlock (BlockPreformat, w) {
+ WikiBlockPreformatRaw (WikiFormat* w): WikiBlock (BlockPreformatRaw, w) {
markup = 0;
};
- virtual ~WikiBlockPreformat () {};
+ virtual ~WikiBlockPreformatRaw () {};
virtual bool nextLine (uiterator b, uiterator e);
virtual void addLine (uiterator b, uiterator e);
bool indentHack;
WikiAttrib1 attrib;
- WikiBlockItemText (WikiFormat* w): WikiBlockComplex (BlockItemText, w), attrib (w, WikiAttrib1::SEL_ID) {
+ WikiBlockItemText (WikiFormat* w): WikiBlockComplex (BlockItemText, w), attrib (w, WikiAttrib1::SEL_ID, false) {
indentHack = false;
};
virtual ~WikiBlockItemText () {};
class WikiBlockItemDL: public WikiBlock {
public:
-// std::vector<ustring> html1;
-// std::vector<ustring> html2;
boost::ptr_vector<WikiMotorObjVec> objv1;
boost::ptr_vector<WikiMotorObjVec> objv2;
int colspan;
bool spanmatch;
-// TableCell (WikiFormat* _wiki, bool inheader): cellattrib (_wiki, WikiAttribTable::SEL_TD, inheader) {
TableCell (WikiFormat* _wiki, WikiAttrib1::mode_t _mode): cellattrib (_wiki, WikiAttribTable::SEL_TD, _mode) {
fcolspan = false;
frowspan = false;
virtual void outputTDe (MotorOutput* out);
};
-// typedef boost::ptr_vector<TableCell> CellList_t;
class CellList_t: public boost::ptr_vector<TableCell> {
public:
WikiAttribTable rowattrib;
-// CellList_t (WikiFormat* _wiki): rowattrib (_wiki, WikiAttribTable::SEL_TR, true) {};
CellList_t (WikiFormat* _wiki): rowattrib (_wiki, WikiAttribTable::SEL_TR, WikiAttrib1::M_ATTRIB) {};
virtual ~CellList_t () {};
};
TableAry_t ary;
ustring captionHtml;
-// WikiBlockTable (WikiFormat* _wiki): WikiBlock (BlockTable, _wiki), attrib (_wiki, WikiAttribTable::SEL_TABLE, true), defaultList (_wiki) {
WikiBlockTable (WikiFormat* _wiki): WikiBlock (BlockTable, _wiki), attrib (_wiki, WikiAttribTable::SEL_TABLE, WikiAttrib1::M_ATTRIB_TEXT), defaultList (_wiki) {
n = 0;
cont = false;
int n;
ustring name;
-// WikiAttrib1 attrib;
WikiAttribInput attrib;
std::vector<SelectItem> item;
-// WikiBlockSelect (WikiFormat* w): WikiBlock (BlockSelect, w), attrib (w, WikiAttrib1::SEL_ELSIZE | WikiAttrib1::SEL_DEFAULT2 | WikiAttrib1::SEL_MULTIPLE2 | WikiAttrib1::SEL_SCRIPT2, true) {
WikiBlockSelect (WikiFormat* w): WikiBlock (BlockSelect, w), attrib (w, WikiAttribInput::SEL_ELSIZE) {
attrib.selector |= WikiAttrib1::SEL_DEFAULT2 | WikiAttrib1::SEL_MULTIPLE2 | WikiAttrib1::SEL_SCRIPT2;
n = 0;
public:
WikiAttrib1 attrib;
-// WikiBlockDiv (WikiFormat* w): WikiBlockComplex (BlockDiv, w), attrib (w, WikiAttrib1::SEL_CLASS2, true) {};
WikiBlockDiv (WikiFormat* w): WikiBlockComplex (BlockDiv, w), attrib (w, WikiAttrib1::SEL_CLASS2, WikiAttrib1::M_ATTRIB) {};
virtual ~WikiBlockDiv () {};
bool fscript;
bool qfileform;
-// WikiBlockForm (WikiFormat* w): WikiBlockComplex (BlockForm, w), attrib (w, WikiAttrib1::SEL_TARGET, true) {
WikiBlockForm (WikiFormat* w): WikiBlockComplex (BlockForm, w), attrib (w, WikiAttrib1::SEL_TARGET, WikiAttrib1::M_ATTRIB) {
method = M_NONE;
fscript = false;
};
virtual bool test () {
return wiki->depth >= 32;
-// if (wiki->depth >= 32)
-// throw (uErrorInclNest);
};
};
virtual void outputFlag (MotorOutput* out, const char* name, size_t len, bool flag);
virtual void outputID (MotorOutput* out, const ustring& id);
virtual void outputClass (MotorOutput* out, std::vector<ustring>& classes);
- virtual void outputSubmitScript (MotorOutput* out, const char* name, size_t len, const ustring& onclick);
+ virtual void outputSubmitScript (MotorOutput* out, const char* name, size_t len, const ustring& onclick, bool scriptcut);
virtual ustring getVar (const ustring& name) {
return mlenv->getVar_string (name);
};
bool wl_button_sub (const char* name, size_t len, WikiMotorObjVecVec* args, WikiMotorObjVec* arg2, WikiMotorObjVec& out, WikiFormat* wiki) {
WikiMotorObjVecVec::const_iterator b = args->begin ();
WikiMotorObjVecVec::const_iterator e = args->end ();
- WikiAttribButton attrib (wiki);
+ WikiAttribButton attrib (wiki, true);
MotorOutputString html;
if (! attrib.readAttrib (b, e))