Browse Source

n2o to n4u - application, js

221V 3 years ago
parent
commit
4e95755214
13 changed files with 20 additions and 20 deletions
  1. 2 2
      README.md
  2. 2 2
      ebin/n4u.app
  3. 1 1
      include/api.hrl
  4. 2 2
      include/wf.hrl
  5. 1 1
      priv/bullet.js
  6. 1 1
      priv/ftp.js
  7. 5 5
      priv/n4u.js
  8. 1 1
      priv/template.js
  9. 1 1
      priv/utf8.js
  10. 1 1
      priv/validation.js
  11. 1 1
      priv/xhr.js
  12. 1 1
      src/endpoints/cowboy/n2o_stream.erl
  13. 1 1
      src/n4u.app.src

+ 2 - 2
README.md

@@ -1,4 +1,4 @@
-N2O: Erlang Application Server
+N4U: Erlang Application Server
 ==============================
 
 Features
@@ -153,7 +153,7 @@ Documentation
 If you are new or you need to decide whether the N2O architecture
 and philosophy is a fit for your project
 
-* Official N2O Book [PDF](http://synrc.com/apps/n2o/doc/book.pdf)
+* Official N2O v4.4 Book (outdated) [PDF](http://synrc.com/apps/n2o/doc/book.pdf)
 
 Windows Users
 -------------

+ 2 - 2
ebin/n4u.app

@@ -1,5 +1,5 @@
-{application, n2o, [
-  {description, "N2O WebSocket Application Server"},
+{application, n4u, [
+  {description, "N4U WebSocket Application Server"},
   {vsn, "4.4.20"},
   {applications, [kernel, stdlib, asn1, public_key, ssl, crypto, ranch, cowboy, fs, active, sh, gproc, nitro]},
   {modules, [n2o, n4u_app, n4u_sup, n2o_async, n2o_xhr, n2o_cx, n2o_cowboy, n2o_multipart, n2o_static, n2o_stream, n2o_document, n2o_proto, n2o_relay, n2o_error, n2o_io, n2o_log, n2o_mq, n2o_pickle, n2o_query, n2o_secret, n2o_session, n2o_syn, n2o_client, n2o_file, n2o_heart, n2o_http, n2o_nitrogen, n2o_text, wf, wf_convert, wf_utils]},

+ 1 - 1
include/api.hrl

@@ -1,6 +1,6 @@
 -include("wf.hrl").
 
-% n2o types
+% n4u types
 
 -type name() :: atom() | binary() | string().
 -type render() :: list() | binary() | tuple() | list(tuple()).

+ 2 - 2
include/wf.hrl

@@ -1,5 +1,5 @@
--ifndef(N2O_HRL).
--define(N2O_HRL, true).
+-ifndef(N4U_HRL).
+-define(N4U_HRL, true).
 
 -record(handler, { name, module, class, group, config, state}).
 -record(cx,      { handlers, actions, req, module, lang, path, session, formatter=false, params, form, state=[] }).

+ 1 - 1
priv/bullet.js

@@ -5,7 +5,7 @@ $ws = { heart: true, interval: 4000,
         creator: function(url) { return window.WebSocket ? new window.WebSocket(url) : false; },
         onheartbeat: function() { this.channel.send('PING'); } };
 
-// N2O Reliable Connection
+// N4U Reliable Connection
 
 $conn = { onopen: nop, onmessage: nop, onclose: nop, onconnect: nop,
           send:  function(data)   { if (this.port.channel) this.port.channel.send(data); },

+ 1 - 1
priv/ftp.js

@@ -1,6 +1,6 @@
 try { module.exports = {ftp:ftp}; } catch (e) { }
 
-// N2O File Transfer Protocol
+// N4U File Transfer Protocol
 
 var ftp = {
     queue: [],

+ 5 - 5
priv/n2o.js → priv/n4u.js

@@ -1,5 +1,5 @@
 
-// N2O CORE
+// N4U CORE
 
 var active      = false,
     debug       = false,
@@ -9,11 +9,11 @@ var active      = false,
     host        = null == transition.host ? window.location.hostname : transition.host,
     port        = null == transition.port ? window.location.port : transition.port;
 
-function N2O_start() {
+function N4U_start() {
     ws = new bullet(protocol + host + (port==""?"":":"+port) + "/ws" + querystring);
     ws.onmessage = function (evt) { // formatters loop
     for (var i=0;i<protos.length;i++) { p = protos[i]; if (p.on(evt, p.do).status == "ok") return; } };
-    ws.onopen = function() { if (!active) { console.log('Connect'); ws.send('N2O,'+transition.pid); active=true; } };
+    ws.onopen = function() { if (!active) { console.log('Connect'); ws.send('N4U,'+transition.pid); active=true; } };
     ws.onclose = function() { active = false; console.log('Disconnect'); }; next(); }
 
 function qi(name) { return document.getElementById(name); }
@@ -22,11 +22,11 @@ function qn(name) { return document.createElement(name);  }
 function is(x,num,name) { return x.t==106?false:(x.v.length === num && x.v[0].v === name); }
 function co(name) { match=document.cookie.match(new RegExp(name+'=([^;]+)')); return match?match[1]:undefined; }
 
-/// N2O Protocols
+/// N4U Protocols
 
 var $io = {}; $io.on = function onio(r, cb) { if (is(r,3,'io')) {
   try {
-    if(window.debug){ console.log("from n2o.js:29\n", utf8_dec(r.v[1].v)); }
+    if(window.debug){ console.log("from n4u.js:29\n", utf8_dec(r.v[1].v)); }
     eval(utf8_dec(r.v[1].v)); if (typeof cb == 'function') cb(r); return { status: "ok" };
   } catch (e) { console.log(e); return { status: '' }; } } else return { status: '' }; }
 

+ 1 - 1
priv/template.js

@@ -1,5 +1,5 @@
 
-// N2O Simple Template
+// N4U Simple Template
 
 function template(html, data) { // template("{this.name}",{name:"Maxim"})
     var re = /{([^}]+)?}/g, code = 'var r=[];', cursor = 0;

+ 1 - 1
priv/utf8.js

@@ -1,6 +1,6 @@
 try { module.exports = {dec:utf8_dec,enc:utf8_toByteArray}; } catch (e) { }
 
-// N2O UTF-8 Support
+// N4U UTF-8 Support
 
 function utf8_toByteArray(str) {
     var byteArray = [];

+ 1 - 1
priv/validation.js

@@ -1,5 +1,5 @@
 
-// N2O Validation
+// N4U Validation
 
 function validateSources(list) {
     return list.reduce(function(acc,x) {

+ 1 - 1
priv/xhr.js

@@ -1,5 +1,5 @@
 
-// N2O XHR Fallback
+// N4U XHR Fallback
 
 // WebSocket = undefined; // to test
 

+ 1 - 1
src/endpoints/cowboy/n2o_stream.erl

@@ -23,7 +23,7 @@ body(R,S)                    -> {ok,R,S}.
 down(R)                      -> {shutdown,R,undefined}.
 reply(D,R,Code)              -> {ok,R2}=cowboy_req:reply(Code,[],D,R), R2.
 
-type(<<"N2O,",_/binary>>)    -> text;
+type(<<"N4U,",_/binary>>)    -> text;
 type(<<"PING">>)             -> text;
 type(_)                      -> binary.
 

+ 1 - 1
src/n4u.app.src

@@ -1,5 +1,5 @@
 {application, n4u,
- [{description, "N2O WebSocket Application Server"},
+ [{description, "N4U WebSocket Application Server"},
   {vsn, "4.4.20"},
   {applications, [kernel, stdlib, cowboy]},
   {modules, []},