From 2e726d532bf7fe8b1e4f5f3912db32f5f0ba6c32 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 6 Nov 2012 17:11:41 +0000 Subject: Rename ajax viewtype to json to be more accurate --- app/Makefile | 2 +- app/template-ajax.lsp | 6 ------ app/template-json.lsp | 5 +++++ lua/mvc.lua | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 app/template-ajax.lsp create mode 100644 app/template-json.lsp diff --git a/app/Makefile b/app/Makefile index a3da5bc..b8862c7 100644 --- a/app/Makefile +++ b/app/Makefile @@ -25,7 +25,7 @@ APP_DIST= \ acf_www-controller.lua\ acf_cli-controller.lua\ menuhints.menu\ - template-ajax.lsp\ + template-json.lsp\ template-html.lsp\ template-stream.lsp\ dispatcherror-html.lsp\ diff --git a/app/template-ajax.lsp b/app/template-ajax.lsp deleted file mode 100644 index bb7fc9f..0000000 --- a/app/template-ajax.lsp +++ /dev/null @@ -1,6 +0,0 @@ -<% local view, viewlibrary, page_info, session = ... %> -<% require("json") %> -Status: 200 OK -Content-Type: "application/json" -<% io.write("\n") %> -<% page_info.viewfunc(view, viewlibrary, page_info, session) %> diff --git a/app/template-json.lsp b/app/template-json.lsp new file mode 100644 index 0000000..03dd5bf --- /dev/null +++ b/app/template-json.lsp @@ -0,0 +1,5 @@ +<% local view, viewlibrary, page_info, session = ... %> +Status: 200 OK +Content-Type: "application/json" +<% io.write("\n") %> +<% page_info.viewfunc(view, viewlibrary, page_info, session) %> diff --git a/lua/mvc.lua b/lua/mvc.lua index 3c7ec54..5524c5b 100755 --- a/lua/mvc.lua +++ b/lua/mvc.lua @@ -345,7 +345,7 @@ auto_view = function(viewtable, viewlibrary, pageinfo, session) if pageinfo.viewtype == "html" then require("htmlviewfunctions") htmlviewfunctions.displayitem(viewtable, 1, pageinfo) - elseif pageinfo.viewtype == "ajax" then + elseif pageinfo.viewtype == "json" then require("json") print(json.encode(viewtable)) elseif pageinfo.viewtype == "stream" then -- cgit v1.2.3