X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fstatic%2Fwclib.js;h=de48e2efbf8c37a6112109c341586ca6274048c0;hb=e1d43d5e4e749fa7756b324bbb16da561fc45e87;hp=e8c0c4ee72c2aa1cd2df3f9e8132c02c284d9552;hpb=b37c43a6c124f7307c5fb644c4a3bf53c4bc06e5;p=citadel.git diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index e8c0c4ee7..de48e2efb 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -1,24 +1,22 @@ /* * JavaScript function library for WebCit. * - * Copyright (c) 2005-2011 by the citadel.org team + * Copyright (c) 2005-2012 by the citadel.org team * - * This program is open source software. You can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is open source software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 3. + * the Free Software Foundation, either version 3 of the License, or + * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * along with this program. If not, see . */ - var browserType; var room_is_trash = 0; @@ -56,8 +54,52 @@ function strcmp ( str1, str2 ) { return ( ( str1 == str2 ) ? 0 : ( ( str1 > str2 ) ? 1 : -1 ) ); } +function CtdlMarkLog($Which, $Status) +{ + if ($Status) + document.getElementById($Which).checked == false; + else + document.getElementById($Which).checked == true; + +} +function ToggleLogEnable($Which) +{ + var p; + var Status = !document.getElementById($Which).checked; + if (Status) + p= encodeURI('g_cmd=LOGS ' + $Which + '|0'); + else + p= encodeURI('g_cmd=LOGS ' + $Which + '|1'); + new Ajax.Request('ajax_servcmd', { + method: 'post', + parameters: p, + onComplete: CtdlMarkLog($Which, Status) + }); +} + +function SMTPRunQueue() +{ + var p; + + p= encodeURI('g_cmd=SMTP runqueue'); + new Ajax.Request('ajax_servcmd', { + method: 'post', + parameters: p, + onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4));} + }); +} +function NetworkSynchronizeRoom(NodeName) +{ + var p; + p= encodeURI('g_cmd=NSYN ' + NodeName); + new Ajax.Request('ajax_servcmd', { + method: 'post', + parameters: p, + onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4));} + }); +} function ToggleVisibility ($Which) { if (document.getElementById) @@ -157,7 +199,50 @@ function hide_imsg_popup() { document.poppedLayer.style.visibility = "hidden"; } +function remove_something(what_to_search, new_visibility) { + if (browserType == "gecko") { + document.poppedLayer = eval('document.getElementById(\'' + what_to_search + '\')'); + } + else if (browserType == "ie") { + document.poppedLayer = eval('document.all[\'' + what_to_search + '\']'); + } + else { + document.poppedLayer = eval('document.layers[\'`' + what_to_search + '\']'); + } + if (document.poppedLayer!= null) + document.poppedLayer.innerHTML = ""; +} +function unhide_imsg_popup() { + if (browserType == "gecko") { + document.poppedLayer = eval('document.getElementById(\'important_message\')'); + } + else if (browserType == "ie") { + document.poppedLayer = eval('document.all[\'important_message\']'); + } + else { + document.poppedLayer = eval('document.layers[\'`important_message\']'); + } + + document.poppedLayer.style.visibility = "visible"; + setTimeout('hide_imsg_popup()', 5000); +} + +function ajax_important_message(messagetext) +{ + if (browserType == "gecko") { + document.poppedLayer = eval('document.getElementById(\'important_message\')'); + } + else if (browserType == "ie") { + document.poppedLayer = eval('document.all[\'important_message\']'); + } + else { + document.poppedLayer = eval('document.layers[\'`important_message\']'); + } + document.poppedLayer.style.visibility = "visible"; + setTimeout('hide_imsg_popup()', 5000); + document.poppedLayer.innerHTML = messagetext; +} // This function activates the ajax-powered recipient autocompleters on the message entry screen. function activate_entmsg_autocompleters() { @@ -303,11 +388,12 @@ function addRoomToList(floorUL,room, roomToEmphasize) { function roomListDropHandler(target, dropped) { if (dropped.getAttribute("citadel:msgid")) { var room = getTextContent(target); + console.log(room); var msgIds = ""; for(msgId in currentlyMarkedRows) { //defined in summaryview.js msgIds += ","+msgId; if (msgIds.length > 800) { - var mvCommand = encodeURI("g_cmd=MOVE " + msgIds + "|"+room+"|0"); + var mvCommand = "g_cmd=MOVE%20" + msgIds + "|"+encodeURIComponent(room)+"|0"; new Ajax.Request("ajax_servcmd", { parameters: mvCommand, method: 'post', @@ -316,7 +402,7 @@ function roomListDropHandler(target, dropped) { } } - var mvCommand = encodeURI("g_cmd=MOVE " + msgIds + "|"+room+"|0"); + var mvCommand = "g_cmd=MOVE%20" + msgIds + "|"+encodeURIComponent(room)+"|0"; new Ajax.Request('ajax_servcmd', { method: 'post', parameters: mvCommand, @@ -846,8 +932,8 @@ 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() } ); } @@ -857,7 +943,7 @@ function DeleteSMTPqueueMsg(msgnum1, msgnum2) { 'ajax_servcmd', { method: 'post', parameters: p, - onComplete: RefreshSMTPqueueDisplay() + onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4)); RefreshSMTPqueueDisplay();} } ); }