1DeWeb.Pages.VirtualInbox = new function () { 2 var statusId = ''; 3 var categoryId = ''; 4 var messsageStatusId = ''; 5 var directionId = ''; 6 var init = function ($viContainer) { 7 $(function() { 8 var $form = $viContainer.parents('form'); 9 statusId = $viContainer.data('status-field'); 10 directionId = $viContainer.data('direction-field'); 11 messsageStatusId = $viContainer.data('message-status-field'); 12 categoryId = $viContainer.data('category-field'); 13 if (statusId) { 14 var $statusField = $('#' + statusId); 15 var $directionField = $('#' + directionId); 16 var $messageStatusField = $('#' + messsageStatusId); 17 $('#status-picker').on('click', 'a[data-name=statusForm]', function (evt) { 18 evt.stopPropagation(); 19 evt.preventDefault(); 20 var $li = $(this); 21 var status = $li.data('statuses'); 22 $statusField.val(status); 23 var direction = $li.data('direction'); 24 $directionField.val(direction); 25 var messageStatus = $li.data('message-status'); 26 $messageStatusField.val(messageStatus); 27 $form.submit(); 28 }); 29 } 30 if (categoryId) { 31 var $categoryField = $('[name=' + categoryId + ']'); 32 $(document).on('change', '[name=' + categoryId + ']', function () { 33 $form.submit(); 34 }); 35 } 36 }); 37 } 38 39 return { 40 Init : init 41 } 42}; 43DeWeb.Utilities.archiveMsg = function ($this) { 44 $this.click(function () { 45 $.ajax({
46 url: $this.data("href"), 47 success: function () { 48 try { 49 DeWeb.Ui.HidePopup(); 50 $("#popup-content-narrow").removeClass("popup-1"); 51 DeWeb.Ui.ShowPopup($('#notification-msg').html(), 'narrow', ''); 52 } catch (e) { 53 console.log(e); 54 } 55 56 } 57 }); 58 }); 59 60}; 61DeWeb.Utilities.virtualInbox = function ($this) { 62 63 DeWeb.Pages.VirtualInbox.Init($this); 64} 65//Filter read unread and priority messages -- substatuses of received 66DeWeb.Utilities.filterMessages = function ($this) { 67 $this.click(function () { 68 var criteria = $this.data("criteria"); 69 var status = $("#Statuses_ID").val(); 70 71 $("a").removeClass("active"); 72 $this.addClass("active"); 73 if (status != "received,archived") { 74 $("#Statuses_ID").val("received,archived"); 75 $("#form_MailboxMessages_GetList_FormId").submit(); 76 } 77 $("div[data-type=msg]").css("display", "block"); 78 $("div[data-type=msg]").each(function () { 79 if ($(this).data(criteria) != "True") { 80 $(this).css("display", "none"); 81 } 82 else { 83 $(this).css("display", "block"); 84 } 85 }); 86 87 88 89 90 91 }); 92}; 93 94DeWeb.Utilities.openMessageDetails = function ($this) { 95 $this.on('click', function(e) { 96 $(this).find('i.recived-msg').removeClass('unread').addClass('red'); 97 e.preventDefault(); 98 var href = $this.data('details-href'); 99 if (href) { 100 $.get(href, function(data) { 101 //DeWeb.Ui.ShowPopup(data, 'wide'); 102 $('<div class="msg-details-popup">' + data + '</div>').dialog().dialog('show'); 103 DeWeb.LoadUtilities($('.msg-details-popup')); 104 }); 105 } 106 107 }); 108 109} 110 111//Message Count and Notification display! 112DeWeb.Utilities.messagesCount = function ($this) { 113 var updateUrl = $this.data('update-url'); 114 var logoutUrl = $this.data('logout-url'); 115 (function pollMessages(firstTime) { 116 var interval = firstTime == true ? 0 : 20000; 117 setTimeout(function () { 118 $.ajax({
119 url: updateUrl, 120 success: function (jsonMailboxUnread) { 121 try { 122 123 if (jsonMailboxUnread.IsSuccesfull === true || jsonMailboxUnread.IsSuccesfull == undefined) { 124 if (jsonMailboxUnread !== undefined) { 125 $this.text(""); 126 127 $this.append("" + jsonMailboxUnread[0] + ""); 128 if (jsonMailboxUnread[1] != "0" && firstTime) { 129 var priorityId = jsonMailboxUnread[3]; 130 var text = $this.data("additional-text") + " " + jsonMailboxUnread[1]; 131 var detailsLink = $this.parent().attr("href")+"/Details" + "/" +priorityId; 132 var title = "Title: " + jsonMailboxUnread[2]; 133 var iconClick = '<i data-utility="popupFromLink" data-popup-type="side" data-href="' + detailsLink + '" class="icon-mail-3"> </i>'; 134 DeWeb.Ui.ShowNotification({ 135 isFaulty: false, 136 title: $this.data("additional-title"), 137 prependTo: '#main', 138 content: $('<div id="error-container-temp" style="display: none"><p>' + text + '</p><p>' + iconClick + title + '</p></div>').html() 139 140 }); 141 142 } 143 } 144 } 145 146 147 } catch (e) { 148 console.log(e); 149 } 150 151 152 }, 153 error: function (jqXHR, textStatus, errorThrown) { 154 155 }, 156 dataType: "json", 157 complete: pollMessages(false) 158 }); 159 }, interval); 160 })(true); 161} 162 163 164DeWeb.Utilities.archiveMessage = function ($this) { 165 166 $this.on('click', function () { 167 var archiveUrl = $this.data('archive-url'); 168 var messageid = $this.data('messageid'); 169 $.ajax({
170 url: archiveUrl, 171 type: 'POST', 172 data: { 173 MessageIds_ID: messageid 174 }, 175 success: function (data) { 176 alert('Archived'); 177 178 }, 179 error: function (jqXHR, textStatus, errorThrown) { 180 alert('Not Archived'); 181 }, 182 dataType: "json" 183 }); 184 }); 185 186}; 187//Mailbox Messages -EDN 188 189 190//Notification Preferences V2 -START 191 192DeWeb.Utilities.setMediumChecked = function ($this) { 193 var checkboxId = $this.data("check-id"); 194 $this.click(function (event, param) { 195 196 if (param != undefined && param== false) { 197 $this.children().first().removeClass("checked"); 198 $this.find("input").prop("checked", false); 199 } 200 if (param != undefined && param == true) { 201 $this.children().first().addClass("checked"); 202 $this.find("input").prop("checked", true); 203 } 204 $("[type=checkbox]#" + checkboxId).prop("checked", $this.children().first().hasClass("checked")); 205 $("[type=checkbox]#" + checkboxId).val($this.children().first().hasClass("checked")); 206 207 208 }); 209 210} 211DeWeb.Utilities.setChildrenPreferences = function ($this) { 212 $this.click(function () { 213 if (!($this.children().first().hasClass("checked"))) { 214 $("[data-id=" + $this.data("group") + "]").each(function () { $(this).trigger("click", [false]); }); 215 } else { 216 $("[data-id=" + $this.data("group") + "]").each(function () { $(this).trigger("click", [true]); }); 217 } 218 }); 219} 220//Notification Preferences V2 -END 221DeWeb.Utilities.mapToField = function ($this) { 222 $this.change(function () { 223 224 $("#" + $this.data("id")).val($this.val()); 225 }); 226} 227 228 229DeWeb.Utilities.refreshPage = function ($this) { 230 $this.click(function () { 231 $('#side-modal-inbox').load(document.URL + ' #side-modal-inbox'); 232 }); 233} 234 235 236 237 238//SearchBox Mailbox 239DeWeb.Utilities.searchMsgs = function ($this) { 240 $this.on("input", function () { 241 $("[data-type=" + $this.data("objname")).each(function () { 242 var actualtxt = $(this).text().toLowerCase(); 243 var searchtxt = $this.val().toLowerCase(); 244 if (actualtxt.indexOf(searchtxt) == -1) { 245 $(this).css("display", "none"); 246 } 247 else { 248 $(this).css("display", "block"); 249 250 } 251 }); 252 253 }); 254}; 255 256//Next Message not ok 257DeWeb.Utilities.swipeMsg = function ($this) { 258 $this.click(function () { 259 var dir = $this.data("direction"); 260 var ids = $("#msgident").data("msglist"); 261 var current = $this.parent().data("current"); 262 currentId = ids.indexOf(current.toString()); 263 if (currentId + parseInt(dir) > ids.length || currentId + parseInt(dir) < 0) { 264 return; 265 } 266 next = ids[currentId + parseInt(dir)]; 267 $("#" + next).trigger("click"); 268 269 }); 270 271}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.