Permalink
Browse files

rewrote ie detection code, changed linkable trigger to data-slide-nam…

…e rather than name
  • Loading branch information...
nikki committed Aug 18, 2012
1 parent d4d6bc8 commit 17e3824cd9a77f187146b4a8de40b75eddc279e4
Showing with 23 additions and 29 deletions.
  1. +1 −11 index.html
  2. +10 −6 js/liteaccordion.jquery.js
  3. +12 −12 test/index.html
View
@@ -17,11 +17,7 @@
</style>
<!-- liteAccordion css -->
<link href="css/liteaccordion.css" rel="stylesheet" />
<!-- syntax highlighter -->
<link href="http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/3.0.83/styles/shCore.css" rel="stylesheet" />
<link href="http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/3.0.83/styles/shThemeDefault.css" rel="stylesheet" />
<link href="css/liteaccordion.css" rel="stylesheet" />
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
@@ -426,11 +422,5 @@ <h2>Attribution</h2>
})(jQuery);
</script>
<!-- syntax highlighter -->
<script src="http://nicolahibbert.com/demo/liteAccordion/js/shCore.js"></script>
<script src="http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/3.0.83/scripts/shBrushXml.js"></script>
<script src="http://alexgorbatchev.com.s3.amazonaws.com/pub/sh/3.0.83/scripts/shBrushJScript.js"></script>
<script>SyntaxHighlighter.all();</script>
</body>
</html>
View
@@ -189,7 +189,7 @@
var slideNames = [];
slides.each(function() {
if ($(this).attr('name')) slideNames.push(($(this).attr('name')).toLowerCase());
if ($(this).attr('data-slide-name')) slideNames.push(($(this).attr('data-slide-name')).toLowerCase());
});
// memoize
@@ -281,7 +281,7 @@
}
// set location.hash
if (settings.linkable && !core.playing) window.location.hash = $this.parent().attr('name');
if (settings.linkable && !core.playing) window.location.hash = $this.parent().attr('data-slide-name');
// trigger callback in context of sibling div
settings.onTriggerSlide.call(next);
@@ -291,9 +291,7 @@
core.animSlideGroup(index, next);
},
ieClass : function() {
var version = +($.browser.version).charAt(0);
ieClass : function(version) {
if (version < 7) methods.destroy();
if (version === 7 || version === 8) {
slides.each(function(index) {
@@ -305,8 +303,14 @@
},
init : function() {
var ua = navigator.userAgent,
index = ua.indexOf('MSIE');
// test for ie
if ($.browser.msie) core.ieClass();
if (index !== -1) {
ua = ua.slice(index + 5, index + 6);
core.ieClass(+ua);
}
// init styles and events
core.setStyles();
View
@@ -3,14 +3,14 @@
<head>
<meta charset="UTF-8" />
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="qunit/qunit/qunit.css" type="text/css" media="screen">
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<link rel="stylesheet" href="../css/liteaccordion.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="../js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="../js/liteaccordion.jquery.js"></script>
<script type="text/javascript" src="qunit/qunit/qunit.js"></script>
<script type="text/javascript" src="qunit/qunit.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body>
@@ -23,48 +23,48 @@ <h2 id="qunit-userAgent"></h2>
<div id="qunit-fixture">
<div id="test">
<ol>
<li>
<li>
<h2><span>Slide One</span></h2>
<div>
<figure>
<img src="../img-demo/1.jpg" alt="image" />
<figcaption>I can haz big caek?</figcaption>
<figcaption>Assassini!</figcaption>
</figure>
</div>
</li>
<li>
<h2><span>Slide Two</span></h2>
<div>
<figure>
<img src="../img-demo/3.jpg" alt="image" />
<figcaption>Whoops.</figcaption>
<img src="../img-demo/2.jpg" alt="image" />
<figcaption>Couldn't find an image of a Khajit thief! Fail!</figcaption>
</figure>
</div>
</li>
<li>
<h2><span>Slide Three</span></h2>
<div>
<figure>
<img src="../img-demo/2a.jpg" alt="image" />
<figcaption>Some caption text goes in here...</figcaption>
<img src="../img-demo/3.jpg" alt="image" />
<figcaption>That's one angry looking red dude.</figcaption>
</figure>
</div>
</li>
<li>
<h2><span>Slide Four</span></h2>
<div>
<figure>
<img src="../img-demo/5.jpg" width="768" alt="image" />
<figcaption>Pew pew pew!</figcaption>
<img src="../img-demo/4.jpg" width="768" alt="image" />
<figcaption>Was fun for a couple of hours or so...</figcaption>
</figure>
</div>
</li>
<li>
<h2><span>Slide Five</span></h2>
<div>
<figure>
<img src="../img-demo/2.jpg" alt="image" />
<figcaption>More caption text here!</figcaption>
<img src="../img-demo/5.jpg" alt="image" />
<figcaption>Not as good as Hot Pursuit.</figcaption>
</figure>
</div>
</li>

0 comments on commit 17e3824

Please sign in to comment.