Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.init_ormmaview = function() {
- var b = window.ormmaview = {},
- j = {
- width: 100,
- height: 100,
- useCustomClose: !1,
- isModal: !1,
- lockOrientation: !1,
- useBackground: !1,
- backgroundColor: "#ffffff",
- backgroundOpacity: 1
- },
- resizeProps = {
- width: 100,
- height: 100,
- customClosePosition: "top-right",
- offsetX: 0,
- offsetY: 0,
- allowOffscreen: !1
- },
- orientationProps = {
- allowOrientationChange : !0,
- forceOrientation : "none"
- },
- calendarParams = {
- description: "",
- location: "",
- summary: "",
- start: "",
- end: "",
- status: "",
- transparency: "",
- recurrence: "",
- reminder: ""
- },
- c = {},
- i = [],
- p = !1,
- n = !1;
- b.fireAssetReadyEvent = function(b, g) {
- var e = c.assetReady;
- if (e != null) for (var h = 0; h < e.length; h++) e[h](b, g);
- return "OK"
- };
- b.fireAssetRemovedEvent = function(b) {
- var g = c.assetRemoved;
- if (g != null) for (var e = 0; e < g.length; e++) g[e](b);
- return "OK"
- };
- b.fireAssetRetiredEvent = function(b) {
- var g = c.assetRetired;
- if (g != null) for (var e = 0; e < g.length; e++) g[e](b);
- return "OK"
- };
- b.fireChangeEvent = function(b) {
- var g = c.change;
- if (g != null) for (var e = 0; e < g.length; e++) g[e](b);
- return "OK"
- };
- b.fireErrorEvent = function(b, g) {
- var e = c.error;
- if (e != null) for (var h = 0; h < e.length; h++) e[h](b, g);
- return "OK"
- };
- b.fireShakeEvent = function() {
- var b = c.shake;
- if (b != null) for (var g = 0; g < b.length; g++) b[g]();
- return "OK"
- };
- b.fireResponseEvent = function(b, g) {
- var e = c.response;
- if (e != null) for (var h = 0; h < e.length; h++) e[h](b, g);
- return "OK"
- };
- b.nativeCallComplete = function() {
- if (i.length == 0) p = !1;
- else {
- var b = i.pop();
- window.location = b;
- return "OK"
- }
- };
- b.showAlert = function(b) {
- alert(b)
- };
- b.zeroPad = function(b) {
- var g = "";
- b < 10 && (g += "0");
- g += b;
- return g
- };
- b.executeNativeCall = function(b) {
- for (var g = "ormma://" + b, c, h = !0, j = 1; j < arguments.length; j += 2) c = arguments[j + 1], c != null && (h ? (g += "?", h = !1) : g += "&", g += arguments[j] + "=" + encodeURIComponent(c));
- p || !n ? i.push(g) : (p = !0, window.location = g)
- };
- b.activate = function(b) {
- this.executeNativeCall("service", "name", b, "enabled", "Y")
- };
- b.addEventListener = function(b, g) {
- var e = c[b];
- e == null && (c[b] = [], e = c[b]);
- for (var h in e) if (g == h) return;
- e.push(g)
- };
- b.deactivate = function(b) {
- this.executeNativeCall("service", "name", b, "enabled", "N")
- };
- b.removeEventListener = function(b, g) {
- var e = c[b];
- e != null && e.remove(g)
- };
- b.close = function() {
- this.executeNativeCall("close")
- };
- b.expand = function(b) {
- //window.alert("executeNativecall expand");
- this.executeNativeCall("expand", "url", b, "width", j.width, "height", j.height, "useCustomClose", j.useCustomClose, "isModal", j.isModal, "useBackground", j.useBackground, "backgroundColor", j.backgroundColor, "backgroundOpacity", j.backgroundOpacity, "lockOrientation", j.lockOrientation, "allowOrientationChange", orientationProps.allowOrientationChange, "forceOrientation", orientationProps.forceOrientation)
- };
- b.hide = function() {
- this.executeNativeCall("hide")
- };
- b.open = function(b) {
- this.executeNativeCall("open", "url", b)
- };
- b.openMap = function(b, c) {
- this.executeNativeCall("openMap", "url", b, "fullscreen", c)
- };
- b.resize = function() {
- //window.alert("resize");
- this.executeNativeCall("resize", "width", resizeProps.width, "height", resizeProps.height, "customClosePosition", resizeProps.customClosePosition, "offsetX", resizeProps.offsetX, "offsetY", resizeProps.offsetY, "allowOffscreen", resizeProps.allowOffscreen);
- };
- b.setResizeProperties = function(b) {
- //window.alert("setResizeProperties");
- var c = "width,height,customClosePosition,offsetX,offsetY,allowOffscreen".split(",");
- for (f in c) {
- var e = c[f];
- b[e] !== void 0 && (resizeProps[e] = b[e])
- }
- };
- b.getResizeProperties = function() {
- return resizeProps;
- };
- b.setOrientationProperties = function(b) {
- //window.alert("setResizeProperties");
- var c = "allowOrientationChange,forceOrientation".split(",");
- for (f in c) {
- var e = c[f];
- b[e] !== void 0 && (orientationProps[e] = b[e])
- }
- };
- b.getOrientationProperties = function() {
- return orientationProps;
- };
- b.getExpandProperties = function() {
- return j
- };
- b.setExpandProperties = function(b) {
- var c = "width,height,useCustomClose,isModal,lockOrientation,useBackground,backgroundColor,backgroundOpacity".split(",");
- for (f in c) {
- var e = c[f];
- b[e] !== void 0 && (j[e] = b[e])
- }
- };
- b.show = function() {
- this.executeNativeCall("show")
- };
- b.storePicture = function(b) {
- this.executeNativeCall("storePicture", "url", b)
- };
- b.useCustomClose = function(b) {
- j.useCustomClose = b
- };
- b.playAudio = function(b, c) {
- var e = "this.executeNativeCall( 'playAudio'";
- e += ", 'url', '" + b + "'";
- c != null && (e += typeof c.autoplay != "undefined" && c.autoplay != null ? ", 'autoplay', 'Y'" : ", 'autoplay', 'N'", e += typeof c.controls != "undefined" && c.controls != null ? ", 'controls', 'Y'" : ", 'controls', 'N'", e += typeof c.loop != "undefined" && c.loop != null ? ", 'loop', 'Y'" : ", 'loop', 'N'", e += typeof c.position != "undefined" && c.position != null ? ", 'position', 'Y'" : ", 'position', 'N'", e += typeof c.startStyle != "undefined" && c.startStyle != null ? ", 'startStyle', '" + c.startStyle + "'" : ", 'startStyle', 'normal'", e += typeof c.stopStyle != "undefined" && c.stopStyle != null ? ", 'stopStyle', '" + c.stopStyle + "'" : ", 'stopStyle', 'normal'");
- e += " );";
- eval(e)
- };
- b.playVideo = function(b, c) {
- var e = "this.executeNativeCall( 'playVideo'";
- e += ", 'url', '" + b + "'";
- c != null && (e += typeof c.audio != "undefined" && c.audio != null ? ", 'audioMuted', 'Y'" : ", 'audioMuted', 'N'", e += typeof c.autoplay != "undefined" && c.autoplay != null ? ", 'autoplay', 'Y'" : ", 'autoplay', 'N'", e += typeof c.controls != "undefined" && c.controls != null ? ", 'controls', 'Y'" : ", 'controls', 'N'", e += typeof c.loop != "undefined" && c.loop != null ? ", 'loop', 'Y'" : ", 'loop', 'N'", typeof c.position != "undefined" && c.position != null && (e += ", 'position_top', '" + c.position.top + "'", e += ", 'position_left', '" + c.position.left + "'", typeof c.width != "undefined" && c.width != null && (e += ", 'position_width', '" + c.width + "'"), typeof c.height != "undefined" && c.height != null && (e += ", 'position_height', '" + c.height + "'")), e += typeof c.startStyle != "undefined" && c.startStyle != null ? ", 'startStyle', '" + c.startStyle + "'" : ", 'startStyle', 'normal'", e += typeof c.stopStyle != "undefined" && c.stopStyle != null ? ", 'stopStyle', '" + c.stopStyle + "'" : ", 'stopStyle', 'normal'");
- e += " );";
- eval(e)
- };
- b.createEvent = function(c, b, e) {
- var h = c.getFullYear(),
- i = c.getMonth() + 1,
- j = c.getDate(),
- n = c.getHours(),
- c = c.getMinutes();
- this.executeNativeCall("calendar_mraid1", "date", h + this.zeroPad(i) + this.zeroPad(j) + this.zeroPad(n) + this.zeroPad(c), "title", b, "body", e)
- };
- b.createCalendarEvent = function(b) {
- var cc = "description,location,summary,start,end,status,transparency,recurrence,reminder".split(",");
- for (f in cc) {
- var e = cc[f];
- b[e] !== void 0 && (calendarParams[e] = b[e]);
- }
- this.executeNativeCall("calendar", "description", calendarParams.description, "location", calendarParams.location, "summary", calendarParams.summary, "start", calendarParams.start, "end", calendarParams.end, "transparency", calendarParams.transparency, "recurrence", calendarParams.recurrence, "reminder", calendarParams.reminder);
- };
- b.makeCall = function(c) {
- this.executeNativeCall("phone", "number", c)
- };
- b.sendMail = function(c, b, e) {
- this.executeNativeCall("email", "to", c, "subject", b, "body", e, "html", "N")
- };
- b.sendSMS = function(c, b) {
- this.executeNativeCall("sms", "to", c, "body", b)
- };
- b.setShakeProperties = function() {};
- b.addAsset = function(c, b) {
- this.executeNativeCall("addasset", "uri", url, "alias", b)
- };
- b.request = function(c, b) {
- this.executeNativeCall("request", "uri", c, "display", b)
- };
- b.removeAsset = function(c) {
- this.executeNativeCall("removeasset", "alias", c)
- };
- document.addEventListener("DOMContentLoaded", function() {
- n = !0;
- this.nativeCallComplete()
- })
- };
- window.ormmaview || window.init_ormmaview();
- window.init_ormma = function() {
- var b = window.ormma = {},
- j = b.STATES = {
- UNKNOWN: "unknown",
- DEFAULT: "default",
- RESIZED: "resized",
- EXPANDED: "expanded",
- HIDDEN: "hidden"
- },
- c = b.EVENTS = {
- ASSETREADY: "assetReady",
- ASSETREMOVED: "assetRemoved",
- ASSETRETIRED: "assetRetired",
- ERROR: "error",
- INFO: "info",
- HEADINGCHANGE: "headingChange",
- KEYBOARDCHANGE: "keyboardChange",
- LOCATIONCHANGE: "locationChange",
- NETWORKCHANGE: "networkChange",
- ORIENTATIONCHANGE: "orientationChange",
- READY: "ready",
- RESPONSE: "response",
- SCREENCHANGE: "screenChange",
- SHAKE: "shake",
- SIZECHANGE: "sizeChange",
- STATECHANGE: "stateChange",
- TILTCHANGE: "tiltChange",
- VIEWABLECHANGE: "viewableChange"
- };
- b.CONTROLS = {
- BACK: "back",
- FORWARD: "forward",
- REFRESH: "refresh",
- ALL: "all"
- };
- var i = b.FEATURES = {
- LEVEL1: "level-1",
- LEVEL2: "level-2",
- LEVEL3: "level-3",
- SCREEN: "screen",
- ORIENTATION: "orientation",
- HEADING: "heading",
- LOCATION: "location",
- SHAKE: "shake",
- TILT: "tilt",
- NETWORK: "network",
- SMS: "sms",
- PHONE: "phone",
- TEL: "tel",
- EMAIL: "email",
- CALENDAR: "calendar",
- CAMERA: "camera",
- STOREPICTURE: "storePicture",
- INLINEVIDEO: "inlineVideo",
- AUDIO: "audio",
- VIDEO: "video",
- MAP: "map"
- },
- p = b.NETWORK = {
- OFFLINE: "offline",
- WIFI: "wifi",
- CELL: "cell",
- UNKNOWN: "unknown"
- },
- n = j.UNKNOWN,
- u = {
- width: 0,
- height: 0
- },
- g = {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
- defaultPosition = {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
- e = {
- width: 0,
- height: 0
- },
- h = {
- "level-1": !0,
- "level-2": !0,
- "level-3": !0,
- screen: !0,
- orientation: !0,
- heading: !0,
- location: !0,
- shake: !0,
- tilt: !0,
- network: !0,
- sms: !0,
- phone:!0,
- tel: !0,
- email: !0,
- calendar: !0,
- camera: !0,
- storePicture: !0,
- inlineVideo: !0,
- audio: !0,
- video: !0,
- map: !0
- },
- w = -1,
- x = !1,
- q = null,
- s = p.UNKNOWN,
- y = -1,
- A = "inline",
- t = null,
- v = {
- interval: 10,
- intensity: 20
- },
- r = null,
- m = {},
- B = -1,
- z = !1,
- E = {
- width: function(a) {
- return !isNaN(a) && a > 0
- },
- height: function(a) {
- return !isNaN(a) && a > 0
- },
- useCustomClose: function(a) {
- return a === !0 || a === !1
- },
- isModal: function(a) {
- return a === !0 || a === !1
- },
- lockOrientation: function(a) {
- return a === !0 || a === !1
- },
- useBackground: function(a) {
- return a === !0 || a === !1
- },
- backgroundColor: function(a) {
- return typeof a == "string" && a.substr(0, 1) == "#" && !isNaN(parseInt(a.substr(1), 16))
- },
- backgroundOpacity: function(a) {
- return !isNaN(a) && a >= 0 && a <= 1
- }
- },
- F = {
- intensity: function(a) {
- return !isNaN(a)
- },
- interval: function(a) {
- return !isNaN(a)
- }
- },
- G = {
- state: function(a) {
- d(c.INFO, "setting state to " + k(a));
- n = a;
- d(c.STATECHANGE, n)
- },
- size: function(a) {
- d(c.INFO, "setting size to " + k(a));
- u = a;
- d(c.SIZECHANGE, u.width, u.height)
- },
- defaultPosition: function(a) {
- d(c.INFO, "setting default position to " + k(a));
- defaultPosition = a
- },
- currentPosition: function(a) {
- d(c.INFO, "setting current position to " + k(a));
- g = a
- },
- maxSize: function(a) {
- d(c.INFO, "setting maxSize to " + k(a));
- e = a
- },
- expandProperties: function(a) {
- d(c.INFO, "merging expandProperties with " + k(a));
- ormmaview.setExpandProperties(a)
- },
- resizeProperties: function(a) {
- d(c.INFO, "merging resizeProperties with " + k(a));
- ormmaview.setResizeProperties(a);
- },
- orientationProperties: function(a) {
- d(c.INFO, "merging orientationProperties with " + k(a));
- ormmaview.setOrientationProperties(a);
- },
- supports: function(a) {
- d(c.INFO, "setting supports to " + k(a));
- h = {};
- for (var b in i) h[i[b]] = C(i[b], a)
- },
- heading: function(a) {
- d(c.INFO, "setting heading to " + k(a));
- w = a;
- d(c.HEADINGCHANGE, w)
- },
- keyboardState: function(a) {
- d(c.INFO, "setting keyboardState to " + k(a));
- x = a;
- d(c.KEYBOARDCHANGE, x)
- },
- location: function(a) {
- d(c.INFO, "setting location to " + k(a));
- q = a;
- d(c.LOCATIONCHANGE, q.lat, q.lon, q.acc)
- },
- network: function(a) {
- d(c.INFO, "setting network to " + k(a));
- s = a;
- d(c.NETWORKCHANGE, s != p.OFFLINE && s != p.UNKNOWN, s)
- },
- orientation: function(a) {
- d(c.INFO, "setting orientation to " + k(a));
- y = a;
- d(c.ORIENTATIONCHANGE, y)
- },
- placementType: function(a) {
- d(c.INFO, "setting placementType to " + k(a));
- A = a
- },
- screenSize: function(a) {
- d(c.INFO, "setting screenSize to " + k(a));
- t = a;
- d(c.SCREENCHANGE, t.width, t.height)
- },
- shakeProperties: function(a) {
- d(c.INFO, "setting shakeProperties to " + k(a));
- v = a
- },
- tilt: function(a) {
- d(c.INFO, "setting tilt to " + k(a));
- r = a;
- d(c.TILTCHANGE, r.x, r.y, r.z)
- },
- cacheRemaining: function(a) {
- d(c.INFO, "setting cacheRemaining to " + k(a));
- B = a
- },
- viewable: function(a) {
- d(c.INFO, "setting viewable to " + k(a));
- z = a;
- d(c.VIEWABLECHANGE, a)
- }
- },
- l = {},
- H = function(a) {
- this.event = a;
- this.count = 0;
- var c = {};
- this.add = function(b) {
- var d = String(b);
- c[d] || (c[d] = b, this.count++, this.count == 1 && ormmaview.activate(a))
- };
- this.remove = function(b) {
- b = String(b);
- return c[b] ? (c[b] = null, delete c[b], this.count--, this.count == 0 && ormmaview.deactivate(a), !0) : !1
- };
- this.removeAll = function() {
- for (var a in c) this.remove(c[a])
- };
- this.broadcast = function(a) {
- for (var b in c) c[b].apply({}, a)
- };
- this.toString = function() {
- var b = [a, ":"],
- d;
- for (d in c) b.push("|", d, "|");
- return b.join("")
- }
- };
- ormmaview.addEventListener("change", function(a) {
- for (var c in a)(0, G[c])(a[c])
- });
- ormmaview.addEventListener("shake", function() {
- d(c.SHAKE)
- });
- ormmaview.addEventListener("error", function(a, b) {
- d(c.ERROR, a, b)
- });
- ormmaview.addEventListener("response", function(a, b) {
- d(c.RESPONSE, a, b)
- });
- ormmaview.addEventListener("assetReady", function(a, b) {
- m[a] = b;
- d(c.ASSETREADY, a)
- });
- ormmaview.addEventListener("assetRemoved", function(a) {
- m[a] = null;
- delete m[a];
- d(c.ASSETREMOVED, a)
- });
- ormmaview.addEventListener("assetRetired", function(a) {
- m[a] = null;
- delete m[a];
- d(c.ASSETRETIRED, a)
- });
- var o = function(a) {
- var c = function() {};
- c.prototype = a;
- return new c
- },
- k = function(a) {
- if (typeof a == "object") if (a.push) {
- var c = [],
- b;
- for (b in a) c.push(a[b]);
- return "[" + c.join(",") + "]"
- } else {
- c = [];
- for (b in a) c.push("'" + b + "':" + a[b]);
- return "{" + c.join(",") + "}"
- } else return String(a)
- },
- D = function(a, b, e, h) {
- if (h) if (a === void 0) return d(c.ERROR, "Required object missing.", e), !1;
- else for (var g in b) if (a[g] === void 0) return d(c.ERROR, "Object missing required property " + g, e), !1;
- for (g in a) if (b[g]) {
- if (!b[g](a[g])) return d(c.ERROR, "Value of property " + g + " is not valid type.", e), !1
- } else return d(c.ERROR, "Invalid property specified - " + g + ".", e), !1;
- return !0
- },
- C = function(a, c) {
- for (var b in c) if (c[b] == a) return !0;
- return !1
- },
- d = function() {
- for (var a = Array(arguments.length), c = 0; c < arguments.length; c++) a[c] = arguments[c];
- c = a.shift();
- l[c] && l[c].broadcast(a)
- };
- b.signalReady = function() {
- window.ORMMAReady && ORMMAReady();
- d(c.READY);
- d(c.INFO, "callback invoked")
- };
- b.addEventListener = function(a, b) {
- !a || !b ? d(c.ERROR, "Both event and listener are required.", "addEventListener") : C(a, c) ? (l[a] || (l[a] = new H(a)), l[a].add(b)) : d(c.ERROR, "Unknown event: " + a, "addEventListener")
- };
- b.close = function() {
- ormmaview.close()
- };
- b.expand = function(a) {
- ormmaview.expand(a)
- };
- b.getDefaultPosition = function() {
- return o(defaultPosition)
- };
- b.getCurrentPosition = function() {
- return o(g)
- };
- b.getExpandProperties = function() {
- return o(ormmaview.getExpandProperties())
- };
- b.getMaxSize = function() {
- return o(e)
- };
- b.getSize = function() {
- return o(u)
- };
- b.getState = function() {
- return n
- };
- b.hide = function() {
- n == j.HIDDEN ? d(c.ERROR, "Ad is currently hidden.", "hide") : ormmaview.hide()
- };
- b.isViewable = function() {
- return z
- };
- b.open = function(a) {
- a ? ormmaview.open(a) : d(c.ERROR, "URL is required.", "open")
- };
- b.openMap = function(a, b) {
- a ? ormmaview.openMap(a, b) : d(c.ERROR, "POI is required.", "openMap")
- };
- b.removeEventListener = function(a, b) {
- a ? b && (!l[a] || !l[a].remove(b)) ? d(c.ERROR, "Listener not currently registered for event", "removeEventListener") : (l[a] && l[a].removeAll(), l[a] && l[a].count == 0 && (l[a] = null, delete l[a])) : d(c.ERROR, "Must specify an event.", "removeEventListener")
- };
- /*
- b.resize = function(a, b) {
- if (a == null || b == null || isNaN(a) || isNaN(b) || a < 0 || b < 0) d(c.ERROR, "Requested size must be numeric values >= 0.", "resize");
- else {
- if (a > e.width) a = e.width;
- if (b > e.height) b = e.height;
- ormmaview.resize(a, b)
- }
- };
- */
- b.resize = function() {
- ormmaview.resize();
- };
- b.setResizeProperties = function(a) {
- ormmaview.setResizeProperties(a);
- };
- b.getResizeProperties = function() {
- return o(ormmaview.getResizeProperties())
- };
- b.setOrientationProperties = function(a) {
- ormmaview.setOrientationProperties(a);
- };
- b.getOrientationProperties = function() {
- return o(ormmaview.getOrientationProperties())
- };
- b.setExpandProperties = function(a) {
- D(a, E, "setExpandProperties") && ormmaview.setExpandProperties(a)
- };
- b.show = function() {
- n != j.HIDDEN ? d(c.ERROR, "Ad is currently visible.", "show") : ormmaview.show()
- };
- b.playAudio = function(a, b) {
- h[i.AUDIO] ? !a || typeof a != "string" ? d(c.ERROR, "Request must specify a URL", "playAudio") : ormmaview.playAudio(a, b) : d(c.ERROR, "Method not supported by this client.", "playAudio")
- };
- b.playVideo = function(a, b) {
- h[i.VIDEO] ? !a || typeof a != "string" ? d(c.ERROR, "Request must specify a URL", "playVideo") : ormmaview.playVideo(a, b) : d(c.ERROR, "Method not supported by this client.", "playVideo")
- };
- b.createEvent = function(a, b, e) {
- b = b.replace(/^\\s+|\\s+$/g, "");
- e = e.replace(/^\\s+|\\s+$/g, "");
- h[i.CALENDAR] ? !a || typeof a != "object" || !a.getDate ? d(c.ERROR, "Valid date required.", "createEvent") : !b || typeof b != "string" || b.length == 0 ? d(c.ERROR, "Valid title required.", "createEvent") : !e || typeof e != "string" || e.length == 0 ? d(c.ERROR, "Valid body required.", "createEvent") : ormmaview.createEvent(a, b, e) : d(c.ERROR, "Method not supported by this client.", "createEvent")
- };
- b.createCalendarEvent = function(a) {
- /*
- h[i.CALENDAR] ? !a ? d(c.ERROR, "Valid date required.", "createCalendarEvent") : ormmaview.createCalendarEvent(a) : d(c.ERROR, "Method not supported by this client.", "createCalendarEvent");
- a = a.replace(/^\\s+|\\s+$/g, "");
- */
- ormmaview.createCalendarEvent(a);
- };
- b.getHeading = function() {
- h[i.HEADING] || d(c.ERROR, "Method not supported by this client.", "getHeading");
- return w
- };
- b.getKeyboardState = function() {
- h[i.LEVEL2] || d(c.ERROR, "Method not supported by this client.", "getKeyboardState");
- return x
- };
- b.getLocation = function() {
- h[i.LOCATION] || d(c.ERROR, "Method not supported by this client.", "getLocation");
- return null == q ? null : o(q)
- };
- b.getNetwork = function() {
- h[i.NETWORK] || d(c.ERROR, "Method not supported by this client.", "getNetwork");
- return s
- };
- b.getOrientation = function() {
- h[i.ORIENTATION] || d(c.ERROR, "Method not supported by this client.", "getOrientation");
- return y
- };
- b.getPlacementType = function() {
- return A
- };
- b.getScreenSize = function() {
- if (h[i.SCREEN]) return null == t ? null : o(t);
- else d(c.ERROR, "Method not supported by this client.", "getScreenSize")
- };
- b.getShakeProperties = function() {
- if (h[i.SHAKE]) return null == v ? null : o(v);
- else d(c.ERROR, "Method not supported by this client.", "getShakeProperties")
- };
- b.getTilt = function() {
- if (h[i.TILT]) return null == r ? null : o(r);
- else d(c.ERROR, "Method not supported by this client.", "getTilt")
- };
- b.getVersion = function() {
- return "2.0"
- };
- b.makeCall = function(a) {
- h[i.TEL] || h[i.PHONE] ? !a || typeof a != "string" ? d(c.ERROR, "Request must provide a number to call.", "makeCall") : ormmaview.makeCall(a) : d(c.ERROR, "Method not supported by this client.", "makeCall")
- };
- b.sendMail = function(a, b, e) {
- h[i.EMAIL] ? !a || typeof a != "string" ? d(c.ERROR, "Request must specify a recipient.", "sendMail") : ormmaview.sendMail(a, b, e) : d(c.ERROR, "Method not supported by this client.", "sendMail")
- };
- b.sendSMS = function(a, b) {
- h[i.SMS] ? !a || typeof a != "string" ? d(c.ERROR, "Request must specify a recipient.", "sendSMS") : ormmaview.sendSMS(a, b) : d(c.ERROR, "Method not supported by this client.", "sendSMS")
- };
- b.setShakeProperties = function(a) {
- h[i.SHAKE] ? D(a, F, "setShakeProperties") && (v = a, ormmaview.setShakeProperties(a)) : d(c.ERROR, "Method not supported by this client.", "setShakeProperties")
- };
- b.storePicture = function(a) {
- ormmaview.storePicture(a)
- };
- b.supports = function(a) {
- return h[a] ? !0 : !1
- };
- b.useCustomClose = function(a) {
- a === !0 || a === !1 ? ormmaview.useCustomClose(a) : d(c.ERROR, "Flag must be boolean", "useCustomClose")
- };
- b.addAsset = function(a, b) {
- !a || !b || typeof a != "string" || typeof b != "string" ? d(c.ERROR, "URL and alias are required.", "addAsset") : h[i.LEVEL3] ? ormmaview.addAsset(a, b) : a.indexOf("ormma://") == 0 ? d(c.ERROR, "Native device assets not supported by this client.", "addAsset") : (m[b] = a, d(c.ASSETREADY, b))
- };
- b.addAssets = function(a) {
- for (var c in a) b.addAsset(a[c], c)
- };
- b.getAssetURL = function(a) {
- m[a] || d(c.ERROR, "Alias unknown.", "getAssetURL");
- return m[a]
- };
- b.getCacheRemaining = function() {
- h[i.LEVEL3] || d(c.ERROR, "Method not supported by this client.", "getCacheRemaining");
- return B
- };
- b.request = function(a, b) {
- h[i.LEVEL3] ? !a || typeof a != "string" ? d(c.ERROR, "URI is required.", "request") : ormmaview.request(a, b) : d(c.ERROR, "Method not supported by this client.", "request")
- };
- b.removeAllAssets = function() {
- for (var a in m) b.removeAsset(a)
- };
- b.removeAsset = function(a) {
- !a || typeof a != "string" ? d(c.ERROR, "Alias is required.", "removeAsset") : m[a] ? h[i.LEVEL3] ? ormmaview.removeAsset(a) : (m[a] = null, delete m[a], d(c.ASSETREMOVED, a)) : d(c.ERROR, "Alias unknown.", "removeAsset")
- };
- b.getViewable = function() {
- return z
- }
- };
- window.ormma || window.init_ormma();
- window.Ormma = window.ormma;
- window.mraid = window.ormma;
- window.open = window.ormma.open;
Advertisement
Add Comment
Please, Sign In to add comment