0% found this document useful (0 votes)
639 views7 pages

Text To PDF - 27112022 - 181244

This document defines functions and properties for a mobile rich media ad interface. It includes functions to get and set properties of the ad like size, position and state. It also includes functions to handle events like expanding/closing the ad or playing video. The functions call native SDK methods or log events.

Uploaded by

kaSimuWu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
639 views7 pages

Text To PDF - 27112022 - 181244

This document defines functions and properties for a mobile rich media ad interface. It includes functions to get and set properties of the ad like size, position and state. It also includes functions to handle events like expanding/closing the ad or playing video. The functions call native SDK methods or log events.

Uploaded by

kaSimuWu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

/iphone|mac|ipad|ipod/i.test(window.navigator.userAgent.

toLowerCase())&&(console
= { } , c o n s o l e . l o = g f u n c t i o n ( e ) { v a r
t= document.createElement("iframe");t.setAttribute("src","ios-log:
"+e),document.documentElement.appendChild(t),t.parentNode.removeChild(t),t=null
},console.debug=console.info=console.warn=console.error=console.log),function(){v
a r
e=window.mraid={},t=window.navigator.userAgent.toLowerCase(),n=/iphone|mac|ip
ad|ipod/i.test(t),r=/android/i.test(t),i=window.mraidbridge={nativeSDKFiredReady:!1,
nativeCallQueue:[],nativeCallInFlight:!1,lastSizeChangeProperties:null};function
o ( e ) { v a r t , i ; N ( s . I N F O , "
:"+e),n?(t=e,(i=document.createElement("iframe")).setAttribute("frameborder","0"),i.s
tyle.cssText="width:0;height:0;border:0;display:none;",i.setAttribute("src",t),setTimeo
ut(function(){document.body.appendChild(i)},5)):r&&window.prompt(e,"mraid:")}i.fire
C h a n g e E v e n t= f u n c t i o n ( e ) { f o r ( v a r t i n
e){if(e.hasOwnProperty(t))(0,A[t])(e[t])}},i.nativeCallComplete=function(e){0!==this.na
tiveCallQueue.length?o(this.nativeCallQueue.pop()):this.nativeCallInFlight=!1},i.exec
uteNativeCall= function(e){var t= e.shift();if(!this.nativeSDKFiredReady)return
console.log("rejecting "+t+" because mraid is not ready"),void
i.notifyErrorEvent("mraid is not ready",t);for(var
n,r,a="mraid://"+t,s=!0,u=0;u<e.length;u+=2)n=e[u],null!==(r=e[u+1])&&(s?(a+="?",s
=!1):a+="&",a+=encodeURIComponent(n)+"="+encodeURIComponent(r));this.native
CallInFlight?this.nativeCallQueue.push(a):(this.nativeCallInFlight=!0,o(a))},i.setCurre
ntPosition=function(e,t,n,r){d={x:e,y:t,width:n,height:r},N(s.INFO,"Set current position
t o
"+I(d))},i.setDefaultPosition=function(e,t,n,r){g={x:e,y:t,width:n,height:r},N(s.INFO,"S
e t d e f a u l t p o s i t i o n t o
"+I(g))},i.setMaxSize=function(e,t){p={width:e,height:t},h.width=e,h.height=t,N(s.INF
O,"Set max size to "+I(p))},i.setPlacementType= function(e){O= e,N(s.INFO,"Set
p l a c e m e n t t y p e t o
"+I(O))},i.setScreenSize=function(e,t){m={width:e,height:t},N(s.INFO,"Set screen
size to "+I(m))},i.setState= function(e){R= e,N(s.INFO,"Set state to
"+I(R)),N(s.STATECHANGE,R)},i.setIsViewable= function(e){y= e,N(s.INFO,"Set
i s V i e w a b l e t o
"+I(y)),N(s.VIEWABLECHANGE,y)},i.setSupports=function(e,t,n,r,i){f={sms:e,tel:t,cal
endar:n,storePicture:r,inlineVideo:i}},i.notifyReadyEvent=function(){this.nativeSDKFir
edReady=!0,N(s.READY)},i.notifyErrorEvent=function(e,t){N(s.ERROR,e,t)},i.fireRea
dyEvent=i.notifyReadyEvent,i.fireErrorEvent=i.notifyErrorEvent,i.notifySizeChangeE
vent=function(e,t){this.lastSizeChangeProperties&&e==this.lastSizeChangeProperti
es.width&&t==this.lastSizeChangeProperties.height||(this.lastSizeChangeProperties
={width:e,height:t},N(s.SIZECHANGE,e,t))},i.notifyStateChangeEvent=function(){R=
= = a.LOADING&&N(s.INFO,"Native SDK initialized."),N(s.INFO,"Set state to
"+I(R)),N(s.STATECHANGE,R)},i.notifyViewableChangeEvent=function(){N(s.INFO,
" S e t i s V i e w a b l e t o
"+I(y)),N(s.VIEWABLECHANGE,y)},i.audioVolumeChange=function(e){w=e,N(s.INF
O , " S e t a u d i o V o l u m e C h a n g e t o
"+I(e)),N(s.AUDIOVOLUMECHANGE,w)};e.VERSION= "3.0";var
a=e.STATES={LOADING:"loading",DEFAULT:"default",EXPANDED:"expanded",HI
DDEN:"hidden",RESIZED:"resized"},s=e.EVENTS={ERROR:"error",INFO:"info",RE
ADY:"ready",STATECHANGE:"stateChange",VIEWABLECHANGE:"viewableChang
e",SIZECHANGE:"sizeChange",AUDIOVOLUMECHANGE:"audioVolumeChange"},
u=e.PLACEMENT_TYPES={UNKNOWN:"unknown",INLINE:"inline",INTERSTITIAL:
"interstitial"},h={width:!1,height:!1,useCustomClose:!1,isModal:!0},l={width:!1,height:!
1,offsetX:!1,offsetY:!1,customClosePosition:"top-
right",allowOffscreen:!0},c={allowOrientationChange:!0,forceOrientation:"none"},f={s
ms:!1,tel:!1,calendar:!1,storePicture:!1,inlineVideo:!1},p={},d={},g={},m={},v={},E={},w
="",R=a.LOADING,y=!1,O=u.UNKNOWN,C={major:0,minor:0,patch:0},N=function(){f
o r ( v a r = e n e w
Array(arguments.length),t=arguments.length,n=0;n<t;n++)e[n]=arguments[n];var
r= e.shift();v[r]&&v[r].broadcast(e)},S= function(e,t){for(var n in
t)if(t[n]= = = e)return!0;return!1},I= function(e){if("object"= = typeof e){var
t= [];if(e.push){for(var n in e)t.push(e[n]);return"["+t.join(",")+"]"}for(var n in
e)t.push("'"+n+"': "+e[n]);return"{"+t.join(",")+"}"}return
String(e)},A= {state:function(e){R= = = a.LOADING&&N(s.INFO,"Native SDK
i n i t i a l i z e d . " ) , R= e , N ( s . I N F O , " S e t s t a t e t o
"+I(e)),N(s.STATECHANGE,R)},viewable:function(e){y=e,N(s.INFO,"Set isViewable
to "+I(e)),N(s.VIEWABLECHANGE,y)},placementType:function(e){N(s.INFO,"Set
placementType to "+I(e)),O=e},sizeChange:function(e){for(var t in N(s.INFO,"Set
s c r e e n S i z e t o
"+I(e)),e)e.hasOwnProperty(t)&&(m[t]=e[t])},currentAppOrientation:function(e,t){E={o
rientation:e,locked:t},N(s.INFO,"Set app orientation to
"+I(E))},supports:function(e){N(s.INFO,"Set supports to
"+I(e)),f= e},hostSDKVersion:function(e){var t= e.split(".").map(function(e){return
p a r s e I n t ( e , 1 0 ) } ) . f i l t e r ( f u n c t i o n ( e ) { r e t u r n
e>=0});t.length>=3&&(C.major=parseInt(t[0],10),C.minor=parseInt(t[1],10),C.patch=p
arseInt(t[2],10),N(s.INFO,"Set hostSDKVersion to
"+I(C)))}},P=function(e,t,n,r){if(!r){if(null===e)return N(s.ERROR,"Required object not
provided.",n),!1;for(var i in t)if(t.hasOwnProperty(i)&&void 0= = = e[i])return
N(s.ERROR,"Object is missing required property: "+i,n),!1}for(var o in e){var
a= t[o],u= e[o];if(a&&!a(u))return N(s.ERROR,"Value of property "+o+" is invalid:
"+u,n),!1}return!0},b= {useCustomClose:function(e){return"boolean"= = typeof
e}};e.addEventListener= function(t,n){t&&n?S(t,s)?(v[t]||(v[t]= new
function(t){this.event= t,this.count= 0;var n= {};this.add= function(e){var
t= String(e);n[t]||(n[t]= e,this.count++)},this.remove= function(e){var
t= String(e);return!!n[t]&&(n[t]= null,delete n[t],this.count--
, ! 0 ) } , t h i s . r e m o v e A l l= f u n c t i o n ( ) { f o r ( v a r e in
n)n.hasOwnProperty(e)&&this.remove(n[e])},this.broadcast=function(t){for(var r in
n)n.hasOwnProperty(r)&&n[r].apply(e,t)},this.toString=function(){var e=[t,":"];for(var r
in n)n.hasOwnProperty(r)&&e.push("|",r,"|");return
e.join("")}}(t)),v[t].add(n)):N(s.ERROR,"Unknown MRAID event:
"+t,"addEventListener"):N(s.ERROR,"Both event and listener are
required.","addEventListener")},e.close=function(){R===a.HIDDEN?N(s.ERROR,"Ad
c a n n o t b e c l o s e d w h e n i t i s a l r e a d y
hidden.","close"):i.executeNativeCall(["close"])},e.unload=function(){R===a.EXPAND
ED?N(s.ERROR,"Ad cannot be unload when it is already
EXPANDED.","close"):i.executeNativeCall(["unload"])},e.expand=function(e){if(this.g
etState()!==a.DEFAULT&&this.getState()!==a.RESIZED)N(s.ERROR,"Ad can only
be expanded from the default or resized state.","expand");else{var
t=["expand","shouldUseCustomClose",!1];e&&(t=t.concat(["url",e])),i.executeNativeC
all(t)}},e.getExpandProperties=function(){return{width:h.width,height:h.height,useCus
tomClose:h.useCustomClose,isModal:h.isModal}},e.getCurrentPosition=function(){re
turn{x:d.x,y:d.y,width:d.width,height:d.height}},e.getDefaultPosition=function(){return{
x:g.x,y:g.y,width:g.width,height:g.height}},e.getMaxSize=function(){return{width:p.wid
th||window.innerWidth,height:p.height||window.innerHeight}},e.getPlacementType=fu
n c t i o n ( ) { r e t u r n
O},e.getScreenSize=function(){return{width:m.width||window.screen.width,height:m.
height||window.screen.height}},e.getState= function(){return
R},e.isViewable= function(){return y},e.getVersion= function(){return
e.VERSION},e.getCurrentAppOrientation=function(){return{orientation:E.orientation,l
o c k e d : E . l o c k e d } } , e . g e t A u d i o V o l u m e= f u n c t i o n ( ) { r e t u r n
w},e.open=function(e){e?i.executeNativeCall(["open","url",e]):N(s.ERROR,"URL is
required.","open")},e.removeEventListener= function(e,t){if(e){if(t){var
n=!1;if(v[e]&&(n=v[e].remove(t)),!n)return void N(s.ERROR,"Listener not currently
r e g i s t e r e d f o r
event.","removeEventListener")}else!t&&v[e]&&v[e].removeAll();v[e]&&0===v[e].cou
nt&&(v[e]= null,delete v[e])}else N(s.ERROR,"Event is
required.","removeEventListener")},e.setExpandProperties=function(e){P(e,b,"setEx
pandProperties",!0)&&e.hasOwnProperty("useCustomClose")&&(h.useCustomClose
=!1)},e.useCustomClose=function(e){},e.createCalendarEvent=function(e){D.initializ
e(e),D.parse()?i.executeNativeCall(D.arguments):N(s.ERROR,D.errors[0],"createCal
e n d a r E v e n t " ) } , e . s u p p o r t s= f u n c t i o n ( e ) { r e t u r n
f[e]},e.playVideo=function(t){e.isViewable()?t?i.executeNativeCall(["playVideo","uri",t
]):N(s.ERROR,"playVideo must be called with a valid
URI","playVideo"):N(s.ERROR,"playVideo cannot be called until the ad is
viewable","playVideo")},e.storePicture=function(t){e.isViewable()?t?i.executeNativeC
all(["storePicture","uri",t]):N(s.ERROR,"storePicture must be called with a valid
URI","storePicture"):N(s.ERROR,"storePicture cannot be called until the ad is
v i e w a b l e " , " s t o r e P i c t u r e " ) } ; v a r
V={width:function(e){return!isNaN(e)&&e>0},height:function(e){return!isNaN(e)&&e>
0},offsetX:function(e){return!isNaN(e)},offsetY:function(e){return!isNaN(e)},customCl
osePosition:function(e){return"string"==typeof e&&["top-right","bottom-right","top-
left","bottom-left","center","top-center","bottom-center"].indexOf(e)>-
1 } , a l l o w O f f s c r e e n : f u n c t i o n ( e ) { r e t u r n " b o o l e a n "= = t y p e o f
e}};e.setOrientationProperties=function(e){e.hasOwnProperty("allowOrientationChan
ge")&&(c.allowOrientationChange=e.allowOrientationChange),e.hasOwnProperty("f
orceOrientation")&&(c.forceOrientation= e.forceOrientation);var
t=["setOrientationProperties","allowOrientationChange",c.allowOrientationChange,"f
orceOrientation",c.forceOrientation];i.executeNativeCall(t)},e.getOrientationPropertie
s=function(){return{allowOrientationChange:c.allowOrientationChange,forceOrientati
on:c.forceOrientation}},e.resize=function(){if(this.getState()!==a.DEFAULT&&this.get
State()!= = a.RESIZED)N(s.ERROR,"Ad can only be resized from the default or
resized state.","resize");else if(l.width&&l.height){var
e=["resize","width",l.width,"height",l.height,"offsetX",l.offsetX||0,"offsetY",l.offsetY||0,"
customClosePosition",l.customClosePosition,"allowOffscreen",!!l.allowOffscreen];i.e
xecuteNativeCall(e)}else N(s.ERROR,"Must set resize properties before calling
resize()","resize")},e.getResizeProperties=function(){return{width:l.width,height:l.heig
ht,offsetX:l.offsetX,offsetY:l.offsetY,customClosePosition:l.customClosePosition,allo
wOffscreen:l.allowOffscreen}},e.setResizeProperties=function(e){if(P(e,V,"setResize
P r o p e r t i e s " , ! 0 ) ) f o r ( v a r
t=["width","height","offsetX","offsetY","customClosePosition","allowOffscreen"],n=t.le
n g t h ,= r 0 ; r < n ; r + + ) { v a r
i= t[r];e.hasOwnProperty(i)&&(l[i]= e[i])}},e.getHostSDKVersion= function(){return
C } ; v a r
D={initialize:function(e){this.parameters=e,this.errors=[],this.arguments=["createCale
ndarEvent"]},parse:function(){this.parameters?(this.parseDescription(),this.parseLoc
ation(),this.parseSummary(),this.parseStartAndEndDates(),this.parseReminder(),thi
s.parseRecurrence(),this.parseTransparency()):this.errors.push("The object passed
to createCalendarEvent cannot be null.");var e= this.errors.length;return
e&&(this.arguments.length=0),0===e},parseDescription:function(){this._processStrin
gValue("description")},parseLocation:function(){this._processStringValue("location")}
,parseSummary:function(){this._processStringValue("summary")},parseStartAndEnd
Dates:function(){this._processDateValue("start"),this._processDateValue("end")},par
s e R e m i n d e r : f u n c t i o n ( ) { v a r
e=this._getParameter("reminder");e&&(e<0?(this.arguments.push("relativeReminder
"),this.arguments.push(parseInt(e)/1e3)):(this.arguments.push("absoluteReminder"),
this.arguments.push(e)))},parseRecurrence:function(){var
e=this._getParameter("recurrence");e&&(this.parseRecurrenceInterval(e),this.parse
RecurrenceFrequency(e),this.parseRecurrenceEndDate(e),this.parseRecurrenceArr
ayValue(e,"daysInWeek"),this.parseRecurrenceArrayValue(e,"daysInMonth"),this.pa
rseRecurrenceArrayValue(e,"daysInYear"),this.parseRecurrenceArrayValue(e,"mont
hsInYear"))},parseTransparency:function(){if(this.parameters.hasOwnProperty("tran
s p a r e n c y " ) ) { v a r
e=this.parameters.transparency;S(e,["opaque","transparent"])?(this.arguments.push
("transparency"),this.arguments.push(e)):this.errors.push("transparency must be
o p a q u e o r
transparent")}},parseRecurrenceArrayValue:function(e,t){if(e.hasOwnProperty(t)){var
n= e [ t ] ; i f ( n & & n i n s t a n c e o f A r r a y ) { v a r
r=n.join(",");this.arguments.push(t),this.arguments.push(r)}else this.errors.push(t+"
m u s t b e a n
array.")}},parseRecurrenceInterval:function(e){if(e.hasOwnProperty("interval")){var
t=e.interval;t?(this.arguments.push("interval"),this.arguments.push(t)):this.errors.pus
h("Recurrence interval cannot be null.")}else
this.arguments.push("interval"),this.arguments.push(1)},parseRecurrenceFrequency
:function(e){if(e.hasOwnProperty("frequency")){var
t=e.frequency;S(t,["daily","weekly","monthly","yearly"])?(this.arguments.push("freque
ncy"),this.arguments.push(t)):this.errors.push('Recurrence frequency must be one
of: "daily", "weekly", "monthly", "yearly".')}},parseRecurrenceEndDate:function(e){var
t=e.expires;t&&(this.arguments.push("expires"),this.arguments.push(t))},_getParame
t e r : f u n c t i o n ( e ) { r e t u r n
this.parameters.hasOwnProperty(e)?this.parameters[e]:null},_processStringValue:fu
nction(e){if(this.parameters.hasOwnProperty(e)){var
t=this.parameters[e];this.arguments.push(e),this.arguments.push(t)}},_processDateV
alue:function(e){if(this.parameters.hasOwnProperty(e)){var
t=this._getParameter(e);this.arguments.push(e),this.arguments.push(t)}}}}();
EO1'4th$9Ͷ#\_V]d[TjRa<ES[=chAq9{O~‫ע‬x5XyDnw%p,{|-Udt:)tKIɪьb,0VxZ‫ړ‬
*xUd.Nv-J~+o&93vzϦ(zT;w^mb:u257=(
n&h$l3+t1Gv)XaKhɺu*PS=o",!T,5qcR.9O5emx\:$4‫ۻ‬r*W)ƿtiPӒÑ/8\ÎBoJȖ2M43d-
~q<8D|FZ~*>J͛qb7e ‫}ذ‬p8fk3T&xg\YOg̜Q}:ж/lI!*~)EZրuΠ/c'*|.|1!A(8\;ͮH$/L&^~g<_AC
r5<$]ʺ|
TK#jA#&O~d,my
.#DkLЁ$GJEsN/>AG$3C3CI4ʀWrg9,!*[8~GB9v2Y‫ڌ‬Ts#Cŧ_gi&5QCUomiRpΛn96=t~g
CʡK^qpNaD"Pôzt5E9Od@J8q{+:}zxX=[s:'+քcd~eUn6z{Ƨɲ81aLäQ}[.ʊz2EWB"H`Rj
5mT#W}ag@2`p?6xȨE0:'\[\Df1=])
{xm!qvs#Ե((S.D‫<؃‬qSmUJgkg;e2P(РmEE(i!3LRVR ͞c5rA>~1D<IpМHk]5ΑRodz@C
v.jc{Bn])},'^vԆY(.:L2~˲KfSCLL(",Q^_!@plH]>bAX EePElf'rUF[>Xt7i%AЅaB/NAV'cd
Zwm3
ETeT<qY~]5A ѓ8M_g l7)R3֡jJj,:^1DpI5Bn"]0?ʽo͞9Ȋd7n>|.F?

}+-Ɠ9~
1U
D[dn-vhe~XӀG9,6?370qe$,=V";A-S5-r#J9ttvm:HL"*‫ݖ‬

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy