Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use external compiler package #952

Open
wants to merge 20 commits into
base: next
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: mobile web is dead
  • Loading branch information
janvennemann committed Nov 29, 2019
commit 145d3a722fe85a21a25c653efa9326e70b36915a
5 changes: 1 addition & 4 deletions Alloy/builtins/string.js
Original file line number Diff line number Diff line change
@@ -64,10 +64,7 @@ exports.lcfirst = function (text) {
* @param {String} amount Amount to format.
* @return {String} Amount formatted as a currency value.
*/
exports.formatCurrency = !(OS_MOBILEWEB) ? String.formatCurrency : function (amount) {
var num = isNaN(amount) || amount === '' || amount === null ? 0.00 : amount;
return '$' + parseFloat(num).toFixed(2);
};
exports.formatCurrency = String.formatCurrency;


/**
17 changes: 0 additions & 17 deletions Alloy/template/lib/alloy.js
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@ exports._ = _;
exports.Backbone = Backbone;

var DEFAULT_WIDGET = 'widget';
var TI_VERSION = Ti.version;
var MW320_CHECK = OS_MOBILEWEB && TI_VERSION >= '3.2.0';
var IDENTITY_TRANSFORM = OS_ANDROID ? (Ti.version >= '8.0.0' ? Ti.UI.createMatrix2D() : Ti.UI.create2DMatrix()) : undefined;
var RESET = {
bottom: null,
@@ -319,8 +317,6 @@ exports.createStyle = function(controller, opts, defaults) {
styleFinal[CONST.CLASS_PROPERTY] = classes;
styleFinal[CONST.APINAME_PROPERTY] = apiName;

if (MW320_CHECK) { delete styleFinal[CONST.APINAME_PROPERTY]; }

return defaults ? _.defaults(styleFinal, defaults) : styleFinal;
};

@@ -338,7 +334,6 @@ exports.addClass = function(controller, proxy, classes, opts) {
// make sure we actually have classes to add
if (!classes) {
if (opts) {
if (MW320_CHECK) { delete opts.apiName; }
proxy.applyProperties(opts);
}
return;
@@ -352,7 +347,6 @@ exports.addClass = function(controller, proxy, classes, opts) {
// make sure we actually added classes before processing styles
if (beforeLen === newClasses.length) {
if (opts) {
if (MW320_CHECK) { delete opts.apiName; }
proxy.applyProperties(opts);
}
return;
@@ -370,7 +364,6 @@ exports.removeClass = function(controller, proxy, classes, opts) {
// make sure there's classes to remove before processing
if (!beforeLen || !classes.length) {
if (opts) {
if (MW320_CHECK) { delete opts.apiName; }
proxy.applyProperties(opts);
}
return;
@@ -382,7 +375,6 @@ exports.removeClass = function(controller, proxy, classes, opts) {
// make sure there was actually a difference before processing
if (beforeLen === newClasses.length) {
if (opts) {
if (MW320_CHECK) { delete opts.apiName; }
proxy.applyProperties(opts);
}
return;
@@ -478,15 +470,6 @@ exports.isTablet = (function() {
var psc = Ti.Platform.Android.physicalSizeCategory;
return psc === Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_LARGE ||
psc === Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_XLARGE;
} else if (OS_MOBILEWEB) {
return Math.min(
Ti.Platform.displayCaps.platformHeight,
Ti.Platform.displayCaps.platformWidth
) >= 400;
// } else if (OS_BLACKBERRY) {
// // Tablets not currently supported by BB TiSDK
// // https://jira.appcelerator.org/browse/TIMOB-13225
// return false;
} else if (OS_WINDOWS) {
// per http://www.extremetech.com/computing/139768-windows-8-smartphones-and-windows-phone-8-tablets
// tablets should be >= 1024x768 and phones could be lower, though current phones are running at