Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private page: Page,
private util: Util,
private fonticon: TNSFontIconService,
private modalService: ModalDialogService,
private vcRef: ViewContainerRef,
private translate: TranslateService,
private cache: GalleryCache
) {
appversion.getVersionName().then((v: string)=> {
this.version = "Version " + v;
});
this.language = Platform.device.language;
this.translate.setDefaultLang("en");
this.translate.use(Platform.device.language.split("-")[0]).subscribe(()=> {
this.host = Settings.getString("host");
this.username = Settings.getString("username");
this.password = Settings.getString("password");
this.rootdir = Settings.getString("rootdir");
this.rootdir = (this.rootdir==null)? "":this.rootdir;
this.headers = {
"OCS-APIREQUEST": "true",
"Authorization": "Basic "+Base64.encode(this.username+':'+this.password)
}
this.cache.images = new Array();
this.home();
});
}
function ImageModalComponent(params, page, translate, fonticon, util) {
this.params = params;
this.page = page;
this.translate = translate;
this.fonticon = fonticon;
this.util = util;
this.language = Platform.device.language;
this.translate.setDefaultLang("en");
this.translate.use(Platform.device.language.split("-")[0]);
this.host = Settings.getString("host");
this.username = Settings.getString("username");
this.password = Settings.getString("password");
this.rootdir = Settings.getString("rootdir");
this.rootdir = (this.rootdir == null) ? "" : this.rootdir;
this.headers = {
"OCS-APIREQUEST": "true",
"Authorization": "Basic " + Base64.encode(this.username + ':' + this.password)
};
this.item = params.context.item;
this.loader = params.context.loader;
}
ImageModalComponent.prototype.ngOnInit = function () {
}
}
instanceModule = require(moduleId);
var instanceType = instanceModule[elementName] || Object;
instance = new instanceType();
}
catch (ex) {
throw new Error("Cannot create module " + moduleId + ". " + ex + ". StackTrace: " + ex.stack);
}
if (instance && instanceModule) {
var bindings = new Array();
for (var attr in attributes) {
var attrValue = attributes[attr];
if (attr.indexOf(":") !== -1) {
var platformName = attr.split(":")[0].trim();
if (platformName.toLowerCase() === platform.device.os.toLowerCase()) {
attr = attr.split(":")[1].trim();
}
else {
continue;
}
}
if (attr.indexOf(".") !== -1) {
var subObj = instance;
var properties = attr.split(".");
var subPropName = properties[properties.length - 1];
var i;
for (i = 0; i < properties.length - 1; i++) {
if (types.isDefined(subObj)) {
subObj = subObj[properties[i]];
}
}
function resolveFilePath(path, ext) {
if (!fileNameResolver) {
fileNameResolver = new fileResolverModule.FileNameResolver({
width: platform.screen.mainScreen.widthDIPs,
height: platform.screen.mainScreen.heightDIPs,
os: platform.device.os,
deviceType: platform.device.deviceType
});
}
return fileNameResolver.resolveFileName(path, ext);
}
function pageFromBuilder(moduleNamePath, moduleExports) {
var platform = require("platform");
var layout_base_1 = require("ui/layouts/layout-base");
var enums_1 = require("ui/enums");
var proxy_1 = require("ui/core/proxy");
var dependency_observable_1 = require("ui/core/dependency-observable");
var AffectsLayout = platform.device.os === platform.platformNames.android ? dependency_observable_1.PropertyMetadataSettings.None : dependency_observable_1.PropertyMetadataSettings.AffectsLayout;
function validateOrientation(value) {
return value === enums_1.Orientation.vertical || value === enums_1.Orientation.horizontal;
}
var StackLayout = (function (_super) {
__extends(StackLayout, _super);
function StackLayout() {
_super.apply(this, arguments);
}
Object.defineProperty(StackLayout.prototype, "orientation", {
get: function () {
return this._getValue(StackLayout.orientationProperty);
},
set: function (value) {
this._setValue(StackLayout.orientationProperty, value);
},
enumerable: true,
if (platform.device.os === platform.platformNames.android) {
var backgroundDrawable = nativeView.getBackground(),
LINEAR_GRADIENT = 0;
colors.forEach(function (c:Color) {
_colors.push(c.android);
});
if (!(backgroundDrawable instanceof android.graphics.drawable.GradientDrawable)) {
backgroundDrawable = new android.graphics.drawable.GradientDrawable();
backgroundDrawable.setColors(_colors);
backgroundDrawable.setGradientType(LINEAR_GRADIENT);
nativeView.setBackgroundDrawable(backgroundDrawable);
}
} else if (platform.device.os === platform.platformNames.ios) {
var iosView:UIView = view.ios;
var colorsArray = NSMutableArray.alloc().initWithCapacity(2);
colors.forEach(function (c:Color) {
colorsArray.addObject(interop.types.id(c.ios.CGColor));
});
var gradientLayer = CAGradientLayer.layer();
gradientLayer.colors = colorsArray;
gradientLayer.frame = iosView.bounds;
iosView.layer.insertSublayerAtIndex(gradientLayer, 0);
}
}