Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added requirejs and simple example

  • Loading branch information...
commit 12f2842f2fc96d65debfb81599f916474e8d1692 1 parent cb1f86f
Thomas Fritz authored March 29, 2012
22  LICENSE
... ...
@@ -0,0 +1,22 @@
  1
+MIT License
  2
+-----------
  3
+
  4
+Copyright (c) 2012, Thomas Fritz
  5
+
  6
+Permission is hereby granted, free of charge, to any person obtaining a copy
  7
+of this software and associated documentation files (the "Software"), to deal
  8
+in the Software without restriction, including without limitation the rights
  9
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10
+copies of the Software, and to permit persons to whom the Software is
  11
+furnished to do so, subject to the following conditions:
  12
+
  13
+The above copyright notice and this permission notice shall be included in
  14
+all copies or substantial portions of the Software.
  15
+
  16
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22
+THE SOFTWARE.
11  README
... ...
@@ -1,11 +0,0 @@
1  
-About
2  
-=====
3  
-
4  
-Browser-only AMD version of Backbone, Underscore and Handlebars. If not too complicated i deleted double checks for
5  
-'exports', 'module', etc. Modules are getting just returned. No global namespace pollution.
6  
-
7  
-
8  
-LICENSE
9  
-=======
10  
-
11  
-See each library for license details.
20  README.md
Source Rendered
... ...
@@ -0,0 +1,20 @@
  1
+About
  2
+=====
  3
+
  4
+Browser-only AMD version of Backbone, Underscore, Bootstrap and Handlebars.
  5
+I deleted checks for 'exports', 'module', objects etc.
  6
+Modules getting returned only - no global (window) namespace pollution.
  7
+
  8
+Also require.js with jquery got patched, so jquery gets not added to the global window object.
  9
+This could be problematic with jquery plugins and other scripts which are not AMD modules. It might be neccessary to
  10
+wrap your jquery plugins and scripts with a 'define' call.
  11
+
  12
+I added an '$' alias besides 'jquery' for retrieving jquery.
  13
+
  14
+I have added a simple test (index.html) which loads all libraries and does a very very basic test of those.
  15
+
  16
+
  17
+LICENSE
  18
+=======
  19
+
  20
+See each library for license details.
22  backbonejs/0.9.2/LICENSE
... ...
@@ -0,0 +1,22 @@
  1
+Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud
  2
+
  3
+Permission is hereby granted, free of charge, to any person
  4
+obtaining a copy of this software and associated documentation
  5
+files (the "Software"), to deal in the Software without
  6
+restriction, including without limitation the rights to use,
  7
+copy, modify, merge, publish, distribute, sublicense, and/or sell
  8
+copies of the Software, and to permit persons to whom the
  9
+Software is furnished to do so, subject to the following
  10
+conditions:
  11
+
  12
+The above copyright notice and this permission notice shall be
  13
+included in all copies or substantial portions of the Software.
  14
+
  15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  17
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  19
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22
+OTHER DEALINGS IN THE SOFTWARE.
2  backbonejs/0.9.2/backbone.js
@@ -5,7 +5,7 @@
5 5
 //     For all details and documentation:
6 6
 //     http://backbonejs.org
7 7
 
