Best JavaScript code snippet using playwright-internal
marker.js
Source:marker.js
...18// //event.target.setOpacity(1);19// point.setOpacity(1);20// }21var LotA = L.circleMarker([33.88739670088401, -117.88914531469347], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {22 LotA.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {23 LotA.setStyle({ opacity: 0 });24 })25});26var LotS = L.circleMarker([33.888228886602846, -117.88657844066621], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {27 LotS.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {28 LotS.setStyle({ opacity: 0 });29 })30});31/*32To Do:33-Need to set all of these area VARS to empty ones34-Map to hold all the long/lat coordinates and associate with the area VARS35-Iterate through to add the circleMarker properties and .addTo(map) to each one36 -This will resolve not having to manually add the properties one by one37*/38var LotG = L.circleMarker([33.88489786727004, -117.88873493671419], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {39 LotG.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {40 LotG.setStyle({ opacity: 0 });41 })42});43var TitanStadium = L.circleMarker([33.88667917748236, -117.88701295852663], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {44 TitanStadium.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {45 TitanStadium.setStyle({ opacity: 0 });46 })47});48var GoodwinField = L.circleMarker([33.88674152265657, -117.88546800613405], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {49 GoodwinField.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {50 GoodwinField.setStyle({ opacity: 0 });51 })52});53var AndersonField = L.circleMarker([33.88598948108825, -117.8851354122162], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {54 AndersonField.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {55 AndersonField.setStyle({ opacity: 0 });56 })57});58var TrackField = L.circleMarker([33.88515616006058, -117.8862512111664], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {59 TrackField.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {60 TrackField.setStyle({ opacity: 0 });61 })62});63var LotD = L.circleMarker([33.884122985837244, -117.8878176212311], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {64 LotD.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {65 LotD.setStyle({ opacity: 0 });66 })67});68// var TennisCt = L.circleMarker([33.884122985837244, -117.8878176212311], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {69// LotS.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {70// LotS.setStyle({ opacity: 0 });71// })72// });73var StateParking = L.circleMarker([33.88307198598094, -117.88857936859132], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {74 StateParking.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {75 StateParking.setStyle({ opacity: 0 });76 })77});78var StudentRec = L.circleMarker([33.88312542723584, -117.88763523101808], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {79 StudentRec.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {80 StudentRec.setStyle({ opacity: 0 });81 })82});83var LotR = L.circleMarker([33.88243570170432, -117.88880467414857], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {84 LotR.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {85 LotR.setStyle({ opacity: 0 });86 })87});88var UnivPolice = L.circleMarker([33.88304136900779, -117.88939476029556], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {89 UnivPolice.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {90 UnivPolice.setStyle({ opacity: 0 });91 })92});93var Golleher = L.circleMarker([33.88167861214047, -117.88944840447586], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {94 Golleher.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {95 Golleher.setStyle({ opacity: 0 });96 })97});98var TitanGym = L.circleMarker([33.88305472926149, -117.886412143871], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {99 TitanGym.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {100 TitanGym.setStyle({ opacity: 0 });101 })102});103var Kinesiology = L.circleMarker([33.882694001677216, -117.8859078885762], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {104 Kinesiology.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {105 Kinesiology.setStyle({ opacity: 0 });106 })107});108var TitanUnion = L.circleMarker([33.88177157868061, -117.88864374160768], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {109 TitanUnion.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {110 TitanUnion.setStyle({ opacity: 0 });111 })112});113var Bookstore = L.circleMarker([33.88182502047821, -117.88684129714967], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {114 Bookstore.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {115 Bookstore.setStyle({ opacity: 0 });116 })117});118var VisualArt = L.circleMarker([33.88039098730793, -117.88849353790285], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {119 VisualArt.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {120 VisualArt.setStyle({ opacity: 0 });121 })122});123var StudentHealth = L.circleMarker([33.88299683481367, -117.88429856300355], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {124 StudentHealth.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {125 StudentHealth.setStyle({ opacity: 0 });126 })127});128var PollakLibrary = L.circleMarker([33.88142420618036, -117.88534998893739], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {129 PollakLibrary.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {130 PollackLibrary.setStyle({ opacity: 0 });131 })132});133var EducationClassroom = L.circleMarker([33.881352950108074, -117.8842878341675], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {134 EducationClassroom.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {135 EducationClassroom.setStyle({ opacity: 0 });136 })137});138var McCarthy = L.circleMarker([33.87966060090187, -117.8854787349701], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {139 McCarthy.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {140 McCarthy.setStyle({ opacity: 0 });141 })142});143var Clayes = L.circleMarker([33.880569129385435, -117.88666963577272], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {144 Clayes.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {145 Clayes.setStyle({ opacity: 0 });146 })147});148var Nutwood = L.circleMarker([33.879015383929314, -117.888520359993], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {149 Nutwood.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {150 Nutwood.setStyle({ opacity: 0 });151 })152});153var LotC = L.circleMarker([33.878324512029835, -117.88885831832887], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {154 LotC.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {155 LotC.setStyle({ opacity: 0 });156 })157});158var LotCE = L.circleMarker([33.87857391687398, -117.88717389106752], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {159 LotCE.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {160 LotCE.setStyle({ opacity: 0 });161 })162});163var DBH = L.circleMarker([33.87909053887517, -117.88583278656007], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {164 DBH.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {165 DBH.setStyle({ opacity: 0 });166 })167});168var Langsdorg = L.circleMarker([33.87901037359725, -117.88448095321657], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {169 Langsdorg.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {170 Langsdorg.setStyle({ opacity: 0 });171 })172});173var Gordon = L.circleMarker([33.87961606494317, -117.88416981697083], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {174 Gordon.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {175 Gordon.setStyle({ opacity: 0 });176 })177});178var Humanities = L.circleMarker([33.88040880153244, -117.88415908813478], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {179 Humanities.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {180 Humanities.setStyle({ opacity: 0 });181 })182});183var TitanHouse = L.circleMarker([33.88382962039666, -117.88415908813478], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {184 TitanHouse.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {185 TitanHouse.setStyle({ opacity: 0 });186 })187});188var CollegeParkWest = L.circleMarker([33.88122435501452, -117.89058029651643], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {189 CollegeParkWest.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {190 CollegeParkWest.setStyle({ opacity: 0 });191 })192});193var Mihaylo = L.circleMarker([33.879072724375476, -117.88348317146301], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {194 Mihaylo.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {195 Mihaylo.setStyle({ opacity: 0 });196 })197});198var LotF = L.circleMarker([33.88019503059313, -117.8830111026764], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {199 LotF.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {200 LotF.setStyle({ opacity: 0 });201 })202});203var LotI = L.circleMarker([33.881513276187036, -117.88304328918458], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {204 LotI.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {205 LotI.setStyle({ opacity: 0 });206 })207});208var EastsideParking1 = L.circleMarker([33.88032863749295, -117.88177728652956], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {209 EastsideParking1.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {210 EastsideParking1.setStyle({ opacity: 0 });211 })212});213var EastsideParking2 = L.circleMarker([33.8812549729115, -117.88164854049684], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {214 EastsideParking2.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {215 EastsideParking2.setStyle({ opacity: 0 });216 })217});218var EngineeringNW = L.circleMarker([33.88270290854949, -117.88323640823366], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {219 EngineeringNW.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {220 EngineeringNW.setStyle({ opacity: 0 });221 })222});223var Engineering = L.circleMarker([33.882324365656906, -117.88324177265169], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {224 Engineering.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {225 Engineering.setStyle({ opacity: 0 });226 })227});228var EngineeringSW = L.circleMarker([33.88195027456017, -117.88324177265169], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {229 EngineeringSW.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {230 EngineeringSW.setStyle({ opacity: 0 });231 })232});233var EngineeringSE = L.circleMarker([33.8819591815101, -117.88268923759462], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {234 EngineeringSE.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {235 EngineeringSE.setStyle({ opacity: 0 });236 })237});238var CS = L.circleMarker([33.88231100528884, -117.88264095783235], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {239 CS.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {240 CS.setStyle({ opacity: 0 });241 })242});243var EngineeringNE = L.circleMarker([33.8826717344924, -117.88273215293886], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {244 EngineeringNE.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {245 EngineeringNE.setStyle({ opacity: 0 });246 })247});248var RubyGerontology = L.circleMarker([33.88327739984853, -117.88324713706972], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {249 RubyGerontology.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {250 RubyGerontology.setStyle({ opacity: 0 });251 })252});253var LotH = L.circleMarker([33.88389196765335, -117.88363873958588], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {254 LotH.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {255 LotH.setStyle({ opacity: 0 });256 })257});258var LotJ = L.circleMarker([33.884301677063824, -117.88288772106172], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {259 LotJ.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {260 LotJ.setStyle({ opacity: 0 });261 })262});263var Gastronome = L.circleMarker([33.88314825097883, -117.88232982158662], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {264 Gastronome.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {265 Gastronome.setStyle({ opacity: 0 });266 })267});268var PineHall = L.circleMarker([33.88359359108361, -117.88278043270113], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {269 PineHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {270 PineHall.setStyle({ opacity: 0 });271 })272});273var GreenhouseComplex = L.circleMarker([33.879451838394594, -117.88695931434631], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {274 GreenhouseComplex.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {275 GreenhouseComplex.setStyle({ opacity: 0 });276 })277});278var HollyHall = L.circleMarker([33.88385188727928, -117.88163244724275], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {279 HollyHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {280 HollyHall.setStyle({ opacity: 0 });281 })282});283var JuniperHall = L.circleMarker([33.88412799614093, -117.88234591484071], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {284 JuniperHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {285 JuniperHall.setStyle({ opacity: 0 });286 })287});288var ResidentHallParking = L.circleMarker([33.88429722371123, -117.88131058216096], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {289 ResidentHallParking.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {290 ResidentHallParking.setStyle({ opacity: 0 });291 })292});293var FigHall = L.circleMarker([33.88449317100487, -117.88165390491487], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {294 FigHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {295 FigHall.setStyle({ opacity: 0 });296 })297});298var AcaciaHall = L.circleMarker([33.88458223780776, -117.88253366947175], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {299 AcaciaHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {300 AcaciaHall.setStyle({ opacity: 0 });301 })302});303var MazanitaHall = L.circleMarker([33.88504093037007, -117.88263559341432], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {304 MazanitaHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {305 MazanitaHall.setStyle({ opacity: 0 });306 })307});308var OakHall = L.circleMarker([33.88506765024913, -117.8821635246277], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {309 OakHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {310 OakHall.setStyle({ opacity: 0 });311 })312});313var WillowHall = L.circleMarker([33.885415007915526, -117.88243174552917], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {314 WillowHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {315 WillowHall.setStyle({ opacity: 0 });316 })317});318var ElmHall = L.circleMarker([33.88513890321907, -117.8816592693329], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {319 ElmHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {320 ElmHall.setStyle({ opacity: 0 });321 })322});323var CypressHall = L.circleMarker([33.8857668174437, -117.88237273693086], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {324 CypressHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {325 CypressHall.setStyle({ opacity: 0 });326 })327});328var SycamoreValencia = L.circleMarker([33.886074092933264, -117.88169682025911], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {329 SycamoreValencia.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {330 SycamoreValencia.setStyle({ opacity: 0 });331 })332});333var EnvironmentalHealth = L.circleMarker([33.88504928033317, -117.88942694664001], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {334 EnvironmentalHealth.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {335 EnvironmentalHealth.setStyle({ opacity: 0 });336 })337});338var ArboretumMuseum = L.circleMarker([33.8881487296391, -117.8841269016266], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {339 ArboretumMuseum.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {340 ArboretumMuseum.setStyle({ opacity: 0 });341 })342});343var FullertonArboretumParking = L.circleMarker([33.88802459849032, -117.88519442081453], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {344 FullertonArboretumParking.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {345 FullertonArboretumParking.setStyle({ opacity: 0 });346 })347});348var BirchHall = L.circleMarker([33.884542157757956, -117.88215011358264], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {349 BirchHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {350 BirchHall.setStyle({ opacity: 0 });351 })352});353var TitanHall = L.circleMarker([33.880872526755084, -117.89009749889375], { opacity: 0.0, radius: 50 }).addTo(map).on('mouseover', function (e) {354 TitanHall.setStyle({ opacity: 1.0 }).on('mouseout', function (e) {355 TitanHall.setStyle({ opacity: 0 });356 })357});358// L.marker([33.88489786727004, -117.88873493671419]).addTo(map)359// var TitanStadium = L.marker([33.88667917748236, -117.88701295852663]).addTo(map)360// var GoodwinField = L.marker([33.88674152265657, -117.88546800613405]).addTo(map)361// var AndersonField = L.marker([33.88598948108825, -117.8851354122162]).addTo(map)362// var TrackField = L.marker([33.88515616006058, -117.8862512111664]).addTo(map)363// var LotD = L.marker([33.884122985837244, -117.8878176212311]).addTo(map)364// var TennisCt = L.marker([33.884122985837244, -117.8878176212311]).addTo(map)365// var StateParking = L.marker([33.88307198598094, -117.88857936859132]).addTo(map)366// var StudentRec = L.marker([33.88312542723584, -117.88763523101808]).addTo(map)367// var LotR = L.marker([33.88243570170432, -117.88880467414857]).addTo(map)368// var UnivPolice = L.marker([33.88304136900779, -117.88939476029556]).addTo(map)369// var Golleher = L.marker([33.88167861214047, -117.88944840447586]).addTo(map)...
radio_presentation.js
Source:radio_presentation.js
...94 volumeAnguloAtual = 360;95 }96 volumeAudio = (volumeAnguloAtual - 180) / 180;97 setVolume(volumeAudio);98 Y.one(volumeRotElement).setStyle(99 "MozTransform",100 "rotate(" + volumeAnguloAtual + "deg)"101 );102 Y.one(volumeRotElement).setStyle(103 "webkitTransform",104 "rotate(" + volumeAnguloAtual + "deg)"105 );106 Y.one(volumeRotElement).setStyle(107 "transform",108 "rotate(" + volumeAnguloAtual + "deg)"109 );110 }111 });*/112 volume.on("click", function() {113 var pointerLeft = pointer.getStyle('left');114 pointerLeft = pointerLeft.substring(0, pointerLeft.length - 2);115 if(pointerLeft <= 8.33*26) {116 pointer.setStyle("left", parseFloat(pointerLeft)+/*25*/8.33);117 } else {118 pointer.setStyle("left", 0);119 }120 pointerLeft = pointer.getStyle('left');121 pointerLeft = pointerLeft.substring(0, pointerLeft.length - 2);122 if (parseFloat(pointerLeft) == 0) {123 Y.one(speaker).setStyle(124 "background",125 "url('../media/weave.jpg')"126 );127 }128 switch(parseFloat(pointerLeft)) {129 case parseFloat((8.33*1).toFixed(2)):130 Y.one(speaker).setStyle(131 "background",132 "url('../media/transmissio_1.jpg') no-repeat center"133 );134 Y.one(speaker).setStyle("backgroundSize", "100% 100%");135 break;136 case parseFloat((8.33*2).toFixed(2)):137 Y.one(speaker).setStyle(138 "background",139 "url('../media/transmissio_2.jpg') no-repeat center"140 );141 Y.one(speaker).setStyle("backgroundSize", "100% 100%");142 break;143 case parseFloat((8.33*3).toFixed(2)):144 Y.one(speaker).setStyle(145 "background",146 "url('../media/transmissio_3.jpg') no-repeat center"147 );148 Y.one(speaker).setStyle("backgroundSize", "100% 100%");149 break;150 case parseFloat((8.33*4).toFixed(2)):151 Y.one(speaker).setStyle(152 "background",153 "url('../media/transmissio_4.jpg') no-repeat center"154 );155 Y.one(speaker).setStyle("backgroundSize", "100% 100%");156 break;157 case parseFloat((8.33*5).toFixed(2)):158 Y.one(speaker).setStyle(159 "background",160 "url('../media/transmissio_5.jpg') no-repeat center"161 );162 Y.one(speaker).setStyle("backgroundSize", "100% 100%");163 break;164 case parseFloat((8.33*6).toFixed(2)):165 Y.one(speaker).setStyle(166 "background",167 "url('../media/transmissio_6.jpg') no-repeat center"168 );169 Y.one(speaker).setStyle("backgroundSize", "100% 100%");170 break;171 case parseFloat((8.33*7).toFixed(2)):172 Y.one(speaker).setStyle(173 "background",174 "url('../media/transmissio_7.jpg') no-repeat center"175 );176 Y.one(speaker).setStyle("backgroundSize", "100% 100%");177 break;178 case parseFloat((8.33*8).toFixed(2)):179 Y.one(speaker).setStyle(180 "background",181 "url('../media/transmissio_8.jpg') no-repeat center"182 );183 Y.one(speaker).setStyle("backgroundSize", "100% 100%");184 break;185 case parseFloat((8.33*9).toFixed(2)):186 Y.one(speaker).setStyle(187 "background",188 "url('../media/transmissio_9.jpg') no-repeat center"189 );190 Y.one(speaker).setStyle("backgroundSize", "100% 100%");191 break;192 case parseFloat((8.33*10).toFixed(2)):193 Y.one(speaker).setStyle(194 "background",195 "url('../media/transmissio_10.jpg') no-repeat center"196 );197 Y.one(speaker).setStyle("backgroundSize", "100% 100%");198 break;199 case parseFloat((8.33*11).toFixed(2)):200 Y.one(speaker).setStyle(201 "background",202 "url('../media/transmissio_11.jpg') no-repeat center"203 );204 Y.one(speaker).setStyle("backgroundSize", "100% 100%");205 break;206 case parseFloat((8.33*12).toFixed(2)):207 Y.one(speaker).setStyle(208 "background",209 "url('../media/transmissio_12.jpg') no-repeat center"210 );211 Y.one(speaker).setStyle("backgroundSize", "100% 100%");212 break;213 case parseFloat((8.33*13).toFixed(2)):214 Y.one(speaker).setStyle(215 "background",216 "url('../media/transmissio_13.jpg') no-repeat center"217 );218 Y.one(speaker).setStyle("backgroundSize", "100% 100%");219 break;220 case parseFloat((8.33*14).toFixed(2)):221 Y.one(speaker).setStyle(222 "background",223 "url('../media/transmissio_14.jpg') no-repeat center"224 );225 Y.one(speaker).setStyle("backgroundSize", "100% 100%");226 break;227 case parseFloat((8.33*15).toFixed(2)):228 Y.one(speaker).setStyle(229 "background",230 "url('../media/recepcio_1.jpg') no-repeat center"231 );232 Y.one(speaker).setStyle("backgroundSize", "100% 100%");233 break;234 case parseFloat((8.33*16).toFixed(2)):235 Y.one(speaker).setStyle(236 "background",237 "url('../media/recepcio_2.jpg') no-repeat center"238 );239 Y.one(speaker).setStyle("backgroundSize", "100% 100%");240 break;241 case parseFloat((8.33*17).toFixed(2)):242 Y.one(speaker).setStyle(243 "background",244 "url('../media/recepcio_3.jpg') no-repeat center"245 );246 Y.one(speaker).setStyle("backgroundSize", "100% 100%");247 break;248 case parseFloat((8.33*18).toFixed(2)):249 Y.one(speaker).setStyle(250 "background",251 "url('../media/recepcio_4.jpg') no-repeat center"252 );253 Y.one(speaker).setStyle("backgroundSize", "100% 100%");254 break;255 case parseFloat((8.33*19).toFixed(2)):256 Y.one(speaker).setStyle(257 "background",258 "url('../media/recepcio_5.jpg') no-repeat center"259 );260 Y.one(speaker).setStyle("backgroundSize", "100% 100%");261 break;262 case parseFloat((8.33*20).toFixed(2)):263 Y.one(speaker).setStyle(264 "background",265 "url('../media/recepcio_6.jpg') no-repeat center"266 );267 Y.one(speaker).setStyle("backgroundSize", "100% 100%");268 break;269 case parseFloat((8.33*21).toFixed(2)):270 Y.one(speaker).setStyle(271 "background",272 "url('../media/recepcio_7.jpg') no-repeat center"273 );274 Y.one(speaker).setStyle("backgroundSize", "100% 100%");275 break;276 case parseFloat((8.33*22).toFixed(2)):277 Y.one(speaker).setStyle(278 "background",279 "url('../media/recepcio_8.jpg') no-repeat center"280 );281 Y.one(speaker).setStyle("backgroundSize", "100% 100%");282 break;283 case parseFloat((8.33*23).toFixed(2)):284 Y.one(speaker).setStyle(285 "background",286 "url('../media/recepcio_9.jpg') no-repeat center"287 );288 Y.one(speaker).setStyle("backgroundSize", "100% 100%");289 break;290 case parseFloat((8.33*24).toFixed(2)):291 Y.one(speaker).setStyle(292 "background",293 "url('../media/recepcio_10.jpg') no-repeat center"294 );295 Y.one(speaker).setStyle("backgroundSize", "100% 100%");296 break;297 case parseFloat((8.33*25).toFixed(2)):298 Y.one(speaker).setStyle(299 "background",300 "url('../media/recepcio_11.jpg') no-repeat center"301 );302 Y.one(speaker).setStyle("backgroundSize", "100% 100%");303 break;304 case parseFloat((8.33*26).toFixed(2)):305 Y.one(speaker).setStyle(306 "background",307 "url('../media/recepcio_12.jpg') no-repeat center"308 );309 Y.one(speaker).setStyle("backgroundSize", "100% 100%");310 break;311 case parseFloat((8.33*27).toFixed(2)):312 Y.one(speaker).setStyle(313 "background",314 "url('../media/recepcio_13.jpg') no-repeat center"315 );316 Y.one(speaker).setStyle("backgroundSize", "100% 100%");317 break;318 }319 console.log(pointerLeft);320 });321 tuner.on("click", function() {322 var pointerLeft = pointer.getStyle('left');323 pointerLeft = pointerLeft.substring(0, pointerLeft.length - 2);324 if(pointerLeft >= 8.33) {325 pointer.setStyle("left", parseFloat(pointerLeft)-/*25*/8.33);326 }327 328 pointerLeft = pointer.getStyle('left');329 pointerLeft = pointerLeft.substring(0, pointerLeft.length - 2);330 if (parseFloat(pointerLeft) == 0) {331 Y.one(speaker).setStyle(332 "background",333 "url('../media/weave.jpg')"334 );335 }336 switch(parseFloat(pointerLeft)) {337 case parseFloat((8.33*1).toFixed(2)):338 Y.one(speaker).setStyle(339 "background",340 "url('../media/transmissio_1.jpg') no-repeat center"341 );342 Y.one(speaker).setStyle("backgroundSize", "100% 100%");343 break;344 case parseFloat((8.33*2).toFixed(2)):345 Y.one(speaker).setStyle(346 "background",347 "url('../media/transmissio_2.jpg') no-repeat center"348 );349 Y.one(speaker).setStyle("backgroundSize", "100% 100%");350 break;351 case parseFloat((8.33*3).toFixed(2)):352 Y.one(speaker).setStyle(353 "background",354 "url('../media/transmissio_3.jpg') no-repeat center"355 );356 Y.one(speaker).setStyle("backgroundSize", "100% 100%");357 break;358 case parseFloat((8.33*4).toFixed(2)):359 Y.one(speaker).setStyle(360 "background",361 "url('../media/transmissio_4.jpg') no-repeat center"362 );363 Y.one(speaker).setStyle("backgroundSize", "100% 100%");364 break;365 case parseFloat((8.33*5).toFixed(2)):366 Y.one(speaker).setStyle(367 "background",368 "url('../media/transmissio_5.jpg') no-repeat center"369 );370 Y.one(speaker).setStyle("backgroundSize", "100% 100%");371 break;372 case parseFloat((8.33*6).toFixed(2)):373 Y.one(speaker).setStyle(374 "background",375 "url('../media/transmissio_6.jpg') no-repeat center"376 );377 Y.one(speaker).setStyle("backgroundSize", "100% 100%");378 break;379 case parseFloat((8.33*7).toFixed(2)):380 Y.one(speaker).setStyle(381 "background",382 "url('../media/transmissio_7.jpg') no-repeat center"383 );384 Y.one(speaker).setStyle("backgroundSize", "100% 100%");385 break;386 case parseFloat((8.33*8).toFixed(2)):387 Y.one(speaker).setStyle(388 "background",389 "url('../media/transmissio_8.jpg') no-repeat center"390 );391 Y.one(speaker).setStyle("backgroundSize", "100% 100%");392 break;393 case parseFloat((8.33*9).toFixed(2)):394 Y.one(speaker).setStyle(395 "background",396 "url('../media/transmissio_9.jpg') no-repeat center"397 );398 Y.one(speaker).setStyle("backgroundSize", "100% 100%");399 break;400 case parseFloat((8.33*10).toFixed(2)):401 Y.one(speaker).setStyle(402 "background",403 "url('../media/transmissio_10.jpg') no-repeat center"404 );405 Y.one(speaker).setStyle("backgroundSize", "100% 100%");406 break;407 case parseFloat((8.33*11).toFixed(2)):408 Y.one(speaker).setStyle(409 "background",410 "url('../media/transmissio_11.jpg') no-repeat center"411 );412 Y.one(speaker).setStyle("backgroundSize", "100% 100%");413 break;414 case parseFloat((8.33*12).toFixed(2)):415 Y.one(speaker).setStyle(416 "background",417 "url('../media/transmissio_12.jpg') no-repeat center"418 );419 Y.one(speaker).setStyle("backgroundSize", "100% 100%");420 break;421 case parseFloat((8.33*13).toFixed(2)):422 Y.one(speaker).setStyle(423 "background",424 "url('../media/transmissio_13.jpg') no-repeat center"425 );426 Y.one(speaker).setStyle("backgroundSize", "100% 100%");427 break;428 case parseFloat((8.33*14).toFixed(2)):429 Y.one(speaker).setStyle(430 "background",431 "url('../media/transmissio_14.jpg') no-repeat center"432 );433 Y.one(speaker).setStyle("backgroundSize", "100% 100%");434 break;435 case parseFloat((8.33*15).toFixed(2)):436 Y.one(speaker).setStyle(437 "background",438 "url('../media/recepcio_1.jpg') no-repeat center"439 );440 Y.one(speaker).setStyle("backgroundSize", "100% 100%");441 break;442 case parseFloat((8.33*16).toFixed(2)):443 Y.one(speaker).setStyle(444 "background",445 "url('../media/recepcio_2.jpg') no-repeat center"446 );447 Y.one(speaker).setStyle("backgroundSize", "100% 100%");448 break;449 case parseFloat((8.33*17).toFixed(2)):450 Y.one(speaker).setStyle(451 "background",452 "url('../media/recepcio_3.jpg') no-repeat center"453 );454 Y.one(speaker).setStyle("backgroundSize", "100% 100%");455 break;456 case parseFloat((8.33*18).toFixed(2)):457 Y.one(speaker).setStyle(458 "background",459 "url('../media/recepcio_4.jpg') no-repeat center"460 );461 Y.one(speaker).setStyle("backgroundSize", "100% 100%");462 break;463 case parseFloat((8.33*19).toFixed(2)):464 Y.one(speaker).setStyle(465 "background",466 "url('../media/recepcio_5.jpg') no-repeat center"467 );468 Y.one(speaker).setStyle("backgroundSize", "100% 100%");469 break;470 case parseFloat((8.33*20).toFixed(2)):471 Y.one(speaker).setStyle(472 "background",473 "url('../media/recepcio_6.jpg') no-repeat center"474 );475 Y.one(speaker).setStyle("backgroundSize", "100% 100%");476 break;477 case parseFloat((8.33*21).toFixed(2)):478 Y.one(speaker).setStyle(479 "background",480 "url('../media/recepcio_7.jpg') no-repeat center"481 );482 Y.one(speaker).setStyle("backgroundSize", "100% 100%");483 break;484 case parseFloat((8.33*22).toFixed(2)):485 Y.one(speaker).setStyle(486 "background",487 "url('../media/recepcio_8.jpg') no-repeat center"488 );489 Y.one(speaker).setStyle("backgroundSize", "100% 100%");490 break;491 case parseFloat((8.33*23).toFixed(2)):492 Y.one(speaker).setStyle(493 "background",494 "url('../media/recepcio_9.jpg') no-repeat center"495 );496 Y.one(speaker).setStyle("backgroundSize", "100% 100%");497 break;498 case parseFloat((8.33*24).toFixed(2)):499 Y.one(speaker).setStyle(500 "background",501 "url('../media/recepcio_10.jpg') no-repeat center"502 );503 Y.one(speaker).setStyle("backgroundSize", "100% 100%");504 break;505 case parseFloat((8.33*25).toFixed(2)):506 Y.one(speaker).setStyle(507 "background",508 "url('../media/recepcio_11.jpg') no-repeat center"509 );510 Y.one(speaker).setStyle("backgroundSize", "100% 100%");511 break;512 case parseFloat((8.33*26).toFixed(2)):513 Y.one(speaker).setStyle(514 "background",515 "url('../media/recepcio_12.jpg') no-repeat center"516 );517 Y.one(speaker).setStyle("backgroundSize", "100% 100%");518 break;519 case parseFloat((8.33*27).toFixed(2)):520 Y.one(speaker).setStyle(521 "background",522 "url('../media/recepcio_13.jpg') no-repeat center"523 );524 Y.one(speaker).setStyle("backgroundSize", "100% 100%");525 break;526 }527 console.log(pointerLeft);528 });529 // --- Tuner --- //530 };531 /*setVolume = function(vol) {532 if (playing) {533 if (channel in volume) {534 audioChiado.volume = (1 - volume[channel]) * vol;535 audios[channel].volume = volume[channel] * vol;536 } else {537 audioChiado.volume = vol;538 }...
sampledata.js
Source:sampledata.js
...11var JSNISSampleDataCommercial = null;12var JSNISSampleData = {13 installSampleData: function()14 { 15 $('jsn-start-installing-sampledata').setStyle('display', 'none'); 16 $('jsn-installing-sampledata').setStyle('display', 'block');17 JSNISSampleData.downloadPackage();18 },19 downloadPackage: function()20 {21 $('jsn-downloading-sampledata').setStyle('display', 'inline-block');22 $('jsn-span-unsuccessful-downloading-sampledata-message').set('html', '');23 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'none');24 $('jsn-download-sampledata-success').setStyle('display', 'none');25 $('jsn-span-unsuccessful-downloading-sampledata').setStyle('display', 'none');26 $('jsn-span-unsuccessful-downloading-sampledata-message').setStyle('display', 'none');27 $('jsn-install-sample-data-package-title').setStyle('display', 'none');28 $('jsn-sampledata-warnings').setStyle('display', 'none');29 $('jsn-sampledata-ul-warnings').set('html', '');30 $('jsn-sample-data-text-alert').setStyle('display', 'none');31 32 var url = 'index.php?' + JSNISToken + '=1';33 var jsonRequest = new Request.JSON({url: url, onSuccess: function(jsonObj){34 if(jsonObj.download)35 {36 $('jsn-downloading-sampledata').setStyle('display', 'none');37 $('jsn-download-sampledata-success').setStyle('display', 'inline-block');38 $('jsn-install-sample-data-package-title').setStyle('display', 'list-item');39 JSNISSampleDataInstallSampleDataName = jsonObj.file_name;40 JSNISSampleData.installPackage(jsonObj.file_name);41 }42 else43 {44 $('jsn-downloading-sampledata').setStyle('display', 'none');45 $('jsn-span-unsuccessful-downloading-sampledata').setStyle('display', 'inline-block');46 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');47 $('jsn-span-unsuccessful-downloading-sampledata-message').set('html', jsonObj.message);48 $('jsn-span-unsuccessful-downloading-sampledata-message').setStyle('display', 'block');49 }50 }}).get({'option': 'com_imageshow', 'controller': 'maintenance', 'task': 'downloadSampleDataPackage', 'sample_download_url': $('sample_download_url').value, 'rand': Math.random()});51 },52 53 installPackage: function(fileName) 54 {55 $('jsn-span-installing-sampledata-state').setStyle('display', 'inline-block');56 $('jsn-span-unsuccessful-installing-sampledata-message').set('html', '');57 $('jsn-span-unsuccessful-installing-sampledata-message').setStyle('display', 'none');58 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'none');59 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none');60 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'none');61 var url = 'index.php?' + JSNISToken + '=1';62 var jsonRequest = new Request.JSON({url: url, onSuccess: function(jsonObj){63 if(jsonObj.install)64 {65 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');66 $('jsn-span-successful-installing-sampledata').setStyle('display', 'inline-block'); 67 $('jsn-installing-sampledata-successfully').setStyle('display', 'block');68 }69 else70 {71 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');72 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');73 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');74 $('jsn-span-unsuccessful-installing-sampledata-message').set('html', jsonObj.message);75 $('jsn-span-unsuccessful-installing-sampledata-message').setStyle('display', 'block');76 if (jsonObj.warnings != undefined)77 {78 var count = jsonObj.warnings.length;79 if (count)80 {81 $('jsn-sampledata-warnings').setStyle('display', 'block');82 JSNISSampleDataRequiredThemeElements = jsonObj.themes;83 JSNISSampleDataRequiredSourceElements = jsonObj.sources;84 JSNISSampleDataRequiredElements = jsonObj.elements;85 JSNISSampleDataTotalRequiredElements = jsonObj.total_elements;86 JSNISSampleDataCommercial = jsonObj.commercial;87 JSNISSampleDataLightCartErrorCode = jsonObj.light_cart_error_code;88 JSNISSampleData.renderWarning(jsonObj.warnings);89 }90 }91 }92 }}).get({'option': 'com_imageshow', 'controller': 'maintenance', 'task': 'installSampledata', 'file_name': fileName, 'rand': Math.random()});93 },94 renderWarning: function(data)95 {96 var warnings = data;97 var count = warnings.length;98 var ul = $('jsn-sampledata-ul-warnings');99 if (count)100 {101 for(var i=0; i < count; i++)102 {103 var li = new Element('li', {html: warnings[i]});104 li.inject(ul);105 }106 }107 },108 installCommercial: function (login)109 {110 JSNISSampleData.installAllRequiredPlugins(login);111 }, 112 installAllRequiredPlugins: function(login)113 { 114 if (JSNISSampleDataCommercial)115 {116 if(login != true)117 {118 url='index.php?option=com_imageshow&controller=maintenance&task=login&layout=form_login&js_class=JSNISSampleData&tmpl=component';119 SqueezeBox.fromElement($('jsn-sampledata-a-link-install-all-requried-plugins'), {parse: 'rel', url: url});120 return;121 }122 }123 var countSources = JSNISSampleDataRequiredSourceElements.length;124 $('jsn-span-installing-sampledata-state').setStyle('display', 'inline-block');125 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'none'); 126 $$('#jsn-sampledata-ul-warnings span').setStyle('color', '#000'); 127 $('jsn-span-unsuccessful-installing-sampledata-message').setStyle('display', 'none');128 $('jsn-sampledata-link-install-all-requried-plugins').setStyle('display', 'none');129 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'none');130 if(countSources)131 { 132 JSNISSampleData.overwriteInstallSource();133 for (var i = 0; i < countSources; i++)134 {135 var sources = JSON.decode(JSNISSampleDataRequiredSourceElements[i]);136 JSNISInstallImageSources.install(sources.download_element_id, sources);137 }138 }139 140 var countThemes = JSNISSampleDataRequiredThemeElements.length;141 if(countThemes)142 { 143 JSNISSampleData.overwriteInstallThemes();144 for (var i = 0; i < countThemes; i++)145 {146 var themes = JSON.decode(JSNISSampleDataRequiredThemeElements[i]);147 JSNISInstallShowcaseThemes.install(themes.download_element_id, themes);148 } 149 } 150 },151 152 overwriteInstallSource: function()153 {154 JSNISInstallImageSources.install=function (el, options)155 {156 JSNISInstallImageSources.options = Object.merge(JSNISInstallImageSources.options,options);157 JSNISInstallImageSources.download(el);158 };159 JSNISInstallImageSources.download=function(el){160 $(el).removeClass('jsn-sampledata-installation-wait');161 var tmpOptions = {};162 tmpOptions.processText = JSNISInstallImageSources.options.process_text;163 tmpOptions.waitText = JSNISInstallImageSources.options.wait_text;164 tmpOptions.parentID = JSNISInstallImageSources.options.download_element_id; 165 tmpOptions.textTag = "p"; 166 var changetext = new JSNISInstallChangeText(tmpOptions); 167 var jsonRequest = new Request.JSON({168 url: 'index.php?option=com_imageshow&controller=installer&task=downloadImageSource&rand='+ Math.random() + '&' + JSNISToken + '=1', 169 onSuccess: function(jsonObj)170 {171 if (jsonObj.success) 172 {173 //changetext.destroy();174 JSNISInstallImageSources.installPackage(jsonObj.package_path, el); 175 }176 else 177 {178 //changetext.destroy();179 $(el).addClass('jsn-sampledata-installation-failure');180 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');181 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 182 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block'); 183 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');184 if (JSNISSampleDataLightCartErrorCode[jsonObj.message]) {185 alert(JSNISSampleDataLightCartErrorCode[jsonObj.message]);186 } else {187 alert(jsonObj.message);188 } 189 }190 },191 onFailure: function()192 {193 $(el).addClass('jsn-sampledata-installation-failure');194 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');195 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 196 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');197 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');198 }199 }).post(JSNISInstallImageSources.options);200 };201 202 JSNISInstallImageSources.installPackage=function(packagePath, el){ 203 var jsonRequest = new Request.JSON({204 url: 'index.php?' + JSNISToken + '=1', 205 onSuccess: function(jsonObj)206 {207 if (jsonObj.success == true)208 {209 JSNISSampleData.checkRequiredElementsIsInstalled();210 $(el).addClass('jsn-sampledata-installation-success');211 }212 else213 {214 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');215 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none');216 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');217 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');218 alert(jsonObj.message);219 }220 }, 221 onFailure: function()222 {223 $(el).addClass('jsn-sampledata-installation-failure');224 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');225 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 226 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');227 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');228 }229 }).get({'option': 'com_imageshow',230 'controller': 'installer',231 'task': 'installImageSource',232 'package_path': packagePath,233 'rand': Math.random()});234 }; 235 },236 237 overwriteInstallThemes: function()238 {239 JSNISInstallShowcaseThemes.install=function (el, options)240 {241 JSNISInstallShowcaseThemes.element = $(el);242 JSNISInstallShowcaseThemes.options = Object.merge(JSNISInstallShowcaseThemes.options, options);243 JSNISInstallShowcaseThemes.download();244 };245 246 JSNISInstallShowcaseThemes.download=function(){247 JSNISInstallShowcaseThemes.element.removeClass('jsn-sampledata-installation-wait');248 var tmpOptions = {};249 tmpOptions.processText = JSNISInstallShowcaseThemes.options.process_text;250 tmpOptions.waitText = JSNISInstallShowcaseThemes.options.wait_text;251 tmpOptions.parentID = JSNISInstallShowcaseThemes.options.download_element_id; 252 tmpOptions.textTag = "p"; 253 var changetext = new JSNISInstallChangeText(tmpOptions); 254 var jsonRequest = new Request.JSON({255 url: 'index.php?option=com_imageshow&controller=installer&task=downloadShowcaseTheme&rand='+ Math.random() + '&' + JSNISToken + '=1',256 onSuccess: function(jsonObj)257 {258 if (jsonObj.success) 259 {260 JSNISInstallShowcaseThemes.installPackage(jsonObj.package_path); 261 }262 else 263 {264 JSNISInstallShowcaseThemes.element.addClass('jsn-sampledata-installation-failure');265 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');266 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 267 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');268 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');269 if (JSNISSampleDataLightCartErrorCode[jsonObj.message]) {270 alert(JSNISSampleDataLightCartErrorCode[jsonObj.message]);271 } else {272 alert(jsonObj.message);273 }274 }275 },276 onFailure: function()277 {278 JSNISInstallShowcaseThemes.element.addClass('jsn-sampledata-installation-failure');279 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');280 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 281 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');282 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');283 }284 }).post(JSNISInstallShowcaseThemes.options);285 };286 287 JSNISInstallShowcaseThemes.installPackage=function(packagePath){ 288 var jsonRequest = new Request.JSON({289 url: 'index.php?' + JSNISToken + '=1',290 onSuccess: function(jsonObj)291 {292 if(jsonObj.success == true)293 { 294 JSNISSampleData.checkRequiredElementsIsInstalled();295 JSNISInstallShowcaseThemes.element.addClass('jsn-sampledata-installation-success');296 }297 else298 {299 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');300 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 301 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');302 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');303 alert(jsonObj.message);304 }305 },306 onFailure: function()307 {308 JSNISInstallShowcaseThemes.element.addClass('jsn-sampledata-installation-failure');309 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');310 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none'); 311 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');312 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');313 }314 }).get({'option': 'com_imageshow',315 'controller': 'installer',316 'task': 'installShowcaseTheme',317 'package_path': packagePath,318 'rand': Math.random()});319 }; 320 },321 reInstallPackage: function(fileName) 322 {323 var jsonRequest = new Request.JSON({324 url: 'index.php?' + JSNISToken + '=1',325 onSuccess: function(jsonObj)326 {327 if(jsonObj.install == true)328 {329 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');330 $('jsn-span-successful-installing-sampledata').setStyle('display', 'inline-block'); 331 $('jsn-installing-sampledata-successfully').setStyle('display', 'block');332 $('jsn-sampledata-ul-warnings').setStyle('display', 'none');333 }334 } 335 }).get({'option': 'com_imageshow', 'controller': 'maintenance', 'task': 'installSampledata', 'file_name': fileName, 'rand': Math.random()}); 336 }, 337 checkRequiredElementsIsInstalled: function()338 {339 var jsonRequest = new Request.JSON({340 url: 'index.php?' + JSNISToken + '=1',341 onSuccess: function(jsonObj)342 {343 if (jsonObj.check == true) 344 { 345 JSNISSampleData.reInstallPackage(JSNISSampleDataInstallSampleDataName);346 } 347 }, 348 onFailure: function()349 {350 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');351 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');352 }353 }).get({'option': 'com_imageshow',354 'controller': 'installer', 355 'task': 'checkRequiredElementsIsInstalled',356 'elements': JSNISSampleDataRequiredElements,357 'total_elements': JSNISSampleDataTotalRequiredElements,358 'rand': Math.random()});359 }...
Panel.js
Source:Panel.js
...55 _padding: 15,56 postCreate: function() {57 },58 startup: function() {59 html.setStyle(this.domNode, utils.getPositionStyle(this.position));60 this.loadDisplayWidgets();61 this._setPanelPadding();62 this._setBarPosition();63 this._setNavPosition();64 this.resize();65 this._switchNavStatus();66 this.panelManager.normalizePanel(this);67 },68 resize: function() {69 this._setFrameSize();70 },71 _setFrameSize: function() {72 var count = Math.min(this.displayNumber, this._getConfigs().length);73 if (count === 0) {74 return;75 }76 var dim = {},77 box = html.getContentBox(this.containerNode);78 if (this.region === 'left' || this.region === 'right') {79 dim.width = '100%';80 dim.height = (box.h - count * this._margin) / count + 'px';81 dim.marginTop = this._margin + 'px';82 } else if (this.region === 'top' || this.region === 'bottom') {83 dim.height = '100%';84 dim.width = (box.w - count * this._margin) / count + 'px';85 dim.marginLeft = this._margin + 'px';86 }87 this.getChildren().forEach(lang.hitch(this, function(frame) {88 html.setStyle(frame.domNode, dim);89 frame.resize();90 }));91 },92 loadDisplayWidgets: function() {93 var configs = this._getConfigs();94 function onWidgetLoaded(frame, loading, widget) {95 loading.destroy();96 frame.setWidget(widget);97 widget.startup();98 // if(widgetConfig.defaultState){99 // this.widgetManager.changeWindowStateTo(widget, widgetConfig.defaultState);100 // }101 }102 var endIndex = this._getEndIndex();103 for (var i = this.firstIndex; i < endIndex; i++) {104 var widgetConfig = configs[i];105 var frame, loading;106 if (this.widgetManager.getWidgetById(widgetConfig.id)) {107 continue;108 }109 loading = new LoadingIndicator();110 frame = this.createFrame(widgetConfig);111 this.addChild(frame);112 html.place(loading.domNode, frame.containerNode);113 this.widgetManager.loadWidget(widgetConfig)114 .then(lang.hitch(this, onWidgetLoaded, frame, loading));115 }116 this._setFrameFloat();117 this._setFrameSize();118 },119 onNormalize: function() {120 html.addClass(this.barNode, 'max');121 html.removeClass(this.barNode, 'min');122 this._setBarPosition();123 if (this.region === 'left') {124 html.setStyle(this.barNode, {125 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_left.png)'126 });127 html.setStyle(this.domNode, {128 left: 0,129 width: this.position.width + 'px'130 });131 html.setStyle(this.barNode, {132 borderTopLeftRadius: 0,133 borderTopRightRadius: '4px',134 borderBottomLeftRadius: 0,135 borderBottomRightRadius: '4px'136 });137 } else if (this.region === 'right') {138 html.setStyle(this.barNode, {139 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_right.png)'140 });141 html.setStyle(this.domNode, {142 right: 0,143 width: this.position.width + 'px'144 });145 html.setStyle(this.barNode, {146 borderTopLeftRadius: '4px',147 borderTopRightRadius: 0,148 borderBottomLeftRadius: '4px',149 borderBottomRightRadius: 0150 });151 } else if (this.region === 'top') {152 html.setStyle(this.barNode, {153 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_up.png)'154 });155 html.setStyle(this.domNode, {156 top: 0,157 height: this.position.height + 'px'158 });159 html.setStyle(this.barNode, {160 borderTopLeftRadius: 0,161 borderTopRightRadius: 0,162 borderBottomLeftRadius: '4px',163 borderBottomRightRadius: '4px'164 });165 } else if (this.region === 'bottom') {166 html.setStyle(this.barNode, {167 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_down.png)'168 });169 html.setStyle(this.domNode, {170 bottom: 0,171 height: this.position.height + 'px'172 });173 html.setStyle(this.barNode, {174 borderTopLeftRadius: '4px',175 borderTopRightRadius: '4px',176 borderBottomLeftRadius: 0,177 borderBottomRightRadius: 0178 });179 }180 this.inherited(arguments);181 },182 onMinimize: function() {183 html.setStyle(this.barNode, {184 borderTopLeftRadius: '4px',185 borderTopRightRadius: '4px',186 borderBottomLeftRadius: '4px',187 borderBottomRightRadius: '4px'188 });189 html.removeClass(this.barNode, 'max');190 html.addClass(this.barNode, 'min');191 this._setBarPosition();192 //on minimize, we can't set width/height = 0 to minimize because we use border-box model193 //and the content height/width can't be nagative194 //go here for more information: http://dev.w3.org/csswg/css-ui/#box-sizing195 if (this.region === 'left') {196 html.setStyle(this.barNode, {197 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_right.png)'198 });199 html.setStyle(this.domNode, {200 left: (0 - this.position.width) + 'px',201 right: 'auto'202 });203 } else if (this.region === 'right') {204 html.setStyle(this.barNode, {205 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_left.png)'206 });207 html.setStyle(this.domNode, {208 right: (0 - this.position.width) + 'px',209 left: 'auto'210 });211 } else if (this.region === 'top') {212 html.setStyle(this.barNode, {213 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_down.png)'214 });215 html.setStyle(this.domNode, {216 top: (0 - this.position.height) + 'px',217 bottom: 'auto'218 });219 } else if (this.region === 'bottom') {220 html.setStyle(this.barNode, {221 backgroundImage: 'url(' + require.toUrl('.') + '/images/bar_up.png)'222 });223 html.setStyle(this.domNode, {224 bottom: (0 - this.position.height) + 'px',225 top: 'auto'226 });227 }228 this.inherited(arguments);229 },230 scrollWidget: function() {231 var endIndex = this._getEndIndex();232 this.getChildren().forEach(lang.hitch(this, function(frame, i) {233 if (i >= this.firstIndex && i < endIndex) {234 html.setStyle(frame.domNode, 'display', '');235 } else {236 html.setStyle(frame.domNode, 'display', 'none');237 }238 }));239 },240 _onBarClick: function() {241 var mapPosition = {};242 if (this.windowState === 'normal') {243 this.panelManager.minimizePanel(this);244 if (this.resizeMap) {245 if (this.region === 'left') {246 mapPosition.left = 0;247 } else if (this.region === 'right') {248 mapPosition.right = 0;249 } else if (this.region === 'top') {250 mapPosition.top = 0;251 } else if (this.region === 'bottom') {252 mapPosition.bottom = 0;253 }254 topic.publish('changeMapPosition', mapPosition);255 }256 } else {257 this.panelManager.normalizePanel(this);258 if (this.resizeMap) {259 if (this.region === 'left') {260 mapPosition.left = this.position.width;261 } else if (this.region === 'right') {262 mapPosition.right = this.position.width;263 } else if (this.region === 'top') {264 mapPosition.top = this.position.height;265 } else if (this.region === 'bottom') {266 mapPosition.bottom = this.position.height;267 }268 topic.publish('changeMapPosition', mapPosition);269 }270 }271 },272 _onPreClick: function() {273 if (this.firstIndex === 0) {274 return;275 }276 this.firstIndex = this.firstIndex - 1;277 this.loadDisplayWidgets();278 this.scrollWidget();279 this._switchNavStatus();280 },281 _onNextClick: function() {282 if (this.firstIndex + this.displayNumber >= this._getConfigs().length) {283 return;284 }285 this.firstIndex = this.firstIndex + 1;286 this.loadDisplayWidgets();287 this.scrollWidget();288 this._switchNavStatus();289 },290 _switchNavStatus: function() {291 if (this.firstIndex === 0) {292 html.setStyle(this.preNode, 'opacity', '0.4');293 } else {294 html.setStyle(this.preNode, 'opacity', '1');295 }296 if (this.firstIndex + this.displayNumber >= this._getConfigs().length) {297 html.setStyle(this.nextNode, 'opacity', '0.4');298 } else {299 html.setStyle(this.nextNode, 'opacity', '1');300 }301 },302 _getEndIndex: function() {303 var configs = this._getConfigs();304 var endIndex = Math.min(this.firstIndex + this.displayNumber, configs.length);305 return endIndex;306 },307 _setBarPosition: function() {308 html.setStyle(this.barNode, {309 position: 'absolute',310 width: this._barSize + 'px',311 height: this._barSize + 'px'312 });313 var pos = this.windowState === 'normal' ?314 (0 - this._barSize) + 'px' : (0 - this._barSize - 2) + 'px';315 if (this.region === 'left') {316 html.setStyle(this.barNode, {317 top: '10px',318 right: pos319 });320 } else if (this.region === 'right') {321 html.setStyle(this.barNode, {322 top: '10px',323 left: pos324 });325 } else if (this.region === 'top') {326 html.setStyle(this.barNode, {327 left: '10px',328 bottom: pos329 });330 } else if (this.region === 'bottom') {331 html.setStyle(this.barNode, {332 left: '10px',333 top: pos334 });335 }336 },337 _setNavPosition: function() {338 var box = html.getMarginBox(this.domNode);339 html.setStyle(this.preNode, {340 position: 'absolute'341 });342 html.setStyle(this.nextNode, {343 position: 'absolute'344 });345 if (this.region === 'left' || this.region === 'right') {346 html.setStyle(this.preNode, {347 top: '10px',348 left: (box.w / 2) + 'px',349 backgroundImage: 'url(' + require.toUrl('.') + '/images/nav_up.png)'350 });351 html.setStyle(this.nextNode, {352 bottom: '10px',353 left: (box.w / 2) + 'px',354 backgroundImage: 'url(' + require.toUrl('.') + '/images/nav_down.png)'355 });356 } else if (this.region === 'top' || this.region === 'bottom') {357 html.setStyle(this.preNode, {358 left: '10px',359 top: (box.h / 2) + 'px',360 backgroundImage: 'url(' + require.toUrl('.') + '/images/nav_left.png)'361 });362 html.setStyle(this.nextNode, {363 right: '10px',364 top: (box.h / 2) + 'px',365 backgroundImage: 'url(' + require.toUrl('.') + '/images/nav_right.png)'366 });367 }368 },369 _setFrameFloat: function() {370 if (this.region === 'top' || this.region === 'bottom') {371 this.getChildren().forEach(function(frame) {372 html.setStyle(frame.domNode, 'float', 'left');373 });374 }375 },376 _setPanelPadding: function() {377 if (this.region === 'left' || this.region === 'right') {378 //padding top is less then padding bottom, because the first element has margin379 html.setStyle(this.domNode, {380 paddingTop: (this._navSize + this._padding - this._margin) + 'px',381 paddingRight: this._padding + 'px',382 paddingBottom: (this._navSize + this._padding) + 'px',383 paddingLeft: this._padding + 'px'384 });385 } else if (this.region === 'top' || this.region === 'bottom') {386 html.setStyle(this.domNode, {387 paddingTop: this._padding + 'px',388 paddingRight: (this._navSize + this._padding) + 'px',389 paddingBottom: this._padding + 'px',390 paddingLeft: (this._navSize + this._padding - this._margin) + 'px'391 });392 }393 },394 _getConfigs: function() {395 var configs = [];396 if (Array.isArray(this.config.widgets)) {397 //it's group398 configs = this.config.widgets;399 } else {400 configs = [this.config];...
script.js
Source:script.js
...10 ];11 12 custom_module_id.each(function(el,j){13 if(el) {14 el.getParent().setStyle('display','none');15 }16 });17 18 if(document.id('jform_params_auto_module_id').value === '0') {19 document.id('jform_params_custom_module_id').getParent().setStyle('display','');20 }21 22 document.id('jform_params_auto_module_id').addEvent("change", function(){23 custom_module_id.each(function(el,j){24 el.getParent().setStyle('display','none');25 });26 if(document.id('jform_params_auto_module_id').value === '0') {27 document.id('jform_params_custom_module_id').getParent().setStyle('display','');28 }29 });30 31 document.id('jform_params_auto_module_id').addEvent("blur", function(){32 custom_module_id.each(function(el,j){33 el.getParent().setStyle('display','none');34 }); 35 if(document.id('jform_params_auto_module_id').value === '0') {36 document.id('jform_params_custom_module_id').getParent().setStyle('display','');37 }38 });39 40 // Toggle data_source fields41 var data_sources = [42 document.id('jform_params_catfilter'), 43 document.id('jformparamscategory_id'), 44 document.id('jform_params_getChildren'), 45 document.id('jform[params][add_k2_items]_name').getParent(), 46 document.id('itemsList'),47 document.id('jform_params_k2_tags'),48 document.id('jform_params_exclude_k2_items'),49 document.id('jform_params_FeaturedItems'),50 document.id('jform_params_popularityRange'),51 document.id('jform_params_videosOnly'),52 document.id('jform_params_items_order')53 ];54 55 data_sources.each(function(el,j){56 if(el) {57 el.getParent().setStyle('display','none');58 }59 })6061 if(document.id('jform_params_data_source').value === 'k2_categories') {62 document.id('jform_params_catfilter').getParent().setStyle('display','');63 document.id('jformparamscategory_id').getParent().setStyle('display','');64 document.id('jform_params_getChildren').getParent().setStyle('display','');65 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');66 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');67 document.id('jform_params_popularityRange').getParent().setStyle('display','');68 document.id('jform_params_videosOnly').getParent().setStyle('display','');69 document.id('jform_params_items_order').getParent().setStyle('display','');70 }71 72 if(document.id('jform_params_data_source').value === 'k2_articles') {73 document.id('jform[params][add_k2_items]_name').getParent().getParent().setStyle('display','');74 document.id('itemsList').getParent().setStyle('display','');75 76 }77 78 if(document.id('jform_params_data_source').value === 'all_k2_articles') {79 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');80 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');81 document.id('jform_params_popularityRange').getParent().setStyle('display','');82 document.id('jform_params_videosOnly').getParent().setStyle('display','');83 document.id('jform_params_items_order').getParent().setStyle('display','');84 }85 86 if(document.id('jform_params_data_source').value === 'k2_tags') {87 document.id('jform_params_k2_tags').getParent().setStyle('display','');88 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');89 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');90 document.id('jform_params_popularityRange').getParent().setStyle('display','');91 document.id('jform_params_videosOnly').getParent().setStyle('display','');92 document.id('jform_params_items_order').getParent().setStyle('display','');93 }94 95 document.id('jform_params_data_source').addEvent("change", function(){96 data_sources.each(function(el,j){97 el.getParent().setStyle('display','none');98 });99100 if(document.id('jform_params_data_source').value === 'k2_categories') {101 document.id('jform_params_catfilter').getParent().setStyle('display','');102 document.id('jformparamscategory_id').getParent().setStyle('display','');103 document.id('jform_params_getChildren').getParent().setStyle('display','');104 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');105 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');106 document.id('jform_params_popularityRange').getParent().setStyle('display','');107 document.id('jform_params_videosOnly').getParent().setStyle('display','');108 document.id('jform_params_items_order').getParent().setStyle('display','');109 }110 111 if(document.id('jform_params_data_source').value === 'k2_articles') {112 document.id('jform[params][add_k2_items]_name').getParent().getParent().setStyle('display','');113 document.id('itemsList').getParent().setStyle('display','');114 }115 116 if(document.id('jform_params_data_source').value === 'all_k2_articles') {117 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');118 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');119 document.id('jform_params_popularityRange').getParent().setStyle('display','');120 document.id('jform_params_videosOnly').getParent().setStyle('display','');121 document.id('jform_params_items_order').getParent().setStyle('display','');122 }123 124 if(document.id('jform_params_data_source').value === 'k2_tags') {125 document.id('jform_params_k2_tags').getParent().setStyle('display','');126 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');127 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');128 document.id('jform_params_popularityRange').getParent().setStyle('display','');129 document.id('jform_params_videosOnly').getParent().setStyle('display','');130 document.id('jform_params_items_order').getParent().setStyle('display','');131 }132 133 });134 135 document.id('jform_params_data_source').addEvent("blur", function(){136 data_sources.each(function(el,j){137 el.getParent().setStyle('display','none');138 });139 140 if(document.id('jform_params_data_source').value === 'k2_categories') {141 document.id('jform_params_catfilter').getParent().setStyle('display','');142 document.id('jformparamscategory_id').getParent().setStyle('display','');143 document.id('jform_params_getChildren').getParent().setStyle('display','');144 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');145 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');146 document.id('jform_params_popularityRange').getParent().setStyle('display','');147 document.id('jform_params_videosOnly').getParent().setStyle('display','');148 document.id('jform_params_items_order').getParent().setStyle('display','');149 }150 151 if(document.id('jform_params_data_source').value === 'k2_articles') {152 document.id('jform[params][add_k2_items]_name').getParent().getParent().setStyle('display','');153 document.id('itemsList').getParent().setStyle('display','');154 }155 156 if(document.id('jform_params_data_source').value === 'all_k2_articles') {157 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');158 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');159 document.id('jform_params_popularityRange').getParent().setStyle('display','');160 document.id('jform_params_videosOnly').getParent().setStyle('display','');161 document.id('jform_params_items_order').getParent().setStyle('display','');162 }163 164 if(document.id('jform_params_data_source').value === 'k2_tags') {165 document.id('jform_params_k2_tags').getParent().setStyle('display','');166 document.id('jform_params_exclude_k2_items').getParent().setStyle('display','');167 document.id('jform_params_FeaturedItems').getParent().setStyle('display','');168 document.id('jform_params_popularityRange').getParent().setStyle('display','');169 document.id('jform_params_videosOnly').getParent().setStyle('display','');170 document.id('jform_params_items_order').getParent().setStyle('display','');171 }172 173 });174
...
preview.js
Source:preview.js
...20 with_units: false21 };22 enqueueStylesheet(props);23 // Attach live preview listeners.24 setStyle({ ...props, subsetting: '[font_name]', css_rule: 'font-family' });25 setStyle({ ...props, subsetting: '[font_weight]', css_rule: 'font-weight' });26 setStyle({ ...props, subsetting: '[font_style]', css_rule: 'font-style' });27 setStyle({ ...props, subsetting: '[text_decoration]', css_rule: 'text-decoration' });28 setStyle({ ...props, subsetting: '[text_transform]', css_rule: 'text-transform' });29 setStyle({ ...props, subsetting: '[font_color]', css_rule: 'color' });30 setStyle({ ...props, subsetting: '[background_color]', css_rule: 'background-color' });31 setStyle({ ...props, subsetting: '[font_size]', css_rule: 'font-size', with_units: true });32 setStyle({ ...props, subsetting: '[line_height]', css_rule: 'line-height' });33 setStyle({ ...props, subsetting: '[letter_spacing]', css_rule: 'letter-spacing', with_units: true });34 setStyle({ ...props, subsetting: '[margin_top]', css_rule: 'margin-top', with_units: true });35 setStyle({ ...props, subsetting: '[margin_bottom]', css_rule: 'margin-bottom', with_units: true });36 setStyle({ ...props, subsetting: '[margin_left]', css_rule: 'margin-left', with_units: true });37 setStyle({ ...props, subsetting: '[margin_right]', css_rule: 'margin-right', with_units: true });38 setStyle({ ...props, subsetting: '[padding_top]', css_rule: 'padding-top', with_units: true });39 setStyle({ ...props, subsetting: '[padding_bottom]', css_rule: 'padding-bottom', with_units: true });40 setStyle({ ...props, subsetting: '[padding_left]', css_rule: 'padding-left', with_units: true });41 setStyle({ ...props, subsetting: '[padding_right]', css_rule: 'padding-right', with_units: true });42 setStyle({ ...props, subsetting: '[border_top_color]', css_rule: 'border-top-color' });43 setStyle({ ...props, subsetting: '[border_top_style]', css_rule: 'border-top-style' });44 setStyle({ ...props, subsetting: '[border_top_width]', css_rule: 'border-top-width', with_units: true });45 setStyle({ ...props, subsetting: '[border_bottom_color]', css_rule: 'border-bottom-color' });46 setStyle({ ...props, subsetting: '[border_bottom_style]', css_rule: 'border-bottom-style' });47 setStyle({ ...props, subsetting: '[border_bottom_width]', css_rule: 'border-bottom-width', with_units: true });48 setStyle({ ...props, subsetting: '[border_left_color]', css_rule: 'border-left-color' });49 setStyle({ ...props, subsetting: '[border_left_style]', css_rule: 'border-left-style' });50 setStyle({ ...props, subsetting: '[border_left_width]', css_rule: 'border-left-width', with_units: true });51 setStyle({ ...props, subsetting: '[border_right_color]', css_rule: 'border-right-color' });52 setStyle({ ...props, subsetting: '[border_right_style]', css_rule: 'border-right-style' });53 setStyle({ ...props, subsetting: '[border_right_width]', css_rule: 'border-right-width', with_units: true });54 setStyle({55 ...props,56 subsetting: '[border_radius_top_left]',57 css_rule: 'border-top-left-radius',58 with_units: true59 });60 setStyle({61 ...props,62 subsetting: '[border_radius_top_right]',63 css_rule: 'border-top-right-radius',64 with_units: true65 });66 setStyle({67 ...props,68 subsetting: '[border_radius_bottom_left]',69 css_rule: 'border-bottom-left-radius',70 with_units: true71 });72 setStyle({73 ...props,74 subsetting: '[border_radius_bottom_right]',75 css_rule: 'border-bottom-right-radius',76 with_units: true77 });78 setStyle({ ...props, subsetting: '[display]', css_rule: 'display' });79 });80});81/**82 * Get Media Query Rules83 * @param {object} min84 * @param {object} max85 */86const getMediaQuery = (min, max) => {87 let mediaQuery = { open: '', close: '' };88 if (!min.amount && !max.amount) {89 return mediaQuery;90 }91 let mediaQueryRules = [];92 if (min.amount) {...
editor_test.js
Source:editor_test.js
...82}83var tests = {84 'change-style-0-2': function() {85 window.puzzle = new Puzzle(0, 2)86 setStyle('Default')87 ASSERT_SIZE(1, 5)88 setStyle('Horizontal Symmetry')89 ASSERT_SIZE(1, 5)90 setStyle('Vertical Symmetry')91 ASSERT_SIZE(1, 5)92 setStyle('Rotational Symmetry')93 ASSERT_SIZE(1, 5)94 setStyle('Pillar')95 ASSERT_SIZE(2, 5)96 setStyle('Pillar (H Symmetry)')97 ASSERT_SIZE(4, 5)98 setStyle('Pillar (V Symmetry)')99 ASSERT_SIZE(4, 5)100 setStyle('Pillar (R Symmetry)')101 ASSERT_SIZE(4, 5)102 setStyle('Pillar (Two Lines)')103 ASSERT_SIZE(4, 5)104 },105 'change-style-1-3': function() {106 window.puzzle = new Puzzle(1, 3)107 setStyle('Default')108 ASSERT_SIZE(3, 7)109 setStyle('Horizontal Symmetry')110 ASSERT_SIZE(3, 7)111 setStyle('Vertical Symmetry')112 ASSERT_SIZE(3, 7)113 setStyle('Rotational Symmetry')114 ASSERT_SIZE(3, 7)115 setStyle('Pillar')116 ASSERT_SIZE(2, 7)117 setStyle('Pillar (H Symmetry)')118 ASSERT_SIZE(4, 7)119 setStyle('Pillar (V Symmetry)')120 ASSERT_SIZE(4, 7)121 setStyle('Pillar (R Symmetry)')122 ASSERT_SIZE(4, 7)123 setStyle('Pillar (Two Lines)')124 ASSERT_SIZE(4, 7)125 },126 'default': function() {127 setStyle('Default')128 ASSERT_SIZE(9, 9)129 ASSERT_ALL_START(0, 8)130 ASSERT_ALL_END(8, 0, 'right')131 },132 'horizontal': function() {133 setStyle('Horizontal Symmetry')134 ASSERT_SIZE(9, 9)135 ASSERT_ALL_START(0, 8, 8, 8)136 ASSERT_ALL_END(0, 0, 'left', 8, 0, 'right')137 },138 'vertical': function() {139 setStyle('Vertical Symmetry')140 ASSERT_SIZE(9, 9)141 ASSERT_ALL_START(0, 8, 0, 0)142 ASSERT_ALL_END(8, 0, 'right', 8, 8, 'right')143 },144 'rotational': function() {145 debugger;146 setStyle('Rotational Symmetry')147 ASSERT_SIZE(9, 9)148 ASSERT_ALL_START(0, 8, 0, 0)149 ASSERT_ALL_END(8, 0, 'right', 8, 8, 'right')150 }151 /*152 setStyle('Pillar')153 ASSERT_SIZE(8, 9)154 setStyle('Pillar (H Symmetry)')155 ASSERT_SIZE(8, 9)156 setStyle('Pillar (V Symmetry)')157 ASSERT_SIZE(8, 9)158 setStyle('Pillar (R Symmetry)')159 ASSERT_SIZE(8, 9)160 setStyle('Pillar (Two Lines)')161 ASSERT_SIZE(8, 9)162 }*/...
sampledatamanual.js
Source:sampledatamanual.js
...5*/6var JSNISSampleDataManual = {7 downloadPackage: function()8 {9 $('jsn-downloading-sampledata').setStyle('display', 'inline-block');10 $('jsn-span-unsuccessful-downloading-sampledata-message').set('html', '');11 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'none');12 $('jsn-installing-sampledata_install_requried_plugin').setStyle('display', 'none');13 $('jsn-download-sampledata-success').setStyle('display', 'none');14 $('jsn-span-unsuccessful-downloading-sampledata').setStyle('display', 'none');15 $('jsn-span-unsuccessful-downloading-sampledata-message').setStyle('display', 'none');16 $('jsn-install-sample-data-package-title').setStyle('display', 'none');17 $('jsn-sampledata-ul-warnings').set('html', '');18 $('jsn-sample-data-text-alert').setStyle('display', 'none');19 var url = 'index.php?' + JSNISToken + '=1';20 var jsonRequest = new Request.JSON({url: url, onSuccess: function(jsonObj){21 if(jsonObj.download)22 {23 $('jsn-downloading-sampledata').setStyle('display', 'none');24 $('jsn-download-sampledata-success').setStyle('display', 'inline-block');25 $('jsn-install-sample-data-package-title').setStyle('display', 'list-item');26 JSNISSampleDataInstallSampleDataName = jsonObj.file_name;27 JSNISSampleData.installPackage(jsonObj.file_name);28 }29 else30 {31 $('jsn-downloading-sampledata').setStyle('display', 'none');32 $('jsn-span-unsuccessful-downloading-sampledata').setStyle('display', 'inline-block');33 $('jsn-installing-sampledata_install_requried_plugin').setStyle('display', 'none');34 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');35 $('jsn-span-unsuccessful-downloading-sampledata-message').set('html', jsonObj.message);36 $('jsn-span-unsuccessful-downloading-sampledata-message').setStyle('display', 'block');37 }38 }}).get({'option': 'com_imageshow', 'controller': 'maintenance', 'task': 'downloadSampleDataPackage', 'rand': Math.random()});39 },40 41 installPackage: function(fileName) 42 {43 $('jsn-span-installing-sampledata-state').setStyle('display', 'inline-block');44 $('jsn-span-unsuccessful-installing-sampledata-message').set('html', '');45 $('jsn-span-unsuccessful-installing-sampledata-message').setStyle('display', 'none');46 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'none');47 $('jsn-installing-sampledata_install_requried_plugin').setStyle('display', 'none');48 $('jsn-span-successful-installing-sampledata').setStyle('display', 'none');49 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'none');50 var url = 'index.php?' + JSNISToken + '=1';51 var jsonRequest = new Request.JSON({url: url, onSuccess: function(jsonObj){52 if(jsonObj.install)53 {54 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');55 $('jsn-span-successful-installing-sampledata').setStyle('display', 'inline-block'); 56 $('jsn-installing-sampledata-successfully').setStyle('display', 'block');57 }58 else59 {60 $('jsn-span-installing-sampledata-state').setStyle('display', 'none');61 $('jsn-install-sampledata-unsuccessful').setStyle('display', 'inline-block');62 63 if (jsonObj.required_elements != undefined)64 { 65 var count = jsonObj.required_elements.length;66 if (count)67 {68 for(var i=0; i<count; i++)69 {70 var element = jsonObj.required_elements[i];71 $('jsn-installing-sampledata_install_requried_plugin').setStyle('display', 'block'); 72 $('jsn-span-unsuccessful-installing-sampledata-message').setStyle('display', 'block');73 $('jsn-span-unsuccessful-installing-sampledata-message').set('html', element.text);74 $('element_type').value=element.type;75 break;76 }77 } 78 }79 else80 {81 $('jsn-span-unsuccessful-installing-sampledata-message').setStyle('display', 'block');82 $('jsn-span-unsuccessful-installing-sampledata-message').set('html', jsonObj.message);83 $('jsn-installing-sampledata-unsuccessfully').setStyle('display', 'block');84 } 85 }86 }}).get({'option': 'com_imageshow', 'controller': 'maintenance', 'task': 'executeInstallSampledataManually', 'file_name': fileName, 'rand': Math.random()});87 }...
Using AI Code Generation
1const { setStyle } = require('playwright/lib/server/dom.js');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 const element = await page.$('text=Learn');8 await setStyle(element, 'background', 'green');9 await page.screenshot({ path: 'screenshot.png' });10 await browser.close();11})();
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({4 });5 const page = await browser.newPage();6 await page.setContent('<div style="font-size: 100px">Hello World</div>');7 await page.$eval('div', (div) => div.setStyle('font-size', '50px'));8 await page.screenshot({ path: 'screenshot.png' });9 await browser.close();10})();11const { chromium } = require('playwright');12(async () => {13 const browser = await chromium.launch({14 });15 const page = await browser.newPage();16 await page.setContent('<div style="font-size: 100px">Hello World</div>');17 await page.$eval('div', (div) => div.setStyle('font-size', '50px'));18 await page.screenshot({ path: 'screenshot.png' });19 await browser.close();20})();21const { chromium } = require('playwright');22(async () => {23 const browser = await chromium.launch({24 });25 const page = await browser.newPage();26 await page.setContent('<div style="font-size: 100px">Hello World</div>');27 await page.$eval('div', (div) => div.setStyle('font-size', '50px'));28 await page.screenshot({ path: 'screenshot.png' });29 await browser.close();30})();31const { chromium } = require('playwright');32(async () => {33 const browser = await chromium.launch({34 });35 const page = await browser.newPage();36 await page.setContent('<div style="font-size: 100px">Hello World</div>');
Using AI Code Generation
1const { setStyle } = require('playwright/lib/server/dom.js');2const {chromium} = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 await page.evaluate(setStyle, 'body', 'background-color', 'red');8 await page.screenshot({path: 'example.png'});9 await browser.close();10})();11const { setStyle } = require('playwright/lib/server/dom.js');12const {chromium} = require('playwright');13(async () => {14 const browser = await chromium.launch();15 const context = await browser.newContext();16 const page = await context.newPage();17 await page.evaluate(setStyle, 'body', 'background-color', 'red');18 await page.screenshot({path: 'example.png'});19 await browser.close();20})();21const { setStyle } = require('playwright/lib/server/dom.js');22const {chromium} = require('playwright');23(async () => {24 const browser = await chromium.launch();25 const context = await browser.newContext();26 const page = await context.newPage();27 await page.evaluate(setStyle, 'body', 'background-color', 'red');28 await page.screenshot({path: 'example.png'});29 await browser.close();30})();31const { setStyle } = require('playwright/lib/server/dom.js');32const {chromium} = require('playwright');33(async () => {34 const browser = await chromium.launch();35 const context = await browser.newContext();36 const page = await context.newPage();37 await page.evaluate(setStyle, 'body', 'background-color', 'red');38 await page.screenshot({path: 'example.png'});39 await browser.close();40})();
Using AI Code Generation
1const { setStyle } = require('playwright-internal');2const fs = require('fs');3const path = require('path');4const css = fs.readFileSync(path.join(__dirname, 'test.css'), 'utf8');5setStyle(css);6body {7 background-color: red;8}9const { chromium } = require('playwright');10(async () => {11 const browser = await chromium.launch();12 const context = await browser.newContext();13 await context.addInitScript(() => {14 const { setStyle } = require('playwright-internal');15 const fs = require('fs');16 const path = require('path');17 const css = fs.readFileSync(path.join(__dirname, 'test.css'), 'utf8');18 setStyle(css);19 });20 const page = await context.newPage();21})();22body {23 background-color: red;24}25const { chromium } = require('playwright');26(async () => {27 const browser = await chromium.launch();28 const context = await browser.newContext({29 extraHTTPHeaders: {30 }31 });32 const page = await context.newPage();33 const headers = await page.evaluate(() => {34 return JSON.parse(document.body.textContent).headers;35 });36 console.log(headers);37})();
Using AI Code Generation
1const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderApp');2setStyle('body', 'background-color: red');3setStyle('body', 'background-color: blue');4setStyle('body', 'background-color: green');5setStyle('body', 'background-color: white');6setStyle('body', 'background-color: black');7const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderApp');8const element = document.querySelector('body');9setStyle(element, 'background-color: red');10setStyle(element, 'background-color: blue');11setStyle(element, 'background-color: green');12setStyle(element, 'background-color: white');13setStyle(element, 'background-color: black');14const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderApp');15const element = document.querySelector('body');16setStyle(element, 'background-color: red');17setStyle(element, 'background-color: blue');18setStyle(element, 'background-color: green');19setStyle(element, 'background-color: white');20setStyle(element, 'background-color: black');21const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderApp');22const element = document.querySelector('body');23setStyle(element, 'background-color: red');24setStyle(element, 'background-color: blue');25setStyle(element, 'background-color: green');26setStyle(element, 'background-color: white');27setStyle(element, 'background-color: black');28const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderApp');29const element = document.querySelector('body');30setStyle(element, 'background-color: red');31setStyle(element, 'background-color: blue');32setStyle(element, 'background-color: green');33setStyle(element, 'background-color: white');34setStyle(element, 'background-color: black');35const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderApp');36const element = document.querySelector('body');37setStyle(element, 'background-color: red');
Using AI Code Generation
1const { setStyle } = require('@playwright/test/lib/server/frames');2const frame = page.mainFrame();3await setStyle(frame, 'body', 'background-color', 'red');4const { getStyle } = require('@playwright/test/lib/server/frames');5const frame = page.mainFrame();6const color = await getStyle(frame, 'body', 'background-color');7const { setViewportSize } = require('@playwright/test/lib/server/browserContext');8await setViewportSize(page.context(), 500, 500);9const { getViewportSize } = require('@playwright/test/lib/server/browserContext');10const size = await getViewportSize(page.context());11const { setGeolocation } = require('@playwright/test/lib/server/browserContext');12await setGeolocation(page.context(), {latitude: 10, longitude: 10});13const { getGeolocation } = require('@playwright/test/lib/server/browserContext');14const geolocation = await getGeolocation(page.context());15const { setExtraHTTPHeaders } = require('@playwright/test/lib/server/browserContext');16await setExtraHTTPHeaders(page.context(), { 'header1': 'value1', 'header2': 'value2' });17const { getExtraHTTPHeaders } = require('@playwright/test/lib/server/browserContext');18const headers = await getExtraHTTPHeaders(page.context());19const { addInitScript } = require('@playwright/test/lib/server/browserContext');20await addInitScript(page.context(), 'window.__myVar = 42;');21const { setOffline } = require('@playwright/test/lib/server/browserContext');22await setOffline(page.context(), true);23const { getOffline } = require('@playwright/test/lib/server/browserContext');24const isOffline = await getOffline(page.context());
Using AI Code Generation
1const { setStyle } = require('@playwright/test/lib/internal/stylesheet');2setStyle('.test', 'color: red');3const { setStyle } = require('@playwright/test/lib/internal/stylesheet');4setStyle('.test', 'color: red');5const { test, expect } = require('@playwright/test');6test('test', async ({ page }) => {7 const title = page.locator('.navbar__inner .navbar__title');8 await expect(title).toHaveText('Playwright');9});10const { test, expect } = require('@playwright/test');11test('test', async ({ page }) => {12 const title = page.locator('.navbar__inner .navbar__title');13 await expect(title).toHaveText('Playwright');14});15const { test, expect } = require('@playwright/test');16test('test', async ({ page }) => {17 const title = page.locator('.navbar__inner .navbar__title');18 await expect(title).toHaveText('Playwright');19});20const { test, expect } = require('@playwright/test');21test('test', async ({ page }) => {22 const title = page.locator('.navbar__inner .navbar__title');23 await expect(title).toHaveText('Playwright');24});25const { test, expect } = require('@playwright/test');26test('test', async ({ page }) => {27 const title = page.locator('.navbar__inner .navbar__title');28 await expect(title).toHaveText('Playwright');29});30const { test, expect } = require('@playwright/test');31test('test', async ({ page }) => {32 const title = page.locator('.navbar__inner .navbar__title');33 await expect(title).toHaveText('Playwright');34});35const { test, expect } = require('@playwright
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const selector = 'text=Learn more';7 await page.waitForSelector(selector);8 const element = await page.$(selector);9 await element.evaluate(element => {
Using AI Code Generation
1const { setStyle } = require('playwright/lib/utils/dom.js');2setStyle(document.querySelector('div'), 'display', 'none');3const { setStyle } = require('test.js');4describe('test', () => {5 it('test', async () => {6 });7});
Using AI Code Generation
1const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');2setStyle('font-family', 'Arial', 'div');3const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');4setStyle('font-family', 'Arial', 'div');5const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');6setStyle('font-family', 'Arial', 'div');7const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');8setStyle('font-family', 'Arial', 'div');9const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');10setStyle('font-family', 'Arial', 'div');11const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');12setStyle('font-family', 'Arial', 'div');13const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');14setStyle('font-family', 'Arial', 'div');15const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');16setStyle('font-family', 'Arial', 'div');17const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');18setStyle('font-family', 'Arial', 'div');19const { setStyle } = require('playwright/lib/server/supplements/recorder/recorderSupplement.js');20setStyle('font-family', 'Arial', 'div');21const { setStyle } = require('playwright/lib/server/supplements/recorder
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!