diff options
Diffstat (limited to 'mediagoblin/static')
-rw-r--r-- | mediagoblin/static/css/audio.css | 3 | ||||
-rw-r--r-- | mediagoblin/static/css/base.css | 13 | ||||
-rw-r--r-- | mediagoblin/static/js/audio.js | 24 | ||||
-rw-r--r-- | mediagoblin/static/js/geolocation-map.js | 6 | ||||
-rw-r--r-- | mediagoblin/static/js/header_dropdown.js | 24 | ||||
-rw-r--r-- | mediagoblin/static/js/post_comment.js | 63 | ||||
-rw-r--r-- | mediagoblin/static/js/show_password.js | 2 |
7 files changed, 107 insertions, 28 deletions
diff --git a/mediagoblin/static/css/audio.css b/mediagoblin/static/css/audio.css index 5c50e727..de388094 100644 --- a/mediagoblin/static/css/audio.css +++ b/mediagoblin/static/css/audio.css @@ -24,10 +24,11 @@ font-size: 40px; width: 50px; text-shadow: 0 0 10px black; + background: none; + border: none; } .audio-control-play-pause.playing { color: #b71500; - letter-spacing: -17px; margin-left: -7px; } .audio-control-play-pause.paused { diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 7852cae9..6da19f94 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -394,6 +394,12 @@ text-align: center; margin-right: auto; } +.form_box > h1, .form_box_xl > h1 { + /* Fix header overflowing issue. */ + overflow: hidden; + text-overflow: ellipsis +} + .form_box_xl { max-width: 460px; } @@ -457,11 +463,9 @@ text-align: center; } .form_field_label { - margin-bottom: 4px; -} - -.form_field_label { font-size:1.125em; + margin-bottom: 0; + padding: 10px 0; } .form_field_description { @@ -585,7 +589,6 @@ ul#action_to_resolve {list-style:none; margin-left:10px;} border-radius: 0 0 5px 5px; padding: 0 0 6px; text-overflow: ellipsis; - white-space: nowrap; overflow: hidden; border-color: #0D0D0D; border-style: solid; diff --git a/mediagoblin/static/js/audio.js b/mediagoblin/static/js/audio.js index 50d58cd9..59a8c801 100644 --- a/mediagoblin/static/js/audio.js +++ b/mediagoblin/static/js/audio.js @@ -116,6 +116,10 @@ var audioPlayer = new Object(); var im = audioPlayer.imageElement; var pos = (e.offsetX || e.originalEvent.layerX) / im.width(); + console.log('pos', (e.offsetX || e.originalEvent.layerX) / im.width()) + console.log('setting current time to', + pos * audioPlayer.audioElement.duration) + audioPlayer.audioElement.currentTime = pos * audioPlayer.audioElement.duration; audioPlayer.audioElement.play(); audioPlayer.setState(audioPlayer.PLAYING); @@ -151,14 +155,16 @@ var audioPlayer = new Object(); switch (state) { case audioPlayer.PLAYING: - $('.audio-spectrogram .audio-control-play-pause') + el = $('.audio-spectrogram .audio-control-play-pause') .removeClass('paused').addClass('playing') - .text('▮▮'); + .text('▮▮').attr('aria-label', 'Pause'); + el[0].setAttribute('aria-label', 'Pause') break; case audioPlayer.PAUSED: - $('.audio-spectrogram .audio-control-play-pause') + el = $('.audio-spectrogram .audio-control-play-pause') .removeClass('playing').addClass('paused') - .text('▶'); + .text('▶').attr('aria-label', 'Play'); + el[0].setAttribute('aria-label', 'Play') break; } }; @@ -200,19 +206,9 @@ var audioPlayer = new Object(); * Attach the player to an image element */ console.log(imageElement); - var im = $(imageElement); - audioPlayer.imageElement = im; - $('<div class="playhead"></div>').appendTo(im.parent()); - $('<div class="buffered-indicators"></div>').appendTo(im.parent()); - $('<div class="seekbar"></div>').appendTo(im.parent()); - $('<div class="audio-control-play-pause paused">▶</div>').appendTo(im.parent()); - $('<div class="audio-currentTime">00:00</div>').appendTo(im.parent()); - $('<input type="range" class="audio-volume"' - +'value="1" min="0" max="1" step="0.001" />').appendTo(im.parent()); - $('.audio-spectrogram').trigger('attachedControls'); }; })(audioPlayer); diff --git a/mediagoblin/static/js/geolocation-map.js b/mediagoblin/static/js/geolocation-map.js index 26d94c5d..c30788f7 100644 --- a/mediagoblin/static/js/geolocation-map.js +++ b/mediagoblin/static/js/geolocation-map.js @@ -30,13 +30,11 @@ $(document).ready(function () { // Get a new map instance attached and element with id="tile-map" var map = new L.Map('tile-map'); - var mqtileUrl = 'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg'; + var mqtileUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var mqtileAttrib = '<a id="osm_license_link">see map license</a>'; var mqtile = new L.TileLayer( mqtileUrl, - {maxZoom: 18, - attribution: mqtileAttrib, - subdomains: '1234'}); + {maxZoom: 18}); map.attributionControl.setPrefix(''); var location = new L.LatLng(latitude, longitude); diff --git a/mediagoblin/static/js/header_dropdown.js b/mediagoblin/static/js/header_dropdown.js index 3ee46228..979d2690 100644 --- a/mediagoblin/static/js/header_dropdown.js +++ b/mediagoblin/static/js/header_dropdown.js @@ -17,9 +17,27 @@ */ $(document).ready(function(){ - $("#header_dropdown").hide(); - $(".header_dropdown_up").hide(); - $(".header_dropdown_down,.header_dropdown_up").click(function() { + // The header drop-down header panel defaults to open until you explicitly + // close it. After that, the panel open/closed setting will persist across + // page loads. + + // Initialise the panel status when page is loaded. + if (localStorage.getItem("panel_closed")) { + $("#header_dropdown").hide(); + $(".header_dropdown_up").hide(); + } + else { + $(".header_dropdown_down").hide(); + } + + // Toggle and persist the panel status. + $(".header_dropdown_down, .header_dropdown_up").click(function() { + if (localStorage.getItem("panel_closed")) { + localStorage.removeItem("panel_closed"); + } + else { + localStorage.setItem("panel_closed", "true"); + } $(".header_dropdown_down").toggle(); $(".header_dropdown_up").toggle(); $("#header_dropdown").slideToggle(); diff --git a/mediagoblin/static/js/post_comment.js b/mediagoblin/static/js/post_comment.js new file mode 100644 index 00000000..431c222f --- /dev/null +++ b/mediagoblin/static/js/post_comment.js @@ -0,0 +1,63 @@ +/** + * GNU MediaGoblin -- federated, autonomous media hosting + * Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +$(document).ready(function(){ + $(function() { + // Hide this button if script is enabled + $('.form_submit_buttons').find('input').hide(); + + // Include this link if script is enabled + $('.form_submit_buttons').append( + '<a class="button_action" id="post_comment" type="button">' + + 'Add this comment </a>'); + + $('#post_comment').click(function() { + $.ajax({ + url: $('#postCommentURL').val(), + data: $('#form_comment').serialize(), + type: 'POST', + success: function(response) { + var message = $(response).find('.mediagoblin_messages'); + var commentsInResponse = $($(response).find('.media_comments')).find('li'); + var commentsInPage = $('.media_comments').find('ul'); + + // Post the message + message.css({"position":"fixed", "top":"50px", "width":"100%"}); + $('body').append(message); + message.delay(1500).fadeOut(); + + // Checking if there is new comment + if(commentsInResponse.length != $(commentsInPage).find('li').length) { + // Post comment and scroll down to it + var newComment = commentsInResponse[commentsInResponse.length - 1]; + $('#form_comment').fadeOut('fast'); + $('#button_addcomment').fadeIn('fast'); + $('#comment_preview').replaceWith("<div id=comment_preview></div>"); + $(commentsInPage).append(newComment); + $('html, body').animate({ + scrollTop: $(newComment).offset().top + }, 1000); + } + }, + error: function(error) { + console.log(error); + } + }); + }); + }); +});
\ No newline at end of file diff --git a/mediagoblin/static/js/show_password.js b/mediagoblin/static/js/show_password.js index b3fbc862..12935124 100644 --- a/mediagoblin/static/js/show_password.js +++ b/mediagoblin/static/js/show_password.js @@ -18,7 +18,7 @@ $(document).ready(function(){ //Create a duplicate password field. We could change the input type dynamically, but this angers the IE gods (not just IE6). - $("#password").after('<input type="text" value="" name="password_clear" id="password_clear" /><label><input type="checkbox" id="password_boolean" />Show password</label>'); + $("#password").after('<input type="text" value="" name="password_clear" id="password_clear" style="width:100%" /><label><br/><input type="checkbox" id="password_boolean" />Show password</label>'); $('#password_clear').hide(); $('#password_boolean').click(function(){ if($('#password_boolean').prop("checked")) { |