8  
-require(['jquery', 'underscore'], function($, _) {
  8
+define(['jquery', 'underscore'], function($, _) {
9 9
 
10 10
   // Initial Setup
11 11
   // -------------
13  bootstrap/2.0.2/LICENSE
... ...
@@ -0,0 +1,13 @@
  1
+Copyright 2012 Twitter, Inc.
  2
+
  3
+Licensed under the Apache License, Version 2.0 (the "License");
  4
+you may not use this file except in compliance with the License.
  5
+You may obtain a copy of the License at
  6
+
  7
+http://www.apache.org/licenses/LICENSE-2.0
  8
+
  9
+Unless required by applicable law or agreed to in writing, software
  10
+distributed under the License is distributed on an "AS IS" BASIS,
  11
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12
+See the License for the specific language governing permissions and
  13
+limitations under the License.
1,688  bootstrap/2.0.2/bootstrap.js
... ...
@@ -0,0 +1,1688 @@
  1
+/* ===================================================
  2
+ * bootstrap-transition.js v2.0.2
  3
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
  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
+define(['jquery'], function($) {
  21
+
  22
+    "use strict"
  23
+
  24
+  $(function () {
  25
+
  26
+    "use strict"
  27
+
  28
+    /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
  29
+     * ======================================================= */
  30
+
  31
+    $.support.transition = (function () {
  32
+      var thisBody = document.body || document.documentElement
  33
+        , thisStyle = thisBody.style
  34
+        , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
  35
+
  36
+      return support && {
  37
+        end: (function () {
  38
+          var transitionEnd = "TransitionEnd"
  39
+          if ( $.browser.webkit ) {
  40
+          	transitionEnd = "webkitTransitionEnd"
  41
+          } else if ( $.browser.mozilla ) {
  42
+          	transitionEnd = "transitionend"
  43
+          } else if ( $.browser.opera ) {
  44
+          	transitionEnd = "oTransitionEnd"
  45
+          }
  46
+          return transitionEnd
  47
+        }())
  48
+      }
  49
+    })()
  50
+
  51
+  })
  52
+
  53
+/* ==========================================================
  54
+ * bootstrap-alert.js v2.0.2
  55
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
  56
+ * ==========================================================
  57
+ * Copyright 2012 Twitter, Inc.
  58
+ *
  59
+ * Licensed under the Apache License, Version 2.0 (the "License");
  60
+ * you may not use this file except in compliance with the License.
  61
+ * You may obtain a copy of the License at
  62
+ *
  63
+ * http://www.apache.org/licenses/LICENSE-2.0
  64
+ *
  65
+ * Unless required by applicable law or agreed to in writing, software
  66
+ * distributed under the License is distributed on an "AS IS" BASIS,
  67
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  68
+ * See the License for the specific language governing permissions and
  69
+ * limitations under the License.
  70
+ * ========================================================== */
  71
+
  72
+
  73
+ /* ALERT CLASS DEFINITION
  74
+  * ====================== */
  75
+
  76
+  var dismiss = '[data-dismiss="alert"]'
  77
+    , Alert = function ( el ) {
  78
+        $(el).on('click', dismiss, this.close)
  79
+      }
  80
+
  81
+  Alert.prototype = {
  82
+
  83
+    constructor: Alert
  84
+
  85
+  , close: function ( e ) {
  86
+      var $this = $(this)
  87
+        , selector = $this.attr('data-target')
  88
+        , $parent
  89
+
  90
+      if (!selector) {
  91
+        selector = $this.attr('href')
  92
+        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  93
+      }
  94
+
  95
+      $parent = $(selector)
  96
+      $parent.trigger('close')
  97
+
  98
+      e && e.preventDefault()
  99
+
  100
+      $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
  101
+
  102
+      $parent
  103
+        .trigger('close')
  104
+        .removeClass('in')
  105
+
  106
+      function removeElement() {
  107
+        $parent
  108
+          .trigger('closed')
  109
+          .remove()
  110
+      }
  111
+
  112
+      $.support.transition && $parent.hasClass('fade') ?
  113
+        $parent.on($.support.transition.end, removeElement) :
  114
+        removeElement()
  115
+    }
  116
+
  117
+  }
  118
+
  119
+
  120
+ /* ALERT PLUGIN DEFINITION
  121
+  * ======================= */
  122
+
  123
+  $.fn.alert = function ( option ) {
  124
+    return this.each(function () {
  125
+      var $this = $(this)
  126
+        , data = $this.data('alert')
  127
+      if (!data) $this.data('alert', (data = new Alert(this)))
  128
+      if (typeof option == 'string') data[option].call($this)
  129
+    })
  130
+  }
  131
+
  132
+  $.fn.alert.Constructor = Alert
  133
+
  134
+
  135
+ /* ALERT DATA-API
  136
+  * ============== */
  137
+
  138
+  $(function () {
  139
+    $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
  140
+  })
  141
+
  142
+/* ============================================================
  143
+ * bootstrap-button.js v2.0.2
  144
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
  145
+ * ============================================================
  146
+ * Copyright 2012 Twitter, Inc.
  147
+ *
  148
+ * Licensed under the Apache License, Version 2.0 (the "License");
  149
+ * you may not use this file except in compliance with the License.
  150
+ * You may obtain a copy of the License at
  151
+ *
  152
+ * http://www.apache.org/licenses/LICENSE-2.0
  153
+ *
  154
+ * Unless required by applicable law or agreed to in writing, software
  155
+ * distributed under the License is distributed on an "AS IS" BASIS,
  156
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  157
+ * See the License for the specific language governing permissions and
  158
+ * limitations under the License.
  159
+ * ============================================================ */
  160
+
  161
+
  162
+ /* BUTTON PUBLIC CLASS DEFINITION
  163
+  * ============================== */
  164
+
  165
+  var Button = function ( element, options ) {
  166
+    this.$element = $(element)
  167
+    this.options = $.extend({}, $.fn.button.defaults, options)
  168
+  }
  169
+
  170
+  Button.prototype = {
  171
+
  172
+      constructor: Button
  173
+
  174
+    , setState: function ( state ) {
  175
+        var d = 'disabled'
  176
+          , $el = this.$element
  177
+          , data = $el.data()
  178
+          , val = $el.is('input') ? 'val' : 'html'
  179
+
  180
+        state = state + 'Text'
  181
+        data.resetText || $el.data('resetText', $el[val]())
  182
+
  183
+        $el[val](data[state] || this.options[state])
  184
+
  185
+        // push to event loop to allow forms to submit
  186
+        setTimeout(function () {
  187
+          state == 'loadingText' ?
  188
+            $el.addClass(d).attr(d, d) :
  189
+            $el.removeClass(d).removeAttr(d)
  190
+        }, 0)
  191
+      }
  192
+
  193
+    , toggle: function () {
  194
+        var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
  195
+
  196
+        $parent && $parent
  197
+          .find('.active')
  198
+          .removeClass('active')
  199
+
  200
+        this.$element.toggleClass('active')
  201
+      }
  202
+
  203
+  }
  204
+
  205
+
  206
+ /* BUTTON PLUGIN DEFINITION
  207
+  * ======================== */
  208
+
  209
+  $.fn.button = function ( option ) {
  210
+    return this.each(function () {
  211
+      var $this = $(this)
  212
+        , data = $this.data('button')
  213
+        , options = typeof option == 'object' && option
  214
+      if (!data) $this.data('button', (data = new Button(this, options)))
  215
+      if (option == 'toggle') data.toggle()
  216
+      else if (option) data.setState(option)
  217
+    })
  218
+  }
  219
+
  220
+  $.fn.button.defaults = {
  221
+    loadingText: 'loading...'
  222
+  }
  223
+
  224
+  $.fn.button.Constructor = Button
  225
+
  226
+
  227
+ /* BUTTON DATA-API
  228
+  * =============== */
  229
+
  230
+  $(function () {
  231
+    $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
  232
+      var $btn = $(e.target)
  233
+      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
  234
+      $btn.button('toggle')
  235
+    })
  236
+  })
  237
+
  238
+/* ==========================================================
  239
+ * bootstrap-carousel.js v2.0.2
  240
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
  241
+ * ==========================================================
  242
+ * Copyright 2012 Twitter, Inc.
  243
+ *
  244
+ * Licensed under the Apache License, Version 2.0 (the "License");
  245
+ * you may not use this file except in compliance with the License.
  246
+ * You may obtain a copy of the License at
  247
+ *
  248
+ * http://www.apache.org/licenses/LICENSE-2.0
  249
+ *
  250
+ * Unless required by applicable law or agreed to in writing, software
  251
+ * distributed under the License is distributed on an "AS IS" BASIS,
  252
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  253
+ * See the License for the specific language governing permissions and
  254
+ * limitations under the License.
  255
+ * ========================================================== */
  256
+
  257
+
  258
+ /* CAROUSEL CLASS DEFINITION
  259
+  * ========================= */
  260
+
  261
+  var Carousel = function (element, options) {
  262
+    this.$element = $(element)
  263
+    this.options = $.extend({}, $.fn.carousel.defaults, options)
  264
+    this.options.slide && this.slide(this.options.slide)
  265
+    this.options.pause == 'hover' && this.$element
  266
+      .on('mouseenter', $.proxy(this.pause, this))
  267
+      .on('mouseleave', $.proxy(this.cycle, this))
  268
+  }
  269
+
  270
+  Carousel.prototype = {
  271
+
  272
+    cycle: function () {
  273
+      this.interval = setInterval($.proxy(this.next, this), this.options.interval)
  274
+      return this
  275
+    }
  276
+
  277
+  , to: function (pos) {
  278
+      var $active = this.$element.find('.active')
  279
+        , children = $active.parent().children()
  280
+        , activePos = children.index($active)
  281
+        , that = this
  282
+
  283
+      if (pos > (children.length - 1) || pos < 0) return
  284
+
  285
+      if (this.sliding) {
  286
+        return this.$element.one('slid', function () {
  287
+          that.to(pos)
  288
+        })
  289
+      }
  290
+
  291
+      if (activePos == pos) {
  292
+        return this.pause().cycle()
  293
+      }
  294
+
  295
+      return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
  296
+    }
  297
+
  298
+  , pause: function () {
  299
+      clearInterval(this.interval)
  300
+      this.interval = null
  301
+      return this
  302
+    }
  303
+
  304
+  , next: function () {
  305
+      if (this.sliding) return
  306
+      return this.slide('next')
  307
+    }
  308
+
  309
+  , prev: function () {
  310
+      if (this.sliding) return
  311
+      return this.slide('prev')
  312
+    }
  313
+
  314
+  , slide: function (type, next) {
  315
+      var $active = this.$element.find('.active')
  316
+        , $next = next || $active[type]()
  317
+        , isCycling = this.interval
  318
+        , direction = type == 'next' ? 'left' : 'right'
  319
+        , fallback  = type == 'next' ? 'first' : 'last'
  320
+        , that = this
  321
+
  322
+      this.sliding = true
  323
+
  324
+      isCycling && this.pause()
  325
+
  326
+      $next = $next.length ? $next : this.$element.find('.item')[fallback]()
  327
+
  328
+      if ($next.hasClass('active')) return
  329
+
  330
+      if (!$.support.transition && this.$element.hasClass('slide')) {
  331
+        this.$element.trigger('slide')
  332
+        $active.removeClass('active')
  333
+        $next.addClass('active')
  334
+        this.sliding = false
  335
+        this.$element.trigger('slid')
  336
+      } else {
  337
+        $next.addClass(type)
  338
+        $next[0].offsetWidth // force reflow
  339
+        $active.addClass(direction)
  340
+        $next.addClass(direction)
  341
+        this.$element.trigger('slide')
  342
+        this.$element.one($.support.transition.end, function () {
  343
+          $next.removeClass([type, direction].join(' ')).addClass('active')
  344
+          $active.removeClass(['active', direction].join(' '))
  345
+          that.sliding = false
  346
+          setTimeout(function () { that.$element.trigger('slid') }, 0)
  347
+        })
  348
+      }
  349
+
  350
+      isCycling && this.cycle()
  351
+
  352
+      return this
  353
+    }
  354
+
  355
+  }
  356
