Skip to content

Commit fc786ea

Browse files
author
loriepisicchio
committed
update sdk and documentation
1 parent 25a0863 commit fc786ea

34 files changed

+91633
-30
lines changed

doc/URI.js

Lines changed: 1429 additions & 0 deletions
Large diffs are not rendered by default.

doc/bootstrap-dropdown.js

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
/* ============================================================
2+
* bootstrap-dropdown.js v2.3.1
3+
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
4+
* ============================================================
5+
* Copyright 2012 Twitter, Inc.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* ============================================================ */
19+
20+
21+
!function ($) {
22+
23+
"use strict"; // jshint ;_;
24+
25+
26+
/* DROPDOWN CLASS DEFINITION
27+
* ========================= */
28+
29+
var toggle = '[data-toggle=dropdown]'
30+
, Dropdown = function (element) {
31+
var $el = $(element).on('click.dropdown.data-api', this.toggle)
32+
$('html').on('click.dropdown.data-api', function () {
33+
$el.parent().removeClass('open')
34+
})
35+
}
36+
37+
Dropdown.prototype = {
38+
39+
constructor: Dropdown
40+
41+
, toggle: function (e) {
42+
var $this = $(this)
43+
, $parent
44+
, isActive
45+
46+
if ($this.is('.disabled, :disabled')) return
47+
48+
$parent = getParent($this)
49+
50+
isActive = $parent.hasClass('open')
51+
52+
clearMenus()
53+
54+
if (!isActive) {
55+
$parent.toggleClass('open')
56+
}
57+
58+
$this.focus()
59+
60+
return false
61+
}
62+
63+
, keydown: function (e) {
64+
var $this
65+
, $items
66+
, $active
67+
, $parent
68+
, isActive
69+
, index
70+
71+
if (!/(38|40|27)/.test(e.keyCode)) return
72+
73+
$this = $(this)
74+
75+
e.preventDefault()
76+
e.stopPropagation()
77+
78+
if ($this.is('.disabled, :disabled')) return
79+
80+
$parent = getParent($this)
81+
82+
isActive = $parent.hasClass('open')
83+
84+
if (!isActive || (isActive && e.keyCode == 27)) {
85+
if (e.which == 27) $parent.find(toggle).focus()
86+
return $this.click()
87+
}
88+
89+
$items = $('[role=menu] li:not(.divider):visible a', $parent)
90+
91+
if (!$items.length) return
92+
93+
index = $items.index($items.filter(':focus'))
94+
95+
if (e.keyCode == 38 && index > 0) index-- // up
96+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
97+
if (!~index) index = 0
98+
99+
$items
100+
.eq(index)
101+
.focus()
102+
}
103+
104+
}
105+
106+
function clearMenus() {
107+
$(toggle).each(function () {
108+
getParent($(this)).removeClass('open')
109+
})
110+
}
111+
112+
function getParent($this) {
113+
var selector = $this.attr('data-target')
114+
, $parent
115+
116+
if (!selector) {
117+
selector = $this.attr('href')
118+
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
119+
}
120+
121+
$parent = selector && $(selector)
122+
123+
if (!$parent || !$parent.length) $parent = $this.parent()
124+
125+
return $parent
126+
}
127+
128+
129+
/* DROPDOWN PLUGIN DEFINITION
130+
* ========================== */
131+
132+
var old = $.fn.dropdown
133+
134+
$.fn.dropdown = function (option) {
135+
return this.each(function () {
136+
var $this = $(this)
137+
, data = $this.data('dropdown')
138+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
139+
if (typeof option == 'string') data[option].call($this)
140+
})
141+
}
142+
143+
$.fn.dropdown.Constructor = Dropdown
144+
145+
146+
/* DROPDOWN NO CONFLICT
147+
* ==================== */
148+
149+
$.fn.dropdown.noConflict = function () {
150+
$.fn.dropdown = old
151+
return this
152+
}
153+
154+
155+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
156+
* =================================== */
157+
158+
$(document)
159+
.on('click.dropdown.data-api', clearMenus)
160+
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
161+
.on('click.dropdown-menu', function (e) { e.stopPropagation() })
162+
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
163+
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
164+
165+
}(window.jQuery);

doc/bootstrap-tab.js

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/* ========================================================
2+
* bootstrap-tab.js v2.3.0
3+
* http://twitter.github.com/bootstrap/javascript.html#tabs
4+
* ========================================================
5+
* Copyright 2012 Twitter, Inc.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* ======================================================== */
19+
20+
21+
!function ($) {
22+
23+
"use strict"; // jshint ;_;
24+
25+
26+
/* TAB CLASS DEFINITION
27+
* ==================== */
28+
29+
var Tab = function (element) {
30+
this.element = $(element)
31+
}
32+
33+
Tab.prototype = {
34+
35+
constructor: Tab
36+
37+
, show: function () {
38+
var $this = this.element
39+
, $ul = $this.closest('ul:not(.dropdown-menu)')
40+
, selector = $this.attr('data-target')
41+
, previous
42+
, $target
43+
, e
44+
45+
if (!selector) {
46+
selector = $this.attr('href')
47+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
48+
}
49+
50+
if ( $this.parent('li').hasClass('active') ) return
51+
52+
previous = $ul.find('.active:last a')[0]
53+
54+
e = $.Event('show', {
55+
relatedTarget: previous
56+
})
57+
58+
$this.trigger(e)
59+
60+
if (e.isDefaultPrevented()) return
61+
62+
$target = $(selector)
63+
64+
this.activate($this.parent('li'), $ul)
65+
this.activate($target, $target.parent(), function () {
66+
$this.trigger({
67+
type: 'shown'
68+
, relatedTarget: previous
69+
})
70+
})
71+
}
72+
73+
, activate: function ( element, container, callback) {
74+
var $active = container.find('> .active')
75+
, transition = callback
76+
&& $.support.transition
77+
&& $active.hasClass('fade')
78+
79+
function next() {
80+
$active
81+
.removeClass('active')
82+
.find('> .dropdown-menu > .active')
83+
.removeClass('active')
84+
85+
element.addClass('active')
86+
87+
if (transition) {
88+
element[0].offsetWidth // reflow for transition
89+
element.addClass('in')
90+
} else {
91+
element.removeClass('fade')
92+
}
93+
94+
if ( element.parent('.dropdown-menu') ) {
95+
element.closest('li.dropdown').addClass('active')
96+
}
97+
98+
callback && callback()
99+
}
100+
101+
transition ?
102+
$active.one($.support.transition.end, next) :
103+
next()
104+
105+
$active.removeClass('in')
106+
}
107+
}
108+
109+
110+
/* TAB PLUGIN DEFINITION
111+
* ===================== */
112+
113+
var old = $.fn.tab
114+
115+
$.fn.tab = function ( option ) {
116+
return this.each(function () {
117+
var $this = $(this)
118+
, data = $this.data('tab')
119+
if (!data) $this.data('tab', (data = new Tab(this)))
120+
if (typeof option == 'string') data[option]()
121+
})
122+
}
123+
124+
$.fn.tab.Constructor = Tab
125+
126+
127+
/* TAB NO CONFLICT
128+
* =============== */
129+
130+
$.fn.tab.noConflict = function () {
131+
$.fn.tab = old
132+
return this
133+
}
134+
135+
136+
/* TAB DATA-API
137+
* ============ */
138+
139+
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
140+
e.preventDefault()
141+
$(this).tab('show')
142+
})
143+
144+
}(window.jQuery);

0 commit comments

Comments
 (0)