{"version":3,"names":[],"mappings":"","sources":["theme.js"],"sourcesContent":["$( document ).ready(function() {\r\n $(\".events-wrap\").on(\"click\", \"#event-button\", function(e){\r\n var $this = $(this);\r\n\r\n var data = {\r\n 'action': 'apply_to_event',\r\n 'event' : $this.parent().parent().data(\"event\")\r\n };\r\n\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n $this.hide();\r\n if (data === 'Not Authorized') {\r\n $this.parent().html();\r\n $this.siblings().show();\r\n }\r\n else {\r\n $this.parent().text(data);\r\n }\r\n } else {}\r\n }\r\n });\r\n })\r\n\r\n\r\n $( '.glyphicon-search' ).click( function () {\r\n $( '#side-menu .search-form' ).submit();\r\n } );\r\n});\r\n\r\n\n/*\r\n Author: Jack Ducasse;\r\n Version: 0.1.0;\r\n (◠‿◠✿)\r\n*/\r\nvar Calendar = function(model, options, date){\r\n // Default Values\r\n this.Options = {\r\n Color: '',\r\n LinkColor: '',\r\n NavShow: true,\r\n NavVertical: false,\r\n NavLocation: '',\r\n DateTimeShow: true,\r\n DateTimeFormat: 'mmm, yyyy',\r\n DatetimeLocation: '',\r\n EventClick: '',\r\n EventTargetWholeDay: false,\r\n DisabledDays: [],\r\n ModelChange: model,\r\n locale: ''\r\n };\r\n // Overwriting default values\r\n for(var key in options){\r\n this.Options[key] = typeof options[key]=='string'?options[key].toLowerCase():options[key];\r\n }\r\n\r\n model?this.Model=model:this.Model={};\r\n this.Today = new Date();\r\n\r\n this.Selected = this.Today\r\n this.Today.Month = this.Today.getMonth();\r\n this.Today.Year = this.Today.getFullYear();\r\n if(date){this.Selected = date}\r\n this.Selected.Month = this.Selected.getMonth();\r\n this.Selected.Year = this.Selected.getFullYear();\r\n\r\n this.Selected.Days = new Date(this.Selected.Year, (this.Selected.Month + 1), 0).getDate();\r\n this.Selected.FirstDay = new Date(this.Selected.Year, (this.Selected.Month), 1).getDay();\r\n this.Selected.LastDay = new Date(this.Selected.Year, (this.Selected.Month + 1), 0).getDay();\r\n\r\n this.Prev = new Date(this.Selected.Year, (this.Selected.Month - 1), 1);\r\n if(this.Selected.Month==0){this.Prev = new Date(this.Selected.Year-1, 11, 1);}\r\n this.Prev.Days = new Date(this.Prev.getFullYear(), (this.Prev.getMonth() + 1), 0).getDate();\r\n};\r\n\r\nfunction createCalendar(calendar, element, adjuster){\r\n if(typeof adjuster !== 'undefined'){\r\n var newDate = new Date(calendar.Selected.Year, calendar.Selected.Month + adjuster, 1);\r\n calendar = new Calendar(calendar.Model, calendar.Options, newDate);\r\n element.innerHTML = '';\r\n }else{\r\n for(var key in calendar.Options){\r\n typeof calendar.Options[key] != 'function' && typeof calendar.Options[key] != 'object' && calendar.Options[key]?element.className += \" \" + key + \"-\" + calendar.Options[key]:0;\r\n }\r\n }\r\n var months = calendar.Options.locale == 'en' ? [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"] : [\"Janvāris\", \"Februāris\", \"Marts\", \"Aprīlis\", \"Maijs\", \"Jūnijs\", \"Jūlijs\", \"Augusts\", \"Septembris\", \"Oktobris\", \"Novembris\", \"Decembris\"];\r\n\r\n function AddSidebar(){\r\n var sidebar = document.createElement('div');\r\n sidebar.className += 'cld-sidebar';\r\n\r\n var monthList = document.createElement('ul');\r\n monthList.className += 'cld-monthList';\r\n\r\n for(var i = 0; i < months.length - 3; i++){\r\n var x = document.createElement('li');\r\n x.className += 'cld-month';\r\n var n = i - (4 - calendar.Selected.Month);\r\n // Account for overflowing month values\r\n if(n<0){n+=12;}\r\n else if(n>11){n-=12;}\r\n // Add Appropriate Class\r\n if(i==0){\r\n x.className += ' cld-rwd cld-nav';\r\n x.addEventListener('click', function(){\r\n typeof calendar.Options.ModelChange == 'function'?calendar.Model = calendar.Options.ModelChange():calendar.Model = calendar.Options.ModelChange;\r\n createCalendar(calendar, element, -1);});\r\n x.innerHTML += '';\r\n }\r\n else if(i==months.length - 4){\r\n x.className += ' cld-fwd cld-nav';\r\n x.addEventListener('click', function(){\r\n typeof calendar.Options.ModelChange == 'function'?calendar.Model = calendar.Options.ModelChange():calendar.Model = calendar.Options.ModelChange;\r\n createCalendar(calendar, element, 1);} );\r\n x.innerHTML += '';\r\n }\r\n else{\r\n if(i < 4){x.className += ' cld-pre';}\r\n else if(i > 4){x.className += ' cld-post';}\r\n else{x.className += ' cld-curr';}\r\n\r\n //prevent losing var adj value (for whatever reason that is happening)\r\n (function () {\r\n var adj = (i-4);\r\n //x.addEventListener('click', function(){createCalendar(calendar, element, adj);console.log('kk', adj);} );\r\n x.addEventListener('click', function(){\r\n typeof calendar.Options.ModelChange == 'function'?calendar.Model = calendar.Options.ModelChange():calendar.Model = calendar.Options.ModelChange;\r\n createCalendar(calendar, element, adj);} );\r\n x.setAttribute('style', 'opacity:' + (1 - Math.abs(adj)/4));\r\n x.innerHTML += months[n].substr(0,3);\r\n }()); // immediate invocation\r\n\r\n if(n==0){\r\n var y = document.createElement('li');\r\n y.className += 'cld-year';\r\n if(i<5){\r\n y.innerHTML += calendar.Selected.Year;\r\n }else{\r\n y.innerHTML += calendar.Selected.Year + 1;\r\n }\r\n monthList.appendChild(y);\r\n }\r\n }\r\n monthList.appendChild(x);\r\n }\r\n sidebar.appendChild(monthList);\r\n if(calendar.Options.NavLocation){\r\n document.getElementById(calendar.Options.NavLocation).innerHTML = \"\";\r\n document.getElementById(calendar.Options.NavLocation).appendChild(sidebar);\r\n }\r\n else{element.appendChild(sidebar);}\r\n }\r\n\r\n var mainSection = document.createElement('div');\r\n mainSection.className += \"cld-main\";\r\n\r\n function AddDateTime(){\r\n var datetime = document.createElement('div');\r\n datetime.className += \"cld-datetime\";\r\n if(calendar.Options.NavShow && !calendar.Options.NavVertical){\r\n var rwd = document.createElement('div');\r\n rwd.className += \" cld-rwd cld-nav\";\r\n rwd.addEventListener('click', function(){createCalendar(calendar, element, -1);} );\r\n rwd.innerHTML = '';\r\n datetime.appendChild(rwd);\r\n }\r\n var today = document.createElement('div');\r\n today.className += ' today';\r\n today.innerHTML = months[calendar.Selected.Month] + \", \" + calendar.Selected.Year;\r\n datetime.appendChild(today);\r\n if(calendar.Options.NavShow && !calendar.Options.NavVertical){\r\n var fwd = document.createElement('div');\r\n fwd.className += \" cld-fwd cld-nav\";\r\n fwd.addEventListener('click', function(){createCalendar(calendar, element, 1);} );\r\n fwd.innerHTML = '';\r\n datetime.appendChild(fwd);\r\n }\r\n if(calendar.Options.DatetimeLocation){\r\n document.getElementById(calendar.Options.DatetimeLocation).innerHTML = \"\";\r\n document.getElementById(calendar.Options.DatetimeLocation).appendChild(datetime);\r\n }\r\n else{mainSection.appendChild(datetime);}\r\n }\r\n\r\n function AddLabels(){\r\n var labels = document.createElement('ul');\r\n labels.className = 'cld-labels';\r\n var labelsList = calendar.Options.locale == 'en' ? [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"] : [\"Sv\", \"Pr\", \"Ot\", \"Tr\", \"Ce\", \"Pk\", \"Se\"];\r\n for(var i = 0; i < labelsList.length; i++){\r\n var label = document.createElement('li');\r\n label.className += \"cld-label\";\r\n label.innerHTML = labelsList[i];\r\n labels.appendChild(label);\r\n }\r\n mainSection.appendChild(labels);\r\n }\r\n function AddDays(){\r\n // Create Number Element\r\n function DayNumber(n){\r\n var number = document.createElement('p');\r\n number.className += \"cld-number\";\r\n number.innerHTML += n;\r\n return number;\r\n }\r\n var days = document.createElement('ul');\r\n days.className += \"cld-days\";\r\n // Previous Month's Days\r\n for(var i = 0; i < (calendar.Selected.FirstDay); i++){\r\n var day = document.createElement('li');\r\n day.className += \"cld-day prevMonth\";\r\n //Disabled Days\r\n var d = i%7;\r\n for(var q = 0; q < calendar.Options.DisabledDays.length; q++){\r\n if(d==calendar.Options.DisabledDays[q]){\r\n day.className += \" disableDay\";\r\n }\r\n }\r\n\r\n var number = DayNumber((calendar.Prev.Days - calendar.Selected.FirstDay) + (i+1));\r\n day.appendChild(number);\r\n\r\n days.appendChild(day);\r\n }\r\n // Current Month's Days\r\n for(var i = 0; i < calendar.Selected.Days; i++){\r\n var day = document.createElement('li');\r\n day.className += \"cld-day currMonth\";\r\n //Disabled Days\r\n var d = (i + calendar.Selected.FirstDay)%7;\r\n for(var q = 0; q < calendar.Options.DisabledDays.length; q++){\r\n if(d==calendar.Options.DisabledDays[q]){\r\n day.className += \" disableDay\";\r\n }\r\n }\r\n var number = DayNumber(i+1);\r\n // Check Date against Event Dates\r\n for(var n = 0; n < calendar.Model.length; n++){\r\n var evDate = calendar.Model[n].Date;\r\n var toDate = new Date(calendar.Selected.Year, calendar.Selected.Month, (i+1));\r\n if(evDate.getTime() == toDate.getTime()){\r\n number.className += \" eventday\";\r\n var title = document.createElement('span');\r\n title.className += \"cld-title\";\r\n\r\n //-------------------\r\n\r\n if(typeof calendar.Model[n].Link == 'function' || calendar.Options.EventClick){\r\n var a = document.createElement('a');\r\n a.setAttribute('href', '#');\r\n a.innerHTML += calendar.Model[n].Title;\r\n if(calendar.Options.EventClick){\r\n var z = calendar.Model[n].Link;\r\n if(typeof calendar.Model[n].Link != 'string'){\r\n a.addEventListener('click', calendar.Options.EventClick.bind.apply(calendar.Options.EventClick, [null].concat(z)) );\r\n if(calendar.Options.EventTargetWholeDay){\r\n day.className += \" clickable\";\r\n day.addEventListener('click', calendar.Options.EventClick.bind.apply(calendar.Options.EventClick, [null].concat(z)) );\r\n }\r\n }else{\r\n a.addEventListener('click', calendar.Options.EventClick.bind(null, z) );\r\n if(calendar.Options.EventTargetWholeDay){\r\n day.className += \" clickable\";\r\n day.addEventListener('click', calendar.Options.EventClick.bind(null, z) );\r\n }\r\n }\r\n }else{\r\n a.addEventListener('click', calendar.Model[n].Link);\r\n if(calendar.Options.EventTargetWholeDay){\r\n day.className += \" clickable\";\r\n day.addEventListener('click', calendar.Model[n].Link);\r\n }\r\n }\r\n //title.appendChild(a);\r\n\r\n }else{\r\n //title.innerHTML += '' + calendar.Model[n].Title + '';\r\n day.setAttribute('data', calendar.Model[n].Title);\r\n }\r\n //number.appendChild(title);\r\n\r\n //-------------------\r\n }\r\n\r\n }\r\n day.appendChild(number);\r\n // If Today..\r\n if((i+1) == calendar.Today.getDate() && calendar.Selected.Month == calendar.Today.Month && calendar.Selected.Year == calendar.Today.Year){\r\n day.className += \" today\";\r\n }\r\n days.appendChild(day);\r\n }\r\n // Next Month's Days\r\n // Always same amount of days in calander\r\n var extraDays = 13;\r\n if(days.children.length>35){extraDays = 6;}\r\n else if(days.children.length<29){extraDays = 20;}\r\n\r\n for(var i = 0; i < (extraDays - calendar.Selected.LastDay); i++){\r\n var day = document.createElement('li');\r\n day.className += \"cld-day nextMonth\";\r\n //Disabled Days\r\n var d = (i + calendar.Selected.LastDay + 1)%7;\r\n for(var q = 0; q < calendar.Options.DisabledDays.length; q++){\r\n if(d==calendar.Options.DisabledDays[q]){\r\n day.className += \" disableDay\";\r\n }\r\n }\r\n\r\n var number = DayNumber(i+1);\r\n day.appendChild(number);\r\n\r\n days.appendChild(day);\r\n }\r\n mainSection.appendChild(days);\r\n }\r\n if(calendar.Options.Color){\r\n mainSection.innerHTML += '';\r\n }\r\n if(calendar.Options.LinkColor){\r\n mainSection.innerHTML += '';\r\n }\r\n element.appendChild(mainSection);\r\n\r\n if(calendar.Options.NavShow && calendar.Options.NavVertical){\r\n AddSidebar();\r\n }\r\n if(calendar.Options.DateTimeShow){\r\n AddDateTime();\r\n }\r\n AddLabels();\r\n AddDays();\r\n}\r\n\r\nfunction caleandar(el, data, settings){\r\n var obj = new Calendar(data, settings);\r\n createCalendar(obj, el);\r\n}\r\n\n/**\r\n * Created by MS-IDI E0163 on 7/11/2017.\r\n */\r\n$(document).ready(function () {\r\n\r\n var links = $('.attachment-download-link');\r\n\r\n\r\n $.each(links, function (index, link) {\r\n var title = $(link).text();\r\n var href = $(link).attr('href');\r\n console.log(\"href \", href );\r\n var ext = href.substr(href.lastIndexOf(\".\") + 1);\r\n $(link).replaceWith(\"
\" +\r\n \"
\" +\r\n \"
\" +\r\n \"
\" + ext + \"
\" +\r\n \"
\" +\r\n \"\" +\r\n \"\" +\r\n \"
\");\r\n });\r\n});\n/**\r\n * Created by MS-IDI E0163 on 7/12/2017.\r\n */\r\n\r\n$(document).ready(function () {\r\n $(\".scroll-bar-wrapper\").mCustomScrollbar({\r\n axis: \"x\", // horizontal scrollbar\r\n theme: \"dark-3\",\r\n scrollButtons: {enable: true},\r\n mouseWheel: {enable: false}\r\n });\r\n});\n$( document ).ready(function() {\r\n $(\"#events-filters\").on(\"click\", \".filter-list-item\", function(e){\r\n var $this = $(this);\r\n $this.addClass(\"selected\").siblings().removeClass(\"selected\");\r\n var data = {\r\n 'action': 'load_filtered_events',\r\n 'page': 0,\r\n 'filter': $this.data(\"value\")\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n $('.events-wrap').empty();\r\n // insert new data before load more button\r\n $('.events-wrap').append(data);\r\n } else {\r\n $('.events-wrap').empty();\r\n }\r\n }\r\n });\r\n })\r\n});\r\n\r\n\nvar filterStatus = \"all\";\r\n\r\n$(document).ready(function () {\r\n $(\"#gallery-filters\").on(\"click\", \".filter-list-item\", function (e) {\r\n var $this = $(this);\r\n $this.addClass(\"selected\").siblings().removeClass(\"selected\");\r\n\r\n var filter = $this.data(\"status\");\r\n filterStatus = filter;\r\n\r\n var data = {\r\n 'filter': filterStatus,\r\n 'action': 'filter_albums',\r\n 'info': true,\r\n 'title': true,\r\n 'page': currentPage\r\n };\r\n sendAjax(data, false);\r\n\r\n });\r\n\r\n $(\"#gallery-search\").on(\"change\", 'input', function (e) {\r\n var $this = $(this);\r\n var searchString = $this.val();\r\n var filter = $(\"#gallery-filters\").find(\".selected\").data(\"status\");\r\n var data = {\r\n 'filter': filter,\r\n 'action': 'filter_albums',\r\n 'page': currentPage,\r\n 'search': searchString\r\n };\r\n sendAjax(data, true);\r\n\r\n });\r\n});\r\n\r\nfunction sendAjax(data, isSearch) {\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success: function (data) {\r\n // checking response sanity\r\n if(data == 0)\r\n {\r\n data = '';\r\n }\r\n var items = $.parseHTML(data);\r\n // insert new data before load more button\r\n $('#gallery-block').html(items);\r\n\r\n if (!isSearch) {\r\n // if changing filters than removing search string.\r\n $(\"#gallery-search\").find(\"input\").val(\"\");\r\n }\r\n }\r\n });\r\n\r\n\r\n data['action'] = 'get_album_pages_count';\r\n\r\n\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success: function (data) {\r\n\r\n if (data) {\r\n maxPages = data;\r\n if (currentPage >= maxPages) {\r\n console.log(\"maxPages:\", maxPages);\r\n console.log(\"current\", currentPage);\r\n $('#galleries-controls').hide();\r\n }\r\n else {\r\n console.log(\"showing\");\r\n $('#galleries-controls').show();\r\n }\r\n }\r\n }\r\n });\r\n}\n$( document ).ready(function() {\r\n $('.events-wrap').on('click', '#load-more-events', function() {\r\n var data = {\r\n 'action': 'load_filtered_events',\r\n 'page' : currentPage,\r\n 'filter': $(\".filter-list-item.selected\").data(\"value\")\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n // insert new data before load more button\r\n $('.events-row').append(data);\r\n // increment page count\r\n currentPage ++;\r\n if (currentPage >= maxPages) {\r\n // if it's last page than remove button\r\n $('#news-controls').hide();\r\n }\r\n } else {\r\n $('#news-controls').remove();\r\n }\r\n }\r\n });\r\n });\r\n\r\n //Calendar stuff\r\n var calendarHtml = document.getElementById('caleandar');\r\n var calendar;\r\n\r\n\r\n if( calendarHtml ){\r\n var events = [];\r\n var settings = {\r\n locale: locale\r\n };\r\n\r\n //Getting event dates\r\n var data = {\r\n 'action': 'arp_get_calendar_dates'\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n\r\n data.forEach(function(element) {\r\n\r\n var date = new Date( element );\r\n var dd = date.getDate();\r\n var mm = date.getMonth();\r\n var yyyy = date.getFullYear();\r\n\r\n if(dd<10){\r\n dd='0'+dd;\r\n }\r\n\r\n var mounth = mm;\r\n mounth++;\r\n if(mounth<10){\r\n mounth='0'+mounth;\r\n }\r\n\r\n var title = dd + '.' + mounth + '.' + yyyy;\r\n\r\n var event = {\r\n 'Date': new Date(yyyy, mm, dd),\r\n 'Title': title\r\n };\r\n\r\n events.push( event );\r\n });\r\n\r\n calendar = caleandar(calendarHtml, events, settings);\r\n } else {\r\n //Fuck off\r\n }\r\n }\r\n });\r\n }\r\n\r\n function getEventsByDate( date ) {\r\n\r\n if( date ){\r\n var data = {\r\n 'action': 'get_events_by_date',\r\n 'date': date\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n $('.events-row').empty();\r\n $('#news-controls').remove();\r\n $('.pagination-script').remove();\r\n\r\n $('.events-row').append(data);\r\n\r\n\r\n } else {\r\n $('#news-controls').remove();\r\n }\r\n }\r\n });\r\n }\r\n }\r\n \r\n \r\n $( document ).on( 'click', '.cld-day', function (e) {\r\n\r\n getEventsByDate( $( this ).attr( 'data') );\r\n } );\r\n\r\n \r\n});\r\n\r\n\nvar uniteGallery;\r\n$( document ).ready(function() {\r\n $('body').fadeIn('slow');\r\n\r\n $('#load-more-galleries').click(function () {\r\n var filter = $(\"#gallery-filters\").find(\".selected\").data(\"status\");\r\n var data = {\r\n 'filter': filter,\r\n 'info': true,\r\n 'title': true,\r\n 'action': 'load_albums',\r\n 'page': currentPage\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success: function (data) {\r\n if (data) {\r\n var items = $.parseHTML(data);\r\n // insert new data before load more button\r\n $('#gallery-block').append(items);\r\n // increment page count\r\n currentPage++;\r\n if (currentPage >= maxPages) {\r\n // if it's last page than remove button\r\n $('#galleries-controls').hide();\r\n }\r\n } else {\r\n $('#galleries-controls').hide();\r\n }\r\n }\r\n });\r\n });\r\n\r\n $('#arp-lightbox').click(function (event) {\r\n // checking sanity\r\n if (event.target !== this)\r\n {\r\n return;\r\n }\r\n console.log(uniteGallery);\r\n $(this).fadeOut();\r\n\r\n // destroying gallery instance;\r\n uniteGallery.html(\"\");\r\n });\r\n\r\n\r\n});\r\n\r\nfunction loadGallery(id){\r\n\r\n var data = {\r\n 'action': 'load_album_by_id',\r\n 'id' : id\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success: function (data) {\r\n if (data) {\r\n var items = $.parseHTML(data);\r\n $('#gallery-block').empty();\r\n $('#gallery-block').append(items);\r\n \r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction showGallery(id){\r\n\r\n var data = {\r\n 'action': 'load_gallery_resources',\r\n 'id' : id\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success: function (data) {\r\n if (data) {\r\n console.log(\"Modal!\", data);\r\n uniteGallery = jQuery(\"#gallery_resources\");\r\n uniteGallery.html(data).unitegallery({\r\n slider_scale_mode: \"scale up\",\r\n theme_enable_text_panel: false,\r\n gallery_height: '480',\r\n gallery_width: '830',\r\n strippanel_background_color: \"#48515d\",\r\n gallery_background_color: \"white\",\r\n thumb_selected_border_width: 2,\r\n thumb_selected_border_color: \"#fdcb20\",\r\n strippanel_padding_left: 135,\r\n thumb_width:65,\r\n thumb_height:45\r\n });\r\n $('#arp-lightbox').fadeIn();\r\n }\r\n }\r\n });\r\n}\n$( document ).ready(function() {\r\n $('body').fadeIn('slow');\r\n\r\n $('.masonry-block').masonry({\r\n // options...\r\n itemSelector: '.masonry-item',\r\n columnWidth: '.masonry-item',\r\n percentPosition: true,\r\n horizontalOrder: true\r\n });\r\n\r\n \r\n $('#load-more-news').click(function(){\r\n var category = $('.masonry-block').attr('id');\r\n var post_type = $('.masonry-block').attr('post_type');\r\n var data = {\r\n 'category': category,\r\n 'post_type': post_type,\r\n 'action': 'load_news',\r\n 'page' : currentPage\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n var items = $.parseHTML(data);\r\n // insert new data before load more button\r\n $('.masonry-block').append( items ).masonry( 'appended', items );\r\n // increment page count\r\n currentPage ++;\r\n if (currentPage >= maxPages) {\r\n // if it's last page than remove button\r\n $('#news-controls').hide();}\r\n } else {\r\n $('#news-controls').remove();\r\n }\r\n }\r\n });\r\n });\r\n \r\n \r\n\r\n \r\n $('#load-all-news').click(function(){\r\n var category = $('.masonry-block').attr('id');\r\n var post_type = $('.masonry-block').attr('post_type');\r\n var data = {\r\n 'category': category,\r\n 'post_type': post_type,\r\n 'action': 'load_news',\r\n 'page' : currentPage,\r\n 'all': true\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n \r\n var items = $.parseHTML(data);\r\n // insert new data before load more button\r\n $('.masonry-block').append( items ).masonry( 'appended', items );\r\n \r\n // remove load more buttons\r\n $('#news-controls').remove();\r\n } else {\r\n $('#news-controls').remove();\r\n }\r\n }\r\n });\r\n });\r\n});\r\n\n$( document ).ready(function() {\r\n $('#load-more-posts').click(function(){\r\n var post_type = $('.posts-container').attr('id');\r\n var data = {\r\n 'action': 'load_posts',\r\n 'page' : currentPage,\r\n 'post_type': post_type\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n // insert new data before load more button\r\n $('.posts-container').append(data);\r\n // increment page count\r\n currentPage ++;\r\n if (currentPage >= maxPages) {\r\n // if it's last page than remove button\r\n $('#news-controls').hide();}\r\n } else {\r\n $('#news-controls').remove();\r\n }\r\n }\r\n });\r\n });\r\n\r\n $('#load-all-posts').click(function(){\r\n var post_type = $('.posts-container').attr('id');\r\n var data = {\r\n 'action': 'load_posts',\r\n 'page' : currentPage,\r\n 'post_type': post_type,\r\n 'all': true\r\n };\r\n $.ajax({\r\n url: ajaxurl,\r\n data: data,\r\n type: 'POST',\r\n success:function(data){\r\n if( data ) {\r\n // insert new data before load more button\r\n $('.posts-container').append(data);\r\n // remove load more buttons\r\n $('#news-controls').remove();\r\n } else {\r\n $('#news-controls').remove();\r\n }\r\n }\r\n });\r\n });\r\n});\r\n\n/**\r\n * Created by MS-IDI E0163 on 7/11/2017.\r\n */\r\n$(document).ready(function () {\r\n\r\n /*Pintereset style images block*/\r\n\r\n // $('.masonry-block').masonry({\r\n // // options...\r\n // itemSelector: '.masonry-item',\r\n // columnWidth: '.masonry-item',\r\n // percentPosition: true\r\n // });\r\n\r\n \r\n});\n$( document ).ready(function() {\r\n var $this = $('#side-menu');\r\n var header = $('.right-header');\r\n var $thisHeader = $this.find('.center-header');\r\n var $thisMenu = $this.find('.menu-side-menu-container');\r\n\r\n $('#side-menu-open').click(function() {\r\n header.velocity({ opacity: 0 }, { duration: 250 }, \"easeInBack\");\r\n $this.show().velocity({ width: 320 }, { duration: 250 }, \"easeInBack\");\r\n setTimeout(function() {\r\n header.hide();\r\n $thisHeader.css('display', 'flex').velocity({ opacity: 1 }, { duration: 250 }, \"easeInBack\");\r\n $thisMenu.show().velocity({ opacity: 1 }, { duration: 250 }, \"easeInBack\");\r\n }, 250);\r\n });\r\n\r\n $('#side-menu-close').click(function() {\r\n $thisHeader.velocity({ opacity: 0 }, { duration: 250 }, \"easeInBack\");\r\n $thisMenu.velocity({ opacity: 0 }, { duration: 250 }, \"easeInBack\");\r\n setTimeout(function() {\r\n header.css('display', 'flex').velocity({ opacity: 1 }, { duration: 250 }, \"easeInBack\");\r\n $this.velocity({ width: 0 }, { duration: 250 }, \"easeInBack\");\r\n setTimeout(function() {\r\n $this.hide();\r\n }, 250);\r\n }, 250);\r\n });\r\n});\r\n\n$( document ).ready(function() {\r\n var slider = $('#peppermint_header_slider');\r\n if (slider.length > 0) {\r\n var headerSlider = slider.Peppermint({\r\n dots: false,\r\n slideshow: false,\r\n mouseDrag: false\r\n });\r\n $('.inactive-slide').removeClass('inactive-slide');\r\n\r\n $('#header_slide_previous').on(\"click\", headerSlider.data('Peppermint').prev);\r\n $('#header_slide_next').on(\"click\", headerSlider.data('Peppermint').next);\r\n }\r\n\r\n // var Parallax = {\r\n // flowers: {\r\n // left: $('#flowers-left'),\r\n // right: $('#flowers-right')\r\n // },\r\n // current: {\r\n // x: null,\r\n // y: null\r\n // },\r\n // diff: {\r\n // x: null,\r\n // y: null\r\n // },\r\n // moveFlowers: function(i, el, movementConstant, diff) {\r\n // var movement = {\r\n // x: $(el).position().left + ( (i + 1) * (diff.x * movementConstant) ),\r\n // y: $(el).position().top + ( (i + 1) * (diff.y * movementConstant) )\r\n // };\r\n // $(el).css('left', movement.x + 'px');\r\n // $(el).css('top', movement.y + 'px');\r\n // }\r\n // };\r\n // if (Parallax.flowers.left.length > 0) {\r\n // $(document.body).mousemove(function(e) {\r\n // Parallax.current.x = (!Parallax.current.x) ? e.pageX : Parallax.current.x;\r\n // Parallax.current.y = (!Parallax.current.y) ? e.pageY : Parallax.current.y;\r\n // Parallax.diff.x = e.pageX - Parallax.current.x;\r\n // Parallax.diff.y = e.pageY - Parallax.current.y;\r\n // Parallax.current.x = e.pageX;\r\n // Parallax.current.y = e.pageY;\r\n // Parallax.flowers.left.each(function(i, el) {\r\n // Parallax.moveFlowers(i, el, 0.0020, Parallax.diff);\r\n // });\r\n // if (Parallax.flowers.right.length > 0) {\r\n // Parallax.flowers.right.each(function(i, el) {\r\n // Parallax.moveFlowers(i, el, 0.0012, Parallax.diff);\r\n // });\r\n // }\r\n // });\r\n // }\r\n});\n/*$( document ).ready(function() {\r\n $(\".event-list-item\").hover(function(){\r\n $(this).find('.event-details').fadeIn('slow');\r\n $(this).find('.event-list-title').hide();\r\n console.log('working');\r\n },function(){\r\n $(this).find('.event-details').hide();\r\n $(this).find('.event-list-title').show();\r\n });\r\n});*/\r\n\r\n\r\n"],"file":"theme.js"}