+
  357
+
  358
+ /* CAROUSEL PLUGIN DEFINITION
  359
+  * ========================== */
  360
+
  361
+  $.fn.carousel = function ( option ) {
  362
+    return this.each(function () {
  363
+      var $this = $(this)
  364
+        , data = $this.data('carousel')
  365
+        , options = typeof option == 'object' && option
  366
+      if (!data) $this.data('carousel', (data = new Carousel(this, options)))
  367
+      if (typeof option == 'number') data.to(option)
  368
+      else if (typeof option == 'string' || (option = options.slide)) data[option]()
  369
+      else data.cycle()
  370
+    })
  371
+  }
  372
+
  373
+  $.fn.carousel.defaults = {
  374
+    interval: 5000
  375
+  , pause: 'hover'
  376
+  }
  377
+
  378
+  $.fn.carousel.Constructor = Carousel
  379
+
  380
+
  381
+ /* CAROUSEL DATA-API
  382
+  * ================= */
  383
+
  384
+  $(function () {
  385
+    $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
  386
+      var $this = $(this), href
  387
+        , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  388
+        , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
  389
+      $target.carousel(options)
  390
+      e.preventDefault()
  391
+    })
  392
+  })
  393
+
  394
+/* =============================================================
  395
+ * bootstrap-collapse.js v2.0.2
  396
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
  397
+ * =============================================================
  398
+ * Copyright 2012 Twitter, Inc.
  399
+ *
  400
+ * Licensed under the Apache License, Version 2.0 (the "License");
  401
+ * you may not use this file except in compliance with the License.
  402
+ * You may obtain a copy of the License at
  403
+ *
  404
+ * http://www.apache.org/licenses/LICENSE-2.0
  405
+ *
  406
+ * Unless required by applicable law or agreed to in writing, software
  407
+ * distributed under the License is distributed on an "AS IS" BASIS,
  408
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  409
+ * See the License for the specific language governing permissions and
  410
+ * limitations under the License.
  411
+ * ============================================================ */
  412
+
  413
+
  414
+  var Collapse = function ( element, options ) {
  415
+  	this.$element = $(element)
  416
+    this.options = $.extend({}, $.fn.collapse.defaults, options)
  417
+
  418
+    if (this.options["parent"]) {
  419
+      this.$parent = $(this.options["parent"])
  420
+    }
  421
+
  422
+    this.options.toggle && this.toggle()
  423
+  }
  424
+
  425
