Skip to content

Instantly share code, notes, and snippets.

View JonasEriksson's full-sized avatar

Jonas JonasEriksson

View GitHub Profile
@JonasEriksson
JonasEriksson / Animate options for Mura CMS SelectBox
Created December 10, 2017 18:38
Animate options for Mura CMS SelectBox
bounce^flash^pulse^rubberBand^shake^headShake^swing^tada^wobble^jello^bounceIn^bounceInDown^bounceInLeft^bounceInRight^bounceInUp^bounceOut^bounceOutDown^bounceOutLeft^bounceOutRight^bounceOutUp^fadeIn^fadeInDown^fadeInDownBig^fadeInLeft^fadeInLeftBig^fadeInRight^fadeInRightBig^fadeInUp^fadeInUpBig^fadeInScale^fadeInScaleDown^fadeOut^fadeOutDown^fadeOutDownBig^fadeOutLeft^fadeOutLeftBig^fadeOutRight^fadeOutRightBig^fadeOutUp^fadeOutUpBig^flipInX^flipInY^flipOutX^flipOutY^lightSpeedIn^lightSpeedOut^rotateIn^rotateInDownLeft^rotateInDownRight^rotateInUpLeft^rotateInUpRight^rotateOut^rotateOutDownLeft^rotateOutDownRight^rotateOutUpLeft^rotateOutUpRight^hinge^jackInTheBox^rollIn^rollOut^zoomIn^zoomInDown^zoomInLeft^zoomInRight^zoomInUp^zoomOut^zoomOutDown^zoomOutLeft^zoomOutRight^zoomOutUp^slideInDown^slideInLeft^slideInRight^slideInUp^slideOutDown^slideOutLeft^slideOutRight^slideOutUp
@JonasEriksson
JonasEriksson / cookieconsent-deutsch.cfm
Created March 11, 2017 11:32
CookieConsent Snippet german language
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "##edeff5",
"text": "##838391"
},
@JonasEriksson
JonasEriksson / gist:8e843287779422671834c93f0d9f0ac9
Created March 11, 2017 10:30
Mura Extended Attribute and check for management IP address
<!--- the "development" mode in Mura requires a logged in user to see the content, if this is an admin, the Mura Edit bar is part of the "preview"
sometimes it can be useful to see what the site would look like to a user without this, then a simple IP address check can solve this easily --->
<!--- Add a Extended Attribute for Site/default named managementipaddress --->
<!--- Add code below just after </head> in the html_head.cfm --->
<cfif Len(m.siteConfig('managementipaddress'))>
<p class="red tiny text-center"> MGNTIP active.</p>
<cfif cgi.REMOTE_ADDR EQ "#m.siteConfig('managementipaddress')#">
<cfelse>
@JonasEriksson
JonasEriksson / Using MapBox in Mura CMS with Extended Attributes
Last active December 12, 2016 18:37
This is an example which requires Mura CMS ExtendedAttributes for Longitude and Latitude, a ZoomLevel Setting as well as a imCompanyName. We take a center basd on a company's location, then expand the boundaries for the map to prevent scrolling off to Timbuktu, and also limit the zoom level (we seek local directions after all, not an image of a …
<cfset companyName = "#m.siteConfig('imCompanyName')#">
<cfset Lng1 = #m.siteConfig('imPositionLongitude')#>
<cfset Lat1 = #m.siteConfig('imPositionLatitude')#>
<cfset Zoom1 = #m.siteConfig('imPositionZoom')#>
<cfset BoundsSWLng1 = Lng1-2.15>
<cfset BoundsSWLat1 = Lat1-4.00>
<cfset BoundsNELng1 = Lng1+8.55>
<cfset BoundsNELat1 = Lat1+4.55>
<div class="col-md-7">
mapbox://styles/mapbox/streets-v10
mapbox://styles/mapbox/outdoors-v9
mapbox://styles/mapbox/light-v9
mapbox://styles/mapbox/dark-v9
mapbox://styles/mapbox/satellite-v9
mapbox://styles/mapbox/satellite-streets-v9
@JonasEriksson
JonasEriksson / Display Logo from Extended Attribute type file in SiteConfig
Last active December 8, 2016 02:18
Mura CMS: Display Logo from Extended Attribute type file in SiteConfig
<!-- Show logo if available in SiteConfig Extended Data Attribute -->
<cfif Len(m.getURLForImage(m.siteConfig('imCompanyLogofile')))>
<cfscript>
img = m.getURLForImage(
fileid = m.siteConfig('imCompanyLogofile') // could be _any_ fileid in Mura
,size = 'Large' // small, medium, large, custom, or any other pre-defined image size
,complete = false // set to true to include the entire URL, not just the absolute path (default)
,siteid = $.event('siteid') // could pull an image from another siteid, if desired
);
</cfscript>
@JonasEriksson
JonasEriksson / currentURL.cfm snippet
Created October 3, 2016 09:52
Display different translations based on Mura site content directory structure.
<!--- Multilanguage sites often are structed with a "directory" structure of www.apple.com/se or www.apple.com/de for different languages.
If your site uses this option in Mura (either a folder or page named accordingly (en, de, se, ...) with other pages below this), the following might be a simple solution for using
templates for page layouts or components. --->
<!--- Mura Translations is a great plugin, but sometimes only a few small sections need to be translated, this is where is is one of probably many options --->
<!--- Note: The following commented out line is only required once per page, you could set this in the header for simplicity. --->
<!--- <cfset currentURL = "#CGI.SERVER_NAME#" & "#CGI.PATH_INFO#"> --->
<cfif currentURL CONTAINS '/en'> <!-- display english language -->
<h3>This should show on the english "site".</h3>
<cfelseif currentURL CONTAINS '/de' OR currentURL CONTAINS '/at'> <!-- display german language -->
@JonasEriksson
JonasEriksson / mk800-hideP1
Last active June 6, 2016 16:21
If loopcount is 1 and "parallel" is set to 1, hide the current row.
<cfif session.goparallel IS 1 AND i IS 1>
hidden
</cfif>
@JonasEriksson
JonasEriksson / innomega_html_foot_add_on_GoogleMap_Coordinates
Last active May 24, 2016 11:09
Script for Google Map coordinates based on Mura CMS Extended Data for Site Settings.
<!--- Requires three Extended Attributes on Site/Default: GoogleMapsZoomFactor,GPSPositionLongitude,GPSPositionLatitude. --->
<!--- To get the coordinates, simply select a point on Google Maps and right-click "What's here" to get the Coordinates --->
<!--- for a place. Then chose the Zoom Factor that suits the map. Enter those values in Edit Site -> Extended Attributes --->
<!--- place this in a column in the contact form or whereever the map should be shown --->
<!-- Map container -->
<div id="map-container" class="z-depth-1 wow fadeInUp" style="height: 300px"></div>
<!-- /.Map-container -->
<!--- place code below in the footer just above the body end tag --->
@JonasEriksson
JonasEriksson / btn_floating_back-to-the-top
Created May 22, 2016 20:55
Drop anywhere to have a small button to scroll back to the top. Add an ID named top-section to something close to the top as a target. Requires MDB code and INNOMEGA core.js
<cfoutput>
<div class="fixed-action-btn smooth-scroll" style="bottom: 45px; right: 25px;">
<a href="##top-section" class="btn-floating btn-large blue">
<i class="fa fa-arrow-up"></i>
</a>
</div>
</cfoutput>