From 23e2bc504245b28835ff7958798b3a715f783c31 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 21 Dec 2015 18:07:13 +0000 Subject: Added analytics to APIDump --- Server/Plugins/APIDump/main_APIDump.lua | 59 ++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) (limited to 'Server/Plugins/APIDump/main_APIDump.lua') diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua index 872fa60f4..4d8f58483 100644 --- a/Server/Plugins/APIDump/main_APIDump.lua +++ b/Server/Plugins/APIDump/main_APIDump.lua @@ -309,6 +309,22 @@ local function WriteHtmlHook(a_Hook, a_HookNav) end f:write([[]]) f:write(GetHtmlTimestamp()) + f:write([[ + + + + ]]) f:write([[]]) f:close(); end @@ -956,6 +972,22 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu) cf:write([[]]) cf:write(GetHtmlTimestamp()) + cf:write([[ + + + + ]]) cf:write([[]]) cf:close() end @@ -1318,6 +1350,7 @@ local function DumpAPIHtml(a_API) local StaticFiles = { "main.css", + "piwik.js", "prettify.js", "prettify.css", "lang-lua.js", @@ -1337,6 +1370,22 @@ local function DumpAPIHtml(a_API) f:write([[]]) f:write(GetHtmlTimestamp()) + f:write([[ + + + + ]]) f:write([[]]) f:close() @@ -1686,7 +1735,7 @@ local function HandleCmdApiCheck(a_Split, a_EntireCmd) if (OfficialStats == "") then return true, "Cannot load official stats" end - + -- Load the API stats as a Lua file, process into usable dictionary: local Loaded, Msg = loadstring(OfficialStats) if not(Loaded) then @@ -1714,10 +1763,10 @@ local function HandleCmdApiCheck(a_Split, a_EntireCmd) end Parsed[clsK] = cls end - + -- Get the current API's undocumented stats: local API = PrepareApi() - + -- Compare the two sets of undocumented stats, list anything extra in current: local res = {} local ins = table.insert @@ -1740,7 +1789,7 @@ local function HandleCmdApiCheck(a_Split, a_EntireCmd) end end table.sort(res) - + -- Bail out if no items found: if not(res[1]) then return true, "No new undocumented functions" @@ -1751,7 +1800,7 @@ local function HandleCmdApiCheck(a_Split, a_EntireCmd) f:write(table.concat(res, "\n")) f:write("\n") f:close() - + return true, "Newly undocumented items: " .. #res .. "\n" .. table.concat(res, "\n") end -- cgit v1.2.3