+  Collapse.prototype = {
  426
+
  427
+    constructor: Collapse
  428
+
  429
+  , dimension: function () {
  430
+      var hasWidth = this.$element.hasClass('width')
  431
+      return hasWidth ? 'width' : 'height'
  432
+    }
  433
+
  434
+  , show: function () {
  435
+      var dimension = this.dimension()
  436
+        , scroll = $.camelCase(['scroll', dimension].join('-'))
  437
+        , actives = this.$parent && this.$parent.find('.in')
  438
+        , hasData
  439
+
  440
+      if (actives && actives.length) {
  441
+        hasData = actives.data('collapse')
  442
+        actives.collapse('hide')
  443
+        hasData || actives.data('collapse', null)
  444
+      }
  445
+
  446
+      this.$element[dimension](0)
  447
+      this.transition('addClass', 'show', 'shown')
  448
+      this.$element[dimension](this.$element[0][scroll])
  449
+
  450
+    }
  451
+
  452
+  , hide: function () {
  453
+      var dimension = this.dimension()
  454
+      this.reset(this.$element[dimension]())
  455
+      this.transition('removeClass', 'hide', 'hidden')
  456
+      this.$element[dimension](0)
  457
+    }
  458
+
  459
+  , reset: function ( size ) {
  460
+      var dimension = this.dimension()
  461
+
  462
+      this.$element
  463
+        .removeClass('collapse')
  464
+        [dimension](size || 'auto')
  465
+        [0].offsetWidth
  466
+
  467
+      this.$element[size ? 'addClass' : 'removeClass']('collapse')
  468
+
  469
+      return this
  470
+    }
  471
+
  472
+  , transition: function ( method, startEvent, completeEvent ) {
  473
+      var that = this
  474
+        , complete = function () {
  475
+            if (startEvent == 'show') that.reset()
  476
+            that.$element.trigger(completeEvent)
  477
+          }
  478
+
  479
+      this.$element
  480
+        .trigger(startEvent)
  481
+        [method]('in')
  482
+
  483
+      $.support.transition && this.$element.hasClass('collapse') ?
  484
+        this.$element.one($.support.transition.end, complete) :
  485
+        complete()
  486
+  	}
  487
+
  488
+  , toggle: function () {
  489
+      this[this.$element.hasClass('in') ? 'hide' : 'show']()
  490
+  	}
  491
+
  492
+  }
  493
+
  494
+  /* COLLAPSIBLE PLUGIN DEFINITION
  495
+  * ============================== */
  496
+
  497
+  $.fn.collapse = function ( option ) {
  498
+    return this.each(function () {
  499
+      var $this = $(this)
  500
+        , data = $this.data('collapse')
  501
+        , options = typeof option == 'object' && option
  502
+      if (!data) $this.data('collapse', (data = new Collapse(this, options)))
  503
+      if (typeof option == 'string') data[option]()
  504
+    })
  505
+  }
  506
+
  507
+  $.fn.collapse.defaults = {
  508
+    toggle: true
  509
+  }
  510
+
  511
+  $.fn.collapse.Constructor = Collapse
  512
+
  513
+
  514
+ /* COLLAPSIBLE DATA-API
  515
+  * ==================== */
  516
+
  517
+  $(function () {
  518
+    $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
  519
+      var $this = $(this), href
  520
+        , target = $this.attr('data-target')
  521
+          || e.preventDefault()
  522
+          || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
  523
+        , option = $(target).data('collapse') ? 'toggle' : $this.data()
  524
+      $(target).collapse(option)
  525
+    })
  526
+  })
  527
+
  528
+/* ============================================================
  529
+ * bootstrap-dropdown.js v2.0.2
  530
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
  531
+ * ============================================================
  532
+ * Copyright 2012 Twitter, Inc.
  533
+ *
  534
+ * Licensed under the Apache License, Version 2.0 (the "License");
  535
+ * you may not use this file except in compliance with the License.
  536
+ * You may obtain a copy of the License at
  537
+ *
  538
+ * http://www.apache.org/licenses/LICENSE-2.0
  539
+ *
  540
+ * Unless required by applicable law or agreed to in writing, software
  541
+ * distributed under the License is distributed on an "AS IS" BASIS,
  542
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  543
+ * See the License for the specific language governing permissions and
  544
+ * limitations under the License.
  545
+ * ============================================================ */
  546
+
  547
+
  548
+ /* DROPDOWN CLASS DEFINITION
  549
+  * ========================= */
  550
+
  551
+  var toggle = '[data-toggle="dropdown"]'
  552
+    , Dropdown = function ( element ) {
  553
+        var $el = $(element).on('click.dropdown.data-api', this.toggle)
  554
+        $('html').on('click.dropdown.data-api', function () {
  555
+          $el.parent().removeClass('open')
  556
+        })
  557
+      }
  558
+
  559
+  Dropdown.prototype = {
  560
+
  561
+    constructor: Dropdown
  562
+
  563
+  , toggle: function ( e ) {
  564
+      var $this = $(this)
  565
+        , selector = $this.attr('data-target')
  566
+        , $parent
  567
+        , isActive
  568
+
  569
+      if (!selector) {
  570
+        selector = $this.attr('href')
  571
+        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  572
+      }
  573
+
  574
+      $parent = $(selector)
  575
+      $parent.length || ($parent = $this.parent())
  576
+
  577
+      isActive = $parent.hasClass('open')
  578
+
  579
+      clearMenus()
  580
+      !isActive && $parent.toggleClass('open')
  581
+
  582
+      return false
  583
+    }
  584
+
  585
+  }
  586
+
  587
+  function clearMenus() {
  588
+    $(toggle).parent().removeClass('open')
  589
+  }
  590
+
  591
+
  592
+  /* DROPDOWN PLUGIN DEFINITION
  593
+   * ========================== */
  594
+
  595
