Commit f4559966 authored by Ted Trask's avatar Ted Trask

Only load js libraries if not already loaded

parent 5871a836
......@@ -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
......@@ -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 = {
......
......@@ -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}}});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment