if (paramID (key, vval, ferr)) {
} else if (paramClass (key, vval, ferr)) {
#ifdef BOOTSTRAPHACK
- } else if (paramDataPrefix (key, vval, dataprefix, ferr)) {
+ } else if (paramDataPrefix (key, vval, ferr)) {
#endif
} else if (paramOnClickCheck (key)) {
if (! checkScript (vval, onclick, ferr)) {
wiki->outputID (out, id);
wiki->outputClass (out, classlist);
#ifdef BOOTSTRAPHACK
- std::pair<ustring,ustring>::const_iterator b, e;
+// std::pair<ustring,ustring>::const_iterator b, e;
+ std::vector<datapre_t>::const_iterator b, e;
b = datapre.begin ();
e = datapre.end ();
for (; b < e; b ++) {
- wiki->outputName (out, b.first, b.second);
+ wiki->outputName (out, (*b).first.c_str (), (*b).first.size (), (*b).second);
}
#endif
+ if (start >= 0)
+ wiki->outputNum (out, CharConst ("start"), start);
wiki->outputSubmitScript (out, CharConst ("onclick"), onclick, scriptcut);
wiki->outputSubmitScript (out, CharConst ("onfocus"), onfocus, scriptcut);
wiki->outputSubmitScript (out, CharConst ("onblur"), onblur, scriptcut);
void WikiAttrib1::paramIDValue (const ustring& key, WikiMotorObjVec& vval, ustring& var, bool& ferr) {
ustring value (vval.textOut (wiki));
- if (checkWikiID (value)) {
+ if (matchWikiID (value)) {
var = value;
ferr = false;
} else {
for (int i = 0; i < args.size (); i ++) {
ustring value (args[i]->textOut (wiki));
if (value.length () > 0) {
- if (checkWikiID (value)) {
+ if ((selector & SEL_DIRECT) && value[0] == '#' && matchWikiID (ustring (value.begin () + 1, value.end ()))) {
+ directlist.push_back (value); // SEL_DIRECTが指定してある場合のみ有効
+ } else if (matchWikiID (value)) {
var.push_back (value);
} else {
wiki->errorMsg.append (value).append (CharConst (": bad class name\n"));
void WikiAttrib1::paramWidthValue (const ustring& key, WikiMotorObjVec& vval, ustring& var, bool& ferr) {
ustring value (vval.textOut (wiki));
- if (checkWidth (value)) {
+ if (matchWidth (value)) {
var = value;
-// if (checkNum (value))
-// var.append (CharConst ("px"));
ferr = false;
} else {
wiki->errorMsg.append (key).append (uEq).append (value).append (CharConst (": bad value\n"));
bool WikiAttrib1::paramSize (const char* name, size_t namelen, const ustring& key, WikiMotorObjVec& vval, ustring& var, bool& ferr) {
if (match (key, name, namelen)) {
ustring value (vval.textOut (wiki));
- if (checkNum (value)) {
+ if (matchNum (value)) {
var = value;
ferr = false;
} else {
}
void WikiAttrib1::paramUNum (const ustring& value, int& var, const ustring& name) {
- if (checkNum (value)) {
+ if (matchNum (value)) {
var = strtoul (value);
} else {
wiki->errorMsg.append (name).append (uEq).append (value).append (uErrorBadValue).append (uLF);
}
void WikiAttrib1::paramTargetBody (const ustring& key, const ustring& value, ustring& var, bool& ferr) {
- if (value.length () == 0 || checkWikiID (value)) {
+ if (value.length () == 0 || matchWikiID (value)) {
var = value;
} else {
if (key.length () > 0)
#ifdef BOOTSTRAPHACK
bool WikiAttrib1::paramDataPrefix (const ustring& key, WikiMotorObjVec& vval, bool& ferr) {
- if (match (CharConst ("data-"), key) && checkWikiID (key)) {
+ if (matchHead (key, CharConst ("data-")) && matchWikiID (key)) {
ustring value (vval.textOut (wiki));
- if (checkWikiID (value)) {
- datapre.push_back (std::pair (key, value));
+ if (matchWikiID (value)) {
+ datapre.push_back (std::pair<ustring,ustring> (key, value));
ferr = false;
} else {
wiki->errorMsg.append (key).append (uEq).append (value).append (CharConst (": bad value\n"));
}
return true;
} else {
- return flase;
+ return false;
}
}
#endif
return true;
}
-void WikiAttribTable::outputMore (MotorOutput* out) {
+void WikiAttribTable::outputMore (MotorOutput* out, bool foutputwidth) {
switch (halign) {
case HAlignLeft:
out->out_raw (CharConst (" align=\"left\""));
case HAlignRight:
out->out_raw (CharConst (" align=\"right\""));
break;
+ default:;
}
- wiki->outputName (out, CharConst ("width"), width);
+ if (foutputwidth)
+ wiki->outputName (out, CharConst ("width"), width);
wiki->outputName (out, CharConst ("height"), height);
wiki->outputName (out, CharConst ("bgcolor"), bgcolor);
case VAlignBottom:
out->out_raw (CharConst (" valign=\"bottom\""));
break;
+ default:;
}
wiki->outputFlag (out, CharConst ("nowrap"), fnowrap);
break;
/* ============================================================ */
bool WikiAttribImg::readAttribMore (const ustring& key, WikiMotorObjVec& vval, bool& ferr) {
if (paramWidth (key, vval, width, ferr)) {
+ if (matchNum (width))
+ width.append (CharConst ("px"));
} else if (paramHeight (key, vval, height, ferr)) {
+ if (matchNum (height))
+ height.append (CharConst ("px"));
} else if (match (key, CharConst ("alt"))) {
alt = vval.textOut (wiki);
} else {
}
void WikiAttribImg::outputMore (MotorOutput* out) {
- wiki->outputName (out, CharConst ("width"), width);
- wiki->outputName (out, CharConst ("height"), height);
+// wiki->outputName (out, CharConst ("width"), width);
+// wiki->outputName (out, CharConst ("height"), height);
+ if (width.length () > 0 || height.length () > 0) {
+ out->out_raw (CharConst (" style=\""));
+ if (width.length () > 0)
+ out->out_raw (CharConst ("width:"))->out_toHTML_noCtrl (width)->out_raw (CharConst (";"));
+ if (height.length () > 0)
+ out->out_raw (CharConst ("height:"))->out_toHTML_noCtrl (height)->out_raw (CharConst (";"));
+ out->out_raw (CharConst ("\""));
+ }
// longdesc
}
ustring v = vval.textOut (wiki);
if (match (v, CharConst ("*"))) {
elsize = 1;
- } else if (checkNum (v)) {
+ } else if (matchNum (v)) {
elsize = to_int32 (v);
if (elsize < 0 || elsize > 999) {
elsize = 1;
pwrap = W_SOFT;
} else if (match (value, CharConst ("hard"))) {
pwrap = W_HARD;
- } else if (paramWidth (key, vval, pwidth, ferr)) {
} else {
wiki->errorMsg.append (key).append (CharConst ("=")).append (vval.dump ()).append (CharConst (": link script error.\n"));
ferr = true;
return false;
}
+ } else if (match (key, CharConst ("accept"))) {
+ ustring value (vval.textOut (wiki));
+ if (match (value, CharConst ("camera"))) {
+ paccept.assign (CharConst ("image/*;capture=camera"));
+ } else {
+ static uregex re ("^"
+ "(" "[a-z_0-9-]+/[a-z_0-9.+*-]+" ")"
+ "(" "," "(" "[a-z_0-9-]+/[a-z_0-9.+*-]+" ")" ")*"
+ "(" ";" "[a-z_0-9-]+=[a-zA-Z_0-9.+*-]+" ")*"
+ "$");
+ if (checkRe (value, re)) {
+ paccept = value;
+ } else {
+ return false;
+ }
+ }
} else {
return false;
}
pdefault = true;
} else if ((selector2 & SEL_CHECK) && match (key, CharConst ("checked"))) {
pchecked = true;
+#ifdef INSERTTABHACK
} else if ((selector2 & SEL_TEXTAREA) && match (key, CharConst ("tab"))) {
ftab = true;
+#endif
} else {
return false;
}
wiki->outputName (out, CharConst ("size"), psize);
wiki->outputName (out, CharConst ("size"), elsize);
if (pwidth.size () > 0) {
- if (checkNum (pwidth)) {
+ if (matchNum (pwidth)) {
out->out_raw (CharConst (" style=\"width:"))->out_toHTML_noCtrl (pwidth)->out_raw (CharConst ("px;\""));
} else {
out->out_raw (CharConst (" style=\"width:"))->out_toHTML_noCtrl (pwidth)->out_raw (CharConst (";\""));
// out->out_raw (CharConst (" wrap=\"physical\""));
break;
}
+#ifdef INSERTTABHACK
if (ftab) {
out->out_raw (uSPC)
->out_raw (CharConst ("onkeypress"))
->out_raw (CharConst ("onkeydown"))
->out_raw (CharConst ("=\""))
->out_toHTML (ustring (CharConst ("return insertTab(event,this);")))
- ->out_raw ("\"");
+ ->out_raw (uQ2);
out->out_raw (uSPC)
->out_raw (CharConst ("onkeyup"))
->out_raw (CharConst ("=\""))
->out_toHTML (ustring (CharConst ("return insertTab(event,this);")))
- ->out_raw ("\"");
+ ->out_raw (uQ2);
}
+#endif
+ }
+ if (paccept.length () > 0) {
+ out->out_raw (CharConst (" accept=\""))
+ ->out_toHTML (paccept)
+ ->out_raw (uQ2);
}
}
if (owner && owner->parent && owner->parent->attrib.id.size () == 0) {
paramIDValue (key, vval, owner->parent->attrib.id, ferr);
}
+ } else if (owner && owner->parent && (owner->parent->attrib.selector & SEL_START) && match (key, CharConst ("start"))) {
+ paramUNum (vval.textOut (wiki), owner->parent->attrib.start, key);
} else {
return false;
}