/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ $(".card_taskfloor_viewmessages").each(function () { $(this).find(".card_title").append(" Messages"); var msglist = $(this).find(".message-list"); var url = $(this).data("apiurl"); $.post(url, { username: getuser(), password: getAPIKey(), action: "getmsgs" }, function (resp) { if (resp.status == "OK") { var msgs = resp.messages; for (var msg in msgs) { msglist.append( '
' + '' + msgs[msg]['from']['name'] + ' ' + msgs[msg]['to']['name'] + '' + '

' + msgs[msg]['text'] + '

' + '' + msgs[msg]['sent'] + '' + '
'); } } else { showmsg(resp.msg, "danger"); } }, "json"); });