if(html) $('WikiPane').innerHTML=html.stringValue();
if(lu&&lu.value.size()>0) $('LastUpdate').innerHTML=lu.stringValue();
}
+function showWikiHandler(r){
+ showWiki(r.responseXML.documentElement);
+}
//
function SubmitForm(form,page,data,func){
if(func){
- callWiki(page,form.serialize(true).update(data),func);
+ callWiki(page,$H($(form).serialize(true)).update(data),func);
}else{
- var f=function(r){
- showWiki(r.responseXML.documentElement);
- };
- callWiki(page,form.serialize(true).update(data),f);
+ callWiki(page,$H($(form).serialize(true)).update(data),showWikiHandler);
}
}
//
(motor-raw "opLogout();")
)
+(defun-wiki-link SubmitForm (page)
+ (motor-raw (concat "SubmitForm(this,'" (js page) "');return false;"))
+)
+
(defun-wiki-command PageIndex (vpage vtitle)
(wiki-page-index nil (wikivar vpage) (wikivar vtitle))
)
)
)
)
+
+(defun-wiki-command WikiSearch (key vpage vtitle vsp)
+ (wiki-search key (wikivar vpage) (wikivar vtitle) (wikivar vsp))
+)
)
)
+(defun wiki-page-backup-list (page vdate)
+ (sql "select Date from BackupIndex where PID=:pid and Page=:page order by Date desc"
+ :bind (list ':pid PID ':page page)
+ :@answer (list vdate))
+)
+
+(defun wiki-page-date (page date)
+ (let (title text)
+ (if (emptyp date)
+ (sql "select b.Title,b.WikiText from WikiIndex a,Wiki b using(WID) where a.PID=:pid and a.Page=:page"
+ :bind (list ':pid PID ':page page)
+ :answer '(title text))
+ (sql "select b.Title,b.WikiText from BackupIndex a,Wiki b using(WID) where a.PID=:pid and a.Page=:page and Date=:date"
+ :bind (list ':pid PID ':page page ':date date)
+ :answer '(title text))
+ )
+ (list title text)
+ )
+)
+
(defun wiki-save (page title text)
(let (iid wid date uid nwid)
(sql "begin")
)
)
)
+
+(defun wiki-search (key vpage vtitle vsp)
+ ($estcmd 'wiki-index
+ (search key
+ :attribute "Page" vpage
+ :attribute "@title" vtitle
+ :snippet vsp
+ :cond (concat "Proj STREQ " PID))
+ )
+ (doarray (list vtitle)
+ (if (emptyp (getvar vtitle))
+ (setvar vtitle "<タイトル未設定>")
+ )
+ )
+)
+
+(defun wiki-diff (page otime ntime vo1 vo2 vn1 vn2)
+ (let (to tn)
+ ($sqlite3 'database
+ (sql
+ )
+ )
+)