{"version":3,"sources":["script.js","vendors/modaal.js"],"names":["scrollAnimation","$","on","event","target","this","attr","console","log","length","preventDefault","removeClass","animate","scrollTop","offset","top","openModaalLarge","modaal","custom_class","overlay_close","background","after_open","jQuery","background_scroll","expandText","css","transform","closest","find","slideUp","slideDown","window","addEventListener","width","Modaal","init","options","elem","self","dom","$elem","extend","fn","data","xhr","scope","is_open","id","Date","getTime","Math","random","toString","substring","source","content_source","private_options","active_class","lastFocus","is_locked","type","hide_close","close_btn","close_aria_label","close_text","animation","animation_speed","after_callback_delay","e","create_modaal","mod_class","outer_controls","prev_btn","next_btn","start_open","should_open","before_open","call","create_basic","fetch_ajax","create_confirm","create_image","create_iframe","create_video","create_instagram","watch_events","off","key","keyCode","contains","document","getElementById","focus","shiftKey","activeElement","is","modaal_close","hasClass","gallery_update","trigger","confirm_callback","confirm_cancel_callback","build_modal","content","igClass","animation_class","wrap_class","fullscreen_class","fullscreen","dimensionsStyle","height","touchTrigger","is_touch","build_markup","accessible_title","append","appendTo","modaal_overlay","contents","detach","empty","instagram_id","error_msg","loading_class","loading_content","ajax","url","dataType","cache","success","html","instgrm","Embeds","process","setTimeout","clone","remove","error","addClass","ajax_error_class","abort","ajax_success","statusText","confirm_title","confirm_content","confirm_button_text","confirm_cancel_button_text","modaal_image_markup","use_group","gallery_group","gallery_group_items","removeAttr","gallery_total","gallery","each","i","item","img_src","img_alt","img_description","img_active","img_src_error","data_modaal_desc","getAttribute","data_item_active","replace","push","alt","rawdesc","desc","active","src_error","is_active","aria_label","this_img_src","this_img_alt","hide","direction","this_gallery","this_gallery_total","new_img_w","new_img_h","current_item","incoming_item","next","prev","before_image_change","stop","opacity","position","display","doc_width","width_threshold","new_natural_w","prop","new_natural_h","gallery_active_class","after_image_change","undefined","modaal_open","modal_wrapper","animation_type","before_close","after_close","action","overlay_opacity","navigator","maxTouchPoints","modaal_existing_selectors","modaal_inline_options","inline_options","parseInt","existing_modaal","Object","create","element","src","single_modaal","modaal_dom_observer","MutationObserver","mutations","forEach","mutation","addedNodes","some","el","elm","modaalSelector","observer_config","subtree","attributes","childList","characterData","observe","body"],"mappings":"aACA,IAAMA,gBAAkB,WACpBC,EAAE,QAAQC,GAAG,QAAS,aAAc,SAAUC,GAC1C,IAAMC,EAASH,EAAEA,EAAEI,MAAMC,KAAK,SAC9BC,QAAQC,IAAI,SACRJ,EAAOK,SACPN,EAAMO,iBACNT,EAAE,QAAQU,YAAY,QACtBV,EAAE,cAAcW,QACZ,CACIC,UAAWT,EAAOU,SAASC,KAE/B,SAOVC,gBAAkB,WACpBf,EAAE,mBAAmBgB,OAAO,CACxBC,aAAc,cACdC,eAAe,EACfC,WAAY,OACZC,WAAY,WACRC,OAAO,0BAA0BL,OAAO,CACpCC,aAAc,eACdK,mBAAmB,IAEvBtB,EAAE,8BAA8BC,GAAG,QAAS,WACxCoB,OAAO,mBAAmBL,OAAO,eAO3CO,WAAa,WACfvB,EAAE,QAAQC,GAAG,QAAS,qBAAsB,SAAUC,GAClDA,EAAMO,iBAES,QADCT,EAAEI,MAAMC,KAAK,YAEzBL,EAAEI,MAAMC,KAAK,WAAW,GACxBL,EAAEI,MAAMoB,IAAI,CAAEC,UAAW,mBACzBzB,EAAEI,MAAMsB,QAAQ,iBAAiBC,KAAK,mBAAmBC,YAEzD5B,EAAEI,MAAMC,KAAK,WAAW,GACxBL,EAAEI,MAAMoB,IAAI,CAAEC,UAAW,iBACzBzB,EAAEI,MAAMsB,QAAQ,iBAAiBC,KAAK,mBAAmBE,gBAKrE7B,EAAE,WACED,kBACAwB,eAIJO,OAAOC,iBAAiB,OAAQ,SAAC7B,GAC7BF,EAAE,mBAAmBgB,OAAO,CACxBG,WAAY,SAEhBnB,EAAE,0BAA0BgB,OAAO,CAC/BG,WAAY,OACZa,MAAO,QCkBd,SAAUhC,GAEV,IAEIiC,EAAS,CACZC,KAAM,SAAUC,EAASC,GACxB,IAAIC,EAAOjC,KAEXiC,EAAKC,IAAMtC,EAAE,QAEbqC,EAAKE,MAAQ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AMjO,EAAEgO,IACRC,EAAInI,GAAG,MAAQmI,EAAInI,GAAG,aAErBmI,EAAIjI,SAAS,UAEhBgH,EAAsBiB,GAGtBlB,EAA0Ba,QAAQ,SAAUM,GAC3C,GAAIA,EAAeZ,SAAWW,EAAI5N,KAAK,SAEtC,OADAL,EAAEiO,GAAKjN,OAAOkN,EAAe/L,UACtB,WAUXgM,EAAkB,CACrBC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,eAAe,GAIhBlG,WAAW,WACVoF,EAAoBe,QAAQ/I,SAASgJ,KAAMN,IACzC,OAxxCJ,CA4xCC9M,QAAQS,OAAQ2D","file":"app.js","sourcesContent":["/* START On click scroll to position */\r\nconst scrollAnimation = () => {\r\n $(\"body\").on(\"click\", \".js-scroll\", function (event) {\r\n const target = $($(this).attr(\"href\"));\r\n console.log(\"hello\");\r\n if (target.length) {\r\n event.preventDefault();\r\n $(\"body\").removeClass(\"open\");\r\n $(\"html, body\").animate(\r\n {\r\n scrollTop: target.offset().top,\r\n },\r\n 1000\r\n );\r\n }\r\n });\r\n};\r\n\r\n/* START Modaal */\r\nconst openModaalLarge = () => {\r\n $(\".js-open-modaal\").modaal({\r\n custom_class: \"modal-large\",\r\n overlay_close: true,\r\n background: \"#000\",\r\n after_open: function () {\r\n jQuery(\".js-open-modaal-inside\").modaal({\r\n custom_class: \"modal-inside\",\r\n background_scroll: true,\r\n });\r\n $(\".modal-large .modaal-close\").on(\"click\", function () {\r\n jQuery(\".js-open-modaal\").modaal(\"close\");\r\n });\r\n },\r\n });\r\n};\r\n\r\n/* START Expand list with arrow rotate */\r\nconst expandText = () => {\r\n $('body').on('click', '.js-expand-element', function (event) {\r\n event.preventDefault();\r\n const visible = $(this).attr('visible');\r\n if (visible == 'true') {\r\n $(this).attr('visible', false);\r\n $(this).css({ transform: 'rotate(315deg)' });\r\n $(this).closest('.js-accordion').find('.js-hidden-area').slideUp();\r\n } else {\r\n $(this).attr('visible', true);\r\n $(this).css({ transform: 'rotate(0deg)' });\r\n $(this).closest('.js-accordion').find('.js-hidden-area').slideDown();\r\n }\r\n });\r\n}\r\n\r\n$(function () {\r\n scrollAnimation();\r\n expandText()\r\n // openModaalLarge();\r\n});\r\n\r\nwindow.addEventListener(\"load\", (event) => {\r\n $(\".js-open-modaal\").modaal({\r\n background: \"#000\",\r\n });\r\n $(\".js-open-modaal--small\").modaal({\r\n background: \"#000\",\r\n width: 640,\r\n });\r\n});\r\n","/*!\r\n\tModaal - accessible modals - v0.4.4\r\n\tby Humaan, for all humans.\r\n\thttp://humaan.com\r\n */\r\n/**\r\n\tModaal jQuery Plugin : Accessible Modals\r\n\r\n\t==== General Options ===\r\n\ttype (string) \t\t\t\t\t: ajax, inline, image, iframe, confirm. Defaults to 'inline'\r\n\tcontent_source (stribg)\t\t\t: Accepts a string value for your target element, such as '#my-content'. This allows for when trigger element is\r\n\t\t\t\t\t\t\t\t\t\tan `` link. Not to be confused with the already existing `source` event.\r\n\tanimation (string) \t\t\t\t: Fade, expand, down, up. Defaults to 'fade'\r\n\tafter_callback_delay (integer)\t: Specify a delay value for the after open callbacks. This is necessary because with the bundled animations\r\n\t\t\t\t\t\t\t\t\t\thave a set duration in the bundled CSS. Specify a delay of the same amount as the animation duration in so\r\n\t\t\t\t\t\t\t\t\t\tmore accurately fire the after open/close callbacks. Defaults 350, does not apply if animation is 'none',\r\n\t\t\t\t\t\t\t\t\t\tafter open callbacks are dispatched immediately\r\n\r\n\tis_locked (boolean)\t\t\t\t: Set this to true to disable closing the modal via keypress or clicking the background. Beware that if\r\n\t\t\t\t\t\t\t\t\t\ttype != 'confirm' there will be no interface to dismiss the modal if is_locked = true, you'd have to\r\n\t\t\t\t\t\t\t\t\t\tprogrammatically arrange to dismiss the modal. Confirm modals are always locked regardless of this option\r\n\t\t\t\t\t\t\t\t\t\tDefaults to false\r\n\r\n\thide_close (boolean)\t\t\t: Set this to true to hide the close modal button. Key press and overlay click will still close the modal.\r\n\t\t\t\t\t\t\t\t\t\tThis method is best used when you want to put a custom close button inside the modal container space.\r\n\r\n\tbackground (string)\t\t\t\t: Background overlay style. Defaults to '#000'\r\n\toverlay_opacity (float) \t\t: Background overlay transparency. Defaults to 0.8\r\n\toverlay_close (boolean)\t\t\t: Set this to false if you want to disable click to close on overlay background.\r\n\r\n\taccessible_title (string)\t\t: Accessible title. Default 'Dialog Window'\r\n\tstart_open (boolean)\t\t\t: Set this to true to launch the Modaal window immediately on page open\r\n\tfullscreen (boolean)\t\t\t: Set this to true to make the modaal fill the entire screen, false will default to own width/height attributes.\r\n\tcustom_class (string)\t\t\t: Fill in this string with a custom class that will be applied to the outer most modal wrapper.\r\n\r\n\twidth (integer)\t\t\t\t\t: Desired width of the modal. Required for iframe type. Defaults to undefined //TODO\r\n\theight (integer)\t\t\t\t: Desired height of the modal. Required for iframe type. Defaults to undefined //TODO\r\n\r\n\tbackground_scroll (boolean)\t\t: Set this to true to enable the page to scroll behind the open modal.\r\n\r\n\tshould_open (boolean|function) : Boolean or closure that returns a boolean to determine whether to open the modal or not.\r\n\r\n\tclose_text\t\t\t\t\t\t: String for close button text. Available for localisation and alternative languages to be used.\r\n\tclose_aria_label\t\t\t\t: String for close button aria-label attribute (value that screen readers will read out). Available for localisation and alternative languages to be used.\r\n\r\n\t=== Events ===\r\n\tbefore_open (function) \t\t\t: Callback function executed before modal is opened\r\n\tafter_open (function)\t\t\t: Callback function executed after modal is opened\r\n\tbefore_close (function)\t\t\t: Callback function executed before modal is closed\r\n\tafter_close (function)\t\t\t: Callback function executed after modal is closed\r\n\tsource (function(element, src))\t: Callback function executed on the default source, it is intended to transform the\r\n\t\t\t\t\t\t\t\t\t\tsource (href in an AJAX modal or iframe). The function passes in the triggering element\r\n\t\t\t\t\t\t\t\t\t\tas well as the default source depending of the modal type. The default output of the\r\n\t\t\t\t\t\t\t\t\t\tfunction is an untransformed default source.\r\n\r\n\r\n\t=== Confirm Options & Events ===\r\n\tconfirm_button_text (string)\t: Text on the confirm button. Defaults to 'Confirm'\r\n\tconfirm_cancel_button_text (string) : Text on the confirm modal cancel button. Defaults to 'Cancel'\r\n\tconfirm_title (string)\t\t\t: Title for confirm modal. Default 'Confirm Title'\r\n\tconfirm_content (string)\t\t: HTML content for confirm message\r\n\tconfirm_callback (function)\t\t: Callback function for when the confirm button is pressed as opposed to cancel\r\n\tconfirm_cancel_callback (function) : Callback function for when the cancel button is pressed\r\n\r\n\r\n\t=== Gallery Options & Events ===\r\n\tgallery_active_class (string)\t: Active class applied to the currently active image or image slide in a gallery 'gallery_active_item'\r\n\touter_controls (boolean)\t\t: Set to true to put the next/prev controls outside the Modaal wrapper, at the edges of the browser window.\r\n\tbefore_image_change (function)\t: Callback function executed before the image slide changes in a gallery modal. Default function( current_item, incoming_item )\r\n\tafter_image_change (function)\t: Callback function executed after the image slide changes in a gallery modal. Default function ( current_item )\r\n\r\n\r\n\t=== AJAX Options & Events ===\r\n\tloading_content (string)\t\t: HTML content for loading message. Default 'Loading …'\r\n\tloading_class (string)\t\t\t: Class name to be applied while content is loaded via AJAX. Default 'is_loading'\r\n\tajax_error_class (string)\t\t: Class name to be applied when content has failed to load. Default is 'modaal-error'\r\n\tajax_success (function)\t\t \t: Callback for when AJAX content is loaded in\r\n\r\n\r\n\t=== SOCIAL CONTENT ===\r\n\tinstagram_id (string)\t\t\t: Unique photo ID for an Instagram photo.\r\n\r\n*/\r\n(function ($) {\r\n\r\n\tvar modaal_loading_spinner = '
'\r\n\r\n\tvar Modaal = {\r\n\t\tinit: function (options, elem) {\r\n\t\t\tvar self = this;\r\n\r\n\t\t\tself.dom = $('body');\r\n\r\n\t\t\tself.$elem = $(elem);\r\n\t\t\tself.options = $.extend({}, $.fn.modaal.options, self.$elem.data(), options);\r\n\t\t\tself.xhr = null;\r\n\r\n\t\t\t// set up the scope\r\n\t\t\tself.scope = {\r\n\t\t\t\tis_open: false,\r\n\t\t\t\tid: 'modaal_' + (new Date().getTime()) + (Math.random().toString(16).substring(2)),\r\n\t\t\t\tsource: self.options.content_source ? self.options.content_source : self.$elem.attr('href')\r\n\t\t\t};\r\n\r\n\t\t\t// add scope attribute to trigger element\r\n\t\t\tself.$elem.attr('data-modaal-scope', self.scope.id);\r\n\r\n\t\t\t// private options\r\n\t\t\tself.private_options = {\r\n\t\t\t\tactive_class: 'is_active'\r\n\t\t\t};\r\n\r\n\t\t\tself.lastFocus = null;\r\n\r\n\t\t\t// if is_locked\r\n\t\t\tif (self.options.is_locked || self.options.type == 'confirm' || self.options.hide_close) {\r\n\t\t\t\tself.scope.close_btn = '';\r\n\t\t\t} else {\r\n\t\t\t\tself.scope.close_btn = '';\r\n\t\t\t}\r\n\r\n\t\t\t// reset animation_speed\r\n\t\t\tif (self.options.animation === 'none') {\r\n\t\t\t\tself.options.animation_speed = 0;\r\n\t\t\t\tself.options.after_callback_delay = 0;\r\n\t\t\t}\r\n\r\n\t\t\t// On click to open modal\r\n\t\t\t$(elem).on('click.Modaal', function (e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tself.create_modaal(self, e);\r\n\t\t\t});\r\n\r\n\t\t\t// Define next/prev buttons\r\n\t\t\tif (self.options.outer_controls === true) {\r\n\t\t\t\tvar mod_class = 'outer';\r\n\t\t\t} else {\r\n\t\t\t\tvar mod_class = 'inner';\r\n\t\t\t}\r\n\t\t\tself.scope.prev_btn = '';\r\n\t\t\tself.scope.next_btn = '';\r\n\r\n\t\t\t// Check for start_open\r\n\t\t\tif (self.options.start_open === true) {\r\n\t\t\t\tself.create_modaal(self);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Initial create to determine which content type it requires\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_modaal: function (self, e) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar source;\r\n\r\n\t\t\t// Save last active state before modal\r\n\t\t\tself.lastFocus = self.$elem;\r\n\r\n\t\t\tif (self.options.should_open === false || (typeof self.options.should_open === 'function' && self.options.should_open() === false)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// CB: before_open\r\n\t\t\tself.options.before_open.call(self, e);\r\n\r\n\t\t\tswitch (self.options.type) {\r\n\t\t\t\tcase 'inline':\r\n\t\t\t\t\tself.create_basic();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ajax':\r\n\t\t\t\t\tsource = self.options.source(self.$elem, self.scope.source);\r\n\t\t\t\t\tself.fetch_ajax(source);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'confirm':\r\n\t\t\t\t\tself.options.is_locked = true;\r\n\t\t\t\t\tself.create_confirm();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'image':\r\n\t\t\t\t\tself.create_image();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'iframe':\r\n\t\t\t\t\tsource = self.options.source(self.$elem, self.scope.source);\r\n\t\t\t\t\tself.create_iframe(source);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'video':\r\n\t\t\t\t\tself.create_video(self.scope.source);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'instagram':\r\n\t\t\t\t\tself.create_instagram();\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// call events to be watched (click, tab, keyup, keydown etc.)\r\n\t\t\tself.watch_events();\r\n\t\t},\r\n\r\n\t\t// Watching Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\twatch_events: function () {\r\n\t\t\tvar self = this;\r\n\r\n\t\t\tself.dom.off('click.Modaal keyup.Modaal keydown.Modaal');\r\n\r\n\t\t\t// Body keydown\r\n\t\t\tself.dom.on('keydown.Modaal', function (e) {\r\n\t\t\t\tvar key = e.keyCode;\r\n\t\t\t\tvar target = e.target;\r\n\r\n\t\t\t\t// look for tab change and reset focus to modal window\r\n\t\t\t\t// done in keydown so the check fires repeatedly when you hold the tab key down\r\n\t\t\t\tif (key == 9 && self.scope.is_open) {\r\n\t\t\t\t\tif (!$.contains(document.getElementById(self.scope.id), target)) {\r\n\t\t\t\t\t\t$('#' + self.scope.id).find('*[tabindex=\"0\"]').focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// Body keyup\r\n\t\t\tself.dom.on('keyup.Modaal', function (e) {\r\n\t\t\t\tvar key = e.keyCode;\r\n\t\t\t\tvar target = e.target;\r\n\r\n\t\t\t\tif ((e.shiftKey && e.keyCode == 9) && self.scope.is_open) {\r\n\t\t\t\t\t// Watch for shift + tab key press. if open shift focus to close button.\r\n\t\t\t\t\tif (!$.contains(document.getElementById(self.scope.id), target)) {\r\n\t\t\t\t\t\t$('#' + self.scope.id).find('.modaal-close').focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!self.options.is_locked) {\r\n\t\t\t\t\t// On escape key press close modal\r\n\t\t\t\t\tif (key == 27 && self.scope.is_open) {\r\n\t\t\t\t\t\tif ($(document.activeElement).is('input:not(:checkbox):not(:radio)')) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tself.modaal_close();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// is gallery open and images length is > 1\r\n\t\t\t\tif (self.options.type == 'image') {\r\n\t\t\t\t\t// arrow left for back\r\n\t\t\t\t\tif (key == 37 && self.scope.is_open && (!$('#' + self.scope.id + ' .modaal-gallery-prev').hasClass('is_hidden'))) {\r\n\t\t\t\t\t\tself.gallery_update('prev');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// arrow right for next\r\n\t\t\t\t\tif (key == 39 && self.scope.is_open && (!$('#' + self.scope.id + ' .modaal-gallery-next').hasClass('is_hidden'))) {\r\n\t\t\t\t\t\tself.gallery_update('next');\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// Body click/touch\r\n\t\t\tself.dom.on('click.Modaal', function (e) {\r\n\t\t\t\tvar trigger = $(e.target);\r\n\r\n\t\t\t\t// General Controls: If it's not locked allow greedy close\r\n\t\t\t\tif (!self.options.is_locked) {\r\n\t\t\t\t\tif ((self.options.overlay_close && trigger.is('.modaal-inner-wrapper')) || trigger.is('.modaal-close') || trigger.closest('.modaal-close').length) {\r\n\t\t\t\t\t\tself.modaal_close();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Confirm Controls\r\n\t\t\t\tif (trigger.is('.modaal-confirm-btn')) {\r\n\t\t\t\t\t// if 'OK' button is clicked, run confirm_callback()\r\n\t\t\t\t\tif (trigger.is('.modaal-ok')) {\r\n\t\t\t\t\t\tself.options.confirm_callback.call(self, self.lastFocus);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (trigger.is('.modaal-cancel')) {\r\n\t\t\t\t\t\tself.options.confirm_cancel_callback.call(self, self.lastFocus);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tself.modaal_close();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Gallery Controls\r\n\t\t\t\tif (trigger.is('.modaal-gallery-control')) {\r\n\t\t\t\t\t// it not active, don't do nuthin!\r\n\t\t\t\t\tif (trigger.hasClass('is_hidden')) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// trigger previous\r\n\t\t\t\t\tif (trigger.is('.modaal-gallery-prev')) {\r\n\t\t\t\t\t\tself.gallery_update('prev');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// trigger next\r\n\t\t\t\t\tif (trigger.is('.modaal-gallery-next')) {\r\n\t\t\t\t\t\tself.gallery_update('next');\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t// Append markup into DOM\r\n\t\tbuild_modal: function (content) {\r\n\t\t\tvar self = this;\r\n\r\n\t\t\t// if is instagram\r\n\t\t\tvar igClass = '';\r\n\t\t\tif (self.options.type == 'instagram') {\r\n\t\t\t\tigClass = ' modaal-instagram';\r\n\t\t\t}\r\n\r\n\t\t\tvar wrap_class = (self.options.type == 'video') ? 'modaal-video-wrap' : 'modaal-content';\r\n\r\n\t\t\t/*\r\n\t\t\t\tmodaal-start_none : fully hidden via display:none;\r\n\t\t\t\tmodaal-start_fade : hidden via opacity:0\r\n\t\t\t\tmodaal-start_slidedown : ...\r\n\r\n\t\t\t*/\r\n\t\t\tvar animation_class;\r\n\t\t\tswitch (self.options.animation) {\r\n\t\t\t\tcase 'fade':\r\n\t\t\t\t\tanimation_class = ' modaal-start_fade';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'slide-down':\r\n\t\t\t\t\tanimation_class = ' modaal-start_slidedown';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tanimation_class = ' modaal-start_none'\r\n\t\t\t}\r\n\r\n\t\t\t// fullscreen check\r\n\t\t\tvar fullscreen_class = '';\r\n\t\t\tif (self.options.fullscreen) {\r\n\t\t\t\tfullscreen_class = ' modaal-fullscreen';\r\n\t\t\t}\r\n\r\n\t\t\t// custom class check\r\n\t\t\tif (self.options.custom_class !== '' || typeof (self.options.custom_class) !== 'undefined') {\r\n\t\t\t\tself.options.custom_class = ' ' + self.options.custom_class;\r\n\t\t\t}\r\n\r\n\t\t\t// if width and heights exists and is typeof number\r\n\t\t\tvar dimensionsStyle = '';\r\n\t\t\tif (self.options.width && self.options.height && typeof self.options.width == 'number' && typeof self.options.height == 'number') {\r\n\t\t\t\t// if width and height exist, and they are both numbers\r\n\t\t\t\tdimensionsStyle = ' style=\"max-width:' + self.options.width + 'px;height:' + self.options.height + 'px;overflow:auto;\"';\r\n\t\t\t} else if (self.options.width && typeof self.options.width == 'number') {\r\n\t\t\t\t// if only width\r\n\t\t\t\tdimensionsStyle = ' style=\"max-width:' + self.options.width + 'px;\"';\r\n\t\t\t} else if (self.options.height && typeof self.options.height == 'number') {\r\n\t\t\t\t// if only height\r\n\t\t\t\tdimensionsStyle = ' style=\"height:' + self.options.height + 'px;overflow:auto;\"';\r\n\t\t\t}\r\n\r\n\t\t\t// Reset dimensions style (width and height) for certain types\r\n\t\t\tif (self.options.type == 'image' || self.options.type == 'video' || self.options.type == 'instagram' || self.options.fullscreen) {\r\n\t\t\t\tdimensionsStyle = '';\r\n\t\t\t}\r\n\r\n\t\t\t// if is touch\r\n\t\t\t// this is a bug fix for iOS to allow regular click events on div elements.\r\n\t\t\tvar touchTrigger = '';\r\n\t\t\tif (self.is_touch()) {\r\n\t\t\t\ttouchTrigger = ' style=\"cursor:pointer;\"'\r\n\t\t\t}\r\n\r\n\t\t\tvar build_markup = '
';\r\n\r\n\t\t\t// hide if video\r\n\t\t\tif (self.options.type != 'video') {\r\n\t\t\t\tbuild_markup += '
';\r\n\t\t\t}\r\n\r\n\t\t\t// add the guts of the content\r\n\t\t\tbuild_markup += '
';\r\n\r\n\t\t\t// If it's inline type, we want to clone content instead of dropping it straight in\r\n\t\t\tif (self.options.type == 'inline') {\r\n\t\t\t\tbuild_markup += '
';\r\n\t\t\t} else {\r\n\t\t\t\t// Drop in the content if it's not inline\r\n\t\t\t\tbuild_markup += content;\r\n\t\t\t}\r\n\r\n\t\t\t// close wrap_class\r\n\t\t\tbuild_markup += '
' + self.scope.close_btn;\r\n\r\n\t\t\t// hide if video\r\n\t\t\tif (self.options.type != 'video') {\r\n\t\t\t\tbuild_markup += '
';\r\n\t\t\t}\r\n\r\n\t\t\t// close off modaal-inner-wrapper\r\n\t\t\tbuild_markup += '
';\r\n\r\n\t\t\t// If type is image AND outer_controls is true: add gallery next and previous controls.\r\n\t\t\tif (self.options.type == 'image' && self.options.outer_controls === true) {\r\n\t\t\t\tbuild_markup += self.scope.prev_btn + self.scope.next_btn;\r\n\t\t\t}\r\n\r\n\t\t\t// close off modaal-wrapper\r\n\t\t\tbuild_markup += '
';\r\n\r\n\t\t\t// append ajax modal markup to dom\r\n\t\t\tif ($('#' + self.scope.id + '_overlay').length < 1) {\r\n\t\t\t\tself.dom.append(build_markup);\r\n\t\t\t}\r\n\r\n\t\t\t// if inline, clone content into space\r\n\t\t\tif (self.options.type == 'inline') {\r\n\t\t\t\tcontent.appendTo('#' + self.scope.id + ' .modaal-content-container');\r\n\t\t\t}\r\n\r\n\t\t\t// Trigger overlay show (which triggers modal show)\r\n\t\t\tself.modaal_overlay('show');\r\n\t\t},\r\n\r\n\t\t// Create Basic Inline Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_basic: function () {\r\n\t\t\tvar self = this;\r\n\t\t\tvar target = $(self.scope.source);\r\n\t\t\tvar content = '';\r\n\r\n\t\t\tif (target.length) {\r\n\t\t\t\tcontent = target.contents().detach();\r\n\t\t\t\ttarget.empty();\r\n\t\t\t} else {\r\n\t\t\t\tcontent = 'Content could not be loaded. Please check the source and try again.';\r\n\t\t\t}\r\n\r\n\t\t\t// now push content into markup\r\n\t\t\tself.build_modal(content);\r\n\t\t},\r\n\r\n\t\t// Create Instagram Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_instagram: function () {\r\n\t\t\tvar self = this;\r\n\t\t\tvar id = self.options.instagram_id;\r\n\t\t\tvar content = '';\r\n\r\n\t\t\tvar error_msg = 'Instagram photo couldn\\'t be loaded, please check the embed code and try again.';\r\n\r\n\t\t\tself.build_modal('
' + self.options.loading_content + '
');\r\n\r\n\t\t\t// ID exists, is not empty null or undefined.\r\n\t\t\tif (id != '' && id !== null && id !== undefined) {\r\n\t\t\t\t// set up oembed url\r\n\t\t\t\tvar ig_url = 'https://api.instagram.com/oembed?url=http://instagr.am/p/' + id + '/';\r\n\r\n\t\t\t\t$.ajax({\r\n\t\t\t\t\turl: ig_url,\r\n\t\t\t\t\tdataType: \"jsonp\",\r\n\t\t\t\t\tcache: false,\r\n\t\t\t\t\tsuccess: function (data) {\r\n\r\n\t\t\t\t\t\t// Create temp dom element from which we'll clone into the modaal instance. This is required to bypass the unusual small thumb issue instagram oembed was serving up\r\n\t\t\t\t\t\tself.dom.append('
' + data.html + '
');\r\n\r\n\t\t\t\t\t\t// Check if it has loaded once before.\r\n\t\t\t\t\t\t// This is to stop the Embeds.process from throwing and error the first time it's being loaded.\r\n\t\t\t\t\t\t// private_options are individual to a modaal_scope so will not work across multiple scopes when checking if true, only that one item.\r\n\t\t\t\t\t\tif (self.dom.attr('data-igloaded')) {\r\n\t\t\t\t\t\t\twindow.instgrm.Embeds.process();\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// first time it's loaded, let's set a new private option to use next time it's opened.\r\n\t\t\t\t\t\t\tself.dom.attr('data-igloaded', 'true');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// now set location for new content\r\n\t\t\t\t\t\t// timeout is required as well to bypass the unusual small thumb issue instagram oembed was serving up\r\n\t\t\t\t\t\tvar target = '#' + self.scope.id + ' .modaal-content-container';\r\n\t\t\t\t\t\tif ($(target).length > 0) {\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t$('#temp-ig').contents().clone().appendTo(target);\r\n\t\t\t\t\t\t\t\t$('#temp-ig').remove();\r\n\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror: function () {\r\n\t\t\t\t\t\tcontent = error_msg;\r\n\r\n\t\t\t\t\t\t// now set location for new content\r\n\t\t\t\t\t\tvar target = $('#' + self.scope.id + ' .modaal-content-container');\r\n\t\t\t\t\t\tif (target.length > 0) {\r\n\t\t\t\t\t\t\ttarget.removeClass(self.options.loading_class).addClass(self.options.ajax_error_class);\r\n\t\t\t\t\t\t\ttarget.html(content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcontent = error_msg;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\t// Fetch Ajax Data\r\n\t\t// ----------------------------------------------------------------\r\n\t\tfetch_ajax: function (url) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar content = '';\r\n\r\n\t\t\t// If no accessible title, set it to 'Dialog Window'\r\n\t\t\tif (self.options.accessible_title == null) {\r\n\t\t\t\tself.options.accessible_title = 'Dialog Window'\r\n\t\t\t}\r\n\r\n\t\t\tif (self.xhr !== null) {\r\n\t\t\t\tself.xhr.abort();\r\n\t\t\t\tself.xhr = null;\r\n\t\t\t}\r\n\r\n\t\t\tself.build_modal('
' + self.options.loading_content + '
');\r\n\r\n\t\t\tself.xhr = $.ajax(url, {\r\n\t\t\t\tsuccess: function (data) {\r\n\t\t\t\t\t// content fetch is successful so push it into markup\r\n\t\t\t\t\tvar target = $('#' + self.scope.id).find('.modaal-content-container');\r\n\t\t\t\t\tif (target.length > 0) {\r\n\t\t\t\t\t\ttarget.removeClass(self.options.loading_class);\r\n\t\t\t\t\t\ttarget.html(data);\r\n\r\n\t\t\t\t\t\tself.options.ajax_success.call(self, target);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\terror: function (xhr) {\r\n\t\t\t\t\t// There were some errors so return an error message\r\n\t\t\t\t\tif (xhr.statusText == 'abort') {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar target = $('#' + self.scope.id + ' .modaal-content-container');\r\n\t\t\t\t\tif (target.length > 0) {\r\n\t\t\t\t\t\ttarget.removeClass(self.options.loading_class).addClass(self.options.ajax_error_class);\r\n\t\t\t\t\t\ttarget.html('Content could not be loaded. Please check the source and try again.');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t// Create Confirm Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_confirm: function () {\r\n\t\t\tvar self = this;\r\n\t\t\tvar content;\r\n\r\n\t\t\tcontent = '
' +\r\n\t\t\t\t'

' + self.options.confirm_title + '

' +\r\n\t\t\t\t'
' + self.options.confirm_content + '
' +\r\n\t\t\t\t'
' +\r\n\t\t\t\t'' +\r\n\t\t\t\t'' +\r\n\t\t\t\t'
' +\r\n\t\t\t\t'
' +\r\n\t\t\t\t'';\r\n\r\n\t\t\t// now push content into markup\r\n\t\t\tself.build_modal(content);\r\n\t\t},\r\n\r\n\t\t// Create Image/Gallery Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_image: function () {\r\n\t\t\tvar self = this;\r\n\t\t\tvar content;\r\n\r\n\t\t\tvar modaal_image_markup = '';\r\n\t\t\tvar gallery_total;\r\n\r\n\t\t\t// If has group attribute\r\n\t\t\tif (self.$elem.is('[data-group]') || self.$elem.is('[rel]')) {\r\n\r\n\t\t\t\t// find gallery groups\r\n\t\t\t\tvar use_group = self.$elem.is('[data-group]');\r\n\t\t\t\tvar gallery_group = use_group ? self.$elem.attr('data-group') : self.$elem.attr('rel');\r\n\t\t\t\tvar gallery_group_items = use_group ? $('[data-group=\"' + gallery_group + '\"]') : $('[rel=\"' + gallery_group + '\"]');\r\n\r\n\t\t\t\t// remove any previous active attribute to any in the group\r\n\t\t\t\tgallery_group_items.removeAttr('data-gallery-active', 'is_active');\r\n\t\t\t\t// add active attribute to the item clicked\r\n\t\t\t\tself.$elem.attr('data-gallery-active', 'is_active');\r\n\r\n\t\t\t\t// how many in the grouping are there (-1 to connect with each function starting with 0)\r\n\t\t\t\tgallery_total = gallery_group_items.length - 1;\r\n\r\n\t\t\t\t// prepare array for gallery data\r\n\t\t\t\tvar gallery = [];\r\n\r\n\t\t\t\t// start preparing markup\r\n\t\t\t\tmodaal_image_markup = '';\r\n\r\n\t\t\t\t// Add next and previous buttons if outside\r\n\t\t\t\tif (self.options.outer_controls != true) {\r\n\t\t\t\t\tmodaal_image_markup += self.scope.prev_btn + self.scope.next_btn;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// This is only a single gallery item so let's grab the necessary values\r\n\r\n\t\t\t\t// define the source, check if content_source option exists, and use that or fall back to href.\r\n\t\t\t\tvar this_img_src;\r\n\t\t\t\tvar img_src_error = false;\r\n\t\t\t\tif (self.$elem.attr('data-modaal-content-source')) {\r\n\t\t\t\t\tthis_img_src = self.$elem.attr('data-modaal-content-source');\r\n\t\t\t\t} else if (self.$elem.attr('href')) {\r\n\t\t\t\t\tthis_img_src = self.$elem.attr('href');\r\n\t\t\t\t} else if (self.$elem.attr('src')) {\r\n\t\t\t\t\tthis_img_src = self.$elem.attr('src');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis_img_src = 'trigger requires href or data-modaal-content-source attribute';\r\n\t\t\t\t\timg_src_error = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar this_img_alt_txt = '';\r\n\t\t\t\tvar this_img_alt = '';\r\n\t\t\t\tvar aria_label = '';\r\n\r\n\t\t\t\tif (self.$elem.attr('data-modaal-desc')) {\r\n\t\t\t\t\taria_label = self.$elem.attr('data-modaal-desc');\r\n\t\t\t\t\tthis_img_alt_txt = self.$elem.attr('data-modaal-desc');\r\n\t\t\t\t\tthis_img_alt = '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\taria_label = \"Image with no description\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if image item has source error, output message rather than undefined image\r\n\t\t\t\tvar image_output = img_src_error ? this_img_src : '\"';\r\n\r\n\t\t\t\t// build up the html\r\n\t\t\t\tmodaal_image_markup = '';\r\n\t\t\t}\r\n\r\n\t\t\t// Update content variable\r\n\t\t\tcontent = modaal_image_markup;\r\n\r\n\t\t\t// now push content into markup\r\n\t\t\tself.build_modal(content);\r\n\r\n\t\t\t// setup next & prev buttons\r\n\t\t\tif ($('.modaal-gallery-item.is_active').is('.gallery-item-0')) {\r\n\t\t\t\t$('.modaal-gallery-prev').hide();\r\n\t\t\t}\r\n\t\t\tif ($('.modaal-gallery-item.is_active').is('.gallery-item-' + gallery_total)) {\r\n\t\t\t\t$('.modaal-gallery-next').hide();\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Gallery Change Image\r\n\t\t// ----------------------------------------------------------------\r\n\t\tgallery_update: function (direction) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar this_gallery = $('#' + self.scope.id);\r\n\t\t\tvar this_gallery_item = this_gallery.find('.modaal-gallery-item');\r\n\t\t\tvar this_gallery_total = this_gallery_item.length - 1;\r\n\r\n\t\t\t// if single item, don't proceed\r\n\t\t\tif (this_gallery_total == 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tvar prev_btn = this_gallery.find('.modaal-gallery-prev'),\r\n\t\t\t\tnext_btn = this_gallery.find('.modaal-gallery-next');\r\n\r\n\t\t\tvar duration = 250;\r\n\r\n\t\t\tvar new_img_w = 0,\r\n\t\t\t\tnew_img_h = 0;\r\n\r\n\t\t\t// CB: Before image change\r\n\t\t\tvar current_item = this_gallery.find('.modaal-gallery-item.' + self.private_options.active_class),\r\n\t\t\t\tincoming_item = (direction == 'next' ? current_item.next('.modaal-gallery-item') : current_item.prev('.modaal-gallery-item'));\r\n\t\t\tself.options.before_image_change.call(self, current_item, incoming_item);\r\n\r\n\t\t\t// stop change if at start of end\r\n\t\t\tif (direction == 'prev' && this_gallery.find('.gallery-item-0').hasClass('is_active')) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else if (direction == 'next' && this_gallery.find('.gallery-item-' + this_gallery_total).hasClass('is_active')) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// lock dimensions\r\n\t\t\tcurrent_item.stop().animate({\r\n\t\t\t\topacity: 0\r\n\t\t\t}, duration, function () {\r\n\t\t\t\t// Move to appropriate image\r\n\t\t\t\tincoming_item.addClass('is_next').css({\r\n\t\t\t\t\t'position': 'absolute',\r\n\t\t\t\t\t'display': 'block',\r\n\t\t\t\t\t'opacity': 0\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// Collect doc width\r\n\t\t\t\tvar doc_width = $(document).width();\r\n\t\t\t\tvar width_threshold = doc_width > 1140 ? 280 : 50;\r\n\r\n\t\t\t\t// start toggle to 'is_next'\r\n\t\t\t\tnew_img_w = this_gallery.find('.modaal-gallery-item.is_next').width();\r\n\t\t\t\tnew_img_h = this_gallery.find('.modaal-gallery-item.is_next').height();\r\n\r\n\t\t\t\tvar new_natural_w = this_gallery.find('.modaal-gallery-item.is_next img').prop('naturalWidth');\r\n\t\t\t\tvar new_natural_h = this_gallery.find('.modaal-gallery-item.is_next img').prop('naturalHeight');\r\n\r\n\t\t\t\t// if new image is wider than doc width\r\n\t\t\t\tif (new_natural_w > (doc_width - width_threshold)) {\r\n\t\t\t\t\t// set new width just below doc width\r\n\t\t\t\t\tnew_img_w = doc_width - width_threshold;\r\n\r\n\t\t\t\t\t// Set temp widths so we can calulate the correct height;\r\n\t\t\t\t\tthis_gallery.find('.modaal-gallery-item.is_next').css({ 'width': new_img_w });\r\n\t\t\t\t\tthis_gallery.find('.modaal-gallery-item.is_next img').css({ 'width': new_img_w });\r\n\r\n\t\t\t\t\t// Set new height variable\r\n\t\t\t\t\tnew_img_h = this_gallery.find('.modaal-gallery-item.is_next').find('img').height();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// new img is not wider than screen, so let's set the new dimensions\r\n\t\t\t\t\tnew_img_w = new_natural_w;\r\n\t\t\t\t\tnew_img_h = new_natural_h;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// resize gallery region\r\n\t\t\t\tthis_gallery.find('.modaal-gallery-item-wrap').stop().animate({\r\n\t\t\t\t\t'width': new_img_w,\r\n\t\t\t\t\t'height': new_img_h\r\n\t\t\t\t}, duration, function () {\r\n\t\t\t\t\t// hide old active image\r\n\t\t\t\t\tcurrent_item.removeClass(self.private_options.active_class + ' ' + self.options.gallery_active_class).removeAttr('style');\r\n\t\t\t\t\tcurrent_item.find('img').removeAttr('style');\r\n\r\n\t\t\t\t\t// show new image\r\n\t\t\t\t\tincoming_item.addClass(self.private_options.active_class + ' ' + self.options.gallery_active_class).removeClass('is_next').css('position', '');\r\n\r\n\t\t\t\t\t// animate in new image (now has the normal is_active class\r\n\t\t\t\t\tincoming_item.stop().animate({\r\n\t\t\t\t\t\topacity: 1\r\n\t\t\t\t\t}, duration, function () {\r\n\t\t\t\t\t\t$(this).removeAttr('style').css({\r\n\t\t\t\t\t\t\t'width': '100%'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t$(this).find('img').css('width', '100%');\r\n\r\n\t\t\t\t\t\t// remove dimension lock\r\n\t\t\t\t\t\tthis_gallery.find('.modaal-gallery-item-wrap').removeAttr('style');\r\n\r\n\t\t\t\t\t\t// CB: After image change\r\n\t\t\t\t\t\tself.options.after_image_change.call(self, incoming_item);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t// Focus on the new gallery item\r\n\t\t\t\t\tthis_gallery.find('.modaal-gallery-item').removeAttr('tabindex');\r\n\t\t\t\t\tthis_gallery.find('.modaal-gallery-item.' + self.private_options.active_class + '').attr('tabindex', '0').focus();\r\n\r\n\t\t\t\t\t// hide/show next/prev\r\n\t\t\t\t\tif (this_gallery.find('.modaal-gallery-item.' + self.private_options.active_class).is('.gallery-item-0')) {\r\n\t\t\t\t\t\tprev_btn.stop().animate({\r\n\t\t\t\t\t\t\topacity: 0\r\n\t\t\t\t\t\t}, 150, function () {\r\n\t\t\t\t\t\t\t$(this).hide();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tprev_btn.stop().css({\r\n\t\t\t\t\t\t\t'display': 'block',\r\n\t\t\t\t\t\t\t'opacity': prev_btn.css('opacity')\r\n\t\t\t\t\t\t}).animate({\r\n\t\t\t\t\t\t\topacity: 1\r\n\t\t\t\t\t\t}, 150);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this_gallery.find('.modaal-gallery-item.' + self.private_options.active_class).is('.gallery-item-' + this_gallery_total)) {\r\n\t\t\t\t\t\tnext_btn.stop().animate({\r\n\t\t\t\t\t\t\topacity: 0\r\n\t\t\t\t\t\t}, 150, function () {\r\n\t\t\t\t\t\t\t$(this).hide();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnext_btn.stop().css({\r\n\t\t\t\t\t\t\t'display': 'block',\r\n\t\t\t\t\t\t\t'opacity': prev_btn.css('opacity')\r\n\t\t\t\t\t\t}).animate({\r\n\t\t\t\t\t\t\topacity: 1\r\n\t\t\t\t\t\t}, 150);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t// Create Video Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_video: function (url) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar content;\r\n\r\n\t\t\t// video markup\r\n\t\t\tcontent = '';\r\n\r\n\t\t\t// now push content into markup\r\n\t\t\tself.build_modal('
' + content + '
');\r\n\t\t},\r\n\r\n\t\t// Create iFrame Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tcreate_iframe: function (url) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar content;\r\n\r\n\t\t\tif (self.options.width !== null || self.options.width !== undefined || self.options.height !== null || self.options.height !== undefined) {\r\n\t\t\t\t// video markup\r\n\t\t\t\tcontent = '';\r\n\t\t\t} else {\r\n\t\t\t\tcontent = '
Please specify a width and height for your iframe
';\r\n\t\t\t}\r\n\r\n\t\t\t// now push content into markup\r\n\t\t\tself.build_modal(content);\r\n\t\t},\r\n\r\n\t\t// Open Modaal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tmodaal_open: function () {\r\n\t\t\tvar self = this;\r\n\t\t\tvar modal_wrapper = $('#' + self.scope.id);\r\n\t\t\tvar animation_type = self.options.animation;\r\n\r\n\t\t\tif (animation_type === 'none') {\r\n\t\t\t\tmodal_wrapper.removeClass('modaal-start_none');\r\n\t\t\t\tself.options.after_open.call(self, modal_wrapper);\r\n\t\t\t}\r\n\r\n\t\t\t// Open with fade\r\n\t\t\tif (animation_type === 'fade') {\r\n\t\t\t\tmodal_wrapper.removeClass('modaal-start_fade');\r\n\t\t\t}\r\n\r\n\t\t\t// Open with slide down\r\n\t\t\tif (animation_type === 'slide-down') {\r\n\t\t\t\tmodal_wrapper.removeClass('modaal-start_slide_down');\r\n\t\t\t}\r\n\r\n\t\t\tvar focusTarget = modal_wrapper;\r\n\r\n\t\t\t// Switch focusTarget tabindex (switch from other modal if exists)\r\n\t\t\t$('.modaal-wrapper *[tabindex=0]').removeAttr('tabindex');\r\n\r\n\t\t\tif (self.options.type == 'image') {\r\n\t\t\t\tfocusTarget = $('#' + self.scope.id).find('.modaal-gallery-item.' + self.private_options.active_class);\r\n\r\n\t\t\t} else if (modal_wrapper.find('.modaal-iframe-elem').length) {\r\n\t\t\t\tfocusTarget = modal_wrapper.find('.modaal-iframe-elem');\r\n\r\n\t\t\t} else if (modal_wrapper.find('.modaal-video-wrap').length) {\r\n\t\t\t\tfocusTarget = modal_wrapper.find('.modaal-video-wrap');\r\n\r\n\t\t\t} else {\r\n\t\t\t\tfocusTarget = modal_wrapper.find('.modaal-focus');\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// now set the focus\r\n\t\t\tfocusTarget.attr('tabindex', '0').focus();\r\n\r\n\t\t\t// Run after_open\r\n\t\t\tif (animation_type !== 'none') {\r\n\t\t\t\t// CB: after_open\r\n\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\tself.options.after_open.call(self, modal_wrapper)\r\n\t\t\t\t}, self.options.after_callback_delay);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Close Modal\r\n\t\t// ----------------------------------------------------------------\r\n\t\tmodaal_close: function () {\r\n\t\t\tvar self = this;\r\n\t\t\tvar modal_wrapper = $('#' + self.scope.id);\r\n\r\n\t\t\t// CB: before_close\r\n\t\t\tself.options.before_close.call(self, modal_wrapper);\r\n\r\n\t\t\tif (self.xhr !== null) {\r\n\t\t\t\tself.xhr.abort();\r\n\t\t\t\tself.xhr = null;\r\n\t\t\t}\r\n\r\n\t\t\t// Now we close the modal\r\n\t\t\tif (self.options.animation === 'none') {\r\n\t\t\t\tmodal_wrapper.addClass('modaal-start_none');\r\n\t\t\t}\r\n\r\n\t\t\t// Close with fade\r\n\t\t\tif (self.options.animation === 'fade') {\r\n\t\t\t\tmodal_wrapper.addClass('modaal-start_fade');\r\n\t\t\t}\r\n\r\n\t\t\t// Close with slide up (using initial slide down)\r\n\t\t\tif (self.options.animation === 'slide-down') {\r\n\t\t\t\tmodal_wrapper.addClass('modaal-start_slide_down');\r\n\t\t\t}\r\n\r\n\t\t\t// CB: after_close and remove\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\t// clone inline content back to origin place\r\n\t\t\t\tif (self.options.type == 'inline') {\r\n\t\t\t\t\t$('#' + self.scope.id + ' .modaal-content-container').contents().detach().appendTo(self.scope.source)\r\n\t\t\t\t}\r\n\t\t\t\t// remove markup from dom\r\n\t\t\t\tmodal_wrapper.remove();\r\n\t\t\t\t// CB: after_close\r\n\t\t\t\tself.options.after_close.call(self);\r\n\t\t\t\t// scope is now closed\r\n\t\t\t\tself.scope.is_open = false;\r\n\r\n\t\t\t}, self.options.after_callback_delay);\r\n\r\n\t\t\t// Call overlay hide\r\n\t\t\tself.modaal_overlay('hide');\r\n\r\n\t\t\t// Roll back to last focus state before modal open. If was closed programmatically, this might not be set\r\n\t\t\tif (self.lastFocus != null) {\r\n\t\t\t\tself.lastFocus.focus();\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Overlay control (accepts action for show or hide)\r\n\t\t// ----------------------------------------------------------------\r\n\t\tmodaal_overlay: function (action) {\r\n\t\t\tvar self = this;\r\n\r\n\t\t\tif (action == 'show') {\r\n\t\t\t\t// Modal is open so update scope\r\n\t\t\t\tself.scope.is_open = true;\r\n\r\n\t\t\t\t// set body to overflow hidden if background_scroll is false\r\n\t\t\t\tif (!self.options.background_scroll) {\r\n\t\t\t\t\tself.dom.addClass('modaal-noscroll');\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// append modaal overlay\r\n\t\t\t\tif ($('#' + self.scope.id + '_overlay').length < 1) {\r\n\t\t\t\t\tself.dom.append('
');\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// now show\r\n\t\t\t\t$('#' + self.scope.id + '_overlay').css('background', self.options.background).stop().animate({\r\n\t\t\t\t\topacity: self.options.overlay_opacity\r\n\t\t\t\t}, self.options.animation_speed, function () {\r\n\t\t\t\t\t// now open the modal\r\n\t\t\t\t\tself.modaal_open();\r\n\t\t\t\t});\r\n\r\n\t\t\t} else if (action == 'hide') {\r\n\r\n\t\t\t\t// now hide the overlay\r\n\t\t\t\t$('#' + self.scope.id + '_overlay').stop().animate({\r\n\t\t\t\t\topacity: 0\r\n\t\t\t\t}, self.options.animation_speed, function () {\r\n\t\t\t\t\t// remove overlay from dom\r\n\t\t\t\t\t$(this).remove();\r\n\t\t\t\t\t// CUSTOM PROPERTY\r\n\t\t\t\t\tif (self.scope.source !== \"#all-speakers-modal--speaker\") {\r\n\t\t\t\t\t\t// remove body overflow lock\r\n\t\t\t\t\t\tself.dom.removeClass('modaal-noscroll');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Check if is touch\r\n\t\t// ----------------------------------------------------------------\r\n\t\tis_touch: function () {\r\n\t\t\treturn 'ontouchstart' in window || navigator.maxTouchPoints;\r\n\t\t}\r\n\t};\r\n\r\n\t// Define default object to store\r\n\tvar modaal_existing_selectors = [];\r\n\r\n\t// Declare the modaal jQuery method\r\n\t// ------------------------------------------------------------\r\n\t$.fn.modaal = function (options) {\r\n\t\treturn this.each(function (i) {\r\n\t\t\tvar existing_modaal = $(this).data('modaal');\r\n\r\n\t\t\tif (existing_modaal) {\r\n\t\t\t\t// Checking for string value, used for methods\r\n\t\t\t\tif (typeof (options) == 'string') {\r\n\t\t\t\t\tswitch (options) {\r\n\t\t\t\t\t\tcase 'open':\r\n\t\t\t\t\t\t\t// create the modal\r\n\t\t\t\t\t\t\texisting_modaal.create_modaal(existing_modaal);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'close':\r\n\t\t\t\t\t\t\texisting_modaal.modaal_close();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Not a string, so let's setup the modal ready to use\r\n\t\t\t\tvar modaal = Object.create(Modaal);\r\n\t\t\t\tmodaal.init(options, this);\r\n\t\t\t\t$.data(this, \"modaal\", modaal);\r\n\r\n\t\t\t\t// push this select into existing selectors array which is referenced during modaal_dom_observer\r\n\t\t\t\tmodaal_existing_selectors.push({\r\n\t\t\t\t\t'element': $(this).attr('class'),\r\n\t\t\t\t\t'options': options\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\t// Default options\r\n\t// ------------------------------------------------------------\r\n\t$.fn.modaal.options = {\r\n\r\n\t\t//General\r\n\t\ttype: 'inline',\r\n\t\tcontent_source: null,\r\n\t\tanimation: 'fade',\r\n\t\tanimation_speed: 300,\r\n\t\tafter_callback_delay: 350,\r\n\t\tis_locked: false,\r\n\t\thide_close: false,\r\n\t\tbackground: '#000',\r\n\t\toverlay_opacity: '0.8',\r\n\t\toverlay_close: true,\r\n\t\taccessible_title: 'Dialog Window',\r\n\t\tstart_open: false,\r\n\t\tfullscreen: false,\r\n\t\tcustom_class: '',\r\n\t\tbackground_scroll: false,\r\n\t\tshould_open: true,\r\n\t\tclose_text: 'Close',\r\n\t\tclose_aria_label: 'Close (Press escape to close)',\r\n\t\twidth: null,\r\n\t\theight: null,\r\n\r\n\t\t//Events\r\n\t\tbefore_open: function () { },\r\n\t\tafter_open: function () { },\r\n\t\tbefore_close: function () { },\r\n\t\tafter_close: function () { },\r\n\t\tsource: function (element, src) {\r\n\t\t\treturn src;\r\n\t\t},\r\n\r\n\t\t//Confirm Modal\r\n\t\tconfirm_button_text: 'Confirm', // text on confirm button\r\n\t\tconfirm_cancel_button_text: 'Cancel',\r\n\t\tconfirm_title: 'Confirm Title', // title for confirm modal\r\n\t\tconfirm_content: '

This is the default confirm dialog content. Replace me through the options

', // html for confirm message\r\n\t\tconfirm_callback: function () { },\r\n\t\tconfirm_cancel_callback: function () { },\r\n\r\n\r\n\t\t//Gallery Modal\r\n\t\tgallery_active_class: 'gallery_active_item',\r\n\t\touter_controls: false,\r\n\t\tbefore_image_change: function (current_item, incoming_item) { },\r\n\t\tafter_image_change: function (current_item) { },\r\n\r\n\t\t//Ajax Modal\r\n\t\tloading_content: modaal_loading_spinner,\r\n\t\tloading_class: 'is_loading',\r\n\t\tajax_error_class: 'modaal-error',\r\n\t\tajax_success: function () { },\r\n\r\n\t\t//Instagram\r\n\t\tinstagram_id: null\r\n\t};\r\n\r\n\t// Check and Set Inline Options\r\n\t// ------------------------------------------------------------\r\n\tfunction modaal_inline_options(self) {\r\n\r\n\t\t// new empty options\r\n\t\tvar options = {};\r\n\t\tvar inline_options = false;\r\n\r\n\t\t// option: type\r\n\t\tif (self.attr('data-modaal-type')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.type = self.attr('data-modaal-type');\r\n\t\t}\r\n\r\n\t\t// option: type\r\n\t\tif (self.attr('data-modaal-content-source')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.content_source = self.attr('data-modaal-content-source');\r\n\t\t}\r\n\r\n\t\t// option: animation\r\n\t\tif (self.attr('data-modaal-animation')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.animation = self.attr('data-modaal-animation');\r\n\t\t}\r\n\r\n\t\t// option: animation_speed\r\n\t\tif (self.attr('data-modaal-animation-speed')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.animation_speed = self.attr('data-modaal-animation-speed');\r\n\t\t}\r\n\r\n\t\t// option: after_callback_delay\r\n\t\tif (self.attr('data-modaal-after-callback-delay')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.after_callback_delay = self.attr('data-modaal-after-callback-delay');\r\n\t\t}\r\n\r\n\t\t// option: is_locked\r\n\t\tif (self.attr('data-modaal-is-locked')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.is_locked = (self.attr('data-modaal-is-locked') === 'true' ? true : false);\r\n\t\t}\r\n\r\n\t\t// option: hide_close\r\n\t\tif (self.attr('data-modaal-hide-close')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.hide_close = (self.attr('data-modaal-hide-close') === 'true' ? true : false);\r\n\t\t}\r\n\r\n\t\t// option: background\r\n\t\tif (self.attr('data-modaal-background')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.background = self.attr('data-modaal-background');\r\n\t\t}\r\n\r\n\t\t// option: overlay_opacity\r\n\t\tif (self.attr('data-modaal-overlay-opacity')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.overlay_opacity = self.attr('data-modaal-overlay-opacity');\r\n\t\t}\r\n\r\n\t\t// option: overlay_close\r\n\t\tif (self.attr('data-modaal-overlay-close')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.overlay_close = (self.attr('data-modaal-overlay-close') === 'false' ? false : true);\r\n\t\t}\r\n\r\n\t\t// option: accessible_title\r\n\t\tif (self.attr('data-modaal-accessible-title')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.accessible_title = self.attr('data-modaal-accessible-title');\r\n\t\t}\r\n\r\n\t\t// option: start_open\r\n\t\tif (self.attr('data-modaal-start-open')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.start_open = (self.attr('data-modaal-start-open') === 'true' ? true : false);\r\n\t\t}\r\n\r\n\t\t// option: fullscreen\r\n\t\tif (self.attr('data-modaal-fullscreen')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.fullscreen = (self.attr('data-modaal-fullscreen') === 'true' ? true : false);\r\n\t\t}\r\n\r\n\t\t// option: custom_class\r\n\t\tif (self.attr('data-modaal-custom-class')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.custom_class = self.attr('data-modaal-custom-class');\r\n\t\t}\r\n\r\n\t\t// option: close_text\r\n\t\tif (self.attr('data-modaal-close-text')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.close_text = self.attr('data-modaal-close-text');\r\n\t\t}\r\n\r\n\t\t// option: close_aria_label\r\n\t\tif (self.attr('data-modaal-close-aria-label')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.close_aria_label = self.attr('data-modaal-close-aria-label');\r\n\t\t}\r\n\r\n\t\t// option: background_scroll\r\n\t\tif (self.attr('data-modaal-background-scroll')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.background_scroll = (self.attr('data-modaal-background-scroll') === 'true' ? true : false);\r\n\t\t}\r\n\r\n\t\t// option: width\r\n\t\tif (self.attr('data-modaal-width')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.width = parseInt(self.attr('data-modaal-width'));\r\n\t\t}\r\n\r\n\t\t// option: height\r\n\t\tif (self.attr('data-modaal-height')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.height = parseInt(self.attr('data-modaal-height'));\r\n\t\t}\r\n\r\n\t\t// option: confirm_button_text\r\n\t\tif (self.attr('data-modaal-confirm-button-text')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.confirm_button_text = self.attr('data-modaal-confirm-button-text');\r\n\t\t}\r\n\r\n\t\t// option: confirm_cancel_button_text\r\n\t\tif (self.attr('data-modaal-confirm-cancel-button-text')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.confirm_cancel_button_text = self.attr('data-modaal-confirm-cancel-button-text');\r\n\t\t}\r\n\r\n\t\t// option: confirm_title\r\n\t\tif (self.attr('data-modaal-confirm-title')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.confirm_title = self.attr('data-modaal-confirm-title');\r\n\t\t}\r\n\r\n\t\t// option: confirm_content\r\n\t\tif (self.attr('data-modaal-confirm-content')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.confirm_content = self.attr('data-modaal-confirm-content');\r\n\t\t}\r\n\r\n\t\t// option: gallery_active_class\r\n\t\tif (self.attr('data-modaal-gallery-active-class')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.gallery_active_class = self.attr('data-modaal-gallery-active-class');\r\n\t\t}\r\n\r\n\t\t// option: loading_content\r\n\t\tif (self.attr('data-modaal-loading-content')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.loading_content = self.attr('data-modaal-loading-content');\r\n\t\t}\r\n\r\n\t\t// option: loading_class\r\n\t\tif (self.attr('data-modaal-loading-class')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.loading_class = self.attr('data-modaal-loading-class');\r\n\t\t}\r\n\r\n\t\t// option: ajax_error_class\r\n\t\tif (self.attr('data-modaal-ajax-error-class')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.ajax_error_class = self.attr('data-modaal-ajax-error-class');\r\n\t\t}\r\n\r\n\t\t// option: start_open\r\n\t\tif (self.attr('data-modaal-instagram-id')) {\r\n\t\t\tinline_options = true;\r\n\t\t\toptions.instagram_id = self.attr('data-modaal-instagram-id');\r\n\t\t}\r\n\r\n\t\t// now set it up for the trigger, but only if inline_options is true\r\n\t\tif (inline_options) {\r\n\t\t\tself.modaal(options);\r\n\t\t}\r\n\t};\r\n\r\n\t// On body load (or now, if already loaded), init any modaals defined inline\r\n\t// Ensure this is done after $.fn.modaal and default options are declared\r\n\t// ----------------------------------------------------------------\r\n\t$(function () {\r\n\r\n\t\tvar single_modaal = $('.modaal');\r\n\r\n\t\t// Check for existing modaal elements\r\n\t\tif (single_modaal.length) {\r\n\t\t\tsingle_modaal.each(function () {\r\n\t\t\t\tvar self = $(this);\r\n\t\t\t\tmodaal_inline_options(self);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Obvserve DOM mutations for newly added triggers\r\n\t\tvar modaal_dom_observer = new MutationObserver(function (mutations) {\r\n\t\t\tmutations.forEach(function (mutation) {\r\n\t\t\t\tif (mutation.addedNodes && mutation.addedNodes.length > 0) {\r\n\t\t\t\t\t// element added to DOM\r\n\t\t\t\t\tvar findElement = [].some.call(mutation.addedNodes, function (el) {\r\n\t\t\t\t\t\tvar elm = $(el);\r\n\t\t\t\t\t\tif (elm.is('a') || elm.is('button')) {\r\n\r\n\t\t\t\t\t\t\tif (elm.hasClass('modaal')) {\r\n\t\t\t\t\t\t\t\t// is inline Modaal, initialise options\r\n\t\t\t\t\t\t\t\tmodaal_inline_options(elm);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// is not inline modaal. Check for existing selector\r\n\t\t\t\t\t\t\t\tmodaal_existing_selectors.forEach(function (modaalSelector) {\r\n\t\t\t\t\t\t\t\t\tif (modaalSelector.element == elm.attr('class')) {\r\n\t\t\t\t\t\t\t\t\t\t$(elm).modaal(modaalSelector.options);\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\tvar observer_config = {\r\n\t\t\tsubtree: true,\r\n\t\t\tattributes: true,\r\n\t\t\tchildList: true,\r\n\t\t\tcharacterData: true\r\n\t\t};\r\n\r\n\t\t// pass in the target node, as well as the observer options\r\n\t\tsetTimeout(function () {\r\n\t\t\tmodaal_dom_observer.observe(document.body, observer_config);\r\n\t\t}, 500);\r\n\r\n\t});\r\n\r\n}(jQuery, window, document));"]}