Permalink
Browse files

JavaScript: Update binaries.

  • Loading branch information...
1 parent 972b9ee commit 06436f0aad0a693f1276a73353723755dbad081c @jayarjo jayarjo committed Apr 5, 2013
Showing with 46 additions and 44 deletions.
  1. +3 −5 bin/js/moxie.dev.js
  2. +40 −36 bin/js/moxie.js
  3. +3 −3 bin/js/moxie.min.js
View
@@ -17,7 +17,7 @@
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
/*globals $code */
-(function(exports) {
+(function(exports, undefined) {
"use strict";
var html = "", baseDir;
@@ -118,6 +118,8 @@
exports.define = define;
exports.require = require;
+ expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/file/FileReaderSync","moxie/runtime/Transporter","moxie/core/JSON","moxie/image/Image","moxie/core/utils/Events"]);
+
load('../../src/javascript/core/utils/Basic.js');
load('../../src/javascript/core/I18n.js');
load('../../src/javascript/core/utils/Mime.js');
@@ -179,12 +181,8 @@
load('../../src/javascript/runtime/html4/xhr/XMLHttpRequest.js');
load('../../src/javascript/runtime/html4/image/Image.js');
- expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/file/FileReaderSync","moxie/runtime/Transporter","moxie/core/JSON","moxie/image/Image","moxie/core/utils/Events"]);
-
-
writeScripts();
})(this);
-
(function() {
var baseDir = '';
var scripts = document.getElementsByTagName('script');
View
@@ -55,10 +55,6 @@
});
}
- function defined(id) {
- return !!modules[id];
- }
-
function resolve(id) {
var target = exports;
var fragments = id.split(/[.\/]/);
@@ -2889,11 +2885,10 @@ define('moxie/file/FileReader', [
var dispatches = ['loadstart', 'progress', 'load', 'abort', 'error', 'loadend'];
function FileReader() {
- var self = this, _runtime;
- RuntimeClient.call(self);
+ RuntimeClient.call(this);
- Basic.extend(self, {
+ Basic.extend(this, {
uid: Basic.guid('uid_'),
/**
@@ -2951,57 +2946,69 @@ define('moxie/file/FileReader', [
@method abort
*/
abort: function() {
- if (!_runtime) {
- return;
- }
-
this.result = null;
if (!!~Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE])) {
return;
} else if (this.readyState === FileReader.LOADING) {
this.readyState = FileReader.DONE;
}
+
+ var runtime = this.getRuntime();
+ if (runtime) {
+ runtime.exec.call(this, 'FileReader', 'abort');
+ }
- self.bind('Abort', function() {
- self.trigger('loadend');
+ this.bind('Abort', function() {
+ this.trigger('loadend');
});
+ },
+
+ /**
+ Destroy component and release resources.
- _runtime.exec('FileReader', 'abort');
+ @method destroy
+ */
+ destroy: function() {
+ this.abort();
+
+ var runtime = this.getRuntime();
+ if (runtime) {
+ runtime.exec.call(this, 'FileReader', 'destroy');
+ this.disconnectRuntime();
+ }
}
});
function _read(op, blob) {
- self.readyState = FileReader.EMPTY;
- self.error = null;
+ this.readyState = FileReader.EMPTY;
+ this.error = null;
- if (self.readyState === FileReader.LOADING || !blob.ruid || !blob.uid) {
+ if (this.readyState === FileReader.LOADING || !blob.ruid || !blob.uid) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
this.convertEventPropsToHandlers(dispatches);
- _runtime = self.connectRuntime(blob.ruid);
-
- self.bind('Error', function(e, error) {
- self.readyState = FileReader.DONE;
- self.result = null;
- self.error = error;
- self.trigger('loadend');
+ this.bind('Error', function(e, error) {
+ this.readyState = FileReader.DONE;
+ this.result = null;
+ this.error = error;
+ this.trigger('loadend');
}, 999);
- self.bind('LoadStart', function() {
- self.readyState = FileReader.LOADING;
+ this.bind('LoadStart', function() {
+ this.readyState = FileReader.LOADING;
}, 999);
- self.bind('Load', function() {
- self.readyState = FileReader.DONE;
- self.trigger('loadend');
+ this.bind('Load', function() {
+ this.readyState = FileReader.DONE;
+ this.trigger('loadend');
}, 999);
- _runtime.exec.call(self, 'FileReader', 'read', op, blob);
+ this.connectRuntime(blob.ruid).exec.call(this, 'FileReader', 'read', op, blob);
}
}
@@ -6237,32 +6244,30 @@ define("moxie/runtime/html5/file/FileReader", [
], function(extensions, Basic) {
function FileReader() {
+
this.read = function(op, blob) {
var target = this, fr = new window.FileReader();
(function() {
- var events = ['loadstart', 'progress', 'load', 'abort', 'error', 'loadend'];
+ var events = ['loadstart', 'progress', 'load', 'abort', 'error'];
function reDispatch(e) {
if (!!~Basic.inArray(e.type, ['progress', 'load'])) {
target.result = fr.result;
}
-
target.trigger(e);
}
function removeEventListeners() {
Basic.each(events, function(name) {
fr.removeEventListener(name, reDispatch);
});
-
fr.removeEventListener('loadend', removeEventListeners);
}
Basic.each(events, function(name) {
fr.addEventListener(name, reDispatch);
});
-
fr.addEventListener('loadend', removeEventListeners);
}());
@@ -9978,8 +9983,7 @@ define("moxie/runtime/html4/image/Image", [
});
expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/file/FileReaderSync","moxie/runtime/Transporter","moxie/core/JSON","moxie/image/Image","moxie/core/utils/Events"]);
-})(this);
-/**
+})(this);/**
* o.js
*
* Copyright 2013, Moxiecode Systems AB
Oops, something went wrong.

0 comments on commit 06436f0

Please sign in to comment.