Browse Source

new mad with fixed n2o_sample

Namdak Tonpa 10 years ago
parent
commit
b955fb7af3
5 changed files with 7 additions and 6 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 2 1
      priv/web/apps/sample/src/index.erl
  4. 1 1
      src/compile/mad_app.erl
  5. 3 3
      src/mad_ling.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"581486").
+-define(VERSION,"3c29eb").

BIN
mad


+ 2 - 1
priv/web/apps/sample/src/index.erl

@@ -9,5 +9,6 @@ body()    -> [ #panel{id=history}, #textbox{id=message},
                #button{id=send,body="Chat",postback=chat,source=[message]} ].
 
 event(init) -> wf:reg(room);
-event(chat) -> wf:insert_bottom(history,#panel{id=history,body=[peer(),": ",message(),#br{}]});
+event(chat) -> wf:send(room,{client,{peer(),message()}});
+event({client,{Peer,Message}}) -> wf:insert_bottom(history,#panel{id=history,body=[Peer,": ",Message,#br{}]});
 event(Event) -> wf:info(?MODULE,"Unknown Event: ~p~n",[Event]).

+ 1 - 1
src/compile/mad_app.erl

@@ -37,5 +37,5 @@ apps(AppName) -> {ok,Apps} = mad_plan:orderapps(), {applications,Apps -- [AppNam
 generate_deps(AppName,Properties) ->
     case lists:keyfind(applications, 1, Properties) of
          false -> Properties ++ [apps(AppName)];
-        Exists -> Properties end.
+        _Exists -> Properties end.
 

+ 3 - 3
src/mad_ling.erl

@@ -5,14 +5,14 @@
 -compile(export_all).
 -define(ARCH, list_to_atom( case os:getenv("ARCH") of false -> "posix_x86"; A -> A end)).
 
-main(App) ->
+main(_App) ->
     io:format("ARCH: ~p~n",         [?ARCH]),
     io:format("Bundle Name: ~p~n",  [mad_repl:local_app()]),
     io:format("System: ~p~n",       [mad_repl:system()]),
     io:format("Apps: ~p~n",         [mad_repl:applist()]),
 %    io:format("Overlay: ~p~n",      [[{filename:basename(N),size(B)}||{N,B} <- mad_bundle:overlay()]]),
 %    io:format("Files: ~p~n",        [[{filename:basename(N),size(B)}||{N,B} <- bundle()]]),
-    io:format("Overlay: ~p~n",      [[filename:basename(N)||{N,B} <- mad_bundle:overlay()]]),
+    io:format("Overlay: ~p~n",      [[filename:basename(N)||{N,_B} <- mad_bundle:overlay()]]),
     add_apps(),
     false.
 
@@ -82,7 +82,7 @@ embed_fs(EmbedFsPath,Bucks)  ->
                     (local_map) -> LocalMap = local_map(Bucks),
                                    io:format("~nMount View:~n ~s",[LocalMap]),
                                    write_bin(EmbedFs, "local.map", LocalMap);
-                  ({App,F,Bin}) -> write_bin(EmbedFs, filename:basename(F), Bin)
+                  ({_App,F,Bin}) -> write_bin(EmbedFs, filename:basename(F), Bin)
           end,Bins)
     end,Bucks),
     file:close(EmbedFs),