+  $.fn.dropdown = function ( option ) {
  596
+    return this.each(function () {
  597
+      var $this = $(this)
  598
+        , data = $this.data('dropdown')
  599
+      if (!data) $this.data('dropdown', (data = new Dropdown(this)))
  600
+      if (typeof option == 'string') data[option].call($this)
  601
+    })
  602
+  }
  603
+
  604
+  $.fn.dropdown.Constructor = Dropdown
  605
+
  606
+
  607
+  /* APPLY TO STANDARD DROPDOWN ELEMENTS
  608
+   * =================================== */
  609
+
  610
+  $(function () {
  611
+    $('html').on('click.dropdown.data-api', clearMenus)
  612
+    $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
  613
+  })
  614
+
  615
+/* =========================================================
  616
+ * bootstrap-modal.js v2.0.2
  617
+ * http://twitter.github.com/bootstrap/javascript.html#modals
  618
+ * =========================================================
  619
+ * Copyright 2012 Twitter, Inc.
  620
+ *
  621
+ * Licensed under the Apache License, Version 2.0 (the "License");
  622
+ * you may not use this file except in compliance with the License.
  623
+ * You may obtain a copy of the License at
  624
+ *
  625
+ * http://www.apache.org/licenses/LICENSE-2.0
  626
+ *
  627
+ * Unless required by applicable law or agreed to in writing, software
  628
+ * distributed under the License is distributed on an "AS IS" BASIS,
  629
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  630
+ * See the License for the specific language governing permissions and
  631
+ * limitations under the License.
  632
+ * ========================================================= */
  633
+
  634
+
  635
+ /* MODAL CLASS DEFINITION
  636
+  * ====================== */
  637
+
  638
+  var Modal = function ( content, options ) {
  639
+    this.options = options
  640
+    this.$element = $(content)
  641
+      .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
  642
+  }
  643
+
  644
+  Modal.prototype = {
  645
+
  646
+      constructor: Modal
  647
+
  648
+    , toggle: function () {
  649
+        return this[!this.isShown ? 'show' : 'hide']()
  650
+      }
  651
+
  652
+    , show: function () {
  653
+        var that = this
  654
+
  655
+        if (this.isShown) return
  656
+
  657
+        $('body').addClass('modal-open')
  658
+
  659
+        this.isShown = true
  660
+        this.$element.trigger('show')
  661
+
  662
+        escape.call(this)
  663
+        backdrop.call(this, function () {
  664
+          var transition = $.support.transition && that.$element.hasClass('fade')
  665
+
  666
+          !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
  667
+
  668
+          that.$element
  669
+            .show()
  670
+
  671
+          if (transition) {
  672
+            that.$element[0].offsetWidth // force reflow
  673
+          }
  674
+
  675
+          that.$element.addClass('in')
  676
+
  677
+          transition ?
  678
+            that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
  679
+            that.$element.trigger('shown')
  680
+
  681
+        })
  682
+      }
  683
+
  684
+    , hide: function ( e ) {
  685
+        e && e.preventDefault()
  686
+
  687
+        if (!this.isShown) return
  688
+
  689
+        var that = this
  690
+        this.isShown = false
  691
+
  692
+        $('body').removeClass('modal-open')
  693
+
  694
+        escape.call(this)
  695
+
  696
+        this.$element
  697
+          .trigger('hide')
  698
+          .removeClass('in')
  699
+
  700
+        $.support.transition && this.$element.hasClass('fade') ?
  701
+          hideWithTransition.call(this) :
  702
+          hideModal.call(this)
  703
+      }
  704
+
  705
+  }
  706
+
  707
+
  708
+ /* MODAL PRIVATE METHODS
  709
+  * ===================== */
  710
+
  711
+  function hideWithTransition() {
  712
+    var that = this
  713
+      , timeout = setTimeout(function () {
  714
+          that.$element.off($.support.transition.end)
  715
+          hideModal.call(that)
  716
+        }, 500)
  717
+
  718
+    this.$element.one($.support.transition.end, function () {
  719
+      clearTimeout(timeout)
  720
+      hideModal.call(that)
  721
+    })
  722
+  }
  723
+
  724
+  function hideModal( that ) {
  725
+    this.$element
  726
+      .hide()
  727
+      .trigger('hidden')
  728
+
  729
+    backdrop.call(this)
  730
+  }
  731
+
  732
