Permalink
Browse files

Removed duplicate javascript includes in work.html.haml and the

application helper. Modified code so tags are dynamic now.
  • Loading branch information...
1 parent 2c4855a commit f4ae00e47e26e8dc1add54a8dd288f92f8c0e770 Aaron Hunter committed May 2, 2011
Showing with 19 additions and 13 deletions.
  1. +11 −8 app/views/jobs/work.html.haml
  2. 0 main
  3. +8 −5 public/javascripts/application.js
  4. 0 temp
@@ -1,7 +1,4 @@
-= javascript_include_tag "/jwplayer/jwplayer.js"
-= javascript_include_tag "/javascripts/coveTag.js"
-
-%script
+%script
-# Init global variables
var timerDiv = "prog";
var progressBar = "progbar";
@@ -24,11 +21,17 @@
#prog
#progbar []
--# Hold to click:
- %button#tagbutton Hold to tag riffing
+- @job.codes.each_index do |i|
+ -# Hold to click:
+ - tagButton_hold = "tagButton_hold_" + @job.codes[i].name
+ - tagButton_toggle = "tagButton_toggle_" + @job.codes[i].name
+
+ %button(id=tagButton_hold)
+ = "Hold to tag " << @job.codes[i].name
--# Push to toggle:
-%button#tagbutton_2 Click to Toggle Riffing
+ -# Push to toggle:
+ %button(id=tagButton_toggle)
+ = "Click to toggle " << @job.codes[i].name
%h3 Active Tags
#activeTags
View
0 main
No changes.
@@ -1,5 +1,4 @@
$(document).ready(function(){
-
// jwplayer config for job work page
jwplayer("jwplayer_container").setup({
flashplayer: "/jwplayer/player.swf",
@@ -16,7 +15,11 @@ $(document).ready(function(){
});
// javascript events for job work page
- $('#tagButton').bind("mousedown mouseup", function() { handleTagClick('Riffing') });
- $('#tagButton').mouseout(function() { handleTagClick('Riffing', true )});
- $('#tagButton_2').click(function() { handleTagClick('Riffing') });
-});
+ for (i=0; i<activeTag.length; i++) {
+ var tagValue = activeTag[i][0];
+
+ $('#tagButton_hold_' + tagValue).bind("mousedown mouseup", { vars: tagValue }, function() { handleTagClick(tagValue) });
+ $('#tagButton_hold_' + tagValue).mouseout(function() { destroyPartialTags() });
+ $('#tagButton_toggle_' + tagValue).click( { vars: tagValue}, function() { handleTagClick(tagValue) });
+ }
+});
View
0 temp
No changes.

0 comments on commit f4ae00e

Please sign in to comment.