Plugin Directory

Changeset 2156545


Ignore:
Timestamp:
09/14/2019 02:41:31 PM (6 years ago)
Author:
traveledmap
Message:

New pictures slider

Location:
traveledmap-trip-itinerary-embedded-map/trunk
Files:
9 added
12 edited

Legend:

Unmodified
Added
Removed
  • traveledmap-trip-itinerary-embedded-map/trunk/.gitignore

    r2136759 r2156545  
    44## keep compiled files out of version control
    55# dist/
     6.idea
  • traveledmap-trip-itinerary-embedded-map/trunk/dist/blocks.build.js

    r2136499 r2156545  
    1 !function(e){function t(l){if(n[l])return n[l].exports;var r=n[l]={i:l,l:!1,exports:{}};return e[l].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t){},function(e,t){},function(e,t){e.exports=wp.components},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(4),n(6)},function(e,t,n){"use strict";function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),a=(n.n(r),n(1)),i=(n.n(a),n(2)),o=(n.n(i),n(5)),__=wp.i18n.__,p=wp.blocks.registerBlockType,s=wp.element.Fragment;p("traveledmap/embedded-trip-block",{title:__("Embedded Trip"),icon:"location-alt",category:"traveledmap",keywords:[__("Embedded Map"),__("TraveledMap"),__("Traveled Map"),__("Embedded"),__("Embed")],attributes:{userId:{type:"string",source:"meta",meta:"traveledmap_user_id"},tripId:{type:"string",source:"meta",meta:"traveledmap_trip_id"},nickname:{type:"string",source:"meta",meta:"traveledmap_nickname"},baseUrl:{type:"string",source:"meta",meta:"traveledmap_trip_base_url"},mapUrl:{type:"string"},showPopup:{type:"boolean",default:!0},showPictures:{type:"boolean",default:!0},showPicturesAtStart:{type:"boolean",default:!1},isSticky:{type:"boolean",default:!0},mapHeight:{type:"string",default:"50%"},standardMapHeight:{type:"string",default:"30%"},extendedMapHeight:{type:"string",default:"60%"},marginTop:{type:"number",default:0}},edit:function(e){var t=e.attributes,n=t.baseUrl,r=t.userId,a=t.nickname,p=t.tripId,c=t.showPopup,u=t.showPictures,m=t.showPicturesAtStart,d=t.mapUrl,h=t.isSticky,w=t.mapHeight,g=t.standardMapHeight,b=t.extendedMapHeight,f=t.marginTop,v=e.setAttributes,y=function(e){return function(t){v(l({},e,t))}},E=function(){v({mapUrl:Object(o.a)(n,c,u,m)})},P=function(e){return!(e&&(!Array.isArray(e)||Array.isArray(e)&&e[0]))};return wp.element.createElement("div",{className:"traveledmap-trip-edit-block"},wp.element.createElement("div",null,wp.element.createElement(i.Panel,{header:"Map settings"},wp.element.createElement(i.PanelBody,{title:"Map content",icon:"admin-site-alt",initialOpen:!0},wp.element.createElement(i.PanelRow,null,wp.element.createElement("p",{className:"mb-0 note"},wp.element.createElement("strong",null,"User id:"),"\xa0",function(){return P(r)?P(a)?null:a:r}()||"You need to fill the user id you want to use in the editor's sidebar, save the post and then reload"),wp.element.createElement("p",{className:"note"},wp.element.createElement("strong",null,"Trip id:"),"\xa0",function(){return P(p)?null:p}()||"You need to fill the trip id you want to use in the editor's sidebar, save the post and then reload")),wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.ToggleControl,{label:"Show steps name",help:c?"Popup with step name will be shown":"Popup will be show only if mouse is over the step marker",checked:c,onChange:function(){return v({showPopup:!c})}})),wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.ToggleControl,{label:"Show pictures",help:u?"Pictures panel will be open":"Pictures will be hidden",checked:u,onChange:function(){return v({showPictures:!u})}})),wp.element.createElement(i.PanelRow,null,u&&wp.element.createElement(i.ToggleControl,{label:"Show overview pictures",help:m?"Your trip overview has pictures that will be shown":"The overview pictures will be hidden",checked:m,onChange:function(){return v({showPicturesAtStart:!m})}})),wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.Button,{isPrimary:!0,onClick:E,className:"ml-auto"},"Validate"))),wp.element.createElement(i.PanelBody,{title:"Map settings",icon:"admin-settings",initialOpen:!0},wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.TextControl,{label:"Map height (when it's not sticky)",value:w,onChange:y("mapHeight"),help:"Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%",className:"input-100"})),wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.ToggleControl,{label:"Map is sticky",help:h?"The map will be visible on top of the screen while scrolling":"The map will be fixed and won't move",checked:h,onChange:function(){return v({isSticky:!h})},className:"mt-5"})),h&&wp.element.createElement(s,null,wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.TextControl,{label:"Map height when the map is sticky and not extended",value:g,onChange:y("standardMapHeight"),help:"Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%",className:"input-100"})),wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.TextControl,{label:"Map height when the map is sticky and extended",value:b,onChange:y("extendedMapHeight"),help:"Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%",className:"input-100"})),wp.element.createElement(i.PanelRow,null,wp.element.createElement(i.TextControl,{type:"number",label:"Top margin (Space between the top of the screen and the map when it's sticky)",value:f,onChange:y("marginTop"),help:"Height can be written only in pixels (px). You don't need to write the unit. i.e: 20",className:"input-100"})))))),d&&wp.element.createElement("div",null,wp.element.createElement("iframe",{className:"map-iframe traveledmap-reference-iframe",src:d,frameBorder:"0",style:{height:function(e){return e.replace("%","VH")}(w)}})))},save:function(){return null}})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var l=function(e,t,n,l){var r=e;return r+=(t?"&showPopup=true":"")+(n?"":"&hidePictures=true")+(l?"&showPicturesAtStart=true":"")}},function(e,t,n){"use strict";var l=n(0),r=(n.n(l),n(1)),a=(n.n(r),n(2)),__=(n.n(a),wp.i18n.__),i=wp.blocks.registerBlockType;wp.element.Fragment;i("traveledmap/embedded-trip-step-block",{title:__("Step scroll anchor"),icon:"location",category:"traveledmap",keywords:[__("Embedded Trip Step"),__("Embed"),__("Step"),__("Trip"),__("City"),__("Place"),__("Scroll"),__("Anchor")],attributes:{tripStepsJson:{type:"string",source:"meta",meta:"traveledmap_trip_steps"},tripSteps:{type:"string"},location:{type:"string"}},edit:function(e){var t=e.attributes,n=t.location,l=t.tripStepsJson,r=t.tripSteps,i=e.setAttributes;if(!r&&l){console.log({tripStepsJson:l});var o=JSON.parse(JSON.parse(l));o?i({tripSteps:o,location:n&&n.length>0?n:Object.keys(o)[0]}):console.warn("Trip steps was not defined",o,l)}return r?wp.element.createElement("div",null,wp.element.createElement(a.SelectControl,{label:"Choose the step the map should move on when reaching this section of the post",value:n,options:Object.keys(r).map(function(e){return{label:r[e],value:e}}),onChange:function(e){return i({location:e})}})):wp.element.createElement("div",{className:"flex-center"},wp.element.createElement(a.Spinner,null))},save:function(e){var t=e.attributes.location;return wp.element.createElement("div",{className:"traveledmap-trip-anchor",id:t})}})}]);
     1!function(e){function t(l){if(n[l])return n[l].exports;var r=n[l]={i:l,l:!1,exports:{}};return e[l].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t){},function(e,t){},function(e,t){e.exports=wp.components},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(4),n(6)},function(e,t,n){"use strict";function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),a=(n.n(r),n(1)),o=(n.n(a),n(2)),i=(n.n(o),n(5)),__=wp.i18n.__,p=wp.blocks.registerBlockType,s=wp.element.Fragment;p("traveledmap/embedded-trip-block",{title:__("Embedded Trip"),icon:"location-alt",category:"traveledmap",keywords:[__("Embedded Map"),__("TraveledMap"),__("Traveled Map"),__("Embedded"),__("Embed")],attributes:{userId:{type:"string",source:"meta",meta:"traveledmap_user_id"},tripId:{type:"string",source:"meta",meta:"traveledmap_trip_id"},nickname:{type:"string",source:"meta",meta:"traveledmap_nickname"},baseUrl:{type:"string",source:"meta",meta:"traveledmap_trip_base_url"},mapUrl:{type:"string"},showPopup:{type:"boolean",default:!0},showPictures:{type:"boolean",default:!0},showPicturesAtStart:{type:"boolean",default:!1},isSticky:{type:"boolean",default:!0},showOnPhones:{type:"boolean",default:!0},showOnTablets:{type:"boolean",default:!0},showOnLargeScreens:{type:"boolean",default:!0},mapHeight:{type:"string",default:"50%"},standardMapHeight:{type:"string",default:"30%"},extendedMapHeight:{type:"string",default:"60%"},marginTop:{type:"number",default:0}},edit:function(e){var t=e.attributes,n=t.baseUrl,r=t.userId,a=t.nickname,p=t.tripId,c=t.showPopup,m=t.showPictures,u=t.showPicturesAtStart,h=t.mapUrl,d=t.isSticky,w=t.showOnPhones,b=t.showOnTablets,g=t.showOnLargeScreens,f=t.mapHeight,v=t.standardMapHeight,y=t.extendedMapHeight,E=t.marginTop,P=e.setAttributes,T=function(e){return function(t){P(l({},e,t))}},x=function(){P({mapUrl:Object(i.a)(n,c,m,u)})},k=function(e){return!(e&&(!Array.isArray(e)||Array.isArray(e)&&e[0]))};return wp.element.createElement("div",{className:"traveledmap-trip-edit-block"},wp.element.createElement("div",null,wp.element.createElement(o.Panel,{header:"Map settings"},wp.element.createElement(o.PanelBody,{title:"Map content",icon:"admin-site-alt",initialOpen:!0},wp.element.createElement(o.PanelRow,null,wp.element.createElement("p",{className:"mb-0 note"},wp.element.createElement("strong",null,"User id:"),"\xa0",function(){return k(r)?k(a)?null:a:r}()||"You need to fill the user id you want to use in the editor's sidebar, save the post and then reload"),wp.element.createElement("p",{className:"note"},wp.element.createElement("strong",null,"Trip id:"),"\xa0",function(){return k(p)?null:p}()||"You need to fill the trip id you want to use in the editor's sidebar, save the post and then reload")),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.ToggleControl,{label:"Show on phones",help:w?"The map will be shown on mobile (< 576px)":"The map will be hidden on mobile devices",checked:w,onChange:function(){return P({showOnPhones:!w})}}),wp.element.createElement(o.ToggleControl,{label:"Show on tablets",help:b?"The map will be shown on tablets (> 576px and < 768px)":"The map will be hidden on tablets devices",checked:b,onChange:function(){return P({showOnTablets:!b})}}),wp.element.createElement(o.ToggleControl,{label:"Show on larger screens",help:g?"The map will be shown on larger screens (> 768px)":"The map will be hidden on larger devices",checked:g,onChange:function(){return P({showOnLargeScreens:!g})}})),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.ToggleControl,{label:"Show steps name",help:c?"Popup with step name will be shown":"Popup will be show only if mouse is over the step marker",checked:c,onChange:function(){return P({showPopup:!c})}})),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.ToggleControl,{label:"Show pictures",help:m?"Pictures panel will be open":"Pictures will be hidden",checked:m,onChange:function(){return P({showPictures:!m})}})),wp.element.createElement(o.PanelRow,null,m&&wp.element.createElement(o.ToggleControl,{label:"Show overview pictures",help:u?"Your trip overview has pictures that will be shown":"The overview pictures will be hidden",checked:u,onChange:function(){return P({showPicturesAtStart:!u})}})),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.Button,{isPrimary:!0,onClick:x,className:"ml-auto"},"Validate"))),wp.element.createElement(o.PanelBody,{title:"Map settings",icon:"admin-settings",initialOpen:!0},wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.TextControl,{label:"Map height (when it's not sticky)",value:f,onChange:T("mapHeight"),help:"Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%",className:"input-100"})),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.ToggleControl,{label:"Map is sticky",help:d?"The map will be visible on top of the screen while scrolling":"The map will be fixed and won't move",checked:d,onChange:function(){return P({isSticky:!d})},className:"mt-5"})),d&&wp.element.createElement(s,null,wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.TextControl,{label:"Map height when the map is sticky and not extended",value:v,onChange:T("standardMapHeight"),help:"Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%",className:"input-100"})),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.TextControl,{label:"Map height when the map is sticky and extended",value:y,onChange:T("extendedMapHeight"),help:"Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%",className:"input-100"})),wp.element.createElement(o.PanelRow,null,wp.element.createElement(o.TextControl,{type:"number",label:"Top margin (Space between the top of the screen and the map when it's sticky)",value:E,onChange:T("marginTop"),help:"Height can be written only in pixels (px). You don't need to write the unit. i.e: 20",className:"input-100"})))))),h&&wp.element.createElement("div",null,wp.element.createElement("iframe",{className:"map-iframe traveledmap-reference-iframe",src:h,frameBorder:"0",allow:"fullscreen",style:{height:function(e){return e.replace("%","VH")}(f)}})))},save:function(){return null}})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var l=function(e,t,n,l){var r=e;return r+=(t?"&showPopup=true":"")+(n?"":"&hidePictures=true")+(l?"&showPicturesAtStart=true":"")}},function(e,t,n){"use strict";var l=n(0),r=(n.n(l),n(1)),a=(n.n(r),n(2)),__=(n.n(a),wp.i18n.__),o=wp.blocks.registerBlockType;wp.element.Fragment;o("traveledmap/embedded-trip-step-block",{title:__("Step scroll anchor"),icon:"location",category:"traveledmap",keywords:[__("Embedded Trip Step"),__("Embed"),__("Step"),__("Trip"),__("City"),__("Place"),__("Scroll"),__("Anchor")],attributes:{tripStepsJson:{type:"string",source:"meta",meta:"traveledmap_trip_steps"},tripSteps:{type:"string"},location:{type:"string"}},edit:function(e){var t=e.attributes,n=t.location,l=t.tripStepsJson,r=t.tripSteps,o=e.setAttributes;if(!r&&l){console.log({tripStepsJson:l});var i=JSON.parse(JSON.parse(l));i?o({tripSteps:i,location:n&&n.length>0?n:Object.keys(i)[0]}):console.warn("Trip steps was not defined",i,l)}return r?wp.element.createElement("div",null,wp.element.createElement(a.SelectControl,{label:"Choose the step the map should move on when reaching this section of the post",value:n,options:Object.keys(r).map(function(e){return{label:r[e],value:e}}),onChange:function(e){return o({location:e})}})):wp.element.createElement("div",{className:"flex-center"},wp.element.createElement(a.Spinner,null))},save:function(e){var t=e.attributes.location;return wp.element.createElement("div",{className:"traveledmap-trip-anchor",id:t})}})}]);
  • traveledmap-trip-itinerary-embedded-map/trunk/dist/blocks.style.build.css

    r2136499 r2156545  
    1 .wp-block-traveledmap-trip{z-index:2000}.wp-block-traveledmap-trip .traveledmap-post-map{width:100%;height:500px;-webkit-transition:height .3s ease;-o-transition:height .3s ease;transition:height .3s ease;margin-bottom:0}.wp-block-traveledmap-trip .actions-wrapper{background-color:rgba(255,255,255,0.75);padding:5px;margin-top:-7px}.wp-block-traveledmap-trip .actions-wrapper button{background-color:transparent;border:1px solid #404040;border-radius:50px;color:#404040;width:30px;height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0;margin:0;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-o-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}.wp-block-traveledmap-trip .actions-wrapper button:focus{outline:none}.wp-block-traveledmap-trip .actions-wrapper button:hover{background-color:#404040;color:white}.wp-block-traveledmap-trip .actions-wrapper button .expand-icon,.wp-block-traveledmap-trip .actions-wrapper button .reduce-icon,.wp-block-traveledmap-trip .actions-wrapper button .show-icon,.wp-block-traveledmap-trip .actions-wrapper button .hide-icon{display:-ms-flexbox;display:flex}.wp-block-traveledmap-trip .actions-wrapper button .expand-icon svg,.wp-block-traveledmap-trip .actions-wrapper button .reduce-icon svg,.wp-block-traveledmap-trip .actions-wrapper button .show-icon svg,.wp-block-traveledmap-trip .actions-wrapper button .hide-icon svg{width:14px;height:14px}.wp-block-traveledmap-trip.is-extended button .expand-icon{display:none}.wp-block-traveledmap-trip.is-extended button .reduce-icon{display:block}.wp-block-traveledmap-trip:not(.is-extended) button .expand-icon,.wp-block-traveledmap-trip:not(.is-extended) button .hide-icon{display:block}.wp-block-traveledmap-trip:not(.is-extended) button .reduce-icon{display:none}.wp-block-traveledmap-trip.is-hidden .toggle-expand-button{display:none}.wp-block-traveledmap-trip.is-hidden button .expand-icon,.wp-block-traveledmap-trip.is-hidden button .hide-icon{display:none}.wp-block-traveledmap-trip.is-hidden button .reduce-icon,.wp-block-traveledmap-trip.is-hidden button .show-icon{display:block}.wp-block-traveledmap-trip:not(.is-hidden) button .hide-icon{display:block}.wp-block-traveledmap-trip:not(.is-hidden) button .show-icon{display:none}.wp-block-traveledmap-trip .flex-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.wp-block-traveledmap-trip .mr-5{margin-right:5px !important}.traveledmap-trip-widget-wrapper{position:relative}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container{z-index:2000}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content.not-extandable .traveledmap-trip-widget-overlay{display:none}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content{position:relative;height:100%;overflow:hidden}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-map{height:100%;width:100%;margin-bottom:0}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay{position:absolute;right:0;bottom:0;left:0;-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);height:50px;width:100%;background-color:rgba(0,0,0,0.6);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;-o-transition:transform .3s ease;transition:transform .3s ease;transition:transform .3s ease, -webkit-transform .3s ease;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:white;cursor:pointer}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay svg{width:18px;height:18px;-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;-o-transition:transform .2s ease;transition:transform .2s ease;transition:transform .2s ease, -webkit-transform .2s ease}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay:hover svg{-webkit-transform:scale(1.3);-ms-transform:scale(1.3);transform:scale(1.3)}@media (max-width: 768px){.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay {display:none}}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content:hover .traveledmap-trip-widget-overlay{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.traveledmap-trip-widget-overlay{background-color:red}.traveledmap-is-hidden{display:none}
     1.wp-block-traveledmap-trip{z-index:2000}.wp-block-traveledmap-trip .traveledmap-post-map{width:100%;height:500px;-webkit-transition:height .3s ease;-o-transition:height .3s ease;transition:height .3s ease;margin-bottom:0}.wp-block-traveledmap-trip .actions-wrapper{background-color:rgba(255,255,255,0.75);padding:5px;margin-top:-7px}.wp-block-traveledmap-trip .actions-wrapper button{background-color:transparent;border:1px solid #404040;border-radius:50px;color:#404040;width:30px;height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0;margin:0;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-o-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}.wp-block-traveledmap-trip .actions-wrapper button:focus{outline:none}.wp-block-traveledmap-trip .actions-wrapper button:hover{background-color:#404040;color:white}.wp-block-traveledmap-trip .actions-wrapper button .expand-icon,.wp-block-traveledmap-trip .actions-wrapper button .reduce-icon,.wp-block-traveledmap-trip .actions-wrapper button .show-icon,.wp-block-traveledmap-trip .actions-wrapper button .hide-icon{display:-ms-flexbox;display:flex}.wp-block-traveledmap-trip .actions-wrapper button .expand-icon svg,.wp-block-traveledmap-trip .actions-wrapper button .reduce-icon svg,.wp-block-traveledmap-trip .actions-wrapper button .show-icon svg,.wp-block-traveledmap-trip .actions-wrapper button .hide-icon svg{width:14px;height:14px}.wp-block-traveledmap-trip.is-extended button .expand-icon{display:none}.wp-block-traveledmap-trip.is-extended button .reduce-icon{display:block}.wp-block-traveledmap-trip:not(.is-extended) button .expand-icon,.wp-block-traveledmap-trip:not(.is-extended) button .hide-icon{display:block}.wp-block-traveledmap-trip:not(.is-extended) button .reduce-icon{display:none}.wp-block-traveledmap-trip.is-hidden .toggle-expand-button{display:none}.wp-block-traveledmap-trip.is-hidden button .expand-icon,.wp-block-traveledmap-trip.is-hidden button .hide-icon{display:none}.wp-block-traveledmap-trip.is-hidden button .reduce-icon,.wp-block-traveledmap-trip.is-hidden button .show-icon{display:block}.wp-block-traveledmap-trip:not(.is-hidden) button .hide-icon{display:block}.wp-block-traveledmap-trip:not(.is-hidden) button .show-icon{display:none}.wp-block-traveledmap-trip .flex-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.wp-block-traveledmap-trip .mr-5{margin-right:5px !important}.traveledmap-trip-breakpoints{display:none}.traveledmap-trip-widget-wrapper{position:relative}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container{z-index:2000}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content.not-extandable .traveledmap-trip-widget-overlay{display:none}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content{position:relative;height:100%;overflow:hidden}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-map{height:100%;width:100%;margin-bottom:0}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay{position:absolute;right:0;bottom:0;left:0;-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);height:50px;width:100%;background-color:rgba(0,0,0,0.6);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;-o-transition:transform .3s ease;transition:transform .3s ease;transition:transform .3s ease, -webkit-transform .3s ease;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:white;cursor:pointer}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay svg{width:18px;height:18px;-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;-o-transition:transform .2s ease;transition:transform .2s ease;transition:transform .2s ease, -webkit-transform .2s ease}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay:hover svg{-webkit-transform:scale(1.3);-ms-transform:scale(1.3);transform:scale(1.3)}@media (max-width: 768px){.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content .traveledmap-trip-widget-overlay {display:none}}.traveledmap-trip-widget-wrapper .traveledmap-trip-widget-map-container .traveledmap-trip-widget-map-content:hover .traveledmap-trip-widget-overlay{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.traveledmap-trip-widget-overlay{background-color:red}.traveledmap-is-hidden{display:none}
  • traveledmap-trip-itinerary-embedded-map/trunk/plugin.php

    r2136759 r2156545  
    22/**
    33 * Plugin Name: TraveledMap Trip itinerary: Embedded map
    4  * Plugin URI: https://wordpress.org/plugins/traveledmap-trip-itinerary-embedded-map/
     4 * Plugin URI: https://github.com/ahmadawais/create-guten-block/
    55 * Description: TraveledMap: Trip
    6  * Author: traveledmap
    7  * Author URI: https://www.traveledmap.com
    8  * Version: 1.0
     6 * Author: mrahmadawais, maedahbatool
     7 * Author URI: https://AhmadAwais.com/
     8 * Version: 1.0.0
    99 * License: GPL2+
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
    1111 *
    12  * @package TraveledMapTripItinerary
     12 * @package CGB
    1313 */
    1414
  • traveledmap-trip-itinerary-embedded-map/trunk/readme.txt

    r2136766 r2156545  
    66Tested up to: 5.2.1
    77Requires PHP: 5.6
    8 Stable tag: 1.0
     8Stable tag: 1.0.1
    99License: GPLv2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050You can customise the widget using different options:
    5151
     52 - <strong>Show on phones</strong> will decide if the map will appear when a user is visiting the website with a mobile (width <= 576px).
     53 - <strong>Show on tablets</strong> will decide if the map will appear when a user is visiting the website with a tablet (576px > width <= 768px).
     54 - <strong>Show on larger screens</strong> will decide if the map will appear when a user is visiting the website with a larger screen than phone or tablet (> 768px).
    5255 - <strong>Map height</strong>: The default map's height when it's not expanded.
    5356 - <strong>Widget is sticky</strong>: If checked, the widget will be sticky to the top of the screen even if he's not expanded. This way, it will follow the user scroll even in reduced size.
     
    8487 - <strong>Map height</strong> can be defined in pixels (px) or percentage (%) of the screen's height. It will define the height of the map when it's not sticky.
    8588 - <strong>Map is sticky</strong> will decide if the map sticks to the top of the screen while user scroll to read the blog post.
     89 - <strong>Show on phones</strong> will decide if the map will appear when a user is visiting the website with a mobile (width <= 576px).
     90 - <strong>Show on tablets</strong> will decide if the map will appear when a user is visiting the website with a tablet (576px > width <= 768px).
     91 - <strong>Show on larger screens</strong> will decide if the map will appear when a user is visiting the website with a larger screen than phone or tablet (> 768px).
    8692 - <strong>Height of the map in its standard height</strong>: This is the height the map will take. Either you can specify a fixed height with pixels (e.g 300px)
    8793 or you can specify a percentage relative to the screen height (e.g 40%).
     
    9298
    9399**Shortcode example**
    94 [embedded_trip show_popup="0" show_pictures="1" show_pictures_at_start="0" map_height="60%" is_sticky="1" standard_map_height="35%" extended_map_height="70%" margin_top="10"]
     100[embedded_trip show_popup="0" show_pictures="1" show_pictures_at_start="0" map_height="60%" is_sticky="1" show_on_phones="1" show_on_tablets="1" show_on_large_screens="1" standard_map_height="35%" extended_map_height="70%" margin_top="10"]
    95101
    96102
     
    137143== Screenshots ==
    138144
    139 1. Example - Expanded widget
    140 2. Example - Reduced widget
    141 3. Example - Standard map
    142 4. How to use - Widget configuration
    143 5. How to use - Standard map block
    144 6. How to use - metabox
     1451. Example - Expanded widget: `/assets/example-1.png`
     1462. Example - Reduced widget: `/assets/example-2.png`
     1473. Example - Standard map: `/assets/example-3.png`
     1484. How to use - metabox: `/assets/metabox.png`
     1495. How to use - Standard map block: `/assets/trip-block.png`
     1506. How to use - Widget configuration: `/assets/widget-config.png`
    145151
    146152== Changelog ==
     
    149155* Creation of the plugin
    150156
     157= 1.0.1 =
     158* New pictures slider
     159
    151160== Upgrade Notice ==
    152161No upgrade to do for the moment
  • traveledmap-trip-itinerary-embedded-map/trunk/src/iframe/iframe-widget.php

    r2136499 r2156545  
    11<?php
     2
     3require('utils/enums.php');
    24
    35add_action('widgets_init', function () {
     
    4042
    4143        $mapUrl .= '&clusteringRadius=0';
    42         $mapUrl .= '&hidePictures=30';
     44        $mapUrl .= '&hidePictures=true';
    4345        $mapUrl .= '&hideAttr=true';
    4446        $mapUrl .= '&hideZoom=true';
     47        $mapUrl .= '&isWidget=true';
    4548        $mapUrl .= $notExtendedShowSteps ? '&showPopup=true' : '';
    4649
     50        $showOnDevices = 'traveledmap-trip-breakpoints';
     51        $showOnDevices .= $instance['show_on_phones'] ? ' ' . DeviceScreensEnum::PHONES : '';
     52        $showOnDevices .= $instance['show_on_tablets'] ? ' ' . DeviceScreensEnum::TABLETS : '';
     53        $showOnDevices .= $instance['show_on_large_screens'] ? ' ' . DeviceScreensEnum::LARGE_SCREENS : '';
     54
     55        echo '<div class="' . $showOnDevices . '">';
    4756        echo $args['before_widget'];
    4857        if (!empty($instance['title'])) {
     
    5463                <div class="traveledmap-trip-widget-map-container">
    5564                    <div class="traveledmap-trip-widget-map-content' . $extendableClass . '">
    56                         <iframe frameborder="0" class="traveledmap-trip-widget-map" src="' . esc_url($mapUrl) . '"></iframe>
     65                        <iframe frameborder="0" allow="fullscreen" class="traveledmap-trip-widget-map" data-src="' . esc_url($mapUrl) . '"></iframe>
    5766                        <div class="traveledmap-trip-widget-overlay" onclick="window.traveledMapToggleMap(\'' . $this->id . '\')">
    5867                            ' . self::getExpandIcon() . '
     
    6877
    6978        echo $args['after_widget'];
     79
     80        echo '</div>';
    7081    }
    7182
     
    8192        $isStickyName = esc_attr($this->get_field_name('is_sticky'));
    8293        $isStickyValue = esc_attr(self::instanceVarToChecked($instance, 'is_sticky'));
     94
     95        $showOnPhoneName = esc_attr($this->get_field_name('show_on_phones'));
     96        $showOnPhonesValue = esc_attr(self::instanceVarToChecked($instance, 'show_on_phones'));
     97        $showOnTabletsName = esc_attr($this->get_field_name('show_on_tablets'));
     98        $showOnTabletsValue = esc_attr(self::instanceVarToChecked($instance, 'show_on_tablets'));
     99        $showOnLargeScreensName = esc_attr($this->get_field_name('show_on_large_screens'));
     100        $showOnLargeScreensValue = esc_attr(self::instanceVarToChecked($instance, 'show_on_large_screens'));
    83101
    84102        $mapHeightName = esc_attr($this->get_field_name('map_height'));
     
    123141
    124142        echo '
     143            <p>
     144                <input type="checkbox" name="' . $showOnPhoneName . '" ' . $showOnPhonesValue . '>
     145                <label for="' . $showOnPhoneName . '">Show on phones</label>,&nbsp;
     146                <input type="checkbox" name="' . $showOnTabletsName . '" ' . $showOnTabletsValue . '>
     147                <label for="' . $showOnTabletsName . '">Show on tablets</label>,&nbsp;
     148                <input type="checkbox" name="' . $showOnLargeScreensName. '" ' . $showOnLargeScreensValue . '>
     149                <label for="' . $showOnLargeScreensName . '">Show on larger screens</label> <br />
     150                <small>
     151                    You can decides on which type of device the widget will show up.
     152                </small>
     153            </p>
    125154            <p>
    126155                <label>Map height (in pixels or percentage)</label>
     
    262291        $instance['extended_left'] = self::instanceVarToBool($new_instance, 'extended_left');
    263292        $instance['is_sticky'] = self::instanceVarToBool($new_instance, 'is_sticky');
     293        $instance['show_on_phones'] = self::instanceVarToBool($new_instance, 'show_on_phones');
     294        $instance['show_on_tablets'] = self::instanceVarToBool($new_instance, 'show_on_tablets');
     295        $instance['show_on_large_screens'] = self::instanceVarToBool($new_instance, 'show_on_large_screens');
    264296        $instance['not_extended_show_steps'] = self::instanceVarToBool($new_instance, 'not_extended_show_steps');
    265297        $instance['extended_show_steps'] = self::instanceVarToBool($new_instance, 'extended_show_steps');
     
    468500           
    469501            ' . listenToIframeLocationChanged() . '
     502           
     503            ' . checkIframeShouldShow() .'
    470504        ';
    471505    }
  • traveledmap-trip-itinerary-embedded-map/trunk/src/iframe/render.php

    r2136499 r2156545  
    1818    $mapClasses = 'traveledmap-post-map';
    1919
    20     $containerClass = 'wp-block-traveledmap-trip';
     20    $containerClass = 'wp-block-traveledmap-trip traveledmap-trip-breakpoints';
    2121    $containerClass .= (bool) $attributes['isSticky'] ? ' map-sticky' : '';
     22    $containerClass .= (bool) $attributes['showOnPhones'] ? ' ' . DeviceScreensEnum::PHONES : '';
     23    $containerClass .= (bool) $attributes['showOnTablets'] ? ' ' . DeviceScreensEnum::TABLETS : '';
     24    $containerClass .= (bool) $attributes['showOnLargeScreens'] ? ' ' . DeviceScreensEnum::LARGE_SCREENS : '';
    2225
    2326    return '
    2427        <div class="' . $containerClass . '">
    25             <iframe id="traveledmap-post-map" class="' . $mapClasses . '" src="' . $mapUrl . '" frameborder="0"></iframe>
     28            <iframe id="traveledmap-post-map" allow="fullscreen" class="' . $mapClasses . '" data-src="' . $mapUrl . '" frameborder="0"></iframe>
    2629            <div class="actions-wrapper flex-center">
    2730                <button type="button" onclick="toggleShow()" class="mr-5">
     
    8790
    8891            ' . listenToIframeLocationChanged() .'
     92           
     93            ' . checkIframeShouldShow() .'
    8994        </div>';
    9095}
  • traveledmap-trip-itinerary-embedded-map/trunk/src/iframe/shortcode.php

    r2136499 r2156545  
    1212        'show_pictures_at_start' => '0',
    1313        'is_sticky' => '1',
     14        'show_on_phones' => '1',
     15        'show_on_tablets' => '1',
     16        'show_on_large_screens' => '1',
    1417        'map_height' => '50%',
    1518        'standard_map_height' => '30%',
     
    2932        'showPicturesAtStart' => $attributes['show_pictures_at_start'],
    3033        'isSticky' => $attributes['is_sticky'],
     34        'showOnPhones' => $attributes['show_on_phones'],
     35        'showOnTablets' => $attributes['show_on_tablets'],
     36        'showOnLargeScreens' => $attributes['show_on_large_screens'],
    3137        'mapHeight' => $attributes['map_height'],
    3238        'standardMapHeight' => $attributes['standard_map_height'],
  • traveledmap-trip-itinerary-embedded-map/trunk/src/iframe/style.scss

    r2136499 r2156545  
    100100}
    101101
     102.traveledmap-trip-breakpoints {
     103    display: none;
     104}
     105
    102106.traveledmap-trip-widget-wrapper {
    103107    //$height: 200px; // be carefull, 200 is also in the JS (iframe-widget.php)
  • traveledmap-trip-itinerary-embedded-map/trunk/src/iframe/trip-block.js

    r2136499 r2156545  
    6868            default: true,
    6969        },
     70        showOnPhones: {
     71            type: 'boolean',
     72            default: true,
     73        },
     74        showOnTablets: {
     75            type: 'boolean',
     76            default: true,
     77        },
     78        showOnLargeScreens: {
     79            type: 'boolean',
     80            default: true,
     81        },
    7082        mapHeight: {
    7183            type: 'string',
     
    98110            attributes: {
    99111                baseUrl, userId, nickname, tripId, showPopup, showPictures, showPicturesAtStart, mapUrl,
    100                 isSticky, mapHeight, standardMapHeight, extendedMapHeight, marginTop,
     112                isSticky, showOnPhones, showOnTablets, showOnLargeScreens, mapHeight, standardMapHeight,
     113                extendedMapHeight, marginTop,
    101114            }, setAttributes
    102115        } = props;
     
    115128
    116129        const getUser = () => {
    117             if(!isEmpty(userId)) {
     130            if (!isEmpty(userId)) {
    118131                return userId;
    119132            }
    120             if(!isEmpty(nickname)) {
     133            if (!isEmpty(nickname)) {
    121134                return nickname;
    122135            }
     
    125138
    126139        const getTripId = () => {
    127             if(!isEmpty(tripId)) {
     140            if (!isEmpty(tripId)) {
    128141                return tripId;
    129142            }
     
    161174                            <PanelRow>
    162175                                <ToggleControl
     176                                    label="Show on phones"
     177                                    help={showOnPhones ? 'The map will be shown on mobile (< 576px)' : 'The map will be hidden on mobile devices'}
     178                                    checked={showOnPhones}
     179                                    onChange={() => setAttributes({showOnPhones: !showOnPhones})}
     180                                />
     181                                <ToggleControl
     182                                    label="Show on tablets"
     183                                    help={showOnTablets ? 'The map will be shown on tablets (> 576px and < 768px)' : 'The map will be hidden on tablets devices'}
     184                                    checked={showOnTablets}
     185                                    onChange={() => setAttributes({showOnTablets: !showOnTablets})}
     186                                />
     187                                <ToggleControl
     188                                    label="Show on larger screens"
     189                                    help={showOnLargeScreens ? 'The map will be shown on larger screens (> 768px)' : 'The map will be hidden on larger devices'}
     190                                    checked={showOnLargeScreens}
     191                                    onChange={() => setAttributes({showOnLargeScreens: !showOnLargeScreens})}
     192                                />
     193                            </PanelRow>
     194
     195                            <PanelRow>
     196                                <ToggleControl
    163197                                    label="Show steps name"
    164198                                    help={showPopup ? 'Popup with step name will be shown' : 'Popup will be show only if mouse is over the step marker'}
     
    219253                                />
    220254                            </PanelRow>
    221                                 {
    222                                     isSticky && (
    223                                         <Fragment>
    224                                             <PanelRow>
    225                                                 <TextControl
    226                                                     label="Map height when the map is sticky and not extended"
    227                                                     value={standardMapHeight}
    228                                                     onChange={onDataChange('standardMapHeight')}
    229                                                     help="Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%"
    230                                                     className="input-100"
    231                                                 />
    232                                             </PanelRow>
    233 
    234                                             <PanelRow>
    235                                                 <TextControl
    236                                                     label="Map height when the map is sticky and extended"
    237                                                     value={extendedMapHeight}
    238                                                     onChange={onDataChange('extendedMapHeight')}
    239                                                     help="Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%"
    240                                                     className="input-100"
    241                                                 />
    242                                             </PanelRow>
    243 
    244                                             <PanelRow>
    245                                                 <TextControl
    246                                                     type="number"
    247                                                     label="Top margin (Space between the top of the screen and the map when it's sticky)"
    248                                                     value={marginTop}
    249                                                     onChange={onDataChange('marginTop')}
    250                                                     help="Height can be written only in pixels (px). You don't need to write the unit. i.e: 20"
    251                                                     className="input-100"
    252                                                 />
    253                                             </PanelRow>
    254                                         </Fragment>
    255                                     )
    256                                 }
     255                            {
     256                                isSticky && (
     257                                    <Fragment>
     258                                        <PanelRow>
     259                                            <TextControl
     260                                                label="Map height when the map is sticky and not extended"
     261                                                value={standardMapHeight}
     262                                                onChange={onDataChange('standardMapHeight')}
     263                                                help="Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%"
     264                                                className="input-100"
     265                                            />
     266                                        </PanelRow>
     267
     268                                        <PanelRow>
     269                                            <TextControl
     270                                                label="Map height when the map is sticky and extended"
     271                                                value={extendedMapHeight}
     272                                                onChange={onDataChange('extendedMapHeight')}
     273                                                help="Height can be written in pixels (px) or percents of the screen's height (%). i.e: 200px or 50%"
     274                                                className="input-100"
     275                                            />
     276                                        </PanelRow>
     277
     278                                        <PanelRow>
     279                                            <TextControl
     280                                                type="number"
     281                                                label="Top margin (Space between the top of the screen and the map when it's sticky)"
     282                                                value={marginTop}
     283                                                onChange={onDataChange('marginTop')}
     284                                                help="Height can be written only in pixels (px). You don't need to write the unit. i.e: 20"
     285                                                className="input-100"
     286                                            />
     287                                        </PanelRow>
     288                                    </Fragment>
     289                                )
     290                            }
    257291                        </PanelBody>
    258292                    </Panel>
     
    261295                    mapUrl && (
    262296                        <div>
    263                             <iframe className="map-iframe traveledmap-reference-iframe" src={mapUrl} frameBorder="0" style={{ height: convertHeightForRendering(mapHeight) }}/>
     297                            <iframe className="map-iframe traveledmap-reference-iframe" src={mapUrl} frameBorder="0" allow="fullscreen" style={{ height: convertHeightForRendering(mapHeight) }}/>
    264298                        </div>
    265299                    )
  • traveledmap-trip-itinerary-embedded-map/trunk/src/iframe/utils/utils.php

    r2136499 r2156545  
    1313                    history.replaceState({}, "", newHash !== null ? "#" + newHash : null);
    1414                    const iframeWindowsTM = window.traveledMapIframes.map(el => el.contentWindow);
    15                     console.log("Test hash change", newHash, iframeWindowsTM);
    1615                    iframeWindowsTM.forEach(ifrmWin => ifrmWin.postMessage({ type: "parentWindowHashChanged", detail: { hash: newHash || null }}, "*"));
    1716                };
     
    9089    ';
    9190}
     91
     92function checkIframeShouldShow() {
     93    return '
     94        <script>
     95            (() => {
     96                const PHONES = "' . DeviceScreensEnum::PHONES . '";
     97                const TABLETS = "' . DeviceScreensEnum::TABLETS . '";
     98                const LARGE_SCREENS = "' . DeviceScreensEnum::LARGE_SCREENS . '";
     99               
     100                const showElement = (el) => {
     101                  const iframe = el.querySelector("iframe");
     102                  if(iframe) {
     103                    el.style.display = "block";
     104                    iframe.setAttribute("src", iframe.getAttribute("data-src"));               
     105                  }
     106                };
     107       
     108                const width = window.innerWidth;
     109                const isPhone = width <= 576;
     110                const isTablet = width > 576 && width <= 768;
     111                const isLargeScreen = width > 768;
     112                Array.from(document.getElementsByClassName("traveledmap-trip-breakpoints")).forEach(el => {
     113                  if(
     114                    isPhone && el.classList.contains(PHONES)
     115                    || isTablet && el.classList.contains(TABLETS)
     116                    || isLargeScreen && el.classList.contains(LARGE_SCREENS)
     117                  ) {
     118                    showElement(el);
     119                  }
     120                });
     121            })();
     122        </script>
     123    ';
     124}
  • traveledmap-trip-itinerary-embedded-map/trunk/src/init.php

    r2136499 r2156545  
    7979                'showPicturesAtStart' => array('type' => 'boolean', 'default' => false),
    8080                'isSticky' => array('type' => 'boolean', 'default' => true),
     81                'showOnPhones' => array('type' => 'boolean', 'default' => true),
     82                'showOnTablets' => array('type' => 'boolean', 'default' => true),
     83                'showOnLargeScreens' => array('type' => 'boolean', 'default' => true),
    8184                'mapHeight' => array('type' => 'string', 'default' => '50%'),
    8285                'standardMapHeight' => array('type' => 'string', 'default' => '30%'),
Note: See TracChangeset for help on using the changeset viewer.