Show More
@@ -120,17 +120,22 b' function selectFileChoice() {' | |||||
120 | }); |
|
120 | }); | |
121 | } |
|
121 | } | |
122 |
|
122 | |||
123 | var source = localStorage.getItem(ITEM_FILE_SOURCE); |
|
123 | var $fileSourceButton = $('#file-source-button'); | |
124 | if (source == null) { |
|
124 | if (window.localStorage) { | |
125 | source = 'file'; |
|
125 | var source = localStorage.getItem(ITEM_FILE_SOURCE); | |
126 | } |
|
126 | if (source == null) { | |
127 |
|
|
127 | source = 'file'; | |
128 | $('#id_file_url').parent().parent().hide(); |
|
128 | } | |
|
129 | if (source == 'file') { | |||
|
130 | $('#id_file_url').parent().parent().hide(); | |||
|
131 | } else { | |||
|
132 | $('#id_file').parent().parent().hide(); | |||
|
133 | } | |||
|
134 | ||||
|
135 | $fileSourceButton.click(function() { | |||
|
136 | selectFileChoice(); | |||
|
137 | }); | |||
129 | } else { |
|
138 | } else { | |
130 |
$ |
|
139 | $fileSourceButton.hide(); | |
131 | } |
|
140 | } | |
132 |
|
||||
133 | $('#file-source-button').click(function() { |
|
|||
134 | selectFileChoice(); |
|
|||
135 | }); |
|
|||
136 | }); |
|
141 | }); |
@@ -123,6 +123,7 b' function getVolumeLevel() {' | |||||
123 | } |
|
123 | } | |
124 |
|
124 | |||
125 | function processVolumeUser(node) { |
|
125 | function processVolumeUser(node) { | |
|
126 | if (!window.localStorage) return; | |||
126 | node.prop("volume", getVolumeLevel()); |
|
127 | node.prop("volume", getVolumeLevel()); | |
127 | node.on('volumechange', function(event) { |
|
128 | node.on('volumechange', function(event) { | |
128 | setVolumeLevel(event.target.volume); |
|
129 | setVolumeLevel(event.target.volume); | |
@@ -140,6 +141,15 b' function addScriptsToPost(post) {' | |||||
140 | processVolumeUser(post.find("video,audio")); |
|
141 | processVolumeUser(post.find("video,audio")); | |
141 | } |
|
142 | } | |
142 |
|
143 | |||
|
144 | /** | |||
|
145 | * Fix compatibility issues with some rare browsers | |||
|
146 | */ | |||
|
147 | function compatibilityCrutches() { | |||
|
148 | if (window.operamini) { | |||
|
149 | $('#form textarea').each(function() { this.placeholder = ''; }); | |||
|
150 | } | |||
|
151 | } | |||
|
152 | ||||
143 | $( document ).ready(function() { |
|
153 | $( document ).ready(function() { | |
144 | hideEmailFromForm(); |
|
154 | hideEmailFromForm(); | |
145 |
|
155 | |||
@@ -158,4 +168,6 b' function addScriptsToPost(post) {' | |||||
158 |
|
168 | |||
159 | var volumeUsers = $("video,audio"); |
|
169 | var volumeUsers = $("video,audio"); | |
160 | processVolumeUser(volumeUsers); |
|
170 | processVolumeUser(volumeUsers); | |
|
171 | ||||
|
172 | compatibilityCrutches(); | |||
161 | }); |
|
173 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now