Permalink
Browse files

- Implement drag/drop reorderable list items

- Add jQueryUI custom build (for just drag/drop components)
- Refactor blast javascript tag to blast.js
- Rename style.css -> blast.css
  • Loading branch information...
kwlzn
kwlzn committed Jul 28, 2012
1 parent aaceb95 commit 54542d1b1fec016dbabadd3f9bf35dd797f9b2aa
View
@@ -99,7 +99,7 @@ blast currently leverages the following open source components to speed developm
- Flask (http://flask.pocoo.org/)
- SoundManager2 (http://www.schillmania.com/projects/soundmanager2/)
- SoundManager2 Page Player (http://www.schillmania.com/projects/soundmanager2/demo/page-player/)
-- jQuery (http://jquery.com/)
+- jQuery / jQueryUI (http://jquery.com/, http://jqueryui.com)
- jQuery Shuffle Plugin (http://yelotofu.com/labs/jquery/snippets/shuffle/)
- Bootstrap (http://twitter.github.com/bootstrap/)
- Sticky (http://thrivingkings.com/sticky)
View
9 TODO
@@ -18,19 +18,20 @@ trunk/0.3
[x] make installable via python easy_install for quick setup
[x] fix README formatting problems
[x] fix loading of files with unicode characters in name (proper html entity conversion)
- [ ] fix modal visibility problem on start
+ [x] drag/drop reordering
+ [x] fix modal visibility problem on start
+ [ ] properly center the modal help window
[ ] automate pypi upload:
export COPYFILE_DISABLE=true
python setup.py sdist upload
backlog
- [ ] properly center the modal help window
+ [ ] make prev track work in shuffle mode
[ ] markers / cue points
[ ] A-B looping
[ ] make html5 player work with seeking, reenable preferflash: false
[ ] make player loop to beginning on finish of last track
[ ] verify progress meter updates on iOS (after making html5 player work)
- [ ] make prev track work in shuffle mode
[ ] figure out why 'MS5/jj - a jj 12_ (2009)_' is broken
[ ] figure out a good way to automate testing of broken loads
[ ] use databinding to reduce mem size for larger lists; investigate album-based pagination
@@ -53,4 +54,4 @@ backlog
[ ] service framework (offline scanning, indexing and other tasks)
[ ] ui views for internal scanner/indexer state: 15,000/25,000 files scanned etc
[ ] scan phases: names, stat, id tags, mp3sum (checksum of data part of mp3), total checksum
- [ ] drag/drop reordering + pop-out playlist controls
+ [ ] pop-out playlist controls
File renamed without changes.
View
@@ -0,0 +1,84 @@
+// Make our playlist items drag/droppable
+$(function() {
+ $( ".sortable" ).sortable();
+ $( ".sortable" ).disableSelection();
+});
+
+// Setup keyboard shortcuts
+keyPressDebug = false;
+jQuery(function($){
+ $('body').keypress(function(e){
+ var code = (e.keyCode ? e.keyCode : e.which);
+ // debug actions
+ //$('div#notifications').html(code);
+ if (keyPressDebug) { $.sticky('keycode: ' + code); }
+ // ref: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
+ if (code == 63) { // ? (toggle help)
+ $('#helpmodal').modal('toggle');
+ } else if (code == 13) { // enter (select track)
+ $.sticky('enter')
+ } else if (code == 99) { // c (toggle pause)
+ soundManager.togglePause(pagePlayer.lastSound.id);
+ $.sticky('toggling pause');
+ } else if (code == 100) { // d (toggle debug)
+ keyPressDebug = keyPressDebug ? false : true;
+ $.sticky('debug:'+keyPressDebug);
+ } else if (code == 109) { // m (toggle mute)
+ $.sticky('toggling mute');
+ soundManager.toggleMute(pagePlayer.lastSound.id);
+ } else if (code == 114) { // r (randomize list)
+ soundManager.stopAll();
+ $.sticky('randomizing!');
+ $('ul').shuffle();
+ } else if (code == 115) { // s (toggle shuffle)
+ if (pagePlayer.shuffle == true) { pagePlayer.shuffle = false; }
+ else { pagePlayer.shuffle = true; }
+ $.sticky('shuffle: '+pagePlayer.shuffle);
+ } else if (code == 110 || // n (next track)
+ code == 106 || code == 98) { // j, b
+ $.sticky('play next track');
+ pagePlayer.playNext();
+ } else if (code == 107 || code == 122) { // k, z (prev track)
+ $.sticky('play prev track');
+ if (!pagePlayer.shuffle) { pagePlayer.playPrevious(); }
+ } else if (code == 120) { // x (stop)
+ $.sticky('stop');
+ soundManager.stopAll();
+ // Reset position to 0
+ if (pagePlayer.lastSound) { soundManager.setPosition(pagePlayer.lastSound.id, 0); }
+ } else if (code == 118) { // v (play)
+ $.sticky('play');
+ if (pagePlayer.lastSound) {
+ pagePlayer.lastSound.play();
+ } else {
+ pagePlayer.startPlay();
+ }
+ } else if (code == 48) { // 0 (reset trackhead to 0)
+ $.sticky('reset');
+ if (pagePlayer.lastSound) { soundManager.setPosition(pagePlayer.lastSound.id, 0); }
+ } else if (code == 44 || // ,
+ code == 91 || code == 123) { // [, { (skip behind)
+ var pos = pagePlayer.lastSound.position;
+ //$.sticky(pos);
+ if (code == 44) { pos -= 1000; // jump behind 1 seconds for ,
+ } else if (code == 123) { pos -= 5000; // jump behind 5 seconds for {
+ } else { pos -= 30000; } // jump behind 30 seconds for [
+ if (pos < 0) { pos = 0; }
+ $.sticky('rewind: '+((pos-pagePlayer.lastSound.position)/1000)+'s');
+ soundManager.setPosition(pagePlayer.lastSound.id, pos);
+ } else if (code == 46 || // .
+ code == 93 || code == 125) { // ], } (skip ahead)
+ var pos = pagePlayer.lastSound.position;
+ if (code == 46) { pos += 1000; // jump ahead 1 seconds for .
+ } else if (code == 125) { pos += 5000; // jump ahead 5 seconds for }
+ } else { pos += 30000; } // jump ahead 30 seconds for ]
+ if (pagePlayer.lastSound.loaded == false) {
+ if (pos > pagePlayer.lastSound.durationEstimate) { pos = pagePlayer.lastSound.durationEstimate; }
+ } else {
+ if (pos > pagePlayer.lastSound.duration) { pos = pagePlayer.lastSound.duration; }
+ }
+ $.sticky('skip: +'+((pos-pagePlayer.lastSound.position)/1000)+'s');
+ soundManager.setPosition(pagePlayer.lastSound.id, pos);
+ }
+ });
+});
Oops, something went wrong.

0 comments on commit 54542d1

Please sign in to comment.