forked from robotframework/robotframework.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobotframework.js
More file actions
45 lines (38 loc) · 1.47 KB
/
Copy pathrobotframework.js
File metadata and controls
45 lines (38 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function init_tweets() {
$( ".container.by" ).after( '<div id="tweets"></div>' );
$("#tweets").tweet({
"username": "robotframework"
, "count": 10
, "template": "{text} {time}"
});
}
function init_carousel() {
var $examples = $( ".examples.container" ),
$heading = $( "#examples > h2" ),
$carousel_html = $('<div class="carousel-inner"></div>');
$carousel_template = [$('<div id="example-carousel" class="carousel slide"></div>')
, [
$('<a class="carousel-control left" href="#example-carousel" data-slide="prev">‹</a>')
, $('<a class="carousel-control right" href="#example-carousel" data-slide="next">›</a>')
]
];
// create carousel items from examples on the page
$examples.each(function( index ){
if ( index == 0 ){
$carousel_html.append( $('<div class="item active">' + this.innerHTML + '</div>') );
} else {
$carousel_html.append( $('<div class="item">' + this.innerHTML + '</div>') );
}
});
// create final DOM for carousel by adding carousel items and navigation to container element
$carousel_html = $carousel_template[ 0 ].append( $carousel_html ).append( $carousel_template[1] );
$( "#examples" ).html( [$heading, $carousel_html] );
$( ".carousel-caption.container" ).removeClass( "container" );
$( "#example-carousel" ).carousel({
"interval": 8000
});
}
$( document ).ready(function() {
init_tweets();
init_carousel();
});