Changeset 30941 for trunk


Ignore:
Timestamp:
Feb 10, 2015, 2:49:36 PM (9 years ago)
Author:
plg
Message:

bug 3198: upgrade Bootstrap tour to version 0.10.1 + change patch to replace toString.call by {}.toString.call (compatibility with IE)

Location:
trunk/plugins/TakeATour
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/TakeATour/css/bootstrap-tour-standalone.css

    r29007 r30941  
    1 /* ===========================================================
    2 # bootstrap-tour - v0.9.3
    3 # http://bootstraptour.com
    4 # ==============================================================
    5 # Copyright 2012-2013 Ulrich Sossou
    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 */
     1/* ========================================================================
     2 * bootstrap-tour - v0.10.1
     3 * http://bootstraptour.com
     4 * ========================================================================
     5 * Copyright 2012-2013 Ulrich Sossou
     6 *
     7 * ========================================================================
     8 * Licensed under the Apache License, Version 2.0 (the "License");
     9 * you may not use this file except in compliance with the License.
     10 * You may obtain a copy of the License at
     11 *
     12 *     http://www.apache.org/licenses/LICENSE-2.0
     13 *
     14 * Unless required by applicable law or agreed to in writing, software
     15 * distributed under the License is distributed on an "AS IS" BASIS,
     16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     17 * See the License for the specific language governing permissions and
     18 * limitations under the License.
     19 * ========================================================================
     20 */
     21
    1922/*!
    2023 * Bootstrap v3.1.0 (http://getbootstrap.com)
     
    3437  padding: 6px 12px;
    3538  font-size: 14px;
    36   line-height: 1.428571429;
     39  line-height: 1.42857143;
    3740  border-radius: 4px;
    3841  -webkit-user-select: none;
     
    4144  user-select: none;
    4245}
    43 .btn:focus {
     46.btn:focus,
     47.btn:active:focus,
     48.btn.active:focus {
    4449  outline: thin dotted;
    4550  outline: 5px auto -webkit-focus-ring-color;
     
    7782.btn-default:active,
    7883.btn-default.active,
    79 .open .dropdown-toggle.btn-default {
     84.open > .dropdown-toggle.btn-default {
    8085  color: #333333;
    81   background-color: #ebebeb;
     86  background-color: #e6e6e6;
    8287  border-color: #adadad;
    8388}
    8489.btn-default:active,
    8590.btn-default.active,
    86 .open .dropdown-toggle.btn-default {
     91.open > .dropdown-toggle.btn-default {
    8792  background-image: none;
    8893}
     
    109114  background-color: #333333;
    110115}
    111 .btn-sm {
     116.btn-primary {
     117  color: #ffffff;
     118  background-color: #428bca;
     119  border-color: #357ebd;
     120}
     121.btn-primary:hover,
     122.btn-primary:focus,
     123.btn-primary:active,
     124.btn-primary.active,
     125.open > .dropdown-toggle.btn-primary {
     126  color: #ffffff;
     127  background-color: #3071a9;
     128  border-color: #285e8e;
     129}
     130.btn-primary:active,
     131.btn-primary.active,
     132.open > .dropdown-toggle.btn-primary {
     133  background-image: none;
     134}
     135.btn-primary.disabled,
     136.btn-primary[disabled],
     137fieldset[disabled] .btn-primary,
     138.btn-primary.disabled:hover,
     139.btn-primary[disabled]:hover,
     140fieldset[disabled] .btn-primary:hover,
     141.btn-primary.disabled:focus,
     142.btn-primary[disabled]:focus,
     143fieldset[disabled] .btn-primary:focus,
     144.btn-primary.disabled:active,
     145.btn-primary[disabled]:active,
     146fieldset[disabled] .btn-primary:active,
     147.btn-primary.disabled.active,
     148.btn-primary[disabled].active,
     149fieldset[disabled] .btn-primary.active {
     150  background-color: #428bca;
     151  border-color: #357ebd;
     152}
     153.btn-primary .badge {
     154  color: #428bca;
     155  background-color: #ffffff;
     156}
     157.btn-success {
     158  color: #ffffff;
     159  background-color: #5cb85c;
     160  border-color: #4cae4c;
     161}
     162.btn-success:hover,
     163.btn-success:focus,
     164.btn-success:active,
     165.btn-success.active,
     166.open > .dropdown-toggle.btn-success {
     167  color: #ffffff;
     168  background-color: #449d44;
     169  border-color: #398439;
     170}
     171.btn-success:active,
     172.btn-success.active,
     173.open > .dropdown-toggle.btn-success {
     174  background-image: none;
     175}
     176.btn-success.disabled,
     177.btn-success[disabled],
     178fieldset[disabled] .btn-success,
     179.btn-success.disabled:hover,
     180.btn-success[disabled]:hover,
     181fieldset[disabled] .btn-success:hover,
     182.btn-success.disabled:focus,
     183.btn-success[disabled]:focus,
     184fieldset[disabled] .btn-success:focus,
     185.btn-success.disabled:active,
     186.btn-success[disabled]:active,
     187fieldset[disabled] .btn-success:active,
     188.btn-success.disabled.active,
     189.btn-success[disabled].active,
     190fieldset[disabled] .btn-success.active {
     191  background-color: #5cb85c;
     192  border-color: #4cae4c;
     193}
     194.btn-success .badge {
     195  color: #5cb85c;
     196  background-color: #ffffff;
     197}
     198.btn-info {
     199  color: #ffffff;
     200  background-color: #5bc0de;
     201  border-color: #46b8da;
     202}
     203.btn-info:hover,
     204.btn-info:focus,
     205.btn-info:active,
     206.btn-info.active,
     207.open > .dropdown-toggle.btn-info {
     208  color: #ffffff;
     209  background-color: #31b0d5;
     210  border-color: #269abc;
     211}
     212.btn-info:active,
     213.btn-info.active,
     214.open > .dropdown-toggle.btn-info {
     215  background-image: none;
     216}
     217.btn-info.disabled,
     218.btn-info[disabled],
     219fieldset[disabled] .btn-info,
     220.btn-info.disabled:hover,
     221.btn-info[disabled]:hover,
     222fieldset[disabled] .btn-info:hover,
     223.btn-info.disabled:focus,
     224.btn-info[disabled]:focus,
     225fieldset[disabled] .btn-info:focus,
     226.btn-info.disabled:active,
     227.btn-info[disabled]:active,
     228fieldset[disabled] .btn-info:active,
     229.btn-info.disabled.active,
     230.btn-info[disabled].active,
     231fieldset[disabled] .btn-info.active {
     232  background-color: #5bc0de;
     233  border-color: #46b8da;
     234}
     235.btn-info .badge {
     236  color: #5bc0de;
     237  background-color: #ffffff;
     238}
     239.btn-warning {
     240  color: #ffffff;
     241  background-color: #f0ad4e;
     242  border-color: #eea236;
     243}
     244.btn-warning:hover,
     245.btn-warning:focus,
     246.btn-warning:active,
     247.btn-warning.active,
     248.open > .dropdown-toggle.btn-warning {
     249  color: #ffffff;
     250  background-color: #ec971f;
     251  border-color: #d58512;
     252}
     253.btn-warning:active,
     254.btn-warning.active,
     255.open > .dropdown-toggle.btn-warning {
     256  background-image: none;
     257}
     258.btn-warning.disabled,
     259.btn-warning[disabled],
     260fieldset[disabled] .btn-warning,
     261.btn-warning.disabled:hover,
     262.btn-warning[disabled]:hover,
     263fieldset[disabled] .btn-warning:hover,
     264.btn-warning.disabled:focus,
     265.btn-warning[disabled]:focus,
     266fieldset[disabled] .btn-warning:focus,
     267.btn-warning.disabled:active,
     268.btn-warning[disabled]:active,
     269fieldset[disabled] .btn-warning:active,
     270.btn-warning.disabled.active,
     271.btn-warning[disabled].active,
     272fieldset[disabled] .btn-warning.active {
     273  background-color: #f0ad4e;
     274  border-color: #eea236;
     275}
     276.btn-warning .badge {
     277  color: #f0ad4e;
     278  background-color: #ffffff;
     279}
     280.btn-danger {
     281  color: #ffffff;
     282  background-color: #d9534f;
     283  border-color: #d43f3a;
     284}
     285.btn-danger:hover,
     286.btn-danger:focus,
     287.btn-danger:active,
     288.btn-danger.active,
     289.open > .dropdown-toggle.btn-danger {
     290  color: #ffffff;
     291  background-color: #c9302c;
     292  border-color: #ac2925;
     293}
     294.btn-danger:active,
     295.btn-danger.active,
     296.open > .dropdown-toggle.btn-danger {
     297  background-image: none;
     298}
     299.btn-danger.disabled,
     300.btn-danger[disabled],
     301fieldset[disabled] .btn-danger,
     302.btn-danger.disabled:hover,
     303.btn-danger[disabled]:hover,
     304fieldset[disabled] .btn-danger:hover,
     305.btn-danger.disabled:focus,
     306.btn-danger[disabled]:focus,
     307fieldset[disabled] .btn-danger:focus,
     308.btn-danger.disabled:active,
     309.btn-danger[disabled]:active,
     310fieldset[disabled] .btn-danger:active,
     311.btn-danger.disabled.active,
     312.btn-danger[disabled].active,
     313fieldset[disabled] .btn-danger.active {
     314  background-color: #d9534f;
     315  border-color: #d43f3a;
     316}
     317.btn-danger .badge {
     318  color: #d9534f;
     319  background-color: #ffffff;
     320}
     321.btn-link {
     322  color: #428bca;
     323  font-weight: normal;
     324  cursor: pointer;
     325  border-radius: 0;
     326}
     327.btn-link,
     328.btn-link:active,
     329.btn-link[disabled],
     330fieldset[disabled] .btn-link {
     331  background-color: transparent;
     332  -webkit-box-shadow: none;
     333  box-shadow: none;
     334}
     335.btn-link,
     336.btn-link:hover,
     337.btn-link:focus,
     338.btn-link:active {
     339  border-color: transparent;
     340}
     341.btn-link:hover,
     342.btn-link:focus {
     343  color: #2a6496;
     344  text-decoration: underline;
     345  background-color: transparent;
     346}
     347.btn-link[disabled]:hover,
     348fieldset[disabled] .btn-link:hover,
     349.btn-link[disabled]:focus,
     350fieldset[disabled] .btn-link:focus {
     351  color: #777777;
     352  text-decoration: none;
     353}
     354.btn-lg,
     355.btn-group-lg > .btn {
     356  padding: 10px 16px;
     357  font-size: 18px;
     358  line-height: 1.33;
     359  border-radius: 6px;
     360}
     361.btn-sm,
     362.btn-group-sm > .btn {
    112363  padding: 5px 10px;
    113364  font-size: 12px;
     
    115366  border-radius: 3px;
    116367}
    117 .fade {
    118   opacity: 0;
    119   -webkit-transition: opacity 0.15s linear;
    120   transition: opacity 0.15s linear;
    121 }
    122 .fade.in {
    123   opacity: 1;
    124 }
    125 .collapse {
    126   display: none;
    127 }
    128 .collapse.in {
     368.btn-xs,
     369.btn-group-xs > .btn {
     370  padding: 1px 5px;
     371  font-size: 12px;
     372  line-height: 1.5;
     373  border-radius: 3px;
     374}
     375.btn-block {
    129376  display: block;
    130 }
    131 .collapsing {
    132   position: relative;
    133   height: 0;
    134   overflow: hidden;
    135   -webkit-transition: height 0.35s ease;
    136   transition: height 0.35s ease;
    137 }
    138 .btn-group {
     377  width: 100%;
     378}
     379.btn-block + .btn-block {
     380  margin-top: 5px;
     381}
     382input[type="submit"].btn-block,
     383input[type="reset"].btn-block,
     384input[type="button"].btn-block {
     385  width: 100%;
     386}
     387.btn-group,
     388.btn-group-vertical {
    139389  position: relative;
    140390  display: inline-block;
    141391  vertical-align: middle;
    142392}
    143 .btn-group > .btn {
     393.btn-group > .btn,
     394.btn-group-vertical > .btn {
    144395  position: relative;
    145396  float: left;
    146397}
    147398.btn-group > .btn:hover,
     399.btn-group-vertical > .btn:hover,
    148400.btn-group > .btn:focus,
     401.btn-group-vertical > .btn:focus,
    149402.btn-group > .btn:active,
    150 .btn-group > .btn.active {
     403.btn-group-vertical > .btn:active,
     404.btn-group > .btn.active,
     405.btn-group-vertical > .btn.active {
    151406  z-index: 2;
    152407}
    153 .btn-group > .btn:focus {
    154   outline: none;
    155 }
    156 .btn-group .btn + .btn {
     408.btn-group > .btn:focus,
     409.btn-group-vertical > .btn:focus {
     410  outline: 0;
     411}
     412.btn-group .btn + .btn,
     413.btn-group .btn + .btn-group,
     414.btn-group .btn-group + .btn,
     415.btn-group .btn-group + .btn-group {
    157416  margin-left: -1px;
     417}
     418.btn-toolbar {
     419  margin-left: -5px;
     420}
     421.btn-toolbar .btn-group,
     422.btn-toolbar .input-group {
     423  float: left;
     424}
     425.btn-toolbar > .btn,
     426.btn-toolbar > .btn-group,
     427.btn-toolbar > .input-group {
     428  margin-left: 5px;
    158429}
    159430.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
     
    167438  border-top-right-radius: 0;
    168439}
    169 .btn-group > .btn:last-child:not(:first-child) {
     440.btn-group > .btn:last-child:not(:first-child),
     441.btn-group > .dropdown-toggle:not(:first-child) {
    170442  border-bottom-left-radius: 0;
    171443  border-top-left-radius: 0;
     444}
     445.btn-group > .btn-group {
     446  float: left;
     447}
     448.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
     449  border-radius: 0;
     450}
     451.btn-group > .btn-group:first-child > .btn:last-child,
     452.btn-group > .btn-group:first-child > .dropdown-toggle {
     453  border-bottom-right-radius: 0;
     454  border-top-right-radius: 0;
     455}
     456.btn-group > .btn-group:last-child > .btn:first-child {
     457  border-bottom-left-radius: 0;
     458  border-top-left-radius: 0;
     459}
     460.btn-group .dropdown-toggle:active,
     461.btn-group.open .dropdown-toggle {
     462  outline: 0;
     463}
     464.btn-group > .btn + .dropdown-toggle {
     465  padding-left: 8px;
     466  padding-right: 8px;
     467}
     468.btn-group > .btn-lg + .dropdown-toggle {
     469  padding-left: 12px;
     470  padding-right: 12px;
     471}
     472.btn-group.open .dropdown-toggle {
     473  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
     474  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
     475}
     476.btn-group.open .dropdown-toggle.btn-link {
     477  -webkit-box-shadow: none;
     478  box-shadow: none;
     479}
     480.btn .caret {
     481  margin-left: 0;
     482}
     483.btn-lg .caret {
     484  border-width: 5px 5px 0;
     485  border-bottom-width: 0;
     486}
     487.dropup .btn-lg .caret {
     488  border-width: 0 5px 5px;
     489}
     490.btn-group-vertical > .btn,
     491.btn-group-vertical > .btn-group,
     492.btn-group-vertical > .btn-group > .btn {
     493  display: block;
     494  float: none;
     495  width: 100%;
     496  max-width: 100%;
     497}
     498.btn-group-vertical > .btn-group > .btn {
     499  float: none;
     500}
     501.btn-group-vertical > .btn + .btn,
     502.btn-group-vertical > .btn + .btn-group,
     503.btn-group-vertical > .btn-group + .btn,
     504.btn-group-vertical > .btn-group + .btn-group {
     505  margin-top: -1px;
     506  margin-left: 0;
     507}
     508.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
     509  border-radius: 0;
     510}
     511.btn-group-vertical > .btn:first-child:not(:last-child) {
     512  border-top-right-radius: 4px;
     513  border-bottom-right-radius: 0;
     514  border-bottom-left-radius: 0;
     515}
     516.btn-group-vertical > .btn:last-child:not(:first-child) {
     517  border-bottom-left-radius: 4px;
     518  border-top-right-radius: 0;
     519  border-top-left-radius: 0;
     520}
     521.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
     522  border-radius: 0;
     523}
     524.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
     525.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
     526  border-bottom-right-radius: 0;
     527  border-bottom-left-radius: 0;
     528}
     529.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
     530  border-top-right-radius: 0;
     531  border-top-left-radius: 0;
     532}
     533.btn-group-justified {
     534  display: table;
     535  width: 100%;
     536  table-layout: fixed;
     537  border-collapse: separate;
     538}
     539.btn-group-justified > .btn,
     540.btn-group-justified > .btn-group {
     541  float: none;
     542  display: table-cell;
     543  width: 1%;
     544}
     545.btn-group-justified > .btn-group .btn {
     546  width: 100%;
     547}
     548.btn-group-justified > .btn-group .dropdown-menu {
     549  left: auto;
     550}
     551[data-toggle="buttons"] > .btn > input[type="radio"],
     552[data-toggle="buttons"] > .btn > input[type="checkbox"] {
     553  position: absolute;
     554  z-index: -1;
     555  opacity: 0;
     556  filter: alpha(opacity=0);
    172557}
    173558.popover {
     
    175560  top: 0;
    176561  left: 0;
    177   z-index: 1010;
     562  z-index: 1060;
    178563  display: none;
    179564  max-width: 276px;
     
    290675  bottom: -10px;
    291676}
    292 
    293677.tour-backdrop {
    294678  position: fixed;
     
    300684  background-color: #000;
    301685  opacity: 0.8;
     686  filter: alpha(opacity=80);
    302687}
    303688.tour-step-backdrop {
     
    306691  background: inherit;
    307692}
     693.tour-step-backdrop > td {
     694  position: relative;
     695  z-index: 1101;
     696}
    308697.tour-step-background {
    309   position: absolute;
     698  position: absolute !important;
    310699  z-index: 1100;
    311700  background: inherit;
  • trunk/plugins/TakeATour/js/custom-bootstrap-tour-standalone.js

    r28775 r30941  
    1 /* ===========================================================
    2 # bootstrap-tour - v0.9.3
    3 # http://bootstraptour.com
    4 # ==============================================================
    5 # Copyright 2012-2013 Ulrich Sossou
    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 */
    191/* ========================================================================
    20  * Bootstrap: transition.js v3.1.1
    21  * http://getbootstrap.com/javascript/#transitions
     2 * bootstrap-tour - v0.10.1
     3 * http://bootstraptour.com
    224 * ========================================================================
    23  * Copyright 2011-2014 Twitter, Inc.
    24  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
    25  * ======================================================================== */
    26 
    27 
    28 +function ($) {
    29   'use strict';
    30 
    31   // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
    32   // ============================================================
    33 
    34   function transitionEnd() {
    35     var el = document.createElement('bootstrap')
    36 
    37     var transEndEventNames = {
    38       'WebkitTransition' : 'webkitTransitionEnd',
    39       'MozTransition'    : 'transitionend',
    40       'OTransition'      : 'oTransitionEnd otransitionend',
    41       'transition'       : 'transitionend'
    42     }
    43 
    44     for (var name in transEndEventNames) {
    45       if (el.style[name] !== undefined) {
    46         return { end: transEndEventNames[name] }
    47       }
    48     }
    49 
    50     return false // explicit for ie8 (  ._.)
    51   }
    52 
    53   // http://blog.alexmaccaw.com/css-transitions
    54   $.fn.emulateTransitionEnd = function (duration) {
    55     var called = false, $el = this
    56     $(this).one($.support.transition.end, function () { called = true })
    57     var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
    58     setTimeout(callback, duration)
    59     return this
    60   }
    61 
    62   $(function () {
    63     $.support.transition = transitionEnd()
    64   })
    65 
    66 }(jQuery);
     5 * Copyright 2012-2013 Ulrich Sossou
     6 *
     7 * ========================================================================
     8 * Licensed under the Apache License, Version 2.0 (the "License");
     9 * you may not use this file except in compliance with the License.
     10 * You may obtain a copy of the License at
     11 *
     12 *     http://www.apache.org/licenses/LICENSE-2.0
     13 *
     14 * Unless required by applicable law or agreed to in writing, software
     15 * distributed under the License is distributed on an "AS IS" BASIS,
     16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     17 * See the License for the specific language governing permissions and
     18 * limitations under the License.
     19 * ========================================================================
     20 */
    6721
    6822/* ========================================================================
    69  * Bootstrap: tooltip.js v3.1.1
     23 * Bootstrap: tooltip.js v3.2.0
    7024 * http://getbootstrap.com/javascript/#tooltip
    7125 * Inspired by the original jQuery.tipsy by Jason Frame
     
    9347  }
    9448
     49  Tooltip.VERSION  = '3.2.0'
     50
    9551  Tooltip.DEFAULTS = {
    9652    animation: true,
    9753    placement: 'top',
    9854    selector: false,
    99     template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
     55    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
    10056    trigger: 'hover focus',
    10157    title: '',
    10258    delay: 0,
    10359    html: false,
    104     container: false
     60    container: false,
     61    viewport: {
     62      selector: 'body',
     63      padding: 0
     64    }
    10565  }
    10666
    10767  Tooltip.prototype.init = function (type, element, options) {
    108     this.enabled  = true
    109     this.type     = type
    110     this.$element = $(element)
    111     this.options  = this.getOptions(options)
     68    this.enabled   = true
     69    this.type      = type
     70    this.$element  = $(element)
     71    this.options   = this.getOptions(options)
     72    this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
    11273
    11374    var triggers = this.options.trigger.split(' ')
     
    162123  Tooltip.prototype.enter = function (obj) {
    163124    var self = obj instanceof this.constructor ?
    164       obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
     125      obj : $(obj.currentTarget).data('bs.' + this.type)
     126
     127    if (!self) {
     128      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
     129      $(obj.currentTarget).data('bs.' + this.type, self)
     130    }
    165131
    166132    clearTimeout(self.timeout)
     
    177143  Tooltip.prototype.leave = function (obj) {
    178144    var self = obj instanceof this.constructor ?
    179       obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
     145      obj : $(obj.currentTarget).data('bs.' + this.type)
     146
     147    if (!self) {
     148      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
     149      $(obj.currentTarget).data('bs.' + this.type, self)
     150    }
    180151
    181152    clearTimeout(self.timeout)
     
    196167      this.$element.trigger(e)
    197168
    198       if (e.isDefaultPrevented()) return
    199       var that = this;
     169      var inDom = $.contains(document.documentElement, this.$element[0])
     170      if (e.isDefaultPrevented() || !inDom) return
     171      var that = this
    200172
    201173      var $tip = this.tip()
    202174
     175      var tipId = this.getUID(this.type)
     176
    203177      this.setContent()
     178      $tip.attr('id', tipId)
     179      this.$element.attr('aria-describedby', tipId)
    204180
    205181      if (this.options.animation) $tip.addClass('fade')
     
    217193        .css({ top: 0, left: 0, display: 'block' })
    218194        .addClass(placement)
     195        .data('bs.' + this.type, this)
    219196
    220197      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
     
    225202
    226203      if (autoPlace) {
    227         var $parent = this.$element.parent()
    228 
    229204        var orgPlacement = placement
    230         var docScroll    = document.documentElement.scrollTop || document.body.scrollTop
    231         var parentWidth  = this.options.container == 'body' ? window.innerWidth  : $parent.outerWidth()
    232         var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
    233         var parentLeft   = this.options.container == 'body' ? 0 : $parent.offset().left
    234 
    235         placement = placement == 'bottom' && pos.top   + pos.height  + actualHeight - docScroll > parentHeight  ? 'top'    :
    236                     placement == 'top'    && pos.top   - docScroll   - actualHeight < 0                         ? 'bottom' :
    237                     placement == 'right'  && pos.right + actualWidth > parentWidth                              ? 'left'   :
    238                     placement == 'left'   && pos.left  - actualWidth < parentLeft                               ? 'right'  :
     205        var $parent      = this.$element.parent()
     206        var parentDim    = this.getPosition($parent)
     207
     208        placement = placement == 'bottom' && pos.top   + pos.height       + actualHeight - parentDim.scroll > parentDim.height ? 'top'    :
     209                    placement == 'top'    && pos.top   - parentDim.scroll - actualHeight < 0                                   ? 'bottom' :
     210                    placement == 'right'  && pos.right + actualWidth      > parentDim.width                                    ? 'left'   :
     211                    placement == 'left'   && pos.left  - actualWidth      < parentDim.left                                     ? 'right'  :
    239212                    placement
    240213
     
    247220
    248221      this.applyPlacement(calculatedOffset, placement)
    249       this.hoverState = null
    250 
    251       var complete = function() {
     222
     223      var complete = function () {
    252224        that.$element.trigger('shown.bs.' + that.type)
     225        that.hoverState = null
    253226      }
    254227
    255228      $.support.transition && this.$tip.hasClass('fade') ?
    256229        $tip
    257           .one($.support.transition.end, complete)
     230          .one('bsTransitionEnd', complete)
    258231          .emulateTransitionEnd(150) :
    259232        complete()
     
    262235
    263236  Tooltip.prototype.applyPlacement = function (offset, placement) {
    264     var replace
    265237    var $tip   = this.tip()
    266238    var width  = $tip[0].offsetWidth
     
    296268
    297269    if (placement == 'top' && actualHeight != height) {
    298       replace = true
    299270      offset.top = offset.top + height - actualHeight
    300271    }
    301272
    302     if (/bottom|top/.test(placement)) {
    303       var delta = 0
    304 
    305       if (offset.left < 0) {
    306         delta       = offset.left * -2
    307         offset.left = 0
    308 
    309         $tip.offset(offset)
    310 
    311         actualWidth  = $tip[0].offsetWidth
    312         actualHeight = $tip[0].offsetHeight
    313       }
    314 
    315       this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
    316     } else {
    317       this.replaceArrow(actualHeight - height, actualHeight, 'top')
    318     }
    319 
    320     if (replace) $tip.offset(offset)
     273    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
     274
     275    if (delta.left) offset.left += delta.left
     276    else offset.top += delta.top
     277
     278    var arrowDelta          = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
     279    var arrowPosition       = delta.left ? 'left'        : 'top'
     280    var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
     281
     282    $tip.offset(offset)
     283    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
    321284  }
    322285
     
    338301    var e    = $.Event('hide.bs.' + this.type)
    339302
     303    this.$element.removeAttr('aria-describedby')
     304
    340305    function complete() {
    341306      if (that.hoverState != 'in') $tip.detach()
     
    351316    $.support.transition && this.$tip.hasClass('fade') ?
    352317      $tip
    353         .one($.support.transition.end, complete)
     318        .one('bsTransitionEnd', complete)
    354319        .emulateTransitionEnd(150) :
    355320      complete()
     
    362327  Tooltip.prototype.fixTitle = function () {
    363328    var $e = this.$element
    364     if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
     329    if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
    365330      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
    366331    }
     
    371336  }
    372337
    373   Tooltip.prototype.getPosition = function () {
    374     var el = this.$element[0]
    375     return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
    376       width: el.offsetWidth,
    377       height: el.offsetHeight
    378     }, this.$element.offset())
     338  Tooltip.prototype.getPosition = function ($element) {
     339    $element   = $element || this.$element
     340    var el     = $element[0]
     341    var isBody = el.tagName == 'BODY'
     342    return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
     343      scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
     344      width:  isBody ? $(window).width()  : $element.outerWidth(),
     345      height: isBody ? $(window).height() : $element.outerHeight()
     346    }, isBody ? { top: 0, left: 0 } : $element.offset())
    379347  }
    380348
     
    384352           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
    385353        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width   }
     354
     355  }
     356
     357  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
     358    var delta = { top: 0, left: 0 }
     359    if (!this.$viewport) return delta
     360
     361    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
     362    var viewportDimensions = this.getPosition(this.$viewport)
     363
     364    if (/right|left/.test(placement)) {
     365      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
     366      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
     367      if (topEdgeOffset < viewportDimensions.top) { // top overflow
     368        delta.top = viewportDimensions.top - topEdgeOffset
     369      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
     370        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
     371      }
     372    } else {
     373      var leftEdgeOffset  = pos.left - viewportPadding
     374      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
     375      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
     376        delta.left = viewportDimensions.left - leftEdgeOffset
     377      } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
     378        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
     379      }
     380    }
     381
     382    return delta
    386383  }
    387384
     
    397394  }
    398395
     396  Tooltip.prototype.getUID = function (prefix) {
     397    do prefix += ~~(Math.random() * 1000000)
     398    while (document.getElementById(prefix))
     399    return prefix
     400  }
     401
    399402  Tooltip.prototype.tip = function () {
    400     return this.$tip = this.$tip || $(this.options.template)
     403    return (this.$tip = this.$tip || $(this.options.template))
    401404  }
    402405
    403406  Tooltip.prototype.arrow = function () {
    404     return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
     407    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
    405408  }
    406409
     
    426429
    427430  Tooltip.prototype.toggle = function (e) {
    428     var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
     431    var self = this
     432    if (e) {
     433      self = $(e.currentTarget).data('bs.' + this.type)
     434      if (!self) {
     435        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
     436        $(e.currentTarget).data('bs.' + this.type, self)
     437      }
     438    }
     439
    429440    self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
    430441  }
     
    439450  // =========================
    440451
    441   var old = $.fn.tooltip
    442 
    443   $.fn.tooltip = function (option) {
     452  function Plugin(option) {
    444453    return this.each(function () {
    445454      var $this   = $(this)
     
    453462  }
    454463
     464  var old = $.fn.tooltip
     465
     466  $.fn.tooltip             = Plugin
    455467  $.fn.tooltip.Constructor = Tooltip
    456468
     
    467479
    468480/* ========================================================================
    469  * Bootstrap: popover.js v3.1.1
     481 * Bootstrap: popover.js v3.2.0
    470482 * http://getbootstrap.com/javascript/#popovers
    471483 * ========================================================================
     
    487499  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
    488500
     501  Popover.VERSION  = '3.2.0'
     502
    489503  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
    490504    placement: 'right',
    491505    trigger: 'click',
    492506    content: '',
    493     template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
     507    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
    494508  })
    495509
     
    512526
    513527    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
    514     $tip.find('.popover-content')[ // we use append for html objects to maintain js events
     528    $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
    515529      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
    516530    ](content)
     
    538552
    539553  Popover.prototype.arrow = function () {
    540     return this.$arrow = this.$arrow || this.tip().find('.arrow')
     554    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
    541555  }
    542556
     
    550564  // =========================
    551565
    552   var old = $.fn.popover
    553 
    554   $.fn.popover = function (option) {
     566  function Plugin(option) {
    555567    return this.each(function () {
    556568      var $this   = $(this)
     
    564576  }
    565577
     578  var old = $.fn.popover
     579
     580  $.fn.popover             = Plugin
    566581  $.fn.popover.Constructor = Popover
    567582
     
    589604      }
    590605      this._options = $.extend({
    591         name: "tour",
     606        name: 'tour',
    592607        steps: [],
    593         container: "body",
     608        container: 'body',
     609        autoscroll: true,
    594610        keyboard: true,
    595611        storage: storage,
    596612        debug: false,
    597613        backdrop: false,
     614        backdropPadding: 0,
    598615        redirect: true,
    599616        orphan: false,
    600617        duration: false,
    601         basePath: "",
    602         template: "<div class='popover'>          <div class='arrow'></div>          <h3 class='popover-title'></h3>          <div class='popover-content'></div>          <div class='popover-navigation'>            <div class='btn-group'>              <button class='btn btn-sm btn-default' data-role='prev'>&laquo; Prev</button>              <button class='btn btn-sm btn-default' data-role='next'>Next &raquo;</button>              <button class='btn btn-sm btn-default' data-role='pause-resume' data-pause-text='Pause' data-resume-text='Resume'>Pause</button>            </div>            <button class='btn btn-sm btn-default' data-role='end'>End tour</button>          </div>        </div>",
     618        delay: false,
     619        basePath: '',
     620        template: '<div class="popover" role="tooltip"> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation"> <div class="btn-group"> <button class="btn btn-sm btn-default" data-role="prev">&laquo; Prev</button> <button class="btn btn-sm btn-default" data-role="next">Next &raquo;</button> <button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="Pause" data-resume-text="Resume">Pause</button> </div> <button class="btn btn-sm btn-default" data-role="end">End tour</button> </div> </div>',
    603621        afterSetState: function(key, value) {},
    604622        afterGetState: function(key, value) {},
     
    645663        return $.extend({
    646664          id: "step-" + i,
    647           path: "",
    648           placement: "right",
    649           title: "",
    650           content: "<p></p>",
     665          path: '',
     666          placement: 'right',
     667          title: '',
     668          content: '<p></p>',
    651669          next: i === this._options.steps.length - 1 ? -1 : i + 1,
    652670          prev: i - 1,
    653671          animation: true,
    654672          container: this._options.container,
     673          autoscroll: this._options.autoscroll,
    655674          backdrop: this._options.backdrop,
     675          backdropPadding: this._options.backdropPadding,
    656676          redirect: this._options.redirect,
    657677          orphan: this._options.orphan,
    658678          duration: this._options.duration,
     679          delay: this._options.delay,
    659680          template: this._options.template,
    660681          onShow: this._options.onShow,
     
    673694      this._force = force;
    674695      if (this.ended()) {
    675         this._debug("Tour ended, init prevented.");
     696        this._debug('Tour ended, init prevented.');
    676697        return this;
    677698      }
     
    681702      this._onResize((function(_this) {
    682703        return function() {
    683         return _this.showStep(_this._current);
     704          return _this.showStep(_this._current);
    684705        };
    685706      })(this));
     
    728749      endHelper = (function(_this) {
    729750        return function(e) {
    730         $(document).off("click.tour-" + _this._options.name);
    731         $(document).off("keyup.tour-" + _this._options.name);
    732         $(window).off("resize.tour-" + _this._options.name);
    733         _this._setState("end", "yes");
    734         _this._inited = false;
    735         _this._force = false;
    736         _this._clearTimer();
    737         if (_this._options.onEnd != null) {
    738           return _this._options.onEnd(_this);
    739         }
    740       };
     751          $(document).off("click.tour-" + _this._options.name);
     752          $(document).off("keyup.tour-" + _this._options.name);
     753          $(window).off("resize.tour-" + _this._options.name);
     754          _this._setState('end', 'yes');
     755          _this._inited = false;
     756          _this._force = false;
     757          _this._clearTimer();
     758          if (_this._options.onEnd != null) {
     759            return _this._options.onEnd(_this);
     760          }
     761        };
    741762      })(this);
    742763      promise = this.hideStep(this._current);
     
    745766
    746767    Tour.prototype.ended = function() {
    747       return !this._force && !!this._getState("end");
     768      return !this._force && !!this._getState('end');
    748769    };
    749770
    750771    Tour.prototype.restart = function() {
    751       this._removeState("current_step");
    752       this._removeState("end");
     772      this._removeState('current_step');
     773      this._removeState('end');
    753774      return this.start();
    754775    };
     
    780801      this._timer = window.setTimeout((function(_this) {
    781802        return function() {
    782         if (_this._isLast()) {
    783           return _this.next();
    784         } else {
    785           return _this.end();
    786         }
     803          if (_this._isLast()) {
     804            return _this.next();
     805          } else {
     806            return _this.end();
     807          }
    787808        };
    788809      })(this), this._duration);
     
    803824      hideStepHelper = (function(_this) {
    804825        return function(e) {
    805         var $element;
    806         $element = $(step.element);
    807         if (!($element.data("bs.popover") || $element.data("popover"))) {
    808           $element = $("body");
    809         }
    810           $element.popover("destroy").removeClass("tour-" + _this._options.name + "-element tour-" + _this._options.name + "-" + i + "-element");
    811         if (step.reflex) {
    812           $element.css("cursor", "").off("click.tour-" + _this._options.name);
    813         }
    814         if (step.backdrop) {
    815           _this._hideBackdrop();
    816         }
    817         if (step.onHidden != null) {
    818           return step.onHidden(_this);
    819         }
    820       };
     826          var $element;
     827          $element = $(step.element);
     828          if (!($element.data('bs.popover') || $element.data('popover'))) {
     829            $element = $('body');
     830          }
     831          $element.popover('destroy').removeClass("tour-" + _this._options.name + "-element tour-" + _this._options.name + "-" + i + "-element");
     832          if (step.reflex) {
     833            $element.removeClass('tour-step-element-reflex').off("" + (_this._reflexEvent(step.reflex)) + ".tour-" + _this._options.name);
     834          }
     835          if (step.backdrop) {
     836            _this._hideBackdrop();
     837          }
     838          if (step.onHidden != null) {
     839            return step.onHidden(_this);
     840          }
     841        };
    821842      })(this);
    822843      this._callOnPromiseDone(promise, hideStepHelper);
     
    827848      var promise, showStepHelper, skipToPrevious, step;
    828849      if (this.ended()) {
    829         this._debug("Tour ended, showStep prevented.");
     850        this._debug('Tour ended, showStep prevented.');
    830851        return this;
    831852      }
     
    838859      showStepHelper = (function(_this) {
    839860        return function(e) {
    840         var current_path, path;
    841         _this.setCurrentStep(i);
    842         path = (function() {
     861          var current_path, path, showPopoverAndOverlay;
     862          _this.setCurrentStep(i);
     863          path = (function() {
    843864            switch ({}.toString.call(step.path)) {
    844             case "[object Function]":
    845               return step.path();
    846             case "[object String]":
    847               return this._options.basePath + step.path;
    848             default:
    849               return step.path;
    850           }
    851         }).call(_this);
    852         current_path = document.location.href;
    853         if (_this._isRedirect(path, current_path)) {
    854           if (toString.call(path) === "[object RegExp]") {
    855             _this._redirect(step, path);
     865              case '[object Function]':
     866                return step.path();
     867              case '[object String]':
     868                return this._options.basePath + step.path;
     869              default:
     870                return step.path;
     871            }
     872          }).call(_this);
     873          current_path = document.location.href;
     874          if (_this._isRedirect(path, current_path)) {
     875            if ({}.toString.call(path) === "[object RegExp]") {
     876             _this._redirect(step, path);
    856877          }
    857878          else {
     
    859880            _this._redirect(step, path);
    860881          }
    861           return;
    862         }
    863         if (_this._isOrphan(step)) {
    864           if (!step.orphan) {
    865             _this._debug("Skip the orphan step " + (_this._current + 1) + ". Orphan option is false and the element doesn't exist or is hidden.");
    866             if (skipToPrevious) {
    867               _this._showPrevStep();
    868             } else {
    869               _this._showNextStep();
     882            return;
     883          }
     884          if (_this._isOrphan(step)) {
     885            if (!step.orphan) {
     886              _this._debug("Skip the orphan step " + (_this._current + 1) + ".\nOrphan option is false and the element does not exist or is hidden.");
     887              if (skipToPrevious) {
     888                _this._showPrevStep();
     889              } else {
     890                _this._showNextStep();
     891              }
     892              return;
    870893            }
    871             return;
    872           }
    873           _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true.");
    874         }
     894            _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true.");
     895          }
    875896        if (step.title  === "" & step.content  === "") {
    876897            if (skipToPrevious) {
     
    881902            return;
    882903        }
    883         if (step.backdrop) {
    884           _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0);
    885         }
    886         _this._scrollIntoView(step.element, function() {
     904          if (step.backdrop) {
     905            _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0);
     906          }
     907          showPopoverAndOverlay = function() {
    887908            if (_this.getCurrentStep() !== i) {
    888909              return;
    889910            }
    890           if ((step.element != null) && step.backdrop) {
    891             _this._showOverlayElement(step.element);
    892           }
    893           _this._showPopover(step, i);
    894           if (step.onShown != null) {
    895             step.onShown(_this);
    896           }
    897           return _this._debug("Step " + (_this._current + 1) + " of " + _this._options.steps.length);
    898         });
    899         if (step.duration) {
    900           return _this.resume();
    901         }
    902       };
     911            if ((step.element != null) && step.backdrop) {
     912              _this._showOverlayElement(step);
     913            }
     914            _this._showPopover(step, i);
     915            if (step.onShown != null) {
     916              step.onShown(_this);
     917            }
     918            return _this._debug("Step " + (_this._current + 1) + " of " + _this._options.steps.length);
     919          };
     920          if (step.autoscroll) {
     921            _this._scrollIntoView(step.element, showPopoverAndOverlay);
     922          } else {
     923            showPopoverAndOverlay();
     924          }
     925          if (step.duration) {
     926            return _this.resume();
     927          }
     928        };
    903929      })(this);
    904       this._callOnPromiseDone(promise, showStepHelper);
     930      if (step.delay) {
     931        this._debug("Wait " + step.delay + " milliseconds to show the step " + (this._current + 1));
     932        window.setTimeout((function(_this) {
     933          return function() {
     934            return _this._callOnPromiseDone(promise, showStepHelper);
     935          };
     936        })(this), step.delay);
     937      } else {
     938        this._callOnPromiseDone(promise, showStepHelper);
     939      }
    905940      return promise;
    906941    };
     
    913948      if (value != null) {
    914949        this._current = value;
    915         this._setState("current_step", value);
     950        this._setState('current_step', value);
    916951      } else {
    917         this._current = this._getState("current_step");
     952        this._current = this._getState('current_step');
    918953        this._current = this._current === null ? null : parseInt(this._current, 10);
    919954      }
     
    930965          e = _error;
    931966          if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {
    932             this.debug("LocalStorage quota exceeded. State storage failed.");
     967            this._debug('LocalStorage quota exceeded. State storage failed.');
    933968          }
    934969        }
     
    9651000        }
    9661001      }
    967       if (value === void 0 || value === "null") {
     1002      if (value === void 0 || value === 'null') {
    9681003        value = null;
    9691004      }
     
    9771012      showNextStepHelper = (function(_this) {
    9781013        return function(e) {
    979         return _this.showStep(step.next);
    980       };
     1014          return _this.showStep(step.next);
     1015        };
    9811016      })(this);
    9821017      promise = this._makePromise(step.onNext != null ? step.onNext(this) : void 0);
     
    9891024      showPrevStepHelper = (function(_this) {
    9901025        return function(e) {
    991         return _this.showStep(step.prev);
    992       };
     1026          return _this.showStep(step.prev);
     1027        };
    9931028      })(this);
    9941029      promise = this._makePromise(step.onPrev != null ? step.onPrev(this) : void 0);
     
    10031038
    10041039    Tour.prototype._isRedirect = function(path, currentPath) {
    1005       return (path != null) && path !== "" && ((toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || (toString.call(path) === "[object String]" && path !== currentPath.replace("http://", "").replace("https://", "")));
     1040      return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path !== currentPath.replace("http://", "").replace("https://", "")));
    10061041    };
    10071042
     
    10161051
    10171052    Tour.prototype._isOrphan = function(step) {
    1018       return (step.element == null) || !$(step.element).length || $(step.element).is(":hidden") && ($(step.element)[0].namespaceURI !== "http://www.w3.org/2000/svg");
     1053      return (step.element == null) || !$(step.element).length || $(step.element).is(':hidden') && ($(step.element)[0].namespaceURI !== 'http://www.w3.org/2000/svg');
    10191054    };
    10201055
     
    10241059
    10251060    Tour.prototype._showPopover = function(step, i) {
    1026       var $element, $navigation, $template, $tip, isOrphan, options;
     1061      var $element, $tip, isOrphan, options;
    10271062      $(".tour-" + this._options.name).remove();
    10281063      options = $.extend({}, this._options);
    1029       $template = $.isFunction(step.template) ? $(step.template(i, step)) : $(step.template);
    1030       $navigation = $template.find(".popover-navigation");
    10311064      isOrphan = this._isOrphan(step);
     1065      step.template = this._template(step, i);
    10321066      if (isOrphan) {
    1033         step.element = "body";
    1034         step.placement = "top";
    1035         $template = $template.addClass("orphan");
     1067        step.element = 'body';
     1068        step.placement = 'top';
    10361069      }
    10371070      $element = $(step.element);
    1038       $template.addClass("tour-" + this._options.name + " tour-" + this._options.name + "-" + i);
    10391071      $element.addClass("tour-" + this._options.name + "-element tour-" + this._options.name + "-" + i + "-element");
    10401072      if (step.options) {
     
    10421074      }
    10431075      if (step.reflex && !isOrphan) {
    1044         $element.css("cursor", "pointer").on("click.tour-" + this._options.name, (function(_this) {
     1076        $element.addClass('tour-step-element-reflex');
     1077        $element.off("" + (this._reflexEvent(step.reflex)) + ".tour-" + this._options.name);
     1078        $element.on("" + (this._reflexEvent(step.reflex)) + ".tour-" + this._options.name, (function(_this) {
    10451079          return function() {
    1046           if (_this._isLast()) {
    1047             return _this.next();
    1048           } else {
    1049             return _this.end();
    1050           }
     1080            if (_this._isLast()) {
     1081              return _this.next();
     1082            } else {
     1083              return _this.end();
     1084            }
    10511085          };
    10521086        })(this));
    10531087      }
    1054       if (step.prev < 0) {
    1055         $navigation.find("[data-role='prev']").addClass("disabled");
    1056       }
    1057       if (step.next < 0) {
    1058         $navigation.find("[data-role='next']").addClass("disabled");
    1059       }
    1060       if (!step.duration) {
    1061         $navigation.find("[data-role='pause-resume']").remove();
    1062       }
    1063       step.template = $template.clone().wrap("<div>").parent().html();
    10641088      $element.popover({
    10651089        placement: step.placement,
    1066         trigger: "manual",
     1090        trigger: 'manual',
    10671091        title: step.title,
    10681092        content: step.content,
     
    10721096        template: step.template,
    10731097        selector: step.element
    1074       }).popover("show");
    1075       $tip = $element.data("bs.popover") ? $element.data("bs.popover").tip() : $element.data("popover").tip();
    1076       $tip.attr("id", step.id);
     1098      }).popover('show');
     1099      $tip = $element.data('bs.popover') ? $element.data('bs.popover').tip() : $element.data('popover').tip();
     1100      $tip.attr('id', step.id);
    10771101      this._reposition($tip, step);
    10781102      if (isOrphan) {
    10791103        return this._center($tip);
     1104      }
     1105    };
     1106
     1107    Tour.prototype._template = function(step, i) {
     1108      var $navigation, $next, $prev, $resume, $template;
     1109      $template = $.isFunction(step.template) ? $(step.template(i, step)) : $(step.template);
     1110      $navigation = $template.find('.popover-navigation');
     1111      $prev = $navigation.find('[data-role="prev"]');
     1112      $next = $navigation.find('[data-role="next"]');
     1113      $resume = $navigation.find('[data-role="pause-resume"]');
     1114      if (this._isOrphan(step)) {
     1115        $template.addClass('orphan');
     1116      }
     1117      $template.addClass("tour-" + this._options.name + " tour-" + this._options.name + "-" + i);
     1118      if (step.prev < 0) {
     1119        $prev.addClass('disabled');
     1120      }
     1121      if (step.next < 0) {
     1122        $next.addClass('disabled');
     1123      }
     1124      if (!step.duration) {
     1125        $resume.remove();
     1126      }
     1127      return $template.clone().wrap('<div>').parent().html();
     1128    };
     1129
     1130    Tour.prototype._reflexEvent = function(reflex) {
     1131      if ({}.toString.call(reflex) === '[object Boolean]') {
     1132        return 'click';
     1133      } else {
     1134        return reflex;
    10801135      }
    10811136    };
     
    10921147        tipOffset.top = tipOffset.top + offsetBottom;
    10931148      }
    1094       offsetRight = $("html").outerWidth() - tipOffset.left - $tip.outerWidth();
     1149      offsetRight = $('html').outerWidth() - tipOffset.left - $tip.outerWidth();
    10951150      if (offsetRight < 0) {
    10961151        tipOffset.left = tipOffset.left + offsetRight;
     
    11031158      }
    11041159      $tip.offset(tipOffset);
    1105       if (step.placement === "bottom" || step.placement === "top") {
     1160      if (step.placement === 'bottom' || step.placement === 'top') {
    11061161        if (originalLeft !== tipOffset.left) {
    1107           return this._replaceArrow($tip, (tipOffset.left - originalLeft) * 2, offsetWidth, "left");
     1162          return this._replaceArrow($tip, (tipOffset.left - originalLeft) * 2, offsetWidth, 'left');
    11081163        }
    11091164      } else {
    11101165        if (originalTop !== tipOffset.top) {
    1111           return this._replaceArrow($tip, (tipOffset.top - originalTop) * 2, offsetHeight, "top");
     1166          return this._replaceArrow($tip, (tipOffset.top - originalTop) * 2, offsetHeight, 'top');
    11121167        }
    11131168      }
     
    11151170
    11161171    Tour.prototype._center = function($tip) {
    1117       return $tip.css("top", $(window).outerHeight() / 2 - $tip.outerHeight() / 2);
     1172      return $tip.css('top', $(window).outerHeight() / 2 - $tip.outerHeight() / 2);
    11181173    };
    11191174
    11201175    Tour.prototype._replaceArrow = function($tip, delta, dimension, position) {
    1121       return $tip.find(".arrow").css(position, delta ? 50 * (1 - delta / dimension) + "%" : "");
     1176      return $tip.find('.arrow').css(position, delta ? 50 * (1 - delta / dimension) + '%' : '');
    11221177    };
    11231178
     
    11341189      this._debug("Scroll into view. ScrollTop: " + scrollTop + ". Element offset: " + offsetTop + ". Window height: " + windowHeight + ".");
    11351190      counter = 0;
    1136       return $("body,html").stop(true, true).animate({
     1191      return $('body, html').stop(true, true).animate({
    11371192        scrollTop: Math.ceil(scrollTop)
    11381193      }, (function(_this) {
    11391194        return function() {
    1140         if (++counter === 2) {
    1141           callback();
    1142           return _this._debug("Scroll into view. Animation end element offset: " + ($element.offset().top) + ". Window height: " + ($window.height()) + ".");
    1143         }
     1195          if (++counter === 2) {
     1196            callback();
     1197            return _this._debug("Scroll into view.\nAnimation end element offset: " + ($element.offset().top) + ".\nWindow height: " + ($window.height()) + ".");
     1198          }
    11441199        };
    11451200      })(this));
     
    11561211      var _this;
    11571212      _this = this;
    1158       return $(document).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']:not(.disabled)").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']:not(.disabled)").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']:not(.disabled)", (function(_this) {
     1213      return $(document).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']", (function(_this) {
    11591214        return function(e) {
    1160         e.preventDefault();
    1161         return _this.next();
     1215          e.preventDefault();
     1216          return _this.next();
    11621217        };
    1163       })(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']:not(.disabled)", (function(_this) {
     1218      })(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']", (function(_this) {
    11641219        return function(e) {
    1165         e.preventDefault();
    1166         return _this.prev();
     1220          e.preventDefault();
     1221          return _this.prev();
    11671222        };
    11681223      })(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']", (function(_this) {
    11691224        return function(e) {
    1170         e.preventDefault();
    1171         return _this.end();
     1225          e.preventDefault();
     1226          return _this.end();
    11721227        };
    11731228      })(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']", function(e) {
     
    11751230        e.preventDefault();
    11761231        $this = $(this);
    1177         $this.text(_this._paused ? $this.data("pause-text") : $this.data("resume-text"));
     1232        $this.text(_this._paused ? $this.data('pause-text') : $this.data('resume-text'));
    11781233        if (_this._paused) {
    11791234          return _this.resume();
     
    11901245      return $(document).on("keyup.tour-" + this._options.name, (function(_this) {
    11911246        return function(e) {
    1192         if (!e.which) {
    1193           return;
    1194         }
    1195         switch (e.which) {
    1196           case 39:
    1197             e.preventDefault();
    1198             if (_this._isLast()) {
    1199               return _this.next();
    1200             } else {
     1247          if (!e.which) {
     1248            return;
     1249          }
     1250          switch (e.which) {
     1251            case 39:
     1252              e.preventDefault();
     1253              if (_this._isLast()) {
     1254                return _this.next();
     1255              } else {
     1256                return _this.end();
     1257              }
     1258              break;
     1259            case 37:
     1260              e.preventDefault();
     1261              if (_this._current > 0) {
     1262                return _this.prev();
     1263              }
     1264              break;
     1265            case 27:
     1266              e.preventDefault();
    12011267              return _this.end();
    1202             }
    1203             break;
    1204           case 37:
    1205             e.preventDefault();
    1206             if (_this._current > 0) {
    1207               return _this.prev();
    1208             }
    1209             break;
    1210           case 27:
    1211             e.preventDefault();
    1212             return _this.end();
    1213         }
     1268          }
    12141269        };
    12151270      })(this));
     
    12281283        return promise.then((function(_this) {
    12291284          return function(e) {
    1230           return cb.call(_this, arg);
     1285            return cb.call(_this, arg);
    12311286          };
    12321287        })(this));
     
    12401295        return;
    12411296      }
    1242       this.backdrop = $("<div/>", {
    1243         "class": "tour-backdrop"
     1297      this.backdrop = $('<div>', {
     1298        "class": 'tour-backdrop'
    12441299      });
    12451300      this.backdrop.backgroundShown = true;
    1246       return $("body").append(this.backdrop);
     1301      return $('body').append(this.backdrop);
    12471302    };
    12481303
     
    12541309    Tour.prototype._hideBackground = function() {
    12551310      if (this.backdrop) {
    1256       this.backdrop.remove();
    1257       this.backdrop.overlay = null;
    1258       return this.backdrop.backgroundShown = false;
    1259       }
    1260     };
    1261 
    1262     Tour.prototype._showOverlayElement = function(element) {
    1263       var $background, $element, offset;
    1264       $element = $(element);
     1311        this.backdrop.remove();
     1312        this.backdrop.overlay = null;
     1313        return this.backdrop.backgroundShown = false;
     1314      }
     1315    };
     1316
     1317    Tour.prototype._showOverlayElement = function(step) {
     1318      var $element, elementData;
     1319      $element = $(step.element);
    12651320      if (!$element || $element.length === 0 || this.backdrop.overlayElementShown) {
    12661321        return;
    12671322      }
    12681323      this.backdrop.overlayElementShown = true;
    1269       $background = $("<div/>");
    1270       offset = $element.offset();
    1271       offset.top = offset.top;
    1272       offset.left = offset.left;
    1273       $background.width($element.innerWidth()).height($element.innerHeight()).addClass("tour-step-background").offset(offset);
    1274       $element.addClass("tour-step-backdrop");
    1275       $("body").append($background);
    1276       this.backdrop.$element = $element;
    1277       return this.backdrop.$background = $background;
     1324      this.backdrop.$element = $element.addClass('tour-step-backdrop');
     1325      this.backdrop.$background = $('<div>', {
     1326        "class": 'tour-step-background'
     1327      });
     1328      elementData = {
     1329        width: $element.innerWidth(),
     1330        height: $element.innerHeight(),
     1331        offset: $element.offset()
     1332      };
     1333      this.backdrop.$background.appendTo('body');
     1334      if (step.backdropPadding) {
     1335        elementData = this._applyBackdropPadding(step.backdropPadding, elementData);
     1336      }
     1337      return this.backdrop.$background.width(elementData.width).height(elementData.height).offset(elementData.offset);
    12781338    };
    12791339
     
    12821342        return;
    12831343      }
    1284       this.backdrop.$element.removeClass("tour-step-backdrop");
     1344      this.backdrop.$element.removeClass('tour-step-backdrop');
    12851345      this.backdrop.$background.remove();
    12861346      this.backdrop.$element = null;
     
    12891349    };
    12901350
     1351    Tour.prototype._applyBackdropPadding = function(padding, data) {
     1352      if (typeof padding === 'object') {
     1353        if (padding.top == null) {
     1354          padding.top = 0;
     1355        }
     1356        if (padding.right == null) {
     1357          padding.right = 0;
     1358        }
     1359        if (padding.bottom == null) {
     1360          padding.bottom = 0;
     1361        }
     1362        if (padding.left == null) {
     1363          padding.left = 0;
     1364        }
     1365        data.offset.top = data.offset.top - padding.top;
     1366        data.offset.left = data.offset.left - padding.left;
     1367        data.width = data.width + padding.left + padding.right;
     1368        data.height = data.height + padding.top + padding.bottom;
     1369      } else {
     1370        data.offset.top = data.offset.top - padding;
     1371        data.offset.left = data.offset.left - padding;
     1372        data.width = data.width + (padding * 2);
     1373        data.height = data.height + (padding * 2);
     1374      }
     1375      return data;
     1376    };
     1377
    12911378    Tour.prototype._clearTimer = function() {
    12921379      window.clearTimeout(this._timer);
  • trunk/plugins/TakeATour/js/custom.patch

    r28775 r30941  
    1 --- E:/Program Files/EasyPHP/www/SITE/sandbox/pwg_test/piwigo_trunk/plugins/TakeATour/js/903.js Mon Jun 23 21:44:59 2014
    2 +++ E:/Program Files/EasyPHP/www/SITE/sandbox/pwg_test/piwigo_trunk/plugins/TakeATour/js/custom-bootstrap-tour-standalone.js    Sun Apr 13 19:05:42 2014
    3 @@ -849,9 +849,15 @@
     1--- bootstrap-tour-standalone.js.orig   2015-02-10 14:28:55.000000000 +0100
     2+++ bootstrap-tour-standalone.js        2015-02-10 14:35:03.000000000 +0100
     3@@ -870,9 +870,15 @@
    44                 return step.path;
    55             }
    66           }).call(_this);
    7 -          current_path = [document.location.pathname, document.location.hash].join("");
    8 +        current_path = document.location.href;
     7-          current_path = [document.location.pathname, document.location.hash].join('');
     8+          current_path = document.location.href;
    99           if (_this._isRedirect(path, current_path)) {
    10 +          if (toString.call(path) === "[object RegExp]") {
    11              _this._redirect(step, path);
     10+            if ({}.toString.call(path) === "[object RegExp]") {
     11+             _this._redirect(step, path);
    1212+          }
    1313+          else {
    1414+            path = document.location.protocol+'//'+path;
    15 +            _this._redirect(step, path);
     15             _this._redirect(step, path);
    1616+          }
    1717             return;
    1818           }
    1919           if (_this._isOrphan(step)) {
    20 @@ -866,6 +872,14 @@
     20@@ -887,6 +893,14 @@
    2121             }
    2222             _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true.");
     
    3333             _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0);
    3434           }
    35 @@ -988,7 +1002,7 @@
     35@@ -1023,7 +1037,7 @@
    3636     };
    3737 
    3838     Tour.prototype._isRedirect = function(path, currentPath) {
    39 -      return (path != null) && path !== "" && (({}.toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || ({}.toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, "")));
    40 +      return (path != null) && path !== "" && ((toString.call(path) === "[object RegExp]" && !path.test(currentPath)) || (toString.call(path) === "[object String]" && path !== currentPath.replace("http://", "").replace("https://", "")));
     39-      return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path.replace(/\?.*$/, '').replace(/\/?$/, '') !== currentPath.replace(/\/?$/, '')));
     40+      return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path !== currentPath.replace("http://", "").replace("https://", "")));
    4141     };
    4242 
Note: See TracChangeset for help on using the changeset viewer.