diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-03 23:50:18 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-03 23:50:18 +0000 |
commit | f4559966aed8f81d115049007a41a931c77af14d (patch) | |
tree | b5aa011be71de324481e1e1f67fe1c24356d87c6 | |
parent | 5871a8369e0a18f711f7bb31de26e10a4c36df86 (diff) | |
download | acf-freeswitch-vmail-f4559966aed8f81d115049007a41a931c77af14d.tar.bz2 acf-freeswitch-vmail-f4559966aed8f81d115049007a41a931c77af14d.tar.xz |
Only load js libraries if not already loaded
-rw-r--r-- | authenticator-freeswitch-vmail.lua | 31 | ||||
-rw-r--r-- | vmail-listmessages-html.lsp | 14 | ||||
-rw-r--r-- | vmail-listusers-html.lsp | 14 |
3 files changed, 29 insertions, 30 deletions
diff --git a/authenticator-freeswitch-vmail.lua b/authenticator-freeswitch-vmail.lua index 74065d9..38e6342 100644 --- a/authenticator-freeswitch-vmail.lua +++ b/authenticator-freeswitch-vmail.lua @@ -2,38 +2,21 @@ module (..., package.seeall) require("md5") -a = require("authenticator-plaintext") list_fields = function(self, tabl) - result = a.list_fields(self, tabl) - return result + return nil end read_field = function(self, tabl, field) - result = a.read_field(self, tabl, field) ---[[ - if tabl == authenticator.usertable and field == "" then - -- authenticator is reading all users - local vmcontroller = self:new("freeswitch-vmail/vmail") - local users = vmcontroller.model.list_passwords() - for i,val in ipairs(users.value) do - local string = md5.sumhexa(val.password)..":Voicemail User:/freeswitch-vmail/vmail/USER::/freeswitch-vmail/vmail/listmymessages" - result[#result+1] = { id=val.username, entry=string } - end - vmcontroller:destroy() - end ---]] - return result + return nil end delete_field = function(self, tabl, field) - result = a.delete_field(self, tabl, field) - return result + return false end write_entry = function(self, tabl, field, id, entry) - result = a.write_entry(self, tabl, field, id, entry) - return result + return false end read_entry = function(self, tabl, field, id) @@ -47,13 +30,9 @@ read_entry = function(self, tabl, field, id) end vmcontroller:destroy() end - if not result then - result = a.read_entry(self, tabl, field, id) - end return result end delete_entry = function (self, tabl, field, id) - result = a.delete_entry(self, tabl, field, id) - return result + return false end diff --git a/vmail-listmessages-html.lsp b/vmail-listmessages-html.lsp index a7553b2..53d9187 100644 --- a/vmail-listmessages-html.lsp +++ b/vmail-listmessages-html.lsp @@ -50,8 +50,18 @@ if viewlibrary.check_permission("editmyusersettings") and viewlibrary.check_perm end %> -<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script> -<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + <script type="text/javascript"> <% -- Browser detect script from http://www.quirksmode.org/js/detect.html %> var BrowserDetect = { diff --git a/vmail-listusers-html.lsp b/vmail-listusers-html.lsp index 0b09be0..63d517d 100644 --- a/vmail-listusers-html.lsp +++ b/vmail-listusers-html.lsp @@ -3,8 +3,18 @@ require("htmlviewfunctions") html = require("acf.html") %> -<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script> -<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + <script type="text/javascript"> $(document).ready(function() { $("#list").tablesorter({headers: {0:{sorter: false}}}); |