|
@@ -9,8 +9,9 @@
|
|
-define(CTX, (get(context))).
|
|
-define(CTX, (get(context))).
|
|
|
|
|
|
-define(B(E), nitro:to_binary(E)).
|
|
-define(B(E), nitro:to_binary(E)).
|
|
-target({qs,S}) -> ["qs('",S,"')"];
|
|
|
|
-target(Id) -> ["qi('",?B(Id),"')"].
|
|
|
|
|
|
+-define(L(E), nitro:to_list(E)).
|
|
|
|
+target({qs,S}) -> ["qs('",nitro:js_escape(?L(S)), "')"];
|
|
|
|
+target(Id) -> ["qi('",nitro:js_escape(?L(Id)),"')"].
|
|
|
|
|
|
new(P,E,D,N,Data,Source) -> new(P,E,D,N,Data,Source,<<>>).
|
|
new(P,E,D,N,Data,Source) -> new(P,E,D,N,Data,Source,<<>>).
|
|
|
|
|
|
@@ -24,4 +25,4 @@ new(Postback, Element, Delegate, Name, Data, Source, Validation) ->
|
|
Event = #ev{name=Name, module=Module, msg=Postback, trigger=Element},
|
|
Event = #ev{name=Name, module=Module, msg=Postback, trigger=Element},
|
|
list_to_binary(["{ if (validateSources([",Join([ nitro:to_list(S) || S <- Source, S =/= []]),
|
|
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(n2o,event,pickle)),"'),bin('",
|
|
- Element,"'),bin('",nitro:pickle(Event),"'),",Data,"))); } else console.log('Validation Error'); }"]).
|
|
|
|
|
|
+ Element,"'),bin('",nitro:pickle(Event),"'),",Data,"))); } else console.log('Validation Error'); }"]).
|