Changeset 1257332
- Timestamp:
- 10/01/2015 11:06:08 AM (11 years ago)
- Location:
- react-webcam/trunk
- Files:
-
- 1 added
- 4 edited
-
css/react-webcam.css (modified) (5 diffs)
-
img/loader.gif (added)
-
js/Webcam.js (modified) (7 diffs)
-
react-webcam.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
react-webcam/trunk/css/react-webcam.css
r1255686 r1257332 4 4 5 5 6 /* Current image with info andnavigation */6 /* Current image with navigation */ 7 7 div.rwc-image-container { 8 8 position: relative; … … 10 10 padding: 56.25% 0 0 0; 11 11 } 12 div.rwc-image-container img { 13 display: block; 14 max-width: 100%; 15 max-height: 100%; 12 div.rwc-image-container * { 16 13 position: absolute; 17 14 top: 0; … … 19 16 bottom: 0; 20 17 left: 0; 21 }22 div.rwc-image-container span {23 z-index: 100;24 position: absolute;25 top: 0;26 bottom: 0;27 width: 30%;28 cursor: pointer;29 18 text-indent: 100%; 30 19 white-space: nowrap; 31 20 overflow: hidden; 21 } 22 div.rwc-image-container img { 23 display: block; 24 max-width: 100%; 25 max-height: 100%; 26 } 27 div.rwc-image-container span.rwc-loading { 28 z-index: 90; 29 background: url('../img/loader.gif') no-repeat center rgba(255,255,255,0.1); 30 } 31 div.rwc-image-container span.prev, 32 div.rwc-image-container span.next { 33 z-index: 100; 34 cursor: pointer; 32 35 -webkit-touch-callout: none; 33 36 -webkit-user-select: none; … … 37 40 user-select: none; 38 41 } 39 div.rwc-image-container span.prev { left: 0; }40 div.rwc-image-container span.next { right: 0; }42 div.rwc-image-container span.prev { right: 70%; } 43 div.rwc-image-container span.next { left: 70%; } 41 44 div.rwc-image-container span.next:hover { 42 45 background: url('../img/right.png') no-repeat right 1em center; … … 47 50 div.rwc-image-container a.full-resolution { 48 51 z-index: 100; 49 position: absolute;50 top: 0;51 bottom: 0;52 52 left: 30%; 53 53 right: 30%; 54 text-indent: 100%;55 white-space: nowrap;56 overflow: hidden;57 54 } 55 56 57 /* Info under webcam image */ 58 58 p.rwc-info { 59 59 background-color: #a9a9a9; -
react-webcam/trunk/js/Webcam.js
r1256905 r1257332 15 15 history: server.initialHistory, 16 16 selectedItemIndex: 0, 17 secondsToRefresh: server.refreshInterval + INITIAL_REFRESH_DELAY 17 secondsToRefresh: server.refreshInterval + INITIAL_REFRESH_DELAY, 18 loading: true 18 19 }; 19 20 … … 28 29 this.setState({ secondsToRefresh: server.refreshInterval }); 29 30 if (this.state.selectedItemIndex == 0) { 30 this.setState({ history: JSON.parse(xhr.responseText) }); 31 this.setState({ 32 history: JSON.parse(xhr.responseText), 33 loading: true 34 }); 31 35 } 32 36 } … … 60 64 } 61 65 this.setState({ 62 selectedItemIndex: index 66 selectedItemIndex: index, 67 loading: true 63 68 }); 64 69 }, … … 67 72 var i = this.state.selectedItemIndex; 68 73 if (i < this.state.history.length - 1) 69 this.setState({ selectedItemIndex: i + 1 }); 74 this.setState({ 75 selectedItemIndex: i + 1, 76 loading: true 77 }); 70 78 }, 71 79 … … 73 81 var i = this.state.selectedItemIndex; 74 82 if (i > 0) 75 this.setState({ selectedItemIndex: i - 1 }); 83 this.setState({ 84 selectedItemIndex: i - 1, 85 loading: true 86 }); 76 87 88 }, 89 90 imageLoaded: function() { 91 this.setState({ 92 loading: false 93 }) 77 94 }, 78 95 … … 115 132 React.createElement('div', null, 116 133 React.createElement('div', { className: 'rwc-image-container' }, 117 React.createElement('img', { src: currentImageUrl, width: 1920, height: 1080 }), 134 React.createElement('img', { 135 src: currentImageUrl, 136 onLoad: this.imageLoaded, 137 width: 1920, 138 height: 1080 139 }), 118 140 firstImageActive ? null : React.createElement('span', { 119 141 className: 'prev', … … 133 155 title: 'Plné rozlišení' 134 156 }, 135 'Plné rozlišení') 157 'Plné rozlišení'), 158 this.state.loading 159 ? React.createElement('span', { 160 className: 'rwc-loading' 161 }, 162 'Načítání') 163 : null 136 164 ), 137 165 React.createElement('p', { className: 'rwc-info' }, -
react-webcam/trunk/react-webcam.php
r1257256 r1257332 2 2 /* 3 3 Plugin Name: React Webcam 4 Version: 2. 2.04 Version: 2.3.0 5 5 Author: Radek Matej 6 6 Description: Add auto-refreshing image from your webcam to any page. -
react-webcam/trunk/readme.txt
r1246533 r1257332 30 30 = 1.1 = 31 31 * Configurable refresh interval. 32 33 = 2.3.0 = 34 * Image loading indicator
Note: See TracChangeset
for help on using the changeset viewer.