Permalink
Browse files

[fix] compilation for Opa v0.9.4 (build 1900)

  • Loading branch information...
1 parent 0c98430 commit 003186ca45c906df0c4db49eded1f72ad8b620df @Aqua-Ye committed Jun 16, 2012
Showing with 13 additions and 12 deletions.
  1. +2 −2 Makefile
  2. +7 −7 plugins/file/file.js
  3. +3 −3 src/main.opa
  4. +1 −0 src/share.opa
View
@@ -2,8 +2,8 @@
OPA ?= opa
OPA_PLUGIN ?= opa-plugin-builder
-OPA_OPT ?= --parser js-like
-MINIMAL_VERSION = 1588
+OPA_OPT ?= --parser js-like --database db3
+MINIMAL_VERSION = 1900
EXE = opa_chat.exe
all: $(EXE)
View
@@ -8,8 +8,8 @@ function file_to_content(file, cb) {
if (window.FileReader) {
var reader = new FileReader();
reader.onload = function(e) {
- // if (file.size > 10*1024*1024) return;
- cb(file.name, file.type, file.size, e.target.result);
+ // if (file.size > 10*1024*1024) return;
+ cb(file.name, file.type, file.size, e.target.result);
};
reader.readAsDataURL(file);
} else {
@@ -20,7 +20,7 @@ function file_to_content(file, cb) {
http.open('POST', '/upload');
http.send(form);
}
-};
+}
##register hook_file_drop : string, (-> void), (string, string, int, string -> void) -> void
##args(sel, waiting_cb, cb)
@@ -29,13 +29,13 @@ function file_to_content(file, cb) {
e.stopPropagation();
e.preventDefault();
if (!$(e.target).hasClass("dropzone") &&
- !$(e.target).parent().hasClass("dropzone")) return;
+ !$(e.target).parent().hasClass("dropzone")) return;
waiting_cb();
var oe = e.originalEvent;
$(oe.dataTransfer.files).each(
- function(key, file) {
- file_to_content(file, cb);
- }
+ function(key, file) {
+ file_to_content(file, cb);
+ }
);
}).on("dragenter, dragexit, dragover", noop_handler);
}
View
@@ -182,7 +182,7 @@ function file_uploaded(user)(name, mimetype, key) {
Network.broadcast({~media}, room)
}
-function client_observe(msg) {
+function observe_client(msg) {
match (msg) {
case {~message} :
message_update(compute_stats(), [message])
@@ -219,7 +219,7 @@ function client_observe(msg) {
// Init the client from the server
function init_client(user, client_channel, _) {
// Observe client
- obs = Network.observe(client_observe, room)
+ obs = Network.observe(observe_client, room)
Network.broadcast({connection:(user, client_channel)}, room)
// Observe disconnection
Dom.bind_beforeunload_confirmation(function(_) {
@@ -345,6 +345,6 @@ url_parser = parser {
// Start the server
Server.start(Server.http, [
{ resources : @static_resource_directory("resources") }, // include resources directory
- { register : { css:["/resources/css/style.css"] } }, // include CSS in headers
+ { register : {css:["/resources/css/style.css"]} }, // include CSS in headers
{ custom : url_parser } // URL parser
])
View
@@ -1,4 +1,5 @@
import stdlib.crypto
+import stdlib.database.db3
import file
/** Sharing module **/

0 comments on commit 003186c

Please sign in to comment.