Skip to content

Commit

Permalink
Update binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayarjo committed Feb 17, 2013
1 parent bcf7147 commit b346454
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 54 deletions.
Binary file modified bin/flash/Moxie.min.swf
Binary file not shown.
Binary file modified bin/flash/Moxie.swf
Binary file not shown.
35 changes: 28 additions & 7 deletions bin/js/moxie.dev.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.0a
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2012-11-13
*/
/**
* Inline development version. Only to be used while developing since it uses document.write to load scripts.
*/

/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
/*globals $code */

(function(exports, undefined) {
(function(exports) {
"use strict";

var html = "", baseDir;
Expand Down Expand Up @@ -106,8 +118,6 @@
exports.define = define;
exports.require = require;

expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/core/utils/Env","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');
Expand Down Expand Up @@ -162,10 +172,21 @@
load('../../src/javascript/runtime/html4/file/FileInput.js');
load('../../src/javascript/runtime/html4/xhr/XMLHttpRequest.js');
load('../../src/javascript/runtime/html4/image/Image.js');
load('../../src/javascript/o.js');

expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/core/utils/Env","moxie/xhr/XMLHttpRequest","moxie/file/FileReaderSync","moxie/runtime/Transporter","moxie/core/JSON","moxie/image/Image","moxie/core/utils/Events"]);


writeScripts();
})(this);

exports.modules = modules;
exports.exposedModules = exposedModules;
})(this);
(function() {
var baseDir = '';
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
var src = scripts[i].src;
if (src.indexOf('/moxie.dev.js') != -1) {
baseDir = src.substring(0, src.lastIndexOf('/'));
}
}
document.write('<script type="text/javascript" src="' + baseDir + '/../../src/javascript/o.js"></script>');
})();
99 changes: 55 additions & 44 deletions bin/js/moxie.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.0a
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2012-11-13
*/
/**
* Compiled inline version. (Library mode)
*/
Expand All @@ -8,7 +20,7 @@
(function(exports, undefined) {
"use strict";

var modules = {}, exposedModules = [];
var modules = {};

function require(ids, callback) {
var module, defs = [];
Expand Down Expand Up @@ -62,26 +74,25 @@
return target;
}

function register(id) {
var target = exports;
var fragments = id.split(/[.\/]/);
function expose(ids) {
for (var i = 0; i < ids.length; i++) {
var target = exports;
var id = ids[i];
var fragments = id.split(/[.\/]/);

for (var fi = 0; fi < fragments.length - 1; ++fi) {
if (target[fragments[fi]] === undefined) {
target[fragments[fi]] = {};
for (var fi = 0; fi < fragments.length - 1; ++fi) {
if (target[fragments[fi]] === undefined) {
target[fragments[fi]] = {};
}

target = target[fragments[fi]];
}

target = target[fragments[fi]];
target[fragments[fragments.length - 1]] = modules[id];
}

target[fragments[fragments.length - 1]] = modules[id];
}

function expose(ids) {
exposedModules = ids;
}

expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/core/utils/Env","moxie/xhr/XMLHttpRequest","moxie/file/FileReaderSync","moxie/runtime/Transporter","moxie/core/JSON","moxie/image/Image","moxie/core/utils/Events"]);// Included from: /Users/jagga/Sites/mxi/plupload/www/plupload/src/moxie/src/javascript/core/utils/Basic.js
// Included from: /Users/jagga/Sites/mxi/plupload/www/plupload/src/moxie/src/javascript/core/utils/Basic.js

/**
* Basic.js
Expand Down Expand Up @@ -7300,20 +7311,21 @@ define("moxie/runtime/html5/image/Image", [
}

function _resize(width, height, crop) {
var ctx, scale, mathFn, imgWidth, imgHeight;
var ctx, scale, mathFn, x, y, imgWidth, imgHeight;

// unify dimensions
mathFn = !crop ? Math.min : Math.max;
scale = mathFn(width/this.width, height/this.height);
imgWidth = Math.round(this.width * scale);
imgHeight = Math.round(this.height * scale);


// we only downsize here
if (scale > 1) {
if (scale > 1 && !crop) { // when cropping one of dimensions may still exceed max, so process it anyway
this.trigger('Resize');
return;
}

imgWidth = Math.round(this.width * scale);
imgHeight = Math.round(this.height * scale);

// prepare canvas if necessary
if (!_canvas) {
_canvas = document.createElement("canvas");
Expand All @@ -7330,10 +7342,15 @@ define("moxie/runtime/html5/image/Image", [
_canvas.height = imgHeight;
}

ctx.clearRect (0, 0 , _canvas.width, _canvas.height);
ctx.drawImage(_img, 0, 0, imgWidth, imgHeight);
// if dimensions of the resulting image still larger than canvas, center it
x = imgWidth > _canvas.width ? Math.round((imgWidth - _canvas.width) / 2) : 0;
y = imgHeight > _canvas.height ? Math.round((imgHeight - _canvas.height) / 2) : 0;

ctx.clearRect (0, 0 , _canvas.width, _canvas.height);
ctx.drawImage(_img, -x, -y, imgWidth, imgHeight);

_modified = true;

this.trigger('Resize', {
width: crop ? width : imgWidth,
height: crop ? height : imgHeight
Expand Down Expand Up @@ -8961,8 +8978,8 @@ define("moxie/runtime/html4/image/Image", [
return (extensions.Image = Image);
});

// Included from: /Users/jagga/Sites/mxi/plupload/www/plupload/src/moxie/src/javascript/o.js

expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/core/utils/Env","moxie/xhr/XMLHttpRequest","moxie/file/FileReaderSync","moxie/runtime/Transporter","moxie/core/JSON","moxie/image/Image","moxie/core/utils/Events"]);
})(this);
/**
* o.js
*
Expand All @@ -8974,7 +8991,7 @@ define("moxie/runtime/html4/image/Image", [
*/

/*jshint smarttabs:true, undef:true, unused:true, latedef:true, curly:true, bitwise:true, scripturl:true, browser:true */
/*global define:true, exposedModules:true, modules:true */
/*global window:true */

/**
Globally exposed namespace with the most frequently used public classes and handy methods.
Expand All @@ -8983,35 +9000,29 @@ Globally exposed namespace with the most frequently used public classes and hand
@static
@private
*/
define('o', [
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/I18n"
], function(Basic, Dom, I18n) {

(function() {
var o = {};

// directly add some public classes
// (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included)
Basic.each(exposedModules, function(id) {
var className = id.replace(/^[\s\S]+?\/([^\/]+)$/, '$1');
if (modules[id]) {
o[className] = modules[id];
(function addAlias(ns) {
for (name in ns) {
var itemType = typeof(ns[name]);
if (itemType === 'object') {
addAlias(ns[name]);
} else if (itemType === 'function') {
o[name] = ns[name];
}
}
});
})(window.moxie);

// add basic handy methods
Basic.extend(o, Basic, Dom, I18n);
// add Env manually
o.Env = window.moxie.core.utils.Env;

// expose globally
window.mOxie = o;
if (!window.o) {
window.o = o;
}
return o;
});

for (var i = 0; i < exposedModules.length; i++) {
register(exposedModules[i]);
}
})(this);
})();
18 changes: 15 additions & 3 deletions bin/js/moxie.min.js

Large diffs are not rendered by default.

Binary file modified bin/silverlight/Moxie.min.xap
Binary file not shown.
Binary file modified bin/silverlight/Moxie.xap
Binary file not shown.

0 comments on commit b346454

Please sign in to comment.