Browse Source

n2o to n2z

221V 3 years ago
parent
commit
215dca0093

+ 1 - 1
README.md

@@ -7,7 +7,7 @@ Features
 --------
 
 * Full HTML5 and SVG Support
-* Support for N2O Erlang WebSocket Application Server
+* Support for N2Z Erlang WebSocket Application Server
 * Native Erlang way for UI/UX controls as HTML/JS/CSS components
 * Tag Inheritance
 * Polymorphic Tuples

+ 4 - 4
include/n2o.hrl → include/n2z.hrl

@@ -1,5 +1,5 @@
--ifndef(N2O_HRL).
--define(N2O_HRL, true).
+-ifndef(N2Z_HRL).
+-define(N2Z_HRL, true).
 
 -define(FORMAT(F), case F of F when is_binary(F) -> binary_to_list(F);
                              F when is_atom(F) -> atom_to_list(F);
@@ -38,8 +38,8 @@
               from      = [] :: [] | binary(),
               vsn       = [] :: [] | binary() }).
 
--define(CTX(ClientId), n2o:cache(ClientId)).
--define(REQ(ClientId), (n2o:cache(ClientId))#cx.req).
+-define(CTX(ClientId), n2z:cache(ClientId)).
+-define(REQ(ClientId), (n2z:cache(ClientId))#cx.req).
 
 % Nitrogen Protocol
 

+ 1 - 0
src/elements/combo/element_comboLookup.erl

@@ -37,3 +37,4 @@ render_element(#comboLookup{id=Id, style=Style, value = Val, bind = Object,
                           end},
                  #panel{id=form:atom([comboContainer, Id]),
                         class = ['dropdown-content']}]}).
+

+ 9 - 0
src/nitro.app

@@ -0,0 +1,9 @@
+{application, nitro, [
+    {description,  "NITRO Nitrogen Web Framework"},
+    {vsn,          "6.6.1"},
+    {applications, [kernel, stdlib]},
+    {modules, [nitro_conv, nitro_n2z, nitro_static, nitro, action_alert, action_api, action_bind, action_confirm, action_event, action_jq, action_manage, action_transfer, action_ui, action_wire, element_calendar, element_comboLookup, element_comboLookupEdit, element_comboLookupVec, element_koatuu, element_sortable_item, element_sortable_list, element_del, element_ins, element_area, element_audio, element_canvas, element_embed, element_iframe, element_image, element_map, element_object, element_param, element_source, element_track, element_video, element_button, element_fieldset, element_form, element_keygen, element_label, element_legend, element_meter, element_output, element_progress, element_select, element_textarea, element_blockquote, element_dtl, element_html, element_li, element_script, element_checkbox, element_color, element_date, element_datetime_local, element_datetime, element_dropdown, element_email, element_file, element_hidden, element_input_button, element_input_image, element_input_time, element_input, element_link, element_list, element_literal, element_month, element_number, element_password, element_radio, element_radiogroup, element_range, element_reset, element_search, element_submit, element_tel, element_textbox, element_url, element_week, element_command, element_details, element_menu, element_summary, element_upload, element_meta_base, element_meta_link, element_meta, element_style, element_col, element_colgroup, element_table, element_td, element_th, element_tr, wf_event, wf_render_actions, wf_render_elements, wf_render, wf_tags ]},
+    {registered,   []},
+    {mod, { nitro, []}},
+    {env, []}
+]}.

+ 0 - 9
src/nitro.app.src

@@ -1,9 +0,0 @@
-{application, nitro, [
-    {description,  "NITRO Nitrogen Web Framework"},
-    {vsn,          "6.6.0"},
-    {applications, [kernel, stdlib]},
-    {modules, []},
-    {registered,   []},
-    {mod, { nitro, []}},
-    {env, []}
-]}.

+ 3 - 3
src/nitro.erl

@@ -60,14 +60,14 @@ to_binary(L) when is_list(L) ->  iolist_to_binary(L);
 to_binary(X) when is_tuple(X) ->  term_to_binary(X).
 
 -ifndef(PICKLER).
--define(PICKLER, (application:get_env(n2o,pickler,nitro_conv))).
+-define(PICKLER, (application:get_env(n2z, pickler, nitro_conv))).
 -endif.
 
 pickle(Data) -> ?PICKLER:pickle(Data).
 depickle(SerializedData) -> ?PICKLER:depickle(SerializedData).
 
-prolongate() -> case application:get_env(n2o,session) of {ok, M} -> M:prolongate(); undefined -> false end.
-authenticate(I, Auth) -> (application:get_env(n2o,session,n2o_session)):authenticate(I, Auth).
+prolongate() -> case application:get_env(n2z, session) of {ok, M} -> M:prolongate(); undefined -> false end.
+authenticate(I, Auth) -> (application:get_env(n2z, session, n2z_session)):authenticate(I, Auth).
 
 render(X) -> wf_render:render(X).
 wire(Actions) -> action_wire:wire(Actions).

