var args arguments var APP require core var rm require resourceManager

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var args = arguments[0] || {};
var APP = require("core");
var rm = require("resourceManager");
var webview = null;
$.init = function() {
$.Wrapper.height = APP.Device.height - 67 - 40;
$.drawAbout();
Ti.App.addEventListener('app:webViewLoadedAction', function() {
var file = Ti.Filesystem.getFile(rm.parseAssetUrl('asset:about_logo.png', true));
var image = file.nativePath;
var gillsansFile = Ti.Filesystem.getFile(rm.parseAssetUrl('asset:GillSans.otf'));
var gillsansUrl = gillsansFile.nativePath;
var gillsansLightFile = Ti.Filesystem.getFile(rm.parseAssetUrl('asset:GillSans-Light.otf'));
var gillsansLightUrl = gillsansLightFile.nativePath;
Ti.App.fireEvent('app:setScaleAction', {
isHD: OS_IOS ? false : true,//Ti.Platform.displayCaps.platformWidth > 1000 ? true : false,
img: image,
gillsansUrl: gillsansUrl,
gillsansLightUrl: gillsansLightUrl
});
setTimeout(function() {webview.visible = true;}, 100);
});
$.Wrapper.addEventListener('innerReopen', function () {
if (webview) {
$.aboutTextWrapper.remove(webview);
webview = null;
$.drawAbout();
}
});
};
$.drawAbout = function() {
if (!Alloy.Globals.actions) return;
var actualAboutImageURL = rm.parseAssetUrl(Alloy.Globals['actions'].current.bannerDesc);
//$.aboutLogo.image = actualAboutImageURL;
if(Alloy.Globals['actions'].current.hasOwnProperty("descriptionFile")) {
var url = rm.parseAssetUrl(Alloy.Globals['actions'].current.descriptionFile);
Ti.API.info("! drawAbout ", url);
var data_file = Titanium.Filesystem.getFile(url || 'notExist.json');
if(data_file.exists()){
var preHtml = data_file.read().text;
var html = rm.normalizeAssetLinksInText(preHtml);
} else {
var html = '<html><head><meta name="viewport" content="user-scalable=0"></head><body> </body></html>';
Ti.API.warn("About_vkusomania html missing");
}
} else {
var html = '<html><head><meta name="viewport" content="user-scalable=0"></head><body> </body></html>';
}
webview = Ti.UI.createWebView({
html: html,
height: Ti.UI.FILL,//'370dp',
width: OS_IOS ? APP.Device.width - 20 : Ti.UI.FILL,
willHandleTouches: false,
globalSwipe: false,
enableZoomControls: false,
visible: false
});
$.aboutTextWrapper.add(webview);
};
$.init();