OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This variable will be changed by iOS scripts. | 5 // This variable will be changed by iOS scripts. |
6 var distiller_on_ios = false; | 6 var distiller_on_ios = false; |
7 | 7 |
8 function addToPage(html) { | 8 function addToPage(html) { |
9 var div = document.createElement('div'); | 9 var div = document.createElement('div'); |
10 div.innerHTML = html; | 10 div.innerHTML = html; |
(...skipping 22 matching lines...) Expand all Loading... |
33 container.setAttribute('class', 'youtubeContainer'); | 33 container.setAttribute('class', 'youtubeContainer'); |
34 container.appendChild(embed); | 34 container.appendChild(embed); |
35 | 35 |
36 parent.replaceChild(container, placeholders[i]); | 36 parent.replaceChild(container, placeholders[i]); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 function showLoadingIndicator(isLastPage) { | 40 function showLoadingIndicator(isLastPage) { |
41 document.getElementById('loadingIndicator').className = | 41 document.getElementById('loadingIndicator').className = |
42 isLastPage ? 'hidden' : 'visible'; | 42 isLastPage ? 'hidden' : 'visible'; |
43 // This function will be one of the last things to occur when a page is | |
44 // loaded. This is temporarily used to signal print preview to generate | |
45 // a PDF. | |
46 if (isLastPage && typeof isPrintPreviewDistiller !== 'undefined' | |
47 && isPrintPreviewDistiller) { | |
48 setTimeout(function() { | |
49 window.location = window.location + "#loaded"; | |
50 }, 0); | |
51 } | |
52 } | 43 } |
53 | 44 |
54 // Sets the title. | 45 // Sets the title. |
55 function setTitle(title) { | 46 function setTitle(title) { |
56 var holder = document.getElementById('titleHolder'); | 47 var holder = document.getElementById('titleHolder'); |
57 | 48 |
58 holder.textContent = title; | 49 holder.textContent = title; |
59 document.title = title; | 50 document.title = title; |
60 } | 51 } |
61 | 52 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 clampedScale = scaling; | 395 clampedScale = scaling; |
405 restoreCenter(); | 396 restoreCenter(); |
406 } | 397 } |
407 }; | 398 }; |
408 }()); | 399 }()); |
409 | 400 |
410 window.addEventListener('touchstart', pincher.handleTouchStart, false); | 401 window.addEventListener('touchstart', pincher.handleTouchStart, false); |
411 window.addEventListener('touchmove', pincher.handleTouchMove, false); | 402 window.addEventListener('touchmove', pincher.handleTouchMove, false); |
412 window.addEventListener('touchend', pincher.handleTouchEnd, false); | 403 window.addEventListener('touchend', pincher.handleTouchEnd, false); |
413 window.addEventListener('touchcancel', pincher.handleTouchCancel, false); | 404 window.addEventListener('touchcancel', pincher.handleTouchCancel, false); |
OLD | NEW |