Browse Source

todo only nitro in nitro

221V 1 year ago
parent
commit
1626056a1f
5 changed files with 8 additions and 6 deletions
  1. 1 1
      include/n2o.hrl
  2. 3 3
      src/nitro.erl
  3. 2 0
      src/nitro_n2o.erl
  4. 1 1
      src/nitro_static.erl
  5. 1 1
      src/render/wf_event.erl

+ 1 - 1
include/n2o.hrl

@@ -1,6 +1,6 @@
 -ifndef(N2O_HRL).
 -ifndef(N2O_HRL).
 -define(N2O_HRL, true).
 -define(N2O_HRL, true).
-
+%% todo mv this from nitro
 
 
 -define(FORMAT(F), case F of F when erlang:is_binary(F) -> erlang:binary_to_list(F);
 -define(FORMAT(F), case F of F when erlang:is_binary(F) -> erlang:binary_to_list(F);
                              F when erlang:is_atom(F) -> erlang:atom_to_list(F);
                              F when erlang:is_atom(F) -> erlang:atom_to_list(F);

+ 3 - 3
src/nitro.erl

@@ -134,20 +134,20 @@ os_env(Key, Default) ->
 
 
 
 
 -ifndef(PICKLER).
 -ifndef(PICKLER).
--define(PICKLER, (application:get_env(n2o, pickler, nitro_pickle))).
+-define(PICKLER, (application:get_env(nitro, pickler, nitro_pickle))).
 -endif.
 -endif.
 
 
 pickle(Data) -> ?PICKLER:pickle(Data).
 pickle(Data) -> ?PICKLER:pickle(Data).
 depickle(SerializedData) -> ?PICKLER:depickle(SerializedData).
 depickle(SerializedData) -> ?PICKLER:depickle(SerializedData).
 
 
 
 
-prolongate() ->
+prolongate() ->  %% todo mv this from nitro
   case application:get_env(n2o, session) of
   case application:get_env(n2o, session) of
     {ok, M} -> M:prolongate();
     {ok, M} -> M:prolongate();
     undefined -> false
     undefined -> false
   end.
   end.
 
 
-authenticate(I, Auth) ->
+authenticate(I, Auth) -> %% todo mv this from nitro
   (application:get_env(n2o, session, n2o_session)):authenticate(I, Auth).
   (application:get_env(n2o, session, n2o_session)):authenticate(I, Auth).
 
 
 
 

+ 2 - 0
src/nitro_n2o.erl

@@ -14,6 +14,8 @@
 
 
 % Nitrogen pickle handler
 % Nitrogen pickle handler
 
 
+%% todo mv this from nitro
+
 info({text, <<"N2O,", Auth/binary>>}, Req, State) ->
 info({text, <<"N2O,", Auth/binary>>}, Req, State) ->
   info(#init{token = Auth}, Req, State);
   info(#init{token = Auth}, Req, State);
 
 

+ 1 - 1
src/nitro_static.erl

@@ -41,7 +41,7 @@ forbidden(Req, State) -> {false, Req, State}.
 
 
 
 
 fixpath(Path) ->
 fixpath(Path) ->
-  {Module,Fun} = application:get_env(n2o, fixpath, {nitro_static, fix}),
+  {Module,Fun} = application:get_env(n2o, fixpath, {nitro_static, fix}), %% todo mv this from nitro
   Module:Fun(Path).
   Module:Fun(Path).
 
 
 
 

+ 1 - 1
src/render/wf_event.erl

@@ -52,7 +52,7 @@ new(Postback, Element, Delegate, Name, Data, Source, Validation) ->
     Join([ nitro:to_list(S) || S <- Source, S =/= [] ]),
     Join([ nitro:to_list(S) || S <- Source, S =/= [] ]),
     "])){", nitro:to_binary(Validation),
     "])){", nitro:to_binary(Validation),
     " ws.send(enc(tuple(atom('",
     " ws.send(enc(tuple(atom('",
-    nitro:to_binary(application:get_env(n2o, event, pickle)),
+    nitro:to_binary(application:get_env(nitro, event, pickle)),
     "'),bin('", Element, "'),bin('", nitro:pickle(Event), "'),", Data, ")));"
     "'),bin('", Element, "'),bin('", nitro:pickle(Event), "'),", Data, ")));"
     "}else console.log('Validation Error');}"
     "}else console.log('Validation Error');}"
   ]).
   ]).