Free javascript Hosting


mraid-modified.js

Uploaded on Dec 16 2021 13:15 by vettriv.06

var imIsObjValid = function(a) {
return "undefined" != typeof a && null != a ? !0 : !1
}
, EventListeners = function(a) {
this.event = a;
this.count = 0;
var b = [];
this.add = function(a) {
b.push(a);
++this.count
}
;
this.remove = function(a) {
var e = !1
, d = this;
b = b.filter(function(b) {
if (b = b === a)
--d.count,
e = !0;
return !b
});
return e
}
;
this.removeAll = function() {
b = [];
this.count = 0
}
;
this.broadcast = function(a) {
b.forEach(function(e) {
try {
e.apply({}, a)
} catch (d) {}
})
}
;
this.toString = function() {
var c = [a, ":"];
b.forEach(function(a) {
c.push("|", String(a), "|")
});
return c.join("")
}
}
, InmobiObj = function() {
this.listeners = [];
this.addEventListener = function(a, b) {
try {
if (imIsObjValid(b) && imIsObjValid(a)) {
var c = this.listeners;
c[a] || (c[a] = new EventListeners);
c[a].add(b);
"micIntensityChange" == a && window.imraidview.startListeningMicIntensity();
"deviceMuted" == a && window.imraidview.startListeningDeviceMuteEvents();
"deviceVolumeChange" == a && window.imraidview.startListeningDeviceVolumeChange();
"volumeChange" == a && window.imraidview.startListeningVolumeChange();
"headphones" == a && window.imraidview.startListeningHeadphonePluggedEvents();
"backButtonPressed" == a && window.imraidview.startListeningForBackButtonPressedEvent();
"downloadStatusChanged" == a && window.imraidview.registerDownloaderCallbacks()
}
} catch (e) {
this.log(e)
}
}
;
this.removeEventListener = function(a, b) {
if (imIsObjValid(a)) {
var c = this.listeners;
imIsObjValid(c[a]) && (imIsObjValid(b) ? c[a].remove(b) : c[a].removeAll());
"micIntensityChange" == a && 0 == c[a].count && window.imraidview.stopListeningMicIntensity();
"deviceMuted" == a && 0 == c[a].count && window.imraidview.stopListeningDeviceMuteEvents();
"deviceVolumeChange" == a && 0 == c[a].count && window.imraidview.stopListeningDeviceVolumeChange();
"volumeChange" == a && 0 == c[a].count && window.imraidview.stopListeningVolumeChange();
"headphones" == a && 0 == c[a].count && window.imraidview.stopListeningHeadphonePluggedEvents();
"backButtonPressed" == a && 0 == c[a].count && window.imraidview.stopListeningForBackButtonPressedEvent();
"downloadStatusChanged" == a && 0 == c[a].count && window.imraidview.unregisterDownloaderCallbacks()
}
}
;
this.broadcastEvent = function(a) {
if (imIsObjValid(a)) {
console.log("Obj valid")
for (var b = Array(arguments.length), c = 0; c < arguments.length; c++)
b[c] = arguments[c];
c = b.shift();
try {
console.log("Inside Try")
this.listeners[c] && this.listeners[c].broadcast(b)
} catch (e) {
console.log("Exception ${e.message}")
}
}
}
;
this.sendSaveContentResult = function(a) {
if (imIsObjValid(a)) {
for (var b = Array(arguments.length), c = 0; c < arguments.length; c++)
if (2 == c) {
var e = arguments[c]
, e = JSON.parse(e);
b[c] = e
} else
b[c] = arguments[c];
e = b[1];
"success" != e && (c = b[0].substring(b[0].indexOf("_") + 1),
imraid.saveContentIDMap[c] && delete imraid.saveContentIDMap[c]);
window.imraid.broadcastEvent(b[0], b[1], b[2])
}
}
}
, __im__iosNativeMessageHandler = void 0;
window.webkit && (window.webkit.messageHandlers && window.webkit.messageHandlers.nativeMessageHandler) && (__im__iosNativeMessageHandler = window.webkit.messageHandlers.nativeMessageHandler);
var __im__iosNativeCall = {
nativeCallInFlight: !1,
nativeCallQueue: [],
executeNativeCall: function(a) {
this.nativeCallInFlight ? this.nativeCallQueue.push(a) : (this.nativeCallInFlight = !0,
imIsObjValid(__im__iosNativeMessageHandler) ? __im__iosNativeMessageHandler.postMessage(a) : window.location = a)
},
nativeCallComplete: function(a) {
0 == this.nativeCallQueue.length ? this.nativeCallInFlight = !1 : (a = this.nativeCallQueue.shift(),
imIsObjValid(__im__iosNativeMessageHandler) ? __im__iosNativeMessageHandler.postMessage(a) : window.location = a)
}
}
, IOSNativeCall = function() {
this.urlScheme = "";
this.executeNativeCall = function(a) {
if (imIsObjValid(__im__iosNativeMessageHandler)) {
e = {};
e.command = a;
e.scheme = this.urlScheme;
for (var b = {}, c = 1; c < arguments.length; c += 2)
d = arguments[c + 1],
null != d && (b[arguments[c]] = "" + d);
e.params = b
} else
for (var e = this.urlScheme + "://" + a, d, b = !0, c = 1; c < arguments.length; c += 2)
d = arguments[c + 1],
null != d && (b ? (e += "?",
b = !1) : e += "&",
e += arguments[c] + "=" + escape(d));
__im__iosNativeCall.executeNativeCall(e);
return "OK"
}
;
this.nativeCallComplete = function(a) {
__im__iosNativeCall.nativeCallComplete(a);
return "OK"
}
;
this.updateKV = function(a, b) {
this[a] = b;
var c = this.broadcastMap[a];
c && this.broadcastEvent(c, b)
}
};
(function() {
var a = window.mraidview = {};
a.orientationProperties = {
allowOrientationChange: !0,
forceOrientation: "none",
direction: "right"
};
var b = []
, c = !1;
a.detectAndBlockFraud = function(e) {
a.isPossibleFraud() && a.fireRedirectFraudBeacon(e);
return !1
}
;
a.popupBlocked = function(e) {
a.firePopupBlockedBeacon(e)
}
;
a.zeroPad = function(a) {
var d = "";
10 > a && (d += "0");
return d + a
}
;
a.supports = function(a) {
console.log("bridge: supports (MRAID)");
if ("string" != typeof a)
window.mraid.broadcastEvent("error", "Supports method expects string parameter", "supports");
else
return "false" != sdkController.supports("window.mraidview", a)
}
;
a.useCustomClose = function(a) {
try {
sdkController.useCustomClose("window.mraidview", a)
} catch (d) {
imraidview.showAlert("use CustomClose: " + d)
}
}
;
a.close = function() {
try {
sdkController.close("window.mraidview")
} catch (a) {
imraidview.showAlert("close: " + a)
}
}
;
a.stackCommands = function(a, d) {
c ? b.push(a) : (eval(a),
d && (c = !0))
}
;
a.expand = function(a) {
try {
"undefined" == typeof a && (a = null),
sdkController.expand("window.mraidview", a)
} catch (d) {
imraidview.showAlert("executeNativeExpand: " + d + ", URL = " + a)
}
}
;
a.setExpandProperties = function(b) {
try {
b ? this.props = b : b = null;
if ("undefined" != typeof b.lockOrientation && null != b.lockOrientation && "undefined" != typeof b.orientation && null != b.orientation) {
var d = {};
d.allowOrientationChange = !b.lockOrientation;
d.forceOrientation = b.orientation;
a.setOrientationProperties(d)
}
sdkController.setExpandProperties("window.mraidview", a.stringify(b))
} catch (c) {
imraidview.showAlert("executeNativesetExpandProperties: " + c + ", props = " + b)
}
}
;
a.getExpandProperties = function() {
try {
return eval("(" + sdkController.getExpandProperties("window.mraidview") + ")")
} catch (a) {
imraidview.showAlert("getExpandProperties: " + a)
}
}
;
a.setOrientationProperties = function(b) {
try {
b ? ("undefined" != typeof b.allowOrientationChange && (a.orientationProperties.allowOrientationChange = b.allowOrientationChange),
"undefined" != typeof b.forceOrientation && (a.orientationProperties.forceOrientation = b.forceOrientation)) : b = null,
sdkController.setOrientationProperties("window.mraidview", a.stringify(a.orientationProperties))
} catch (d) {
imraidview.showAlert("setOrientationProperties: " + d + ", props = " + b)
}
}
;
a.getOrientationProperties = function() {
return {
forceOrientation: a.orientationProperties.forceOrientation,
allowOrientationChange: a.orientationProperties.allowOrientationChange
}
}
;
a.resizeProps = null;
a.setResizeProperties = function(b) {
var d, c;
try {
d = parseInt(b.width);
c = parseInt(b.height);
if (isNaN(d) || isNaN(c) || 1 > d || 1 > c)
throw "Invalid";
b.width = d;
b.height = c;
a.resizeProps = b;
sdkController.setResizeProperties("window.mraidview", a.stringify(b))
} catch (h) {
window.mraid.broadcastEvent("error", "Invalid properties.", "setResizeProperties")
}
}
;
a.getResizeProperties = function() {
try {
return eval("(" + sdkController.getResizeProperties("window.mraidview") + ")")
} catch (a) {
imraidview.showAlert("getResizeProperties: " + a)
}
}
;
a.open = function(a) {
"undefined" == typeof a && (a = null);
try {
sdkController.open("window.mraidview", a)
} catch (d) {
imraidview.showAlert("open: " + d)
}
}
;
a.getScreenSize = function() {
try {
return eval("(" + sdkController.getScreenSize("window.mraidview") + ")")
} catch (a) {
imraidview.showAlert("getScreenSize: " + a)
}
}
;
a.getMaxSize = function() {
try {
return eval("(" + sdkController.getMaxSize("window.mraidview") + ")")
} catch (a) {
imraidview.showAlert("getMaxSize: " + a)
}
}
;
a.getCurrentPosition = function() {
try {
return eval("(" + sdkController.getCurrentPosition("window.mraidview") + ")")
} catch (a) {
imraidview.showAlert("getCurrentPosition: " + a)
}
}
;
a.getDefaultPosition = function() {
try {
return eval("(" + sdkController.getDefaultPosition("window.mraidview") + ")")
} catch (a) {
imraidview.showAlert("getDefaultPosition: " + a)
}
}
;
a.getState = function() {
try {
return String(sdkController.getState("window.mraidview"))
} catch (a) {
imraidview.showAlert("getState: " + a)
}
}
;
a.isViewable = function() {
try {
return sdkController.isViewable("window.mraidview")
} catch (a) {
imraidview.showAlert("isViewable: " + a)
}
}
;
a.getPlacementType = function() {
return sdkController.getPlacementType("window.mraidview")
}
;
a.close = function() {
try {
sdkController.close("window.mraidview")
} catch (a) {
imraidview.showAlert("close: " + a)
}
}
;
"function" != typeof String.prototype.startsWith && (String.prototype.startsWith = function(a) {
return 0 == this.indexOf(a)
}
);
a.playVideo = function(a) {
var d = "";
null != a && (d = a);
try {
sdkController.playVideo("window.mraidview", d)
} catch (b) {
imraidview.showAlert("playVideo: " + b)
}
}
;
a.stringify = function(b) {
if ("undefined" === typeof JSON) {
var d = "", c;
if ("undefined" == typeof b.length)
return a.stringifyArg(b);
for (c = 0; c < b.length; c++)
0 < c && (d += ","),
d += a.stringifyArg(b[c]);
return d + "]"
}
return JSON.stringify(b)
}
;
a.stringifyArg = function(a) {
var d, b, c;
b = typeof a;
d = "";
if ("number" === b || "boolean" === b)
d += args;
else if (a instanceof Array)
d = d + "[" + a + "]";
else if (a instanceof Object) {
b = !0;
d += "{";
for (c in a)
null !== a[c] && (b || (d += ","),
d = d + '"' + c + '":',
b = typeof a[c],
d = "number" === b || "boolean" === b ? d + a[c] : "function" === typeof a[c] ? d + '""' : a[c]instanceof Object ? d + this.stringify(args[i][c]) : d + '"' + a[c] + '"',
b = !1);
d += "}"
} else
a = a.replace(/\\/g, "\\\\"),
a = a.replace(/"/g, '\\"'),
d = d + '"' + a + '"';
imraidview.showAlert("json:" + d);
return d
}
;
getPID = function(a) {
var b = "";
null != a && ("undefined" != typeof a.id && null != a.id) && (b = a.id);
return b
}
;
a.resize = function() {
if (null == a.resizeProps)
window.mraid.broadcastEvent("error", "Valid resize dimensions must be provided before calling resize", "resize");
else
try {
sdkController.resize("window.mraidview")
} catch (b) {
imraidview.showAlert("resize called in bridge")
}
}
;
a.storePicture = function(b) {
console.log("bridge: storePicture");
if ("string" != typeof b)
window.mraid.broadcastEvent("error", "storePicture method expects url as string parameter", "storePicture");
else {
if (a.supports("storePicture"))
return !window.confirm("Do you want to download the file?") ? (window.mraid.broadcastEvent("error", "Store picture on " + b + " was cancelled by user.", "storePicture"),
!1) : sdkController.storePicture("window.mraidview", b);
window.mraid.broadcastEvent("error", "Store picture on " + b + " was cancelled because it is unsupported in this device/app.", "storePicture")
}
}
;
a.fireMediaTrackingEvent = function(a, b) {}
;
a.fireMediaErrorEvent = function(a, b) {}
;
a.fireMediaTimeUpdateEvent = function(a, b, c) {}
;
a.fireMediaCloseEvent = function(a, b, c) {}
;
a.fireMediaVolumeChangeEvent = function(a, b, c) {}
;
a.broadcastEvent = function() {
window.mraid.broadcastEvent.apply(window.mraid, arguments)
}
}
)();
(function() {
var a = window.mraid = new InmobiObj
, b = window.mraidview
, c = !1;
b.isAdShownToUser = !1;
b.onUserInteraction = function() {
imraidview.onUserInteraction();
c = !0
}
;
b.isPossibleFraud = function() {
return a.supports("redirectFraudDetection") && (!b.isAdShownToUser || !c)
}
;
b.fireRedirectFraudBeacon = function(a) {
if ("undefined" != typeof inmobi && inmobi.recordEvent) {
var d = {};
d.trigger = a;
d.isAdShown = b.isAdShownToUser.toString();
inmobi.recordEvent(135, d)
}
}
;
b.firePopupBlockedBeacon = function(a) {
if ("undefined" != typeof inmobi && inmobi.recordEvent) {
var b = {};
b.trigger = a;
inmobi.recordEvent(136, b)
}
}
;
window.onbeforeunload = function() {
b.detectAndBlockFraud("redirect")
}
;
a.addEventListener("viewableChange", function(a) {
a && !b.isAdShownToUser && (b.isAdShownToUser = !0)
});
a.useCustomClose = b.useCustomClose;
a.close = b.close;
a.getExpandProperties = b.getExpandProperties;
a.setExpandProperties = function(c) {
"undefined" != typeof c && ("useCustomClose"in c && "undefined" != typeof a.getState() && "expanded" != a.getState()) && a.useCustomClose(c.useCustomClose);
b.setExpandProperties(c)
}
;
a.getResizeProperties = b.getResizeProperties;
a.setResizeProperties = b.setResizeProperties;
a.getOrientationProperties = b.getOrientationProperties;
a.setOrientationProperties = b.setOrientationProperties;
a.expand = b.expand;
a.getMaxSize = b.getMaxSize;
a.getState = b.getState;
a.isViewable = b.isViewable;
a.createCalendarEvent = function(a) {
window.mraid.broadcastEvent("error", "Method not supported", "createCalendarEvent")
}
;
a.open = function(c) {
b.detectAndBlockFraud("mraid.open") || ("string" != typeof c ? a.broadcastEvent("error", "URL is required.", "open") : b.open(c))
}
;
a.resize = b.resize;
a.getVersion = function() {
return "2.0"
}
;
a.getPlacementType = b.getPlacementType;
a.playVideo = function(a) {
b.playVideo(a)
}
;
a.getScreenSize = b.getScreenSize;
a.getCurrentPosition = b.getCurrentPosition;
a.getDefaultPosition = b.getDefaultPosition;
a.supports = function(a) {
return b.supports(a)
}
;
a.storePicture = function(c) {
"string" != typeof c ? a.broadcastEvent("error", "Request must specify a valid URL", "storePicture") : b.storePicture(c)
}
}
)();
(function() {
var a = window.imraidview = {}, b, c = !0;
a.setOrientationProperties = function(b) {
try {
b ? ("undefined" != typeof b.allowOrientationChange && (mraidview.orientationProperties.allowOrientationChange = b.allowOrientationChange),
"undefined" != typeof b.forceOrientation && (mraidview.orientationProperties.forceOrientation = b.forceOrientation),
"undefined" != typeof b.direction && (mraidview.orientationProperties.direction = b.direction)) : b = null,
sdkController.setOrientationProperties("window.imraidview", mraidview.stringify(mraidview.orientationProperties))
} catch (c) {
a.showAlert("setOrientationProperties: " + c + ", props = " + b)
}
}
;
a.getOrientationProperties = function() {
return mraidview.orientationProperties
}
;
a.getWindowOrientation = function() {
var a = window.orientation;
0 > a && (a += 360);
window.innerWidth !== this.previousWidth && 0 == a && window.innerWidth > window.innerHeight && (a = 90);
return a
}
;
var e = function() {
window.setTimeout(function() {
if (c || a.getWindowOrientation() !== b)
c = !1,
b = a.getWindowOrientation(),
sdkController.onOrientationChange("window.imraidview"),
imraid.broadcastEvent("orientationChange", b)
}, 200)
};
a.registerOrientationListener = function() {
b = a.getWindowOrientation();
window.addEventListener("resize", e, !1);
window.addEventListener("orientationchange", e, !1)
}
;
a.unRegisterOrientationListener = function() {
window.removeEventListener("resize", e, !1);
window.removeEventListener("orientationchange", e, !1)
}
;
window.imraidview.registerOrientationListener();
a.firePostStatusEvent = function(a) {
window.imraid.broadcastEvent("postStatus", a)
}
;
a.fireMediaTrackingEvent = function(a, b) {
var c = {};
c.name = a;
var f = "inmobi_media_" + a;
"undefined" != typeof b && (null != b && "" != b) && (f = f + "_" + b);
window.imraid.broadcastEvent(f, c)
}
;
a.fireMediaErrorEvent = function(a, b) {
var c = {
name: "error"
};
c.code = b;
var f = "inmobi_media_" + c.name;
"undefined" != typeof a && (null != a && "" != a) && (f = f + "_" + a);
window.imraid.broadcastEvent(f, c)
}
;
a.fireMediaTimeUpdateEvent = function(a, b, c) {
var f = {
name: "timeupdate",
target: {}
};
f.target.currentTime = b;
f.target.duration = c;
b = "inmobi_media_" + f.name;
"undefined" != typeof a && (null != a && "" != a) && (b = b + "_" + a);
window.imraid.broadcastEvent(b, f)
}
;
a.saveContent = function(a, b, c) {
window.imraid.addEventListener("saveContent_" + a, c);
sdkController.saveContent("window.imraidview", a, b)
}
;
a.cancelSaveContent = function(a) {
sdkController.cancelSaveContent("window.imraidview", a)
}
;
a.disableCloseRegion = function(a) {
sdkController.disableCloseRegion("window.imraidview", a)
}
;
a.fireGalleryImageSelectedEvent = function(a, b, c) {
var f = new Image;
f.src = "data:image/jpeg;base64," + a;
f.width = b;
f.height = c;
window.imraid.broadcastEvent("galleryImageSelected", f)
}
;
a.fireCameraPictureCatpturedEvent = function(a, b, c) {
var f = new Image;
f.src = "data:image/jpeg;base64," + a;
f.width = b;
f.height = c;
window.imraid.broadcastEvent("cameraPictureCaptured", f)
}
;
a.fireMediaCloseEvent = function(a, b, c) {
var f = {
name: "close"
};
f.viaUserInteraction = b;
f.target = {};
f.target.currentTime = c;
b = "inmobi_media_" + f.name;
"undefined" != typeof a && (null != a && "" != a) && (b = b + "_" + a);
window.imraid.broadcastEvent(b, f)
}
;
a.fireMediaVolumeChangeEvent = function(a, b, c) {
var f = {
name: "volumechange",
target: {}
};
f.target.volume = b;
f.target.muted = c;
b = "inmobi_media_" + f.name;
"undefined" != typeof a && (null != a && "" != a) && (b = b + "_" + a);
window.imraid.broadcastEvent(b, f)
}
;
a.fireDeviceMuteChangeEvent = function(a) {
window.imraid.broadcastEvent("deviceMuted", a)
}
;
a.fireDeviceVolumeChangeEvent = function(a) {
window.imraid.broadcastEvent("deviceVolumeChange", a)
}
;
a.fireHeadphonePluggedEvent = function(a) {
window.imraid.broadcastEvent("headphones", a)
}
;
a.showAlert = function(a) {
sdkController.showAlert("window.imraidview", a)
}
;
a.openExternal = function(b, c) {
try {
600 <= getSdkVersionInt() ? sdkController.openExternal("window.imraidview", b, c) : sdkController.openExternal("window.imraidview", b)
} catch (e) {
a.showAlert("openExternal: " + e)
}
}
;
a.log = function(b) {
try {
sdkController.log("window.imraidview", b)
} catch (c) {
a.showAlert("log: " + c)
}
}
;
a.getPlatform = function() {
return "android"
}
;
a.asyncPing = function(b) {
try {
sdkController.asyncPing("window.imraidview", b)
} catch (c) {
a.showAlert("asyncPing: " + c)
}
}
;
a.startListeningDeviceMuteEvents = function() {
sdkController.registerDeviceMuteEventListener("window.imraidview")
}
;
a.stopListeningDeviceMuteEvents = function() {
sdkController.unregisterDeviceMuteEventListener("window.imraidview")
}
;
a.startListeningDeviceVolumeChange = function() {
sdkController.registerDeviceVolumeChangeEventListener("window.imraidview")
}
;
a.stopListeningDeviceVolumeChange = function() {
sdkController.unregisterDeviceVolumeChangeEventListener("window.imraidview")
}
;
a.startListeningHeadphonePluggedEvents = function() {
sdkController.registerHeadphonePluggedEventListener("window.imraidview")
}
;
a.stopListeningHeadphonePluggedEvents = function() {
sdkController.unregisterHeadphonePluggedEventListener("window.imraidview")
}
;
getSdkVersionInt = function() {
for (var b = a.getSdkVersion().split("."), c = b.length, e = "", f = 0; f < c; f++)
e += b[f];
return parseInt(e)
}
;
a.getSdkVersion = function() {
return window._im_imaiview.getSdkVersion()
}
;
a.supports = function(a) {
console.log("bridge: supports (IMRAID)");
if ("string" != typeof a)
window.imraid.broadcastEvent("error", "Supports method expects string parameter", "supports");
else
return "false" != sdkController.supports("window.imraidview", a)
}
;
a.postToSocial = function(b, c, e, f) {
window.imraid.broadcastEvent("error", "Method not supported", "postToSocial");
a.log("Method postToSocial not supported")
}
;
a.incentCompleted = function(a) {
if ("object" != typeof a || null == a)
sdkController.incentCompleted("window.imraidview", null);
else
try {
sdkController.incentCompleted("window.imraidview", JSON.stringify(a))
} catch (b) {
sdkController.incentCompleted("window.imraidview", null)
}
}
;
a.getOrientation = function() {
try {
return String(sdkController.getOrientation("window.imraidview"))
} catch (b) {
a.showAlert("getOrientation: " + b)
}
}
;
a.acceptAction = function(b) {
try {
sdkController.acceptAction("window.imraidview", mraidview.stringify(b))
} catch (c) {
a.showAlert("acceptAction: " + c + ", params = " + b)
}
}
;
a.rejectAction = function(b) {
try {
sdkController.rejectAction("window.imraidview", mraidview.stringify(b))
} catch (c) {
a.showAlert("rejectAction: " + c + ", params = " + b)
}
}
;
a.updateToPassbook = function(b) {
window.imraid.broadcastEvent("error", "Method not supported", "updateToPassbook");
a.log("Method not supported")
}
;
a.isDeviceMuted = function() {
return "false" != sdkController.isDeviceMuted("window.imraidview")
}
;
a.getDeviceVolume = function() {
return 603 >= getSdkVersionInt() ? -1 : sdkController.getDeviceVolume("window.imraidview")
}
;
a.isHeadPhonesPlugged = function() {
return "false" != sdkController.isHeadphonePlugged("window.imraidview")
}
;
a.sendSaveContentResult = function() {
window.imraid.sendSaveContentResult.apply(window.imraid, arguments)
}
;
a.broadcastEvent = function() {
window.imraid.broadcastEvent.apply(window.imraid, arguments)
}
;
a.disableBackButton = function(a) {
void 0 == a || "boolean" != typeof a ? console.log("disableBackButton called with invalid params") : sdkController.disableBackButton("window.imraidview", a)
}
;
a.isBackButtonDisabled = function() {
return sdkController.isBackButtonDisabled("window.imraidview")
}
;
a.startListeningForBackButtonPressedEvent = function() {
sdkController.registerBackButtonPressedEventListener("window.imraidview")
}
;
a.stopListeningForBackButtonPressedEvent = function() {
sdkController.unregisterBackButtonPressedEventListener("window.imraidview")
}
;
a.hideStatusBar = function() {}
;
a.setOpaqueBackground = function() {}
;
a.startDownloader = function(a, b, c) {
682 <= getSdkVersionInt() && sdkController.startDownloader("window.imraidview", a, b, c)
}
;
a.registerDownloaderCallbacks = function() {
682 <= getSdkVersionInt() && sdkController.registerDownloaderCallbacks("window.imraidview")
}
;
a.unregisterDownloaderCallbacks = function() {
682 <= getSdkVersionInt() && sdkController.unregisterDownloaderCallbacks("window.imraidview")
}
;
a.getDownloadProgress = function() {
return 682 <= getSdkVersionInt() ? sdkController.getDownloadProgress("window.imraidview") : -1
}
;
a.getDownloadStatus = function() {
return 682 <= getSdkVersionInt() ? sdkController.getDownloadStatus("window.imraidview") : -1
}
;
a.fireEvent = function(a) {
700 <= getSdkVersionInt() && ("fireSkip" === a ? sdkController.fireSkip("window.imraidview") : "fireComplete" === a ? sdkController.fireComplete("window.imraidview") : "showEndCard" === a && sdkController.showEndCard("window.imraidview"))
}
;
a.saveBlob = function(a) {
700 <= getSdkVersionInt() && sdkController.saveBlob("window.imraidview", a)
}
;
a.getBlob = function(a, b) {
700 <= getSdkVersionInt() && sdkController.getBlob(a, b)
}
;
a.setCloseEndCardTracker = function(a) {
700 <= getSdkVersionInt() && sdkController.setCloseEndCardTracker("window.imraidview", a)
}
;
a.getRenderableAdIndexes = function() {
try {
if (917 <= getSdkVersionInt())
return sdkController.getRenderableAdIndexes("window.imraidview")
} catch (a) {}
return "[]"
}
;
a.getCurrentRenderingIndex = function() {
try {
if (917 <= getSdkVersionInt())
return sdkController.getCurrentRenderingIndex("window.imraidview")
} catch (a) {}
return -1
}
;
a.showAd = function(a) {
try {
917 <= getSdkVersionInt() && sdkController.showAd("window.imraidview", a)
} catch (b) {}
}
;
a.timeSinceShow = function() {
try {
if (917 <= getSdkVersionInt())
return sdkController.timeSinceShow("window.imraidview")
} catch (a) {}
return -1
}
;
a.getShowTimeStamp = function() {
try {
if (917 <= getSdkVersionInt())
return sdkController.getShowTimeStamp("window.imraidview")
} catch (a) {}
return -1
}
;
a.closeAll = function() {
try {
917 <= getSdkVersionInt() && sdkController.closeAll("window.imraidview")
} catch (a) {}
}
;
a.loadAd = function(a) {
try {
917 <= getSdkVersionInt() && sdkController.loadAd("window.imraidview", a)
} catch (b) {}
}
;
a.setAdContext = function(a) {
try {
917 <= getSdkVersionInt() && sdkController.setAdContext("window.imraidview", a)
} catch (b) {}
}
;
a.getAdContext = function() {
try {
if (917 <= getSdkVersionInt())
return sdkController.getAdContext("window.imraidview")
} catch (a) {}
return ""
}
;
a.openWithoutTracker = function(a) {
try {
"undefined" == typeof a && (a = null),
sdkController.openWithoutTracker("window.imraidview", a)
} catch (b) {}
}
;
a.impressionRendered = function() {
window.imraid.broadcastEvent("impressionRendered")
}
;
a.onGestureDetected = function(a, b) {
window.imraid.broadcastEvent("onGestureDetected", a, b)
}
;
a.onUserLandingCompleted = function() {
window.imraid.broadcastEvent("onUserLandingCompleted")
}
;
a.onUserInteraction = function() {
window.imraid.broadcastEvent("onUserInteraction")
}
}
)();
(function() {
var a = window.imraid = new InmobiObj
, b = window.imraidview;
a.getOrientation = b.getOrientation;
a.setOrientationProperties = b.setOrientationProperties;
a.getOrientationProperties = b.getOrientationProperties;
a.saveContentIDMap = {};
a.saveContent = function(c, e, d) {
var k = arguments.length, h, f = null;
if (3 > k) {
if ("function" === typeof arguments[k - 1])
h = arguments[k - 1];
else
return;
f = {
reason: 1
}
} else
a.saveContentIDMap[c] && (h = arguments[2],
f = {
reason: 11,
url: arguments[1]
});
"function" !== !h && (f ? (window.imraid.addEventListener("saveContent_failed_" + c, h),
window.imraid.sendSaveContentResult("saveContent_failed_" + c, "failed", JSON.stringify(f))) : (a.removeEventListener("saveContent_" + c),
a.saveContentIDMap[c] = !0,
b.saveContent(c, e, d)))
}
;
a.cancelSaveContent = function(a) {
b.cancelSaveContent(a)
}
;
a.asyncPing = function(c) {
"string" != typeof c ? a.broadcastEvent("error", "URL is required.", "asyncPing") : b.asyncPing(c)
}
;
a.disableCloseRegion = b.disableCloseRegion;
a.getSdkVersion = b.getSdkVersion;
a.log = function(c) {
"undefined" == typeof c ? a.broadcastEvent("error", "message is required.", "log") : "string" == typeof c ? b.log(c) : b.log(JSON.stringify(c))
}
;
a.getInMobiAIVersion = function() {
return "2.0"
}
;
a.getVendorName = function() {
return "inmobi"
}
;
a.openExternal = function(a, e) {
console.log("openExternal is deprecated, will be removed in future version");
mraidview.detectAndBlockFraud("imraid.openExternal") || b.openExternal(a, e)
}
;
a.updateToPassbook = function(c) {
mraidview.detectAndBlockFraud("imraid.updateToPassbook") || ("string" != typeof c ? a.broadcastEvent("error", "Request must specify a valid URL", "updateToPassbook") : b.updateToPassbook(c))
}
;
a.postToSocial = function(a, e, d, k) {
mraidview.detectAndBlockFraud("imraid.postToSocial") || b.postToSocial(a, e, d, k)
}
;
a.getPlatform = b.getPlatform;
a.incentCompleted = b.incentCompleted;
a.loadSKStore = b.loadSKStore;
a.showSKStore = function(a, e, d, k, h, f, g, l) {
mraidview.detectAndBlockFraud("imraid.showSKStore") || b.showSKStore(a, e, d, k, h, f, g, l)
}
;
a.skoverlay = b.skoverlay;
a.skoverlayWithSkan = b.skoverlayWithSkan;
a.dismissSKOverlay = b.dismissSKOverlay;
a.supports = function(a) {
return b.supports(a)
}
;
a.isDeviceMuted = function() {
return !imIsObjValid(a.listeners.deviceMuted) ? -1 : b.isDeviceMuted()
}
;
a.isHeadPhonesPlugged = function() {
return !imIsObjValid(a.listeners.headphones) ? !1 : b.isHeadPhonesPlugged()
}
;
a.getDeviceVolume = function() {
return b.getDeviceVolume()
}
;
a.setDeviceVolume = function(a) {
b.setDeviceVolume(a)
}
;
a.hideStatusBar = function() {
b.hideStatusBar()
}
;
a.setOpaqueBackground = function() {
b.setOpaqueBackground()
}
;
a.getRenderableAdIndexes = b.getRenderableAdIndexes;
a.getCurrentRenderingIndex = b.getCurrentRenderingIndex;
a.showAd = b.showAd;
a.timeSinceShow = b.timeSinceShow;
a.closeAll = b.closeAll;
a.loadAd = b.loadAd;
a.setAdContext = b.setAdContext;
a.getAdContext = b.getAdContext;
a.getShowTimeStamp = b.getShowTimeStamp;
a.disableBackButton = b.disableBackButton;
a.isBackButtonDisabled = b.isBackButtonDisabled;
a.startDownloader = b.startDownloader;
a.getDownloadProgress = b.getDownloadProgress;
a.getDownloadStatus = b.getDownloadStatus;
a.fireEvent = b.fireEvent;
a.saveBlob = b.saveBlob;
a.getBlob = b.getBlob;
a.setCloseEndCardTracker = b.setCloseEndCardTracker;
a.openWithoutTracker = b.openWithoutTracker;
a.impressionRendered = b.impressionRendered;
a.onGestureDetected = b.onGestureDetected;
a.onUserLandingCompleted = b.onUserLandingCompleted
}
)();
(function() {
var a = window._im_imaiview = {
ios: {}
};
window.imaiview = a;
a.broadcastEvent = function() {
for (var a = Array(arguments.length), c = 0; c < arguments.length; c++)
a[c] = arguments[c];
c = a.shift();
try {
window.mraid.broadcastEvent(c, a)
} catch (e) {}
}
;
a.getPlatform = function() {
return "android"
}
;
a.getPlatformVersion = function() {
return sdkController.getPlatformVersion("window.imaiview")
}
;
a.log = function(a) {
sdkController.log("window.imaiview", a)
}
;
a.openEmbedded = function(a) {
sdkController.openEmbedded("window.imaiview", a)
}
;
a.openExternal = function(a, c) {
600 <= getSdkVersionInt() ? sdkController.openExternal("window.imaiview", a, c) : sdkController.openExternal("window.imaiview", a)
}
;
a.ping = function(a, c) {
sdkController.ping("window.imaiview", a, c)
}
;
a.pingInWebView = function(a, c) {
sdkController.pingInWebView("window.imaiview", a, c)
}
;
a.getSdkVersion = function() {
try {
var a = sdkController.getSdkVersion("window.imaiview");
if ("string" == typeof a && null != a)
return a
} catch (c) {
return "3.7.0"
}
}
;
a.onUserInteraction = function(a) {
if ("object" != typeof a || null == a)
sdkController.onUserInteraction("window.imaiview", null);
else
try {
sdkController.onUserInteraction("window.imaiview", JSON.stringify(a))
} catch (c) {
sdkController.onUserInteraction("window.imaiview", null)
}
}
;
a.fireAdReady = function() {
sdkController.fireAdReady("window.imaiview")
}
;
a.fireAdFailed = function() {
sdkController.fireAdFailed("window.imaiview")
}
;
a.broadcastEvent = function() {
window.imai.broadcastEvent.apply(window.imai, arguments)
}
}
)();
(function() {
var a = window._im_imaiview;
window._im_imai = new InmobiObj;
window._im_imai.ios = new InmobiObj;
var b = window._im_imai;
window.imai = window._im_imai;
b.matchString = function(a, b) {
if ("string" != typeof a || null == a || null == b)
return -1;
var d = -1;
try {
d = a.indexOf(b)
} catch (k) {}
return d
}
;
b.isHttpUrl = function(a) {
return "string" != typeof a || null == a ? !1 : 0 == b.matchString(a, "http://") ? !0 : 0 == b.matchString(a, "https://") ? !0 : !1
}
;
b.appendTapParams = function(a, e, d) {
if (!imIsObjValid(e) || !imIsObjValid(d))
return a;
b.isHttpUrl(a) && (a = -1 == b.matchString(a, "?") ? a + ("?u-tap-o=" + e + "," + d) : a + ("&u-tap-o=" + e + "," + d));
return a
}
;
b.performAdClick = function(a, e) {
e = e || event;
if (imIsObjValid(a)) {
var d = a.clickConfig
, k = a.landingConfig;
if (!imIsObjValid(d) && !imIsObjValid(k))
b.log("click/landing config are invalid, Nothing to process ."),
this.broadcastEvent("error", "click/landing config are invalid, Nothing to process .");
else {
var h = null
, f = null
, g = null
, l = null
, n = null
, m = null
, q = null
, p = null;
if (imIsObjValid(e))
try {
l = e.changedTouches[0].pageX,
n = e.changedTouches[0].pageY
} catch (r) {
n = l = 0
}
imIsObjValid(k) ? imIsObjValid(d) ? (m = k.url,
q = k.fallbackUrl,
p = k.urlType,
h = d.url,
f = d.pingWV,
g = d.fr) : (m = k.url,
p = k.urlType) : (m = d.url,
p = d.urlType);
d = b.getPlatform();
try {
if ("boolean" != typeof g && "number" != typeof g || null == g)
g = !0;
if (0 > g || 1 < g)
g = !0;
if ("boolean" != typeof f && "number" != typeof f || null == f)
f = !0;
if (0 > f || 1 < f)
f = !0;
if ("number" != typeof p || null == p)
p = 0;
h = b.appendTapParams(h, l, n);
imIsObjValid(h) ? !0 == f ? b.pingInWebView(h, g) : b.ping(h, g) : b.log("clickurl provided is null.");
if (imIsObjValid(m))
switch (imIsObjValid(h) || (m = b.appendTapParams(m, l, n)),
p) {
case 1:
b.openEmbedded(m);
break;
case 2:
"ios" == d ? b.ios.openItunesProductView(m) : this.broadcastEvent("error", "Cannot process openItunesProductView for os" + d);
break;
default:
b.openExternal(m, q)
}
else
b.log("Landing url provided is null.")
} catch (s) {}
}
} else
b.log(" invalid config, nothing to process ."),
this.broadcastEvent("error", "invalid config, nothing to process .")
}
;
b.performActionClick = function(a, e) {
e = e || event;
if (imIsObjValid(a)) {
var d = a.clickConfig
, k = a.landingConfig;
if (!imIsObjValid(d) && !imIsObjValid(k))
b.log("click/landing config are invalid, Nothing to process ."),
this.broadcastEvent("error", "click/landing config are invalid, Nothing to process .");
else {
var h = null
, f = null
, g = null
, l = null
, n = null;
if (imIsObjValid(e))
try {
l = e.changedTouches[0].pageX,
n = e.changedTouches[0].pageY
} catch (m) {
n = l = 0
}
imIsObjValid(d) && (h = d.url,
f = d.pingWV,
g = d.fr);
try {
if ("boolean" != typeof g && "number" != typeof g || null == g)
g = !0;
if (0 > g || 1 < g)
g = !0;
if ("boolean" != typeof f && "number" != typeof f || null == f)
f = !0;
if (0 > f || 1 < f)
f = !0;
h = b.appendTapParams(h, l, n);
imIsObjValid(h) ? !0 == f ? b.pingInWebView(h, g) : b.ping(h, g) : b.log("clickurl provided is null.");
b.onUserInteraction(k)
} catch (q) {}
}
} else
b.log(" invalid config, nothing to process ."),
this.broadcastEvent("error", "invalid config, nothing to process .")
}
;
b.getVersion = function() {
return "1.0"
}
;
b.getPlatform = a.getPlatform;
b.getPlatformVersion = a.getPlatformVersion;
b.log = a.log;
b.openEmbedded = function(b) {
console.log("openEmbedded is deprecated, will be removed in future version");
mraidview.detectAndBlockFraud("imai.openEmbedded") || a.openEmbedded(b)
}
;
b.openExternal = function(b, e) {
console.log("openExternal is deprecated, will be removed in future version");
mraidview.detectAndBlockFraud("imai.openExternal") || a.openExternal(b, e)
}
;
b.ping = a.ping;
b.pingInWebView = a.pingInWebView;
b.onUserInteraction = a.onUserInteraction;
b.getSdkVersion = a.getSdkVersion;
b.loadSKStore = a.loadSKStore;
b.showSKStore = function(b) {
mraidview.detectAndBlockFraud("imai.showSKStore") || a.showSKStore(b)
}
;
b.ios.openItunesProductView = function(b) {
mraidview.detectAndBlockFraud("imai.ios.openItunesProductView") || a.ios.openItunesProductView(b)
}
;
b.fireAdReady = a.fireAdReady;
b.fireAdFailed = a.fireAdFailed
}
)();

Back to list