+ 4 - 4
src/nitro_conv.erl

@@ -1,6 +1,6 @@
 -module(nitro_conv).
--description('N2O Formatter: JSON, BERT').
--author('Maxim Sokhatsky').
+% N2Z Formatter: JSON, BERT
+% author Maxim Sokhatsky
 -compile(export_all).
 -include_lib("nitro/include/nitro.hrl").
 
@@ -8,8 +8,8 @@
 
 -define(IS_STRING(Term), (is_list(Term) andalso Term /= [] andalso is_integer(hd(Term)))).
 
--ifndef(N2O_JSON).
--define(N2O_JSON, (application:get_env(n2o,json,jsone))).
+-ifndef(N2Z_JSON).
+-define(N2Z_JSON, (application:get_env(n2z, json, jsone))).
 -endif.
 
 

+ 6 - 6
src/nitro_n2o.erl → src/nitro_n2z.erl

@@ -1,11 +1,11 @@
--module(nitro_n2o).
--description('N2O Nitrogen Web Framework Protocol').
--include_lib("nitro/include/n2o.hrl").
--export([info/3,render_actions/1,io/1,io/2,event/1]).
+-module(nitro_n2z).
+% N2Z Nitrogen Web Framework Protocol
+-include_lib("nitro/include/n2z.hrl").
+-export([info/3, render_actions/1, io/1, io/2, event/1]).
 
 % Nitrogen pickle handler
 
-info({text,<<"N2O,",Auth/binary>>}, Req, State) ->
+info({text,<<"N2Z,", Auth/binary>>}, Req, State) ->
     info(#init{token=Auth},Req,State);
 
 info(#init{token=Auth}, Req, State) ->
@@ -48,7 +48,7 @@ render_actions(Actions) ->
     nitro:actions([]),
     nitro:to_binary([First,Second]).
 
-% n2o events
+% n2z events
 
 html_events(#pickle{source=Source,pickled=Pickled,args=Linked}, State=#cx{token = Token}) ->
     Ev  = nitro:depickle(Pickled),

+ 4 - 4
src/nitro_static.erl

@@ -1,7 +1,7 @@
 -module(nitro_static).
--description('NITRO Static bridge for MAD containers').
--author('Maxim Sokhatsky').
--compile(export_all).
+% NITRO Static bridge
+% author Maxim Sokhatsky
+-compile([export_all, nowarn_export_all]).
 -include_lib("kernel/include/file.hrl").
 
 init(_, _, _) -> {upgrade, protocol, cowboy_rest}.
@@ -22,7 +22,7 @@ forbidden(Req, State) -> {false, Req, State}.
 
 
 
-fixpath(Path) -> {Module,Fun} = application:get_env(n2o,fixpath,{nitro_static,fix}),
+fixpath(Path) -> {Module,Fun} = application:get_env(n2z, fixpath, {nitro_static,fix}),
                  Module:Fun(Path).
 
 fix(A) -> A.

+ 4 - 4
src/render/wf_event.erl

@@ -1,9 +1,9 @@
 -module(wf_event).
--author('Maxim Sokhatsky').
--author('Andrey Martemyanov').
+% author Maxim Sokhatsky
+% author Andrey Martemyanov
 -include_lib("nitro/include/cx.hrl").
 -include_lib("nitro/include/nitro.hrl").
--compile(export_all).
+-compile([export_all, nowarn_export_all]).
 
 -record(ev,      { module, msg, trigger, name }).
 
@@ -32,5 +32,5 @@ new(Postback, Element, Delegate, Name, Data, Source, Validation) ->
          ([H|T]) -> [[$'|H]++[$']] ++ [ [$,,$'|E]++[$'] || E <- T ] end,
     Event = #ev{name=Name, module=Module, msg=Postback, trigger=Element},
     list_to_binary(["{ if (validateSources([",Join([ nitro:to_list(S) || S <- Source, S =/= []]),
-        "])) { ",?B(Validation)," ws.send(enc(tuple(atom('",?B(application:get_env(n2o,event,pickle)),"'),bin('",
+        "])) { ",?B(Validation)," ws.send(enc(tuple(atom('",?B(application:get_env(n2z, event, pickle)),"'),bin('",
         Element,"'),bin('",nitro:pickle(Event),"'),",Data,"))); } else console.log('Validation Error'); }"]).

+ 1 - 1
src/render/wf_render_elements.erl

@@ -73,4 +73,4 @@ default_render(Tag, Record) ->
             {<<"onmousemove">>,     element(#element.onmousemove, Record)},
             {<<"role">>,            element(#element.role, Record)}],
         element(#element.data_fields, Record),
-        element(#element.aria_states, Record)])).
+        element(#element.aria_states, Record)])).