Loading.... |
";
- p = 'which_addr_book=' + which_addr_book
- + '&target_input=' + target_input
- + '&r=' + CtdlRandomString();
- new Ajax.Updater(
- 'address_book_inner_div',
- 'display_address_book_inner_div',
- {
- method: 'get',
- parameters: p
- }
- );
+
+ $('address_book_inner_div').innerHTML =
+ "" +
+ "
" +
+ "" +
+ "" +
+ " Loading...." +
+ " |
";
+
+ p = 'which_addr_book=' + which_addr_book
+ + '&target_input=' + target_input
+ + '&r=' + ctdlRandomString()
+ + "&template=addressbook_namelist";
+ new Ajax.Updater(
+ 'address_book_inner_div',
+ 'do_template',
+ {
+ method: 'get',
+ parameters: p
+ }
+ );
}
// What happens when a contact is selected from the address book popup
// (populate the specified target)
function AddContactsToTarget(target, whichaddr) {
- while (whichaddr.selectedIndex != -1) {
+ while (whichaddr.selectedIndex !== -1) {
if (target.value.length > 0) {
target.value = target.value + ', ';
}
@@ -661,48 +635,50 @@ function HandleRSVP(question_divname, title_divname, msgnum, cal_partnum, sc) {
0,0,0,0,0, false, false, false, false, 0, null); */
// TODO: Collapse into one function
function toggleTaskDtStart(event) {
- var checkBox = $('nodtstart');
- var checkBoxTime = $('dtstart_time_assoc');
- var dtstart = document.getElementById("dtstart");
- var dtstart_date = document.getElementById("dtstart_date");
- var dtstart_time = document.getElementById("dtstart_time");
- if (checkBox.checked) {
- dtstart_date.style.visibility = "hidden";
- dtstart_time.style.visibility = "hidden";
+ var checkBox = $('nodtstart');
+ var checkBoxTime = $('dtstart_time_assoc');
+ var dtstart = document.getElementById("dtstart");
+ var dtstart_date = document.getElementById("dtstart_date");
+ var dtstart_time = document.getElementById("dtstart_time");
+ if (checkBox.checked) {
+ dtstart_date.style.visibility = "hidden";
+ dtstart_time.style.visibility = "hidden";
+ } else {
+ if (checkBoxTime.checked) {
+ dtstart_time.style.visibility = "visible";
} else {
- if (checkBoxTime.checked) {
- dtstart_time.style.visibility = "visible";
- } else {
- dtstart_time.style.visibility = "hidden";
- }
- dtstart_date.style.visibility = "visible";
- if (dtstart.value.length == 0)
- dtstart.dpck._initCurrentDate();
+ dtstart_time.style.visibility = "hidden";
}
+ dtstart_date.style.visibility = "visible";
+ if (dtstart.value.length === 0) {
+ dtstart.dpck._initCurrentDate();
+ }
+ }
}
function toggleTaskDue(event) {
- var checkBox = $('nodue');
- var checkBoxTime = $('due_time_assoc');
- var due = document.getElementById("due");
- var due_date = document.getElementById("due_date");
- var due_time = document.getElementById("due_time");
- if (checkBox.checked) {
- due_date.style.visibility = "hidden";
- due_time.style.visibility = "hidden";
+ var checkBox = $('nodue');
+ var checkBoxTime = $('due_time_assoc');
+ var due = document.getElementById("due");
+ var due_date = document.getElementById("due_date");
+ var due_time = document.getElementById("due_time");
+ if (checkBox.checked) {
+ due_date.style.visibility = "hidden";
+ due_time.style.visibility = "hidden";
+ } else {
+ if (checkBoxTime.checked) {
+ due_time.style.visibility = "visible";
} else {
- if (checkBoxTime.checked) {
- due_time.style.visibility = "visible";
- } else {
- due_time.style.visibility = "hidden";
- }
- due_date.style.visibility = "visible";
- if (due.value.length == 0)
- due.dpck._initCurrentDate();
+ due_time.style.visibility = "hidden";
+ }
+ due_date.style.visibility = "visible";
+ if (due.value.length === 0) {
+ due.dpck._initCurrentDate();
}
+ }
}
function ToggleTaskDateOrNoDateActivate(event) {
var dtstart = document.getElementById("nodtstart");
- if (dtstart != null) {
+ if (dtstart !== null) {
toggleTaskDtStart(null);
toggleTaskDue(null);
$('nodtstart').observe('click', toggleTaskDtStart);
@@ -749,14 +725,14 @@ function RecurrenceShowHide() {
$('rrule_div').style.display = 'none';
}
- if ($('freq_selector').selectedIndex == 4) {
+ if ($('freq_selector').selectedIndex === 4) {
$('weekday_selector').style.display = 'block';
}
else {
$('weekday_selector').style.display = 'none';
}
- if ($('freq_selector').selectedIndex == 5) {
+ if ($('freq_selector').selectedIndex === 5) {
$('monthday_selector').style.display = 'block';
}
else {
@@ -793,7 +769,7 @@ function RecurrenceShowHide() {
$('rrmweekday').disabled = true;
}
- if ($('freq_selector').selectedIndex == 6) {
+ if ($('freq_selector').selectedIndex === 6) {
$('yearday_selector').style.display = 'block';
}
else {
@@ -821,7 +797,7 @@ function RecurrenceShowHide() {
// the attendees list is empty
function EnableOrDisableCheckButton()
{
- if ($('attendees_box').value.length == 0) {
+ if ($('attendees_box').value.length === 0) {
$('check_button').disabled = true;
}
else {
@@ -833,10 +809,12 @@ function EnableOrDisableCheckButton()
function launchChat(event) {
-window.open('chat', 'ctdl_chat_window', 'toolbar=no,location=no,directories=no,copyhistory=no,status=no,scrollbars=yes,resizable=yes');
+ window.open('chat',
+ 'ctdl_chat_window',
+ 'toolbar=no,location=no,directories=no,copyhistory=no,status=no,scrollbars=yes,resizable=yes');
}
// logger
-function WCLog(msg) {
+function wCLog(msg) {
if (!!window.console && !!console.log) {
console.log(msg);
} else if (!!window.opera && !!opera.postError) {
@@ -847,39 +825,320 @@ function WCLog(msg) {
}
function RefreshSMTPqueueDisplay() {
- new Ajax.Updater('smtpqueue_inner_div',
- 'display_smtpqueue_inner_div', { method: 'get',
+ new Ajax.Updater('mailqueue_list',
+ 'dotskip?room=__CitadelSMTPspoolout__&view=11&ListOnly=yes', { method: 'get',
parameters: Math.random() } );
}
function DeleteSMTPqueueMsg(msgnum1, msgnum2) {
- var p = encodeURI('g_cmd=DELE ' + msgnum1 + ',' + msgnum2);
- new Ajax.Request(
- 'ajax_servcmd', {
- method: 'post',
- parameters: p,
- onComplete: RefreshSMTPqueueDisplay()
- }
- );
+ var p = encodeURI('g_cmd=DELE ' + msgnum1 + ',' + msgnum2);
+ new Ajax.Request(
+ 'ajax_servcmd', {
+ method: 'post',
+ parameters: p,
+ onComplete: function(transport) {
+ ajax_important_message(transport.responseText.substr(4));
+ RefreshSMTPqueueDisplay();}
+ }
+ );
}
function ConfirmLogoff() {
- new Ajax.Updater(
- 'md-content',
- 'do_template?template=confirmlogoff',
- {
- method: 'get',
- onSuccess: function(cl_success) {
- toggleModal(1);
- }
- }
- );
+ new Ajax.Updater(
+ 'md-content',
+ 'do_template?template=confirmlogoff',
+ {
+ method: 'get',
+ evalScripts: true,
+ onSuccess: function(cl_success) {
+ toggleModal(1);
+ }
+ }
+ );
}
function switch_to_lang(new_lang) {
- p = 'push?url=' + encodeURI(window.location);
- new Ajax.Request(p, { method: 'get' } );
+ p = 'push?url=' + encodeURI(window.location);
+ new Ajax.Request(p, { method: 'get' } );
window.location = 'switch_language?lang=' + new_lang ;
}
+
+
+function toggle_roomlist()
+{
+ /* WARNING: VILE, SLEAZY HACK. We determine the state of the box based on the image loaded. */
+ if ( $('expand_roomlist').src.substring($('expand_roomlist').src.length - 12) === "collapse.gif" ) {
+ $('roomlist').style.display = 'none';
+ $('expand_roomlist').src = 'static/webcit_icons/expand.gif';
+ wstate=0;
+ }
+
+ else {
+ $('roomlist').style.display = 'block';
+ $('expand_roomlist').src = 'static/webcit_icons/collapse.gif';
+ $('roomlist').innerHTML = '';
+ fillRooms(iconBarRoomList);
+ wstate=1;
+ }
+
+ // tell the server what I did
+ p = 'toggle_roomlist_expanded_state?wstate=' + wstate + '?rand=' + Math.random() ;
+ new Ajax.Request(p, { method: 'get' } );
+
+ return false; /* this prevents the click from registering as a roomlist button press */
+}
+
+
+function toggle_wholist()
+{
+ /* WARNING: VILE, SLEAZY HACK. We determine the state of the box based on the image loaded. */
+ if ( $('expand_wholist').src.substring($('expand_wholist').src.length - 12) === "collapse.gif" ) {
+ $('online_users').style.display = 'none';
+ $('expand_wholist').src = 'static/webcit_icons/expand.gif';
+ wstate=0;
+ }
+
+ else {
+ $('online_users').style.display = 'block';
+ $('expand_wholist').src = 'static/webcit_icons/collapse.gif';
+ activate_iconbar_wholist_populat0r();
+ wstate=1;
+ }
+
+ // tell the server what I did
+ p = 'toggle_wholist_expanded_state?wstate=' + wstate + '?rand=' + Math.random() ;
+ new Ajax.Request(p, { method: 'get' } );
+
+ return false; /* this prevents the click from registering as a wholist button press */
+}
+
+function getBlogStartText(wikitype) {
+ var wikitext = document.getElementById("wikitext").innerHTML;
+ var wikipublish = document.getElementById("wikipublish").innerHTML;
+ var wikilinktext = document.getElementById("wikilinktext").innerHTML;
+ var wikilinkmore = document.getElementById("wikilinkmore").innerHTML;
+ var wikilinkembedmedia = document.getElementById("wikilinkembedmedia").innerHTML;
+ if (wikitype) {
+ return "\n" +
+ "" + wikitext + "
\n" +
+ "" + wikipublish + "
\n" +
+ "" + wikilinktext + "" +
+ "" + wikilinkmore + "
\n" +
+ "" + wikilinkembedmedia + "
\n\n" +
+ "";
+ }
+ else {
+ return "#" + wikitext + "\n" +
+ wikipublish + "\n\n" +
+ "[" + wikilinktext + "](wiki?page=firstarticle)\n\n" +
+ wikilinkmore + "\n\n" +
+ wikilinkembedmedia + "\n\n ![alttext](/download_file/test.jpg)";
+ }
+}
+
+function create_blog()
+{
+ var er_view_blog = document.getElementById('er_view_blog');
+ var Nonce = document.getElementById('Nonce');
+ var roomname = document.getElementById('er_name').value;
+ var editroomname = roomname + '\\edit';
+ var filePath = "files_" + roomname;
+ var floorID = document.getElementById('er_floor').value;
+
+ var selects = document.getElementById("er_floor");
+ var selectedFloor = selects.options[selects.selectedIndex].value;
+ var selectedFloorName = selects.options[selects.selectedIndex].text;
+
+ var vselects = document.getElementById("er_view");
+ var vselectedMarkup = vselects.options[vselects.selectedIndex].value;
+ var vselectedMarkupName = vselects.options[vselects.selectedIndex].text;
+
+ var adminPW = document.getElementById('adminlist_passworded').checked;
+
+ var passvoid = document.getElementById('er_password').value;
+ var roomtypeWiki = document.getElementById('er_blog_markup_html').value;
+
+ var isHtmlWiki = vselectedMarkup === roomtypeWiki;
+ var starttext = getBlogStartText(isHtmlWiki);
+
+ ToggleVisibility('er_password');
+ var type_edit;
+ if (adminPW) {
+ type_edit = document.getElementById('adminlist_passworded').value;
+ ToggleVisibility('li_adminlist_invonly');
+ ToggleVisibility('adminlist_passworded');
+
+ }
+ else {
+ type_edit = document.getElementById('adminlist_invonly').value;
+ ToggleVisibility('adminlist_invonly');
+ ToggleVisibility('li_adminlist_passworded');
+ }
+
+ ToggleVisibility('er_floor');
+ document.getElementById('er_floor_fixed').innerHTML = selectedFloorName;
+ ToggleVisibility('er_floor_fixed');
+
+ ToggleVisibility('er_name');
+ document.getElementById('er_name_fixed').innerHTML = roomname;
+ ToggleVisibility('er_name_fixed');
+
+ ToggleVisibility('er_view');
+ document.getElementById('er_view_fixed').innerHTML = vselectedMarkupName;
+ ToggleVisibility('er_view_fixed');
+
+ ToggleVisibility('create_buttons');
+
+ ToggleVisibility('edit_info');
+ ToggleVisibility('throbber');
+
+
+ var roomdata = {
+ create_blog_room: {
+ nonce: Nonce,
+ er_name: roomname,
+ type: 'public',
+ er_view: er_view_blog,
+ er_floor: floorID,
+ template: "room_result_json",
+ ok_button: 1
+ },
+ setflags_blog_room: {
+ nonce: Nonce,
+ er_name: roomname,
+ go: roomname,
+ type: 'public',
+ er_floor: floorID,
+
+ directory: "yes",
+ er_dirname: filePath,
+ ulallowed: "no",
+ dlallowed: "yes",
+ ulmsg: "no",
+ visdir: "no",
+
+ anon: "no",
+ last_tabsel: 1,
+ er_view: er_view_blog,
+ template: "room_result_json",
+ ok_button: 1
+ },
+ create_blog_edit_room: {
+ nonce: Nonce,
+ er_name: editroomname,
+ type: type_edit,
+ er_view: vselectedMarkup,
+ er_floor: floorID,
+ er_password: passvoid,
+ template: "room_result_json",
+ ok_button: 1
+ },
+ setflags_blog_edit_room: {
+ nonce: Nonce,
+ er_name: editroomname,
+ go: editroomname,
+ type: type_edit,
+ er_floor: floorID,
+
+ directory: "yes",
+ er_dirname: filePath,
+ ulallowed: "yes",
+ dlallowed: "yes",
+ ulmsg: "no",
+ visdir: "yes",
+
+ anon: "no",
+ last_tabsel: 1,
+ er_view: er_view_blog,
+ template: "room_result_json",
+ ok_button: 1
+ },
+ blog_wiki_startmessage : {
+ nonce: Nonce,
+ force_room: editroomname,
+ page: "home",
+ markdown: (isHtmlWiki)?0:1,
+ msgtext: starttext
+
+ }
+ };
+
+ /* promises anyone?
+ * - create the blog room
+ * - set the blog rooms file flags
+ * - create the edit room
+ * - set the blog edit room flags
+ */
+ new Ajax.Request("/entroom",
+ { method: 'post',
+ parameters: $H(roomdata.create_blog_room).toQueryString(),
+ onComplete: function(transport) {
+ new Ajax.Request("/editroom",
+ { method: 'post',
+ parameters: $H(roomdata.setflags_blog_room).toQueryString(),
+ onComplete: function(transport) {
+ new Ajax.Request("/entroom",
+ { method: 'post',
+ parameters: $H(roomdata.create_blog_edit_room).toQueryString(),
+ onComplete: function(transport) {
+ new Ajax.Request("/editroom",
+ { method: 'post',
+ parameters: $H(roomdata.setflags_blog_edit_room).toQueryString(),
+ onComplete: function(transport) {
+ ToggleVisibility('throbber');
+ new Ajax.Request("/post",
+ { method: 'post',
+ parameters: $H(roomdata.blog_wiki_startmessage).toQueryString(),
+ onComplete: function(transport) {
+
+ }
+ }
+ );
+ }
+ }
+ );
+ }
+ }
+ );
+ }
+ }
+ )
+ }
+ }
+ );
+
+ return false;
+}
+
+
+function deleteAllSelectedMessages() {
+
+}
+
+
+function publishMessage()
+{
+ var messages = document.getElementsByClassName("message");
+ var messageIdParts = messages[0].id.split('|');
+ var editRoomName = getTextContent(document.getElementById("rmname"));
+ var roomName = editRoomName.substring(0, editRoomName.length - 5);
+
+ var publish = {
+ editRoom: editRoomName,
+ blogRoom: roomName,
+ msgNo : messageIdParts[1],
+ msgIdStr : messageIdParts[2]
+ }
+
+ mvCommand = encodeURI("g_cmd=MOVE " + publish.msgNo + "|" + publish.blogRoom + "|1");
+
+ new Ajax.Request("ajax_servcmd", {
+ parameters: mvCommand,
+ method: 'post',
+ onSuccess: function(transport) {
+ wCLog(transport.responseText);
+ }
+ });
+}
\ No newline at end of file