+  function backdrop( callback ) {
  733
+    var that = this
  734
+      , animate = this.$element.hasClass('fade') ? 'fade' : ''
  735
+
  736
+    if (this.isShown && this.options.backdrop) {
  737
+      var doAnimate = $.support.transition && animate
  738
+
  739
+      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
  740
+        .appendTo(document.body)
  741
+
  742
+      if (this.options.backdrop != 'static') {
  743
+        this.$backdrop.click($.proxy(this.hide, this))
  744
+      }
  745
+
  746
+      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  747
+
  748
+      this.$backdrop.addClass('in')
  749
+
  750
+      doAnimate ?
  751
+        this.$backdrop.one($.support.transition.end, callback) :
  752
+        callback()
  753
+
  754
+    } else if (!this.isShown && this.$backdrop) {
  755
+      this.$backdrop.removeClass('in')
  756
+
  757
+      $.support.transition && this.$element.hasClass('fade')?
  758
+        this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
  759
+        removeBackdrop.call(this)
  760
+
  761
+    } else if (callback) {
  762
+      callback()
  763
+    }
  764
+  }
  765
+
  766
+  function removeBackdrop() {
  767
+    this.$backdrop.remove()
  768
+    this.$backdrop = null
  769
+  }
  770
+
  771
+  function escape() {
  772
+    var that = this
  773
+    if (this.isShown && this.options.keyboard) {
  774
+      $(document).on('keyup.dismiss.modal', function ( e ) {
  775
+        e.which == 27 && that.hide()
  776
+      })
  777
+    } else if (!this.isShown) {
  778
+      $(document).off('keyup.dismiss.modal')
  779
+    }
  780
+  }
  781
+
  782
+
  783
+ /* MODAL PLUGIN DEFINITION
  784
+  * ======================= */
  785
+
  786
+  $.fn.modal = function ( option ) {
  787
+    return this.each(function () {
  788
+      var $this = $(this)
  789
+        , data = $this.data('modal')
  790
+        , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
  791
+      if (!data) $this.data('modal', (data = new Modal(this, options)))
  792
+      if (typeof option == 'string') data[option]()
  793
+      else if (options.show) data.show()
  794
+    })
  795
+  }
  796
+
  797
+  $.fn.modal.defaults = {
  798
+      backdrop: true
  799
+    , keyboard: true
  800
+    , show: true
  801
+  }
  802
+
  803
+  $.fn.modal.Constructor = Modal
  804
+
  805
+
  806
+ /* MODAL DATA-API
  807
+  * ============== */
  808
+
  809
+  $(function () {
  810
+    $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
  811
+      var $this = $(this), href
  812
+        , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  813
+        , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
  814
+
  815
+      e.preventDefault()
  816
+      $target.modal(option)
  817
+    })
  818
+  })
  819
+
  820
+/* ===========================================================
  821
+ * bootstrap-tooltip.js v2.0.2
  822
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
  823
+ * Inspired by the original jQuery.tipsy by Jason Frame
  824
+ * ===========================================================
  825
+ * Copyright 2012 Twitter, Inc.
  826
+ *
  827
+ * Licensed under the Apache License, Version 2.0 (the "License");
  828
+ * you may not use this file except in compliance with the License.
  829
+ * You may obtain a copy of the License at
  830
+ *
  831
+ * http://www.apache.org/licenses/LICENSE-2.0
  832
+ *
  833
+ * Unless required by applicable law or agreed to in writing, software
  834
+ * distributed under the License is distributed on an "AS IS" BASIS,
  835
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  836
+ * See the License for the specific language governing permissions and
  837
+ * limitations under the License.
  838
+ * ========================================================== */
  839
+
  840
+ /* TOOLTIP PUBLIC CLASS DEFINITION
  841
+  * =============================== */
  842
+
  843
+  var Tooltip = function ( element, options ) {
  844
+    this.init('tooltip', element, options)
  845
+  }
  846
+
  847
+  Tooltip.prototype = {
  848
+
  849
+    constructor: Tooltip
  850
+
  851
+  , init: function ( type, element, options ) {
  852
+      var eventIn
  853
+        , eventOut
  854
+
  855
+      this.type = type
  856
+      this.$element = $(element)
  857
+      this.options = this.getOptions(options)
  858
+      this.enabled = true
  859
+
  860
+      if (this.options.trigger != 'manual') {
  861
+        eventIn  = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
  862
+        eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
  863
+        this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
  864
+        this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
  865
+      }
  866
+
  867
+      this.options.selector ?
  868
+        (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  869
+        this.fixTitle()
  870
+    }
  871
+
  872
+  , getOptions: function ( options ) {
  873
+      options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
  874
+
  875
+      if (options.delay && typeof options.delay == 'number') {
  876
+        options.delay = {
  877
+          show: options.delay
  878
+        , hide: options.delay
  879
+        }
  880
+      }
  881
+
  882
+      return options
  883
+    }
  884
+
  885
+  , enter: function ( e ) {
  886
+      var self = $(e.currentTarget)[this.type](this._options).data(this.type)
  887
+
  888
+      if (!self.options.delay || !self.options.delay.show) {
  889
+        self.show()
  890
+      } else {
  891
+        self.hoverState = 'in'
  892
+        setTimeout(function() {
  893
+          if (self.hoverState == 'in') {
  894
+            self.show()
  895
+          }
  896
+        }, self.options.delay.show)
  897
+      }
  898
+    }
  899
+
  900
+  , leave: function ( e ) {
  901
+      var self = $(e.currentTarget)[this.type](this._options).data(this.type)
  902
+
  903
+      if (!self.options.delay || !self.options.delay.hide) {
  904
+        self.hide()
  905
+      } else {
  906
+        self.hoverState = 'out'
  907
+        setTimeout(function() {
  908
+          if (self.hoverState == 'out') {
  909
+            self.hide()
  910
+          }
  911
+        }, self.options.delay.hide)
  912
+      }
  913
+    }
  914
+
  915
+  , show: function () {
  916
+      var $tip
  917
+        , inside
  918
+        , pos
  919
+        , actualWidth
  920
+        , actualHeight
  921
+        , placement
  922
+        , tp
  923
+
  924
+      if (this.hasContent() && this.enabled) {
  925
+        $tip = this.tip()
  926
+        this.setContent()
  927
+
  928
+        if (this.options.animation) {
  929
+          $tip.addClass('fade')
  930
+        }
  931
+
  932
+        placement = typeof this.options.placement == 'function' ?
  933
+          this.options.placement.call(this, $tip[0], this.$element[0]) :
  934
+          this.options.placement
  935
+
  936
+        inside = /in/.test(placement)
  937
+
  938
+        $tip
  939
+          .remove()
  940
+          .css({ top: 0, left: 0, display: 'block' })
  941
+          .appendTo(inside ? this.$element : document.body)
  942
+
  943
+        pos = this.getPosition(inside)
  944
+
  945
+        actualWidth = $tip[0].offsetWidth
  946
+        actualHeight = $tip[0].offsetHeight
  947
+
  948
+        switch (inside ? placement.split(' ')[1] : placement) {
  949
+          case 'bottom':
  950
+            tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
  951
+            break
  952
+          case 'top':
  953
+            tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
  954
+            break
  955
+          case 'left':
  956
+            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
  957
+            break
  958
+          case 'right':
  959
+            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
  960
+            break
  961
+        }
  962
+
  963
+        $tip
  964
+          .css(tp)
  965
+          .addClass(placement)
  966
+          .addClass('in')
  967
+      }
  968
+    }
  969
+
  970
+  , setContent: function () {
  971
+      var $tip = this.tip()
  972
+      $tip.find('.tooltip-inner').html(this.getTitle())
  973
+      $tip.removeClass('fade in top bottom left right')
  974
+    }
  975
+
  976
+  , hide: function () {
  977
+      var that = this
  978
+        , $tip = this.tip()
  979
+
  980
+      $tip.removeClass('in')
  981
+
  982
+      function removeWithAnimation() {
  983
+        var timeout = setTimeout(function () {
  984
+          $tip.off($.support.transition.end).remove()
  985
+        }, 500)
  986
+
  987
+        $tip.one($.support.transition.end, function () {
  988
+          clearTimeout(timeout)
  989
+          $tip.remove()
  990
+        })
  991
+      }
  992
+
  993
+      $.support.transition && this.$tip.hasClass('fade') ?
  994
+        removeWithAnimation() :
  995
+        $tip.remove()
  996
+    }
  997
+
  998
+  , fixTitle: function () {
  999
+      var $e = this.$element
  1000
+      if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
  1001
+        $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
  1002
+      }
  1003
+    }
  1004
+
  1005
+  , hasContent: function () {
  1006
+      return this.getTitle()
  1007
+    }
  1008
+
  1009
+  , getPosition: function (inside) {
  1010
+      return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
  1011
+        width: this.$element[0].offsetWidth
  1012
+      , height: this.$element[0].offsetHeight
  1013
+      })
  1014
+    }
  1015
+
  1016
+  , getTitle: function () {
  1017
+      var title
  1018
+        , $e = this.$element
  1019
+        , o = this.options
  1020
+
  1021
+      title = $e.attr('data-original-title')
  1022
+        || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
  1023
+
  1024
+      title = (title || '').toString().replace(/(^\s*|\s*$)/, "")
  1025
+
  1026
+      return title
  1027
+    }
  1028
+
  1029
+  , tip: function () {
  1030
+      return this.$tip = this.$tip || $(this.options.template)
  1031
+    }
  1032
+
  1033
+  , validate: function () {
  1034
+      if (!this.$element[0].parentNode) {
  1035
+        this.hide()
  1036
+        this.$element = null
  1037
+        this.options = null
  1038
+      }
  1039
+    }
  1040
+
  1041
+  , enable: function () {
  1042
+      this.enabled = true
  1043
+    }
  1044
+
  1045
+  , disable: function () {
  1046
+      this.enabled = false
  1047
+    }
  1048