- Timestamp:
- Feb 10, 2015, 2:49:36 PM (9 years ago)
- 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 19 22 /*! 20 23 * Bootstrap v3.1.0 (http://getbootstrap.com) … … 34 37 padding: 6px 12px; 35 38 font-size: 14px; 36 line-height: 1.4285714 29;39 line-height: 1.42857143; 37 40 border-radius: 4px; 38 41 -webkit-user-select: none; … … 41 44 user-select: none; 42 45 } 43 .btn:focus { 46 .btn:focus, 47 .btn:active:focus, 48 .btn.active:focus { 44 49 outline: thin dotted; 45 50 outline: 5px auto -webkit-focus-ring-color; … … 77 82 .btn-default:active, 78 83 .btn-default.active, 79 .open .dropdown-toggle.btn-default {84 .open > .dropdown-toggle.btn-default { 80 85 color: #333333; 81 background-color: #e bebeb;86 background-color: #e6e6e6; 82 87 border-color: #adadad; 83 88 } 84 89 .btn-default:active, 85 90 .btn-default.active, 86 .open .dropdown-toggle.btn-default {91 .open > .dropdown-toggle.btn-default { 87 92 background-image: none; 88 93 } … … 109 114 background-color: #333333; 110 115 } 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], 137 fieldset[disabled] .btn-primary, 138 .btn-primary.disabled:hover, 139 .btn-primary[disabled]:hover, 140 fieldset[disabled] .btn-primary:hover, 141 .btn-primary.disabled:focus, 142 .btn-primary[disabled]:focus, 143 fieldset[disabled] .btn-primary:focus, 144 .btn-primary.disabled:active, 145 .btn-primary[disabled]:active, 146 fieldset[disabled] .btn-primary:active, 147 .btn-primary.disabled.active, 148 .btn-primary[disabled].active, 149 fieldset[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], 178 fieldset[disabled] .btn-success, 179 .btn-success.disabled:hover, 180 .btn-success[disabled]:hover, 181 fieldset[disabled] .btn-success:hover, 182 .btn-success.disabled:focus, 183 .btn-success[disabled]:focus, 184 fieldset[disabled] .btn-success:focus, 185 .btn-success.disabled:active, 186 .btn-success[disabled]:active, 187 fieldset[disabled] .btn-success:active, 188 .btn-success.disabled.active, 189 .btn-success[disabled].active, 190 fieldset[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], 219 fieldset[disabled] .btn-info, 220 .btn-info.disabled:hover, 221 .btn-info[disabled]:hover, 222 fieldset[disabled] .btn-info:hover, 223 .btn-info.disabled:focus, 224 .btn-info[disabled]:focus, 225 fieldset[disabled] .btn-info:focus, 226 .btn-info.disabled:active, 227 .btn-info[disabled]:active, 228 fieldset[disabled] .btn-info:active, 229 .btn-info.disabled.active, 230 .btn-info[disabled].active, 231 fieldset[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], 260 fieldset[disabled] .btn-warning, 261 .btn-warning.disabled:hover, 262 .btn-warning[disabled]:hover, 263 fieldset[disabled] .btn-warning:hover, 264 .btn-warning.disabled:focus, 265 .btn-warning[disabled]:focus, 266 fieldset[disabled] .btn-warning:focus, 267 .btn-warning.disabled:active, 268 .btn-warning[disabled]:active, 269 fieldset[disabled] .btn-warning:active, 270 .btn-warning.disabled.active, 271 .btn-warning[disabled].active, 272 fieldset[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], 301 fieldset[disabled] .btn-danger, 302 .btn-danger.disabled:hover, 303 .btn-danger[disabled]:hover, 304 fieldset[disabled] .btn-danger:hover, 305 .btn-danger.disabled:focus, 306 .btn-danger[disabled]:focus, 307 fieldset[disabled] .btn-danger:focus, 308 .btn-danger.disabled:active, 309 .btn-danger[disabled]:active, 310 fieldset[disabled] .btn-danger:active, 311 .btn-danger.disabled.active, 312 .btn-danger[disabled].active, 313 fieldset[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], 330 fieldset[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, 348 fieldset[disabled] .btn-link:hover, 349 .btn-link[disabled]:focus, 350 fieldset[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 { 112 363 padding: 5px 10px; 113 364 font-size: 12px; … … 115 366 border-radius: 3px; 116 367 } 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 { 129 376 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 } 382 input[type="submit"].btn-block, 383 input[type="reset"].btn-block, 384 input[type="button"].btn-block { 385 width: 100%; 386 } 387 .btn-group, 388 .btn-group-vertical { 139 389 position: relative; 140 390 display: inline-block; 141 391 vertical-align: middle; 142 392 } 143 .btn-group > .btn { 393 .btn-group > .btn, 394 .btn-group-vertical > .btn { 144 395 position: relative; 145 396 float: left; 146 397 } 147 398 .btn-group > .btn:hover, 399 .btn-group-vertical > .btn:hover, 148 400 .btn-group > .btn:focus, 401 .btn-group-vertical > .btn:focus, 149 402 .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 { 151 406 z-index: 2; 152 407 } 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 { 157 416 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; 158 429 } 159 430 .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { … … 167 438 border-top-right-radius: 0; 168 439 } 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) { 170 442 border-bottom-left-radius: 0; 171 443 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); 172 557 } 173 558 .popover { … … 175 560 top: 0; 176 561 left: 0; 177 z-index: 10 10;562 z-index: 1060; 178 563 display: none; 179 564 max-width: 276px; … … 290 675 bottom: -10px; 291 676 } 292 293 677 .tour-backdrop { 294 678 position: fixed; … … 300 684 background-color: #000; 301 685 opacity: 0.8; 686 filter: alpha(opacity=80); 302 687 } 303 688 .tour-step-backdrop { … … 306 691 background: inherit; 307 692 } 693 .tour-step-backdrop > td { 694 position: relative; 695 z-index: 1101; 696 } 308 697 .tour-step-background { 309 position: absolute ;698 position: absolute !important; 310 699 z-index: 1100; 311 700 background: inherit; -
trunk/plugins/TakeATour/js/custom-bootstrap-tour-standalone.js
r28775 r30941 1 /* ===========================================================2 # bootstrap-tour - v0.9.33 # http://bootstraptour.com4 # ==============================================================5 # Copyright 2012-2013 Ulrich Sossou6 #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 at10 #11 # http://www.apache.org/licenses/LICENSE-2.012 #13 # Unless required by applicable law or agreed to in writing, software14 # 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 and17 # limitations under the License.18 */19 1 /* ======================================================================== 20 * Bootstrap: transition.js v3.1.121 * http:// getbootstrap.com/javascript/#transitions2 * bootstrap-tour - v0.10.1 3 * http://bootstraptour.com 22 4 * ======================================================================== 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 */ 67 21 68 22 /* ======================================================================== 69 * Bootstrap: tooltip.js v3. 1.123 * Bootstrap: tooltip.js v3.2.0 70 24 * http://getbootstrap.com/javascript/#tooltip 71 25 * Inspired by the original jQuery.tipsy by Jason Frame … … 93 47 } 94 48 49 Tooltip.VERSION = '3.2.0' 50 95 51 Tooltip.DEFAULTS = { 96 52 animation: true, 97 53 placement: 'top', 98 54 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>', 100 56 trigger: 'hover focus', 101 57 title: '', 102 58 delay: 0, 103 59 html: false, 104 container: false 60 container: false, 61 viewport: { 62 selector: 'body', 63 padding: 0 64 } 105 65 } 106 66 107 67 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) 112 73 113 74 var triggers = this.options.trigger.split(' ') … … 162 123 Tooltip.prototype.enter = function (obj) { 163 124 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 } 165 131 166 132 clearTimeout(self.timeout) … … 177 143 Tooltip.prototype.leave = function (obj) { 178 144 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 } 180 151 181 152 clearTimeout(self.timeout) … … 196 167 this.$element.trigger(e) 197 168 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 200 172 201 173 var $tip = this.tip() 202 174 175 var tipId = this.getUID(this.type) 176 203 177 this.setContent() 178 $tip.attr('id', tipId) 179 this.$element.attr('aria-describedby', tipId) 204 180 205 181 if (this.options.animation) $tip.addClass('fade') … … 217 193 .css({ top: 0, left: 0, display: 'block' }) 218 194 .addClass(placement) 195 .data('bs.' + this.type, this) 219 196 220 197 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) … … 225 202 226 203 if (autoPlace) { 227 var $parent = this.$element.parent()228 229 204 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' : 239 212 placement 240 213 … … 247 220 248 221 this.applyPlacement(calculatedOffset, placement) 249 this.hoverState = null 250 251 var complete = function() { 222 223 var complete = function () { 252 224 that.$element.trigger('shown.bs.' + that.type) 225 that.hoverState = null 253 226 } 254 227 255 228 $.support.transition && this.$tip.hasClass('fade') ? 256 229 $tip 257 .one( $.support.transition.end, complete)230 .one('bsTransitionEnd', complete) 258 231 .emulateTransitionEnd(150) : 259 232 complete() … … 262 235 263 236 Tooltip.prototype.applyPlacement = function (offset, placement) { 264 var replace265 237 var $tip = this.tip() 266 238 var width = $tip[0].offsetWidth … … 296 268 297 269 if (placement == 'top' && actualHeight != height) { 298 replace = true299 270 offset.top = offset.top + height - actualHeight 300 271 } 301 272 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) 321 284 } 322 285 … … 338 301 var e = $.Event('hide.bs.' + this.type) 339 302 303 this.$element.removeAttr('aria-describedby') 304 340 305 function complete() { 341 306 if (that.hoverState != 'in') $tip.detach() … … 351 316 $.support.transition && this.$tip.hasClass('fade') ? 352 317 $tip 353 .one( $.support.transition.end, complete)318 .one('bsTransitionEnd', complete) 354 319 .emulateTransitionEnd(150) : 355 320 complete() … … 362 327 Tooltip.prototype.fixTitle = function () { 363 328 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') { 365 330 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 366 331 } … … 371 336 } 372 337 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()) 379 347 } 380 348 … … 384 352 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 385 353 /* 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 386 383 } 387 384 … … 397 394 } 398 395 396 Tooltip.prototype.getUID = function (prefix) { 397 do prefix += ~~(Math.random() * 1000000) 398 while (document.getElementById(prefix)) 399 return prefix 400 } 401 399 402 Tooltip.prototype.tip = function () { 400 return this.$tip = this.$tip || $(this.options.template)403 return (this.$tip = this.$tip || $(this.options.template)) 401 404 } 402 405 403 406 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')) 405 408 } 406 409 … … 426 429 427 430 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 429 440 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 430 441 } … … 439 450 // ========================= 440 451 441 var old = $.fn.tooltip 442 443 $.fn.tooltip = function (option) { 452 function Plugin(option) { 444 453 return this.each(function () { 445 454 var $this = $(this) … … 453 462 } 454 463 464 var old = $.fn.tooltip 465 466 $.fn.tooltip = Plugin 455 467 $.fn.tooltip.Constructor = Tooltip 456 468 … … 467 479 468 480 /* ======================================================================== 469 * Bootstrap: popover.js v3. 1.1481 * Bootstrap: popover.js v3.2.0 470 482 * http://getbootstrap.com/javascript/#popovers 471 483 * ======================================================================== … … 487 499 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 488 500 501 Popover.VERSION = '3.2.0' 502 489 503 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 490 504 placement: 'right', 491 505 trigger: 'click', 492 506 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>' 494 508 }) 495 509 … … 512 526 513 527 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) 514 $tip.find('.popover-content') [ // we use append for html objects to maintain js events528 $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events 515 529 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' 516 530 ](content) … … 538 552 539 553 Popover.prototype.arrow = function () { 540 return this.$arrow = this.$arrow || this.tip().find('.arrow')554 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) 541 555 } 542 556 … … 550 564 // ========================= 551 565 552 var old = $.fn.popover 553 554 $.fn.popover = function (option) { 566 function Plugin(option) { 555 567 return this.each(function () { 556 568 var $this = $(this) … … 564 576 } 565 577 578 var old = $.fn.popover 579 580 $.fn.popover = Plugin 566 581 $.fn.popover.Constructor = Popover 567 582 … … 589 604 } 590 605 this._options = $.extend({ 591 name: "tour",606 name: 'tour', 592 607 steps: [], 593 container: "body", 608 container: 'body', 609 autoscroll: true, 594 610 keyboard: true, 595 611 storage: storage, 596 612 debug: false, 597 613 backdrop: false, 614 backdropPadding: 0, 598 615 redirect: true, 599 616 orphan: false, 600 617 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'>« Prev</button> <button class='btn btn-sm btn-default' data-role='next'>Next »</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">« Prev</button> <button class="btn btn-sm btn-default" data-role="next">Next »</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>', 603 621 afterSetState: function(key, value) {}, 604 622 afterGetState: function(key, value) {}, … … 645 663 return $.extend({ 646 664 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>', 651 669 next: i === this._options.steps.length - 1 ? -1 : i + 1, 652 670 prev: i - 1, 653 671 animation: true, 654 672 container: this._options.container, 673 autoscroll: this._options.autoscroll, 655 674 backdrop: this._options.backdrop, 675 backdropPadding: this._options.backdropPadding, 656 676 redirect: this._options.redirect, 657 677 orphan: this._options.orphan, 658 678 duration: this._options.duration, 679 delay: this._options.delay, 659 680 template: this._options.template, 660 681 onShow: this._options.onShow, … … 673 694 this._force = force; 674 695 if (this.ended()) { 675 this._debug( "Tour ended, init prevented.");696 this._debug('Tour ended, init prevented.'); 676 697 return this; 677 698 } … … 681 702 this._onResize((function(_this) { 682 703 return function() { 683 return _this.showStep(_this._current);704 return _this.showStep(_this._current); 684 705 }; 685 706 })(this)); … … 728 749 endHelper = (function(_this) { 729 750 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 }; 741 762 })(this); 742 763 promise = this.hideStep(this._current); … … 745 766 746 767 Tour.prototype.ended = function() { 747 return !this._force && !!this._getState( "end");768 return !this._force && !!this._getState('end'); 748 769 }; 749 770 750 771 Tour.prototype.restart = function() { 751 this._removeState( "current_step");752 this._removeState( "end");772 this._removeState('current_step'); 773 this._removeState('end'); 753 774 return this.start(); 754 775 }; … … 780 801 this._timer = window.setTimeout((function(_this) { 781 802 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 } 787 808 }; 788 809 })(this), this._duration); … … 803 824 hideStepHelper = (function(_this) { 804 825 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 }; 821 842 })(this); 822 843 this._callOnPromiseDone(promise, hideStepHelper); … … 827 848 var promise, showStepHelper, skipToPrevious, step; 828 849 if (this.ended()) { 829 this._debug( "Tour ended, showStep prevented.");850 this._debug('Tour ended, showStep prevented.'); 830 851 return this; 831 852 } … … 838 859 showStepHelper = (function(_this) { 839 860 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() { 843 864 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); 856 877 } 857 878 else { … … 859 880 _this._redirect(step, path); 860 881 } 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; 870 893 } 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 } 875 896 if (step.title === "" & step.content === "") { 876 897 if (skipToPrevious) { … … 881 902 return; 882 903 } 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() { 887 908 if (_this.getCurrentStep() !== i) { 888 909 return; 889 910 } 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 }; 903 929 })(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 } 905 940 return promise; 906 941 }; … … 913 948 if (value != null) { 914 949 this._current = value; 915 this._setState( "current_step", value);950 this._setState('current_step', value); 916 951 } else { 917 this._current = this._getState( "current_step");952 this._current = this._getState('current_step'); 918 953 this._current = this._current === null ? null : parseInt(this._current, 10); 919 954 } … … 930 965 e = _error; 931 966 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.'); 933 968 } 934 969 } … … 965 1000 } 966 1001 } 967 if (value === void 0 || value === "null") {1002 if (value === void 0 || value === 'null') { 968 1003 value = null; 969 1004 } … … 977 1012 showNextStepHelper = (function(_this) { 978 1013 return function(e) { 979 return _this.showStep(step.next);980 };1014 return _this.showStep(step.next); 1015 }; 981 1016 })(this); 982 1017 promise = this._makePromise(step.onNext != null ? step.onNext(this) : void 0); … … 989 1024 showPrevStepHelper = (function(_this) { 990 1025 return function(e) { 991 return _this.showStep(step.prev);992 };1026 return _this.showStep(step.prev); 1027 }; 993 1028 })(this); 994 1029 promise = this._makePromise(step.onPrev != null ? step.onPrev(this) : void 0); … … 1003 1038 1004 1039 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://", ""))); 1006 1041 }; 1007 1042 … … 1016 1051 1017 1052 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'); 1019 1054 }; 1020 1055 … … 1024 1059 1025 1060 Tour.prototype._showPopover = function(step, i) { 1026 var $element, $ navigation, $template, $tip, isOrphan, options;1061 var $element, $tip, isOrphan, options; 1027 1062 $(".tour-" + this._options.name).remove(); 1028 1063 options = $.extend({}, this._options); 1029 $template = $.isFunction(step.template) ? $(step.template(i, step)) : $(step.template);1030 $navigation = $template.find(".popover-navigation");1031 1064 isOrphan = this._isOrphan(step); 1065 step.template = this._template(step, i); 1032 1066 if (isOrphan) { 1033 step.element = "body"; 1034 step.placement = "top"; 1035 $template = $template.addClass("orphan"); 1067 step.element = 'body'; 1068 step.placement = 'top'; 1036 1069 } 1037 1070 $element = $(step.element); 1038 $template.addClass("tour-" + this._options.name + " tour-" + this._options.name + "-" + i);1039 1071 $element.addClass("tour-" + this._options.name + "-element tour-" + this._options.name + "-" + i + "-element"); 1040 1072 if (step.options) { … … 1042 1074 } 1043 1075 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) { 1045 1079 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 } 1051 1085 }; 1052 1086 })(this)); 1053 1087 } 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();1064 1088 $element.popover({ 1065 1089 placement: step.placement, 1066 trigger: "manual",1090 trigger: 'manual', 1067 1091 title: step.title, 1068 1092 content: step.content, … … 1072 1096 template: step.template, 1073 1097 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); 1077 1101 this._reposition($tip, step); 1078 1102 if (isOrphan) { 1079 1103 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; 1080 1135 } 1081 1136 }; … … 1092 1147 tipOffset.top = tipOffset.top + offsetBottom; 1093 1148 } 1094 offsetRight = $( "html").outerWidth() - tipOffset.left - $tip.outerWidth();1149 offsetRight = $('html').outerWidth() - tipOffset.left - $tip.outerWidth(); 1095 1150 if (offsetRight < 0) { 1096 1151 tipOffset.left = tipOffset.left + offsetRight; … … 1103 1158 } 1104 1159 $tip.offset(tipOffset); 1105 if (step.placement === "bottom" || step.placement === "top") {1160 if (step.placement === 'bottom' || step.placement === 'top') { 1106 1161 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'); 1108 1163 } 1109 1164 } else { 1110 1165 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'); 1112 1167 } 1113 1168 } … … 1115 1170 1116 1171 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); 1118 1173 }; 1119 1174 1120 1175 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) + '%' : ''); 1122 1177 }; 1123 1178 … … 1134 1189 this._debug("Scroll into view. ScrollTop: " + scrollTop + ". Element offset: " + offsetTop + ". Window height: " + windowHeight + "."); 1135 1190 counter = 0; 1136 return $( "body,html").stop(true, true).animate({1191 return $('body, html').stop(true, true).animate({ 1137 1192 scrollTop: Math.ceil(scrollTop) 1138 1193 }, (function(_this) { 1139 1194 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 } 1144 1199 }; 1145 1200 })(this)); … … 1156 1211 var _this; 1157 1212 _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) { 1159 1214 return function(e) { 1160 e.preventDefault();1161 return _this.next();1215 e.preventDefault(); 1216 return _this.next(); 1162 1217 }; 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) { 1164 1219 return function(e) { 1165 e.preventDefault();1166 return _this.prev();1220 e.preventDefault(); 1221 return _this.prev(); 1167 1222 }; 1168 1223 })(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']", (function(_this) { 1169 1224 return function(e) { 1170 e.preventDefault();1171 return _this.end();1225 e.preventDefault(); 1226 return _this.end(); 1172 1227 }; 1173 1228 })(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']", function(e) { … … 1175 1230 e.preventDefault(); 1176 1231 $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')); 1178 1233 if (_this._paused) { 1179 1234 return _this.resume(); … … 1190 1245 return $(document).on("keyup.tour-" + this._options.name, (function(_this) { 1191 1246 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(); 1201 1267 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 } 1214 1269 }; 1215 1270 })(this)); … … 1228 1283 return promise.then((function(_this) { 1229 1284 return function(e) { 1230 return cb.call(_this, arg);1285 return cb.call(_this, arg); 1231 1286 }; 1232 1287 })(this)); … … 1240 1295 return; 1241 1296 } 1242 this.backdrop = $( "<div/>", {1243 "class": "tour-backdrop"1297 this.backdrop = $('<div>', { 1298 "class": 'tour-backdrop' 1244 1299 }); 1245 1300 this.backdrop.backgroundShown = true; 1246 return $( "body").append(this.backdrop);1301 return $('body').append(this.backdrop); 1247 1302 }; 1248 1303 … … 1254 1309 Tour.prototype._hideBackground = function() { 1255 1310 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); 1265 1320 if (!$element || $element.length === 0 || this.backdrop.overlayElementShown) { 1266 1321 return; 1267 1322 } 1268 1323 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); 1278 1338 }; 1279 1339 … … 1282 1342 return; 1283 1343 } 1284 this.backdrop.$element.removeClass( "tour-step-backdrop");1344 this.backdrop.$element.removeClass('tour-step-backdrop'); 1285 1345 this.backdrop.$background.remove(); 1286 1346 this.backdrop.$element = null; … … 1289 1349 }; 1290 1350 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 1291 1378 Tour.prototype._clearTimer = function() { 1292 1379 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 20142 +++ 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 20143 @@ -8 49,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 @@ 4 4 return step.path; 5 5 } 6 6 }).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; 9 9 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); 12 12 + } 13 13 + else { 14 14 + path = document.location.protocol+'//'+path; 15 +_this._redirect(step, path);15 _this._redirect(step, path); 16 16 + } 17 17 return; 18 18 } 19 19 if (_this._isOrphan(step)) { 20 @@ -8 66,6 +872,14 @@20 @@ -887,6 +893,14 @@ 21 21 } 22 22 _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true."); … … 33 33 _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0); 34 34 } 35 @@ - 988,7 +1002,7 @@35 @@ -1023,7 +1037,7 @@ 36 36 }; 37 37 38 38 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://", ""))); 41 41 }; 42 42
Note: See TracChangeset
for help on using the changeset viewer.