X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fstatic%2Fwclib.js;fp=webcit%2Fstatic%2Fwclib.js;h=59bbc84b270fa3668857694f752bbd8adfa618f7;hb=ad4801a14334e5e55f058445d13334c279804e37;hp=e9f88042e302e7eb6f0ec5e655d32c645acc1435;hpb=1cb2a1c6efb4ff083970426b1acde2026f435a90;p=citadel.git diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index e9f88042e..59bbc84b2 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -999,7 +999,7 @@ function create_blog() create_blog_room: { nonce: Nonce, er_name: roomname, - type: 'public', + type: 'public', er_view: er_view_blog, er_floor: floorID, template: "room_result_json", @@ -1008,8 +1008,8 @@ function create_blog() setflags_blog_room: { nonce: Nonce, er_name: roomname, - go: roomname, - type: 'public', + go: roomname, + type: 'public', er_floor: floorID, directory: "yes", @@ -1019,7 +1019,7 @@ function create_blog() ulmsg: "no", visdir: "no", - anon: "no", + anon: "no", last_tabsel: 1, er_view: er_view_blog, template: "room_result_json", @@ -1028,7 +1028,7 @@ function create_blog() create_blog_edit_room: { nonce: Nonce, er_name: editroomname, - type: type_edit, + type: type_edit, er_view: vselectedMarkup, er_floor: floorID, er_password: passvoid, @@ -1038,8 +1038,8 @@ function create_blog() setflags_blog_edit_room: { nonce: Nonce, er_name: editroomname, - go: editroomname, - type: type_edit, + go: editroomname, + type: type_edit, er_floor: floorID, directory: "yes", @@ -1049,7 +1049,7 @@ function create_blog() ulmsg: "no", visdir: "yes", - anon: "no", + anon: "no", last_tabsel: 1, er_view: er_view_blog, template: "room_result_json", @@ -1058,7 +1058,7 @@ function create_blog() blog_wiki_startmessage : { nonce: Nonce, force_room: editroomname, - page: "home", + page: "home", markdown: (isHtmlWiki)?0:1, msgtext: starttext @@ -1141,4 +1141,27 @@ function publishMessage() wCLog(transport.responseText); } }); -} \ No newline at end of file +} + + + + +// Generate a random string of the specified length +// Useful for generating one-time-use div names +// +function randomString(length) { + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz'.split(''); + var str = ''; + + if (!length) { + length = Math.floor(Math.random() * chars.length); + } + for (var i = 0; i < length; i++) { + str += chars[Math.floor(Math.random() * chars.length)]; + } + return str; +} + + + +