Skip to content
Browse files

Working with issue #50 and completing the Hotels section.

- Second phase of styling to come, but it is acceptable and functional
  • Loading branch information...
1 parent bdee695 commit a0aaebba9166926e9e2a614d3384df87badd7dfe @dragoonis dragoonis committed Feb 23, 2012
View
205 css/anythingslider.css
@@ -0,0 +1,205 @@
+/*
+ AnythingSlider v1.7+ Default (base) theme
+ By Chris Coyier: http://css-tricks.com
+ with major improvements by Doug Neiner: http://pixelgraphics.us/
+ based on work by Remy Sharp: http://jqueryfordesigners.com/
+*/
+
+/*****************************
+ SET DEFAULT DIMENSIONS HERE
+ *****************************/
+/* change the ID to match your slider */
+#slider {
+ width: 700px;
+ height: 390px;
+ list-style: none;
+ /* Prevent FOUC (see FAQ page) and keep things readable if javascript is disabled */
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+/* Opera width restriction */
+.anythingBase { max-width: 32766px; }
+
+/*****************
+ SET COLORS HERE
+ *****************/
+
+/* Navigation buttons, default state */
+div.anythingSlider .anythingControls ul a.cur, div.anythingSlider .anythingControls ul a {
+ background: #777;
+ color: #000;
+}
+/* start-stop button, stopped, default state */
+div.anythingSlider .start-stop {
+ background-color: #040;
+ color: #fff;
+}
+/* start-stop button, playing, default state */
+div.anythingSlider .start-stop.playing {
+ background-color: #800;
+}
+/* start-stop button, default hovered text color (when visible) */
+div.anythingSlider .start-stop:hover, div.anythingSlider .start-stop.hover {
+ color: #ddd;
+}
+
+/* Navigation buttons, active state */
+div.anythingSlider.activeSlider .anythingControls ul a.cur, div.anythingSlider.activeSlider .anythingControls ul a {
+ background-color: #7C9127;
+}
+/* start-stop button, stopped, active state */
+div.anythingSlider .start-stop {
+ background-color: #080;
+ color: #fff;
+}
+/* start-stop button, playing, active state */
+div.anythingSlider .start-stop.playing {
+ background-color: #d00;
+}
+/* start-stop button, active slider hovered text color (when visible) */
+div.anythingSlider .start-stop:hover, div.anythingSlider .start-stop.hover {
+ color: #fff;
+}
+
+/***********************
+ COMMON SLIDER STYLING
+ ***********************/
+/* Overall Wrapper: 45px right & left padding for the arrows, 28px @ bottom for navigation */
+div.anythingSlider {
+ display: block;
+ margin: 0 auto;
+ overflow: visible !important; /* needed for Opera and Safari */
+ position: relative;
+ padding: 0 45px 28px 45px;
+}
+/* anythingSlider viewport window */
+div.anythingSlider .anythingWindow {
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+/* anythingSlider base (original element) */
+.anythingBase {
+ background: transparent;
+ list-style: none;
+ position: absolute;
+ overflow: visible !important;
+ top: 0;
+ left: 0;
+ margin: 0;
+ padding: 0;
+}
+/* all panels inside the slider */
+.anythingBase .panel {
+ background: transparent;
+ display: block;
+ overflow: hidden;
+ float: left;
+ padding: 0;
+ margin: 0;
+}
+.anythingBase .panel.vertical {
+ float: none;
+}
+
+/* Navigation Arrows */
+div.anythingSlider .arrow {
+ top: 310px;
+ position: absolute;
+ display: block;
+}
+div.anythingSlider .arrow a {
+ display: block;
+ height: 31px;
+ margin: 0 0 0 0;
+ width: 54px;
+ text-align: center;
+ outline: 0;
+}
+
+div.anythingSlider .arrow.back {
+ background: url(./images/slider-arrow-left.png) no-repeat;
+ background-position: 0 -31px;
+}
+
+div.anythingSlider .arrow.forward {
+ right: -14px;
+ background: url(./images/slider-arrow-right.png) no-repeat;
+ background-position: 0 -31px;
+}
+
+/* hide text, target the span so IE7 doesn't text-indent the link */
+div.anythingSlider .arrow a span { display: block; text-indent: -9999px; }
+/* back arrow */
+div.anythingSlider .back { left: 0; }
+div.anythingSlider .back a { background-position: left top; }
+/*div.anythingSlider .back a:hover, div.anythingSlider .back a.hover { background-position: left -140px; }*/
+div.anythingSlider .back.disabled { display: none; } /* disabled arrows, hide or reduce opacity: opacity: .5; filter: alpha(opacity=50); */
+/* forward arrow */
+div.anythingSlider .forward { right: 3px; }
+div.anythingSlider .forward a { background-position: right top; }
+/*div.anythingSlider .forward a:hover, div.anythingSlider .forward a.hover { background-position: right -140px; }*/
+div.anythingSlider .forward.disabled { display: none; } /* disabled arrows, hide or reduce opacity: opacity: .5; filter: alpha(opacity=50); */
+
+/* Navigation Links */
+div.anythingSlider .anythingControls { outline: 0; display: none; }
+div.anythingSlider .anythingControls ul { margin: 0; padding: 0; float: left; }
+div.anythingSlider .anythingControls ul li { display: inline; }
+div.anythingSlider .anythingControls ul a {
+ font: 11px/18px Georgia, Serif;
+ display: inline-block;
+ text-decoration: none;
+ padding: 2px 8px;
+ height: 18px;
+ margin: 0 5px 0 0;
+ background-image: url(../images/default.png);
+ background-position: center -288px ;
+ background-repeat: repeat-x;
+ text-align: center;
+ outline: 0;
+ border-radius: 0 0 5px 5px;
+ -moz-border-radius: 0 0 5px 5px;
+ -webkit-border-radius: 0 0 5px 5px;
+}
+div.anythingSlider .anythingControls ul a:hover {
+ background-image: none;
+}
+/* Navigation size window */
+div.anythingSlider .anythingControls .anythingNavWindow { overflow: hidden; float: left; }
+
+/* slider autoplay right-to-left, reverse order of nav links to look better */
+div.anythingSlider.rtl .anythingControls ul a { float: right; } /* reverse order of nav links */
+div.anythingSlider.rtl .anythingControls ul { float: left; } /* move nav link group to left */
+div.anythingSlider.rtl .anythingWindow {
+ direction: ltr;
+ unicode-bidi: bidi-override;
+}
+/* div.anythingSlider.rtl .start-stop { float: right; } */ /* move start/stop button - in case you want to switch sides */
+
+/* Autoplay Start/Stop button */
+div.anythingSlider .start-stop {
+ background-image: url(../images/default.png);
+ background-position: center -288px;
+ background-repeat: repeat-x;
+ padding: 2px 5px;
+ width: 40px;
+ text-align: center;
+ text-decoration: none;
+ float: right;
+ z-index: 100;
+ outline: 0;
+ border-radius: 0 0 5px 5px;
+ -moz-border-radius: 0 0 5px 5px;
+ -webkit-border-radius: 0 0 5px 5px;
+}
+/* hide cell shading on hover - makes the button appear to come forward */
+div.anythingSlider .start-stop:hover, div.anythingSlider .start-stop.hover { background-image: none; }
+
+/* probably not necessary, but added just in case */
+div.anythingSlider, div.anythingSlider .anythingWindow, div.anythingSlider .anythingControls ul a, div.anythingSlider .arrow a, div.anythingSlider .start-stop {
+ transition-duration: 0;
+ -o-transition-duration: 0;
+ -moz-transition-duration: 0;
+ -webkit-transition-duration: 0;
+}
View
BIN css/images/slider-arrow-left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/images/slider-arrow-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
31 css/style.css
@@ -169,7 +169,7 @@ section h1:before {
}
.information-section > div {
- padding-bottom: 200px;
+ padding-bottom: 50px;
}
.information-section h1 {
@@ -359,7 +359,7 @@ section h1:before {
#accordion-wrapper {
margin-left: 10px;
margin-right: 10px;
- height: 400px;
+ /*height: 400px;*/
}
.information-section .inner {
@@ -375,6 +375,18 @@ section h1:before {
height: 250px;
}
+.information-section .active .inner-tall {
+ border-top: 3px solid white;
+ height: 600px;
+}
+.information-section .inner-tall {
+ -webkit-transition: height 0.3s ease-out;
+ border-top: 3px solid transparent;
+ height: 0px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+}
+
.how-to-get-there {
background-position: 40px 65px;
background-image: url(../img/info_icon4.png);
@@ -911,6 +923,21 @@ footer > a {
opacity: 1;
}
+#accommodation div.hotel-map {
+ z-index: 0;
+ margin: 10px;
+ width: 555px;
+ height: 350px;
+ background: #333;
+ clear: both;
+}
+
+#accommodation div.hotel-map img {
+ background: none;
+ margin: 0px auto;
+ border-radius: 0;
+}
+
@media screen and (max-width: 600px) {
View
BIN img/mapmarker.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
136 index.html
@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Whisky Web conference - April 13th, 14th 2012 in Edinburgh, UK</title>
<link rel="stylesheet" href="./css/style.css" />
+ <link rel="stylesheet" href="./css/anythingslider.css" />
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Abel|Oswald" />
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" href="css/leaflet.css" />
@@ -135,7 +136,68 @@ <h2 class="date">
<a href="http://www.thehub-edinburgh.com/">www.thehub-edinburgh.com</a></p>
</div>
</div>
- </div>
+
+ <div class="item">
+ <h2>Accommodation</h2>
+ <div class="inner-tall" id="accommodation">
+ <p>While Whisky Web are in no affiliated with the establishments shown below, we thought it might be useful to our delegates and speakeres to provide some details of local hotels that are a short distance from the main conference venue.</p>
+ <div class="slider-container">
+ <ul class="slider">
+ <li>
+ <h3><a href="http://www.ibishotel.com/gb/hotel-2039-ibis-edinburgh-centre/index.shtml">Ibis Hotel</a></h3>
+ <p>From &pound;45 pp/pn</p>
+ <p>~5 minute walk to/from The Hub</p>
+ <p>6 Hunter Square, Off Royal Mile, Edinburgh, EH1 1QW</p>
+ <div id="hotel-map-1" class="hotel-map"><span class="lat">55.949616</span><span class="lon">-3.188095</span></div>
+ </li>
+ <li>
+ <h3><a href="http://www.easyhotel.com/hotels/edinburgh.html">Easy Hotel</a></h3>
+ <p>From &pound;47 pp/pn</p>
+ <p>~20 minute walk to/from The Hub</p>
+ <p>125A Princes Street, Edinburgh, EH2 4AD</p>
+ <div id="hotel-map-2" class="hotel-map"><span class="lat">55.951087</span><span class="lon">-3.204138</span></div>
+ </li>
+ <li>
+ <h3><a href="http://www.thistle.com/en/hotels/united_kingdom/edinburgh/the_king_james/index.html">King James Hotel</a></h3>
+ <p>From &pound;95 pp/pn</p>
+ <p>~15 minute walk to/from The Hub</p>
+ <p>107 Leith Street, Edinburgh, EH1 3SW</p>
+ <div id="hotel-map-3" class="hotel-map"><span class="lat">55.954478</span><span class="lon">-3.188003</span></div>
+ </li>
+ <li>
+ <h3><a href="http://www.apexhotels.co.uk/hotels/edinburgh-city/find-us/">Edinburgh Apex Hotel</a></h3>
+ <p>From &pound;89 pp/pn</p>
+ <p>~5 minute walk to/from The Hub</p>
+ <p>Apex City Hotel, 61 Grassm2HJarket, Edinburgh, EH1 2HJ</p>
+ <div id="hotel-map-4" class="hotel-map"><span class="lat">55.947521</span><span class="lon">-3.194756</span></div>
+ </li>
+ <li>
+ <h3><a href="http://www.bankhoteledinburgh.co.uk/">Bank Hotel</a></h3>
+ <p>From &pound;45 pp/pn</p>
+ <p>~10 minute walk to/from The Hub</p>
+ <p>1 South Bridge, Edinburgh, Scotland, EH1 1LL</p>
+ <div id="hotel-map-5" class="hotel-map"><span class="lat">55.948902</span><span class="lon">-3.186696</span></div>
+ </li>
+ <li>
+ <h3><a href="http://www.accorhotels.com/gb/hotel-3271-novotel-edinburgh-centre/index.shtml">Novotel</a></h3>
+ <p>From &pound;55 pp/pn</p>
+ <p>~15 minute walk to/from The Hub</p>
+ <p>80 Lauriston Place, Edinburgh, EH3 9DE</p>
+ <div id="hotel-map-6" class="hotel-map"><span class="lat">55.945091</span><span class="lon">-3.199757</span></div>
+ </li>
+ <li>
+ <h3><a href="http://edinburghhotels.jurysinns.com/">Jurys Inn</a></h3>
+ <p>From &pound;80 pp/pn</p>
+ <p>~10 minute walk to/from The Hub</p>
+ <p>43 Jeffrey Street, Edinburgh, EH1 1DH</p>
+ <div id="hotel-map-7" class="hotel-map"><span class="lat">55.951151</span><span class="lon">-3.185435</span></div>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ </div>
</div>
</section>
@@ -283,7 +345,7 @@ <h2 id="announce">Schedule</h2>
<table class="schedule" width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr>
- <th>&nbsp;</td>
+ <th>&nbsp;</th>
<th>Track 1</th>
<th>Track 2</th>
</tr>
@@ -519,24 +581,66 @@ <h3 class="addr">The Hub, Castlehill, Edinburgh, EH1 2NE</h3>
<script src="./js/jquery-1.7.1.min.js"></script>
<script src="./js/jquery.tabSlideOut.v1.3.js"></script>
+ <script src="./js/anythingslider.js"></script>
<script src="./js/whiskyweb.js"></script>
<script src="js/leaflet.js"></script>
<script>
- var openstreetmapUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
- openstreetmapAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 openstreetmap',
- openstreetmap = new L.TileLayer(openstreetmapUrl, {maxZoom: 18, attribution: openstreetmapAttribution});
-
- var map = new L.Map('map');
- map.setView(new L.LatLng(55.9488, -3.195), 14).addLayer(openstreetmap);
-
- var HubIcon = L.Icon.extend({
- iconUrl: './img/marker.png',
- iconSize: new L.Point(71, 73),
- iconAnchor: new L.Point(36, 73),
- });
+
+ var openstreetmapUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+ openstreetmapAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 openstreetmap',
+ openstreetmap = new L.TileLayer(openstreetmapUrl, {maxZoom: 18, attribution: openstreetmapAttribution});
+
+ var map = new L.Map('map');
+ map.setView(new L.LatLng(55.9488, -3.195), 14).addLayer(openstreetmap);
+
+ var HubIcon = L.Icon.extend({
+ iconUrl: './img/marker.png',
+ iconSize: new L.Point(71, 73),
+ iconAnchor: new L.Point(36, 73)
+ });
+
+ var marker = new L.Marker(new L.LatLng(55.9488, -3.195), {icon: new HubIcon()});
+ map.addLayer(marker);
+
+ jQuery(document).ready(function($) {
+
+
+ $('div.hotel-map').each(function() {
+ var openstreetmapUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ var openstreetmapAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 openstreetmap';
+ var openstreetmap = new L.TileLayer(openstreetmapUrl, {maxZoom: 18, attribution: openstreetmapAttribution});
+
+ var lat = $(this).find('span.lat').text();
+ $(this).find('span.lat').remove();
+ var lon = $(this).find('span.lon').text();
+ $(this).find('span.lon').remove();
+ var mapId = $(this).attr('id');
+ console.log($(this));
+ var mapNumber = mapId.charAt(mapId.length -1);
+
+ var map = new L.Map('hotel-map-' + mapNumber);
+ map.setView(new L.LatLng(lat, lon), 15).addLayer(openstreetmap);
+
+ var MapIcon = L.Icon.extend({
+ iconUrl: './img/mapmarker.png'
+ });
+
+ var marker = new L.Marker(new L.LatLng(lat, lon), {icon: new MapIcon()});
+ map.addLayer(marker);
+ });
+
+ $('#accommodation').find('.slider').anythingSlider({
+ buildNavigation: false,
+ resizeContents: false,
+ showMultiple: 1,
+ changeBy: 1,
+ autoPlay: false,
+ buildStartStop: false
+ });
+
+ });
+
- var marker = new L.Marker(new L.LatLng(55.9488, -3.195), {icon: new HubIcon()});
- map.addLayer(marker);
</script>
<script type="text/javascript">
View
6 js/anythingslider.js
@@ -0,0 +1,6 @@
+/*
+ AnythingSlider v1.7.18 minified using Google Closure Compiler
+ Original by Chris Coyier: http://css-tricks.com
+ Get the latest version: https://github.com/ProLoser/AnythingSlider
+*/
+(function(d){d.anythingSlider=function(h,i){var a=this,b;a.el=h;a.$el=d(h).addClass("anythingBase").wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');a.$el.data("AnythingSlider",a);a.init=function(){a.options=b=d.extend({},d.anythingSlider.defaults,i);a.initialized=!1;d.isFunction(b.onBeforeInitialize)&&a.$el.bind("before_initialize",b.onBeforeInitialize);a.$el.trigger("before_initialize",a);a.$wrapper=a.$el.parent().closest("div.anythingSlider").addClass("anythingSlider-"+ b.theme);a.$window=a.$el.closest("div.anythingWindow");a.win=window;a.$win=d(a.win);a.$controls=d('<div class="anythingControls"></div>').appendTo(null!==b.appendControlsTo&&d(b.appendControlsTo).length?d(b.appendControlsTo):a.$wrapper);a.$startStop=d('<a href="#" class="start-stop"></a>');b.buildStartStop&&a.$startStop.appendTo(null!==b.appendStartStopTo&&d(b.appendStartStopTo).length?d(b.appendStartStopTo):a.$controls);a.$nav=d('<ul class="thumbNav" />').appendTo(null!==b.appendNavigationTo&&d(b.appendNavigationTo).length? d(b.appendNavigationTo):a.$controls);a.flag=!1;a.playing=b.autoPlay;a.slideshow=!1;a.hovered=!1;a.panelSize=[];a.currentPage=b.startPanel=parseInt(b.startPanel,10)||1;b.changeBy=parseInt(b.changeBy,10)||1;a.adj=b.infiniteSlides?0:1;a.width=a.$el.width();a.height=a.$el.height();a.outerPad=[a.$wrapper.innerWidth()-a.$wrapper.width(),a.$wrapper.innerHeight()-a.$wrapper.height()];b.playRtl&&a.$wrapper.addClass("rtl");if(b.expand)a.$outer=a.$wrapper.parent(),a.$window.css({width:"100%",height:"100%"}), a.checkResize();b.buildStartStop&&a.buildAutoPlay();b.buildArrows&&a.buildNextBackButtons();if(!b.autoPlay)b.autoPlayLocked=!1;a.updateSlider();a.$lastPage=a.$currentPage;a.runTimes=d("div.anythingSlider").index(a.$wrapper)+1;a.regex=RegExp("panel"+a.runTimes+"-(\\d+)","i");1===a.runTimes&&a.makeActive();if(!d.isFunction(d.easing[b.easing]))b.easing="swing";b.pauseOnHover&&a.$wrapper.hover(function(){a.playing&&(a.$el.trigger("slideshow_paused",a),a.clearTimer(!0))},function(){a.playing&&(a.$el.trigger("slideshow_unpaused", a),a.startStop(a.playing,!0))});a.setCurrentPage(a.gotoHash()||b.startPage,!1);a.slideControls(!1);a.$wrapper.bind("mouseenter mouseleave",function(b){a.hovered="mouseenter"===b.type?!0:!1;a.slideControls(a.hovered,!1)});d(document).keyup(function(c){if(b.enableKeyboard&&a.$wrapper.is(".activeSlider")&&!c.target.tagName.match("TEXTAREA|INPUT|SELECT")&&(b.vertical||!(38===c.which||40===c.which)))switch(c.which){case 39:case 40:a.goForward();break;case 37:case 38:a.goBack()}});a.$items.delegate("a", "focus.AnythingSlider",function(c){var e=d(this).closest(".panel"),e=a.$items.index(e)+a.adj;a.$items.find(".focusedLink").removeClass("focusedLink");d(this).addClass("focusedLink");a.$window.scrollLeft(0);if(-1!==e&&(e>=a.currentPage+b.showMultiple||e<a.currentPage))a.gotoPage(e),c.preventDefault()});var c="slideshow_paused slideshow_unpaused slide_init slide_begin slideshow_stop slideshow_start initialized swf_completed".split(" ");d.each("onShowPause onShowUnpause onSlideInit onSlideBegin onShowStop onShowStart onInitialized onSWFComplete".split(" "), function(f,e){d.isFunction(b[e])&&a.$el.bind(c[f],b[e])});d.isFunction(b.onSlideComplete)&&a.$el.bind("slide_complete",function(){setTimeout(function(){b.onSlideComplete(a)},0)});a.initialized=!0;a.$el.trigger("initialized",a);a.startStop(a.playing)};a.updateSlider=function(){a.$el.children(".cloned").remove();a.$nav.empty();a.currentPage=a.currentPage||1;a.$items=a.$el.children();a.pages=a.$items.length;a.dir=b.vertical?"top":"left";b.showMultiple=b.vertical?1:parseInt(b.showMultiple,10)||1;b.navigationSize= !1===b.navigationSize?0:parseInt(b.navigationSize,10)||0;if(1<b.showMultiple){if(b.showMultiple>a.pages)b.showMultiple=a.pages;a.adjustMultiple=b.infiniteSlides&&1<a.pages?0:b.showMultiple-1;a.pages=a.$items.length-a.adjustMultiple}a.$controls.add(a.$nav).add(a.$startStop).add(a.$forward).add(a.$back)[1>=a.pages?"hide":"show"]();1<a.pages&&a.buildNavigation();b.infiniteSlides&&1<a.pages&&(a.$el.prepend(a.$items.filter(":last").clone().removeAttr("id").addClass("cloned")),1<b.showMultiple?a.$el.append(a.$items.filter(":lt("+ b.showMultiple+")").clone().removeAttr("id").addClass("cloned").addClass("multiple")):a.$el.append(a.$items.filter(":first").clone().removeAttr("id").addClass("cloned")),a.$el.find(".cloned").each(function(){d(this).find("a,input,textarea,select,button,area").attr("disabled","disabled");d(this).find("[id]").removeAttr("id")}));a.$items=a.$el.children().addClass("panel"+(b.vertical?" vertical":""));a.setDimensions();b.resizeContents?(a.$items.css("width",a.width),a.$wrapper.css("width",a.getDim(a.currentPage)[0]), a.$wrapper.add(a.$items).css("height",a.height)):a.$win.load(function(){a.setDimensions()});if(a.currentPage>a.pages)a.currentPage=a.pages;a.setCurrentPage(a.currentPage,!1);a.$nav.find("a").eq(a.currentPage-1).addClass("cur")};a.buildNavigation=function(){if(b.buildNavigation&&1<a.pages){var c,f;a.$items.filter(":not(.cloned)").each(function(e){var g=e+1;c=(1===g?"first":"")+(g===a.pages?"last":"");f=d('<a href="#"></a>').addClass("panel"+g).wrap('<li class="'+c+'" />');a.$nav.append(f.parent()); d.isFunction(b.navigationFormatter)?(c=b.navigationFormatter(g,d(this)),f.html("<span>"+c+"</span>"),0>parseInt(f.find("span").css("text-indent"),10)&&f.addClass(b.tooltipClass).attr("title",c)):f.html("<span>"+g+"</span>");f.bind(b.clickControls,function(c){if(!a.flag&&b.enableNavigation)a.flag=!0,setTimeout(function(){a.flag=!1},100),a.gotoPage(g),b.hashTags&&a.setHash(g);c.preventDefault()})});if(b.navigationSize&&b.navigationSize<a.pages)a.$controls.find(".anythingNavWindow").length||a.$nav.before('<ul><li class="prev"><a href="#"><span>'+ b.backText+"</span></a></li></ul>").after('<ul><li class="next"><a href="#"><span>'+b.forwardText+"</span></a></li></ul>").wrap('<div class="anythingNavWindow"></div>'),a.navWidths=a.$nav.find("li").map(function(){return d(this).innerWidth()+Math.ceil(parseInt(d(this).find("span").css("left"),10)/2||0)}).get(),a.navLeft=1,a.$nav.width(a.navWidth(1,a.pages+1)+5),a.$controls.find(".anythingNavWindow").width(a.navWidth(1,b.navigationSize+1)).end().find(".prev,.next").bind(b.clickControls,function(c){if(!a.flag)a.flag= !0,setTimeout(function(){a.flag=!1},200),a.navWindow(a.navLeft+b.navigationSize*(d(this).is(".prev")?-1:1));c.preventDefault()})}};a.navWidth=function(b,f){var d;d=Math.min(b,f);for(var g=Math.max(b,f),j=0;d<g;d++)j+=a.navWidths[d-1]||0;return j};a.navWindow=function(c){if(b.navigationSize&&b.navigationSize<a.pages&&a.navWidths){var d=a.pages-b.navigationSize+1,c=1>=c?1:1<c&&c<d?c:d;if(c!==a.navLeft)a.$controls.find(".anythingNavWindow").animate({scrollLeft:a.navWidth(1,c),width:a.navWidth(c,c+b.navigationSize)}, {queue:!1,duration:b.animationTime}),a.navLeft=c}};a.buildNextBackButtons=function(){a.$forward=d('<span class="arrow forward"><a href="#"><span>'+b.forwardText+"</span></a></span>");a.$back=d('<span class="arrow back"><a href="#"><span>'+b.backText+"</span></a></span>");a.$back.bind(b.clickBackArrow,function(c){if(b.enableArrows&&!a.flag)a.flag=!0,setTimeout(function(){a.flag=!1},100),a.goBack();c.preventDefault()});a.$forward.bind(b.clickForwardArrow,function(c){if(b.enableArrows&&!a.flag)a.flag= !0,setTimeout(function(){a.flag=!1},100),a.goForward();c.preventDefault()});a.$back.add(a.$forward).find("a").bind("focusin focusout",function(){d(this).toggleClass("hover")});a.$back.appendTo(null!==b.appendBackTo&&d(b.appendBackTo).length?d(b.appendBackTo):a.$wrapper);a.$forward.appendTo(null!==b.appendForwardTo&&d(b.appendForwardTo).length?d(b.appendForwardTo):a.$wrapper);a.$arrowWidth=a.$forward.width()};a.buildAutoPlay=function(){a.$startStop.html("<span>"+(a.playing?b.stopText:b.startText)+ "</span>").bind(b.clickSlideshow,function(c){b.enableStartStop&&(a.startStop(!a.playing),a.makeActive(),a.playing&&!b.autoPlayDelayed&&a.goForward(!0));c.preventDefault()}).bind("focusin focusout",function(){d(this).toggleClass("hover")})};a.checkResize=function(c){clearTimeout(a.resizeTimer);a.resizeTimer=setTimeout(function(){var d=a.$outer.width()-a.outerPad[0],e=("BODY"===a.$outer[0].tagName?a.$win.height():a.$outer.height())-a.outerPad[1];if(a.width*b.showMultiple!==d||a.height!==e)a.setDimensions(), a.gotoPage(a.currentPage,a.playing,null,-1);"undefined"===typeof c&&a.checkResize()},500)};a.setDimensions=function(){var c,f,e,g=0,j={width:"100%",height:"100%"},h=1<b.showMultiple?a.width||a.$window.width()/b.showMultiple:a.$window.width(),i=a.$win.width();if(b.expand)c=a.$outer.width()-a.outerPad[0],a.height=f=a.$outer.height()-a.outerPad[1],a.$wrapper.add(a.$window).add(a.$items).css({width:c,height:f}),a.width=h=1<b.showMultiple?c/b.showMultiple:c;a.$items.each(function(k){e=d(this).children(); if(b.resizeContents)c=a.width,f=a.height,d(this).css({width:c,height:f}),e.length&&("EMBED"===e[0].tagName&&e.attr(j),"OBJECT"===e[0].tagName&&e.find("embed").attr(j),1===e.length&&e.css(j));else{c=d(this).width()||a.width;1===e.length&&c>=i&&(c=e.width()>=i?h:e.width(),e.css("max-width",c));d(this).css("width",c);f=1===e.length?e.outerHeight(!0):d(this).height();if(f<=a.outerPad[1])f=a.height;d(this).css("height",f)}a.panelSize[k]=[c,f,g];g+=b.vertical?f:c});a.$el.css(b.vertical?"height":"width", g)};a.getDim=function(c){if(1>a.pages||isNaN(c))return[a.width,a.height];var c=b.infiniteSlides&&1<a.pages?c:c-1,d,e=a.panelSize[c][0],g=a.panelSize[c][1];if(1<b.showMultiple)for(d=1;d<b.showMultiple;d++)e+=a.panelSize[(c+d)%b.showMultiple][0],g=Math.max(g,a.panelSize[c+d][1]);return[e,g]};a.goForward=function(c){a.gotoPage(a.currentPage+b.changeBy*(b.playRtl?-1:1),c)};a.goBack=function(c){a.gotoPage(a.currentPage+b.changeBy*(b.playRtl?1:-1),c)};a.gotoPage=function(c,f,e,g){!0!==f&&(f=!1,a.startStop(!1), a.makeActive());/^[#|.]/.test(c)&&d(c).length&&(c=d(c).closest(".panel").index()+a.adj);1!==b.changeBy&&(0>c&&(c+=a.pages),c>a.pages&&(c-=a.pages));if(!(1>=a.pages)){a.$lastPage=a.$currentPage;if("number"!==typeof c)c=b.startPanel,a.setCurrentPage(c);if(!f||!b.isVideoPlaying(a))c>a.pages+1-a.adj&&(c=!b.infiniteSlides&&!b.stopAtEnd?1:a.pages),c<a.adj&&(c=!b.infiniteSlides&&!b.stopAtEnd?a.pages:1),a.currentPage=c>a.pages?a.pages:1>c?1:a.currentPage,a.$currentPage=a.$items.eq(a.currentPage-a.adj),a.exactPage= c,a.targetPage=0===c?a.pages-a.adj:c>a.pages?1-a.adj:c-a.adj,a.$targetPage=a.$items.eq(a.targetPage),g=g||b.animationTime,0<=g&&a.$el.trigger("slide_init",a),a.slideControls(!0,!1),!0!==f&&(f=!1),(!f||b.stopAtEnd&&c===a.pages)&&a.startStop(!1),0<=g&&a.$el.trigger("slide_begin",a),setTimeout(function(d){b.resizeContents||(d=a.getDim(c),a.$wrapper.filter(":not(:animated)").animate({width:d[0]||a.width,height:d[1]||a.height},{queue:!1,duration:0>g?0:g,easing:b.easing}));d={};d[a.dir]=-a.panelSize[b.infiniteSlides&& 1<a.pages?c:c-1][2];a.$el.filter(":not(:animated)").animate(d,{queue:!1,duration:g,easing:b.easing,complete:function(){a.endAnimation(c,e,g)}})},parseInt(b.delayBeforeAnimate,10)||0)}};a.endAnimation=function(c,d,e){0===c?(a.$el.css(a.dir,-a.panelSize[a.pages][2]),c=a.pages):c>a.pages&&(a.$el.css(a.dir,-a.panelSize[1][2]),c=1);a.exactPage=c;a.setCurrentPage(c,!1);a.$items.removeClass("activePage").eq(c-a.adj).addClass("activePage");a.hovered||a.slideControls(!1);0<=e&&a.$el.trigger("slide_complete", a);"function"===typeof d&&d(a);b.autoPlayLocked&&!a.playing&&setTimeout(function(){a.startStop(!0)},b.resumeDelay-(b.autoPlayDelayed?b.delay:0))};a.setCurrentPage=function(c,d){c=parseInt(c,10);if(!(1>a.pages||0===c||isNaN(c))){c>a.pages+1-a.adj&&(c=a.pages-a.adj);c<a.adj&&(c=1);b.buildNavigation&&a.$nav.find(".cur").removeClass("cur").end().find("a").eq(c-1).addClass("cur");!b.infiniteSlides&&b.stopAtEnd&&(a.$wrapper.find("span.forward")[c===a.pages?"addClass":"removeClass"]("disabled").end().find("span.back")[1=== c?"addClass":"removeClass"]("disabled"),c===a.pages&&a.playing&&a.startStop());if(!d){var e=a.getDim(c);a.$wrapper.css({width:e[0],height:e[1]}).add(a.$window).scrollLeft(0);a.$el.css(a.dir,-a.panelSize[b.infiniteSlides&&1<a.pages?c:c-1][2])}a.currentPage=c;a.$currentPage=a.$items.removeClass("activePage").eq(c-a.adj).addClass("activePage")}};a.makeActive=function(){a.$wrapper.is(".activeSlider")||(d(".activeSlider").removeClass("activeSlider"),a.$wrapper.addClass("activeSlider"))};a.gotoHash=function(){var c= a.win.location.hash,f=c.indexOf("&"),e=c.match(a.regex);null===e&&!/^#&/.test(c)&&!/#!?\//.test(c)?(c=c.substring(0,0<=f?f:c.length),e=d(c).length&&d(c).closest(".anythingBase")[0]===a.el?d(c).closest(".panel").index():null):null!==e&&(e=b.hashTags?parseInt(e[1],10):null);return e};a.setHash=function(b){var d="panel"+a.runTimes+"-",e=a.win.location.hash;if("undefined"!==typeof e)a.win.location.hash=0<e.indexOf(d)?e.replace(a.regex,d+b):e+"&"+d+b};a.slideControls=function(c){var d=c?0:b.animationTime, e=c?b.animationTime:0,g=c?1:0,h=c?0:1;b.toggleControls&&a.$controls.stop(!0,!0).delay(d)[c?"slideDown":"slideUp"](b.animationTime/2).delay(e);b.buildArrows&&b.toggleArrows&&(!a.hovered&&a.playing&&(h=1,g=0),a.$forward.stop(!0,!0).delay(d).animate({right:h*a.$arrowWidth,opacity:g},b.animationTime/2),a.$back.stop(!0,!0).delay(d).animate({left:h*a.$arrowWidth,opacity:g},b.animationTime/2))};a.clearTimer=function(b){if(a.timer&&(a.win.clearInterval(a.timer),!b&&a.slideshow))a.$el.trigger("slideshow_stop", a),a.slideshow=!1};a.startStop=function(c,d){!0!==c&&(c=!1);if((a.playing=c)&&!d)a.$el.trigger("slideshow_start",a),a.slideshow=!0;b.buildStartStop&&(a.$startStop.toggleClass("playing",c).find("span").html(c?b.stopText:b.startText),0>parseInt(a.$startStop.find("span").css("text-indent"),10)&&a.$startStop.addClass(b.tooltipClass).attr("title",c?b.stopText:b.startText));c?(a.clearTimer(!0),a.timer=a.win.setInterval(function(){b.isVideoPlaying(a)?b.resumeOnVideoEnd||a.startStop():a.goForward(!0)},b.delay)): a.clearTimer()};a.init()};d.anythingSlider.defaults={theme:"default",expand:!1,resizeContents:!0,vertical:!1,showMultiple:!1,easing:"swing",buildArrows:!0,buildNavigation:!0,buildStartStop:!0,appendForwardTo:null,appendBackTo:null,appendControlsTo:null,appendNavigationTo:null,appendStartStopTo:null,toggleArrows:!1,toggleControls:!1,startText:"Start",stopText:"Stop",forwardText:"&raquo;",backText:"&laquo;",tooltipClass:"tooltip",enableArrows:!0,enableNavigation:!0,enableStartStop:!0,enableKeyboard:!0, startPanel:1,changeBy:1,hashTags:!0,infiniteSlides:!0,navigationFormatter:null,navigationSize:!1,autoPlay:!1,autoPlayLocked:!1,autoPlayDelayed:!1,pauseOnHover:!0,stopAtEnd:!1,playRtl:!1,delay:3E3,resumeDelay:15E3,animationTime:600,delayBeforeAnimate:0,clickForwardArrow:"click",clickBackArrow:"click",clickControls:"click focusin",clickSlideshow:"click",resumeOnVideoEnd:!0,resumeOnVisible:!0,addWmodeToObject:"opaque",isVideoPlaying:function(){return!1}};d.fn.anythingSlider=function(h,i){return this.each(function(){var a, b=d(this).data("AnythingSlider");(typeof h).match("object|undefined")?b?b.updateSlider():new d.anythingSlider(this,h):/\d/.test(h)&&!isNaN(h)&&b?(a="number"===typeof h?h:parseInt(d.trim(h),10),1<=a&&a<=b.pages&&b.gotoPage(a,!1,i)):/^[#|.]/.test(h)&&d(h).length&&b.gotoPage(h,!1,i)})}})(jQuery);

0 comments on commit a0aaebb

Please sign in to comment.
Something went wrong with that request. Please try again.