From 839feddb636e0d2fc0b5c15bd37c8424e36053ed Mon Sep 17 00:00:00 2001 From: lukemelia Date: Fri, 14 Sep 2007 05:44:01 +0000 Subject: [PATCH] Tweaks to the new stats page to implement a workaround for a bug in the Flash add-in for Firefox/Mac. The workaround involves removing the opacity from the header navigation area for the stats page. Also introduced FlashObject.js to handle Flash embedding, and removed some duplication in the views. This changeset should also resolve problems with the stats page for people who don't run tracks from the root of their website. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@589 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/views/layouts/standard.rhtml | 2 +- tracks/app/views/stats/_actions.rhtml | 39 ++++---- tracks/app/views/stats/_chart.rhtml | 6 +- tracks/app/views/stats/_contexts.rhtml | 17 ++-- tracks/app/views/stats/_projects.rhtml | 16 ++-- tracks/app/views/stats/_tags.rhtml | 7 +- tracks/app/views/stats/index.rhtml | 8 +- tracks/config/asset_packages.yml | 1 + tracks/public/javascripts/flashobject.js | 8 ++ .../{tracks_562.js => tracks_1189744942.js} | 3 +- tracks/public/stylesheets/standard.css | 18 +++- tracks/public/stylesheets/tracks_567.css | 3 + tracks/public/{ => swf}/open-flash-chart.swf | Bin .../vendor/plugins/flashobject_helper/README | 35 ++++++++ .../vendor/plugins/flashobject_helper/init.rb | 4 + .../plugins/flashobject_helper/install.rb | 5 ++ .../javascripts/flashobject.js | 8 ++ .../lib/flashobject_view_helper.rb | 85 ++++++++++++++++++ 18 files changed, 215 insertions(+), 50 deletions(-) create mode 100644 tracks/public/javascripts/flashobject.js rename tracks/public/javascripts/{tracks_562.js => tracks_1189744942.js} (96%) rename tracks/public/{ => swf}/open-flash-chart.swf (100%) create mode 100644 tracks/vendor/plugins/flashobject_helper/README create mode 100644 tracks/vendor/plugins/flashobject_helper/init.rb create mode 100644 tracks/vendor/plugins/flashobject_helper/install.rb create mode 100644 tracks/vendor/plugins/flashobject_helper/javascripts/flashobject.js create mode 100644 tracks/vendor/plugins/flashobject_helper/lib/flashobject_view_helper.rb diff --git a/tracks/app/views/layouts/standard.rhtml b/tracks/app/views/layouts/standard.rhtml index e467511e..51f7152c 100644 --- a/tracks/app/views/layouts/standard.rhtml +++ b/tracks/app/views/layouts/standard.rhtml @@ -23,7 +23,7 @@ window.onload=function(){ <%= @page_title %> - +

diff --git a/tracks/app/views/stats/_actions.rhtml b/tracks/app/views/stats/_actions.rhtml index 091dd254..5bd0574a 100755 --- a/tracks/app/views/stats/_actions.rhtml +++ b/tracks/app/views/stats/_actions.rhtml @@ -5,25 +5,26 @@ The minimum time to complete is <%= @actions_min_ttc_sec %>

In the last 30 days you created on average <%=@sum_actions_created_last30days/30%> actions and completed on average <%=@sum_actions_done_last30days/30%> actions per day. In the last 12 months you created on average <%=@sum_actions_created_last12months/12 %> actions -and completed on average <%=@sum_actions_done_last12months/12%> actions per month. -


-<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_done_last30days_data'} -%> -  -<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_done_last12months_data'} -%> +and completed on average <%=@sum_actions_done_last12months/12%> actions per month.

-


-<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_completion_time_data'} -%> -


-<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_visible_running_time_data'} -%> -  -<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_running_time_data'} -%> +<% %w{ actions_done_last30days_data + actions_done_last12months_data + actions_completion_time_data + }.each do |action| + %><%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => action)} -%><% + end +%> -


-<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_day_of_week_all_data'} -%> -  -<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_day_of_week_30days_data'} -%> +
-


-<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_time_of_day_all_data'} -%> -  -<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => '/stats/actions_time_of_day_30days_data'} -%> \ No newline at end of file +<% %w{ actions_visible_running_time_data + actions_running_time_data + actions_day_of_week_all_data + actions_day_of_week_30days_data + actions_day_of_week_30days_data + actions_time_of_day_all_data + actions_time_of_day_30days_data + }.each do |action| + %><%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => action)} -%><% + end +%> \ No newline at end of file diff --git a/tracks/app/views/stats/_chart.rhtml b/tracks/app/views/stats/_chart.rhtml index 8167023b..4f215656 100755 --- a/tracks/app/views/stats/_chart.rhtml +++ b/tracks/app/views/stats/_chart.rhtml @@ -1,5 +1 @@ - - - - - +<%= flashobject_tag "open-flash-chart.swf", :query_params => { 'width' => width, 'height' => height, 'data' => data}, :size => "#{width}x#{height}", :parameters => { 'allowScriptAccess' => 'sameDomain'}, :class_name => 'open-flash-chart' %> \ No newline at end of file diff --git a/tracks/app/views/stats/_contexts.rhtml b/tracks/app/views/stats/_contexts.rhtml index ee165c73..151ee32b 100755 --- a/tracks/app/views/stats/_contexts.rhtml +++ b/tracks/app/views/stats/_contexts.rhtml @@ -1,9 +1,9 @@ -


-<%= render :partial => 'chart', :locals => {:width => @pie_width, :height => @pie_height, :data => '/stats/context_total_actions_data'} -%> -  -<%= render :partial => 'chart', :locals => {:width => @pie_width, :height => @pie_height, :data => '/stats/context_running_actions_data'} -%> +<%= render :partial => 'chart', :locals => {:width => @pie_width, :height => @pie_height, :data => url_for(:action => 'context_total_actions_data')} -%> -

Top 5 Contexts
+<%= render :partial => 'chart', :locals => {:width => @pie_width, :height => @pie_height, :data => url_for(:action => 'context_running_actions_data')} -%> + +

+

Top 5 Contexts

<% 1.upto 5 do |i| %><%=i-%> - @@ -14,9 +14,10 @@
<% end -%> -

+
-

Top 5 Visible Contexts with uncomplete actions
+

+

Top 5 Visible Contexts with uncomplete actions

<% 1.upto 5 do |i| %><%=i-%> - @@ -27,4 +28,4 @@
<% end -%> -

\ No newline at end of file +
\ No newline at end of file diff --git a/tracks/app/views/stats/_projects.rhtml b/tracks/app/views/stats/_projects.rhtml index 6d6b65e1..971c9df7 100755 --- a/tracks/app/views/stats/_projects.rhtml +++ b/tracks/app/views/stats/_projects.rhtml @@ -1,5 +1,5 @@ -
-

Top 10 projects
+

+

Top 10 projects

<% i=0 @projects_and_actions.each do |p| i+=1 -%> @@ -11,9 +11,10 @@ <% end end %> +
-
-

Top 10 project in past 30 days
+

+

Top 10 project in past 30 days

<% i=0 @projects_and_actions_last30days.each do |p| i+=1 -%> @@ -25,9 +26,10 @@ <% end end %> +
-
-

Top 10 longest running projects
+

+

Top 10 longest running projects

<% i=0 @projects_and_runtime.each do |p| i+=1 -%> @@ -39,4 +41,4 @@ <% end end %> -
\ No newline at end of file +
\ No newline at end of file diff --git a/tracks/app/views/stats/_tags.rhtml b/tracks/app/views/stats/_tags.rhtml index 26b9e989..c424c6b1 100755 --- a/tracks/app/views/stats/_tags.rhtml +++ b/tracks/app/views/stats/_tags.rhtml @@ -1,5 +1,5 @@ -
-

Tag Cloud

+
+

Tag Cloud

<% if @tags_for_cloud.size < 1 %> no tags available <% @@ -12,4 +12,5 @@ -%> <% end end-%> -

\ No newline at end of file +

+
\ No newline at end of file diff --git a/tracks/app/views/stats/index.rhtml b/tracks/app/views/stats/index.rhtml index 1ffc5357..140b7882 100755 --- a/tracks/app/views/stats/index.rhtml +++ b/tracks/app/views/stats/index.rhtml @@ -1,19 +1,16 @@ -

Totals

+
+

Totals

<%= render :partial => 'totals' -%> - -

Actions

<%= render :partial => 'actions' -%> -

Contexts

<%= render :partial => 'contexts' -%> -

Projects

<%= render :partial => 'projects' -%> @@ -21,3 +18,4 @@

Tags

<%= render :partial => 'tags' -%> +
\ No newline at end of file diff --git a/tracks/config/asset_packages.yml b/tracks/config/asset_packages.yml index eb3b5762..e01160a8 100644 --- a/tracks/config/asset_packages.yml +++ b/tracks/config/asset_packages.yml @@ -15,6 +15,7 @@ javascripts: - niftycube - protoload - lowpro + - flashobject stylesheets: - tracks: - standard diff --git a/tracks/public/javascripts/flashobject.js b/tracks/public/javascripts/flashobject.js new file mode 100644 index 00000000..e7edd42c --- /dev/null +++ b/tracks/public/javascripts/flashobject.js @@ -0,0 +1,8 @@ +/** + * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ +if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/tracks/public/javascripts/tracks_562.js b/tracks/public/javascripts/tracks_1189744942.js similarity index 96% rename from tracks/public/javascripts/tracks_562.js rename to tracks/public/javascripts/tracks_1189744942.js index ba5cd484..640b9050 100644 --- a/tracks/public/javascripts/tracks_562.js +++ b/tracks/public/javascripts/tracks_1189744942.js @@ -740,4 +740,5 @@ else if(!params.id)params.id=selector.substring(id+1);selector=selector.substrin if(selector.classes.length==1){results=results.select(function(target){return $(target).hasClassName(selector.classes[0]);});}else if(selector.classes.length>1){results=results.select(function(target){var klasses=$(target).classNames();return selector.classes.all(function(klass){return klasses.include(klass);});});} if(descendant){this.results=this.results.concat(results);}else{++this.index;results.each(function(target){this.findElements(target,this.index==(this.selectors.length-1));}.bind(this));}}} LowPro.$$old=$$;LowPro.optimize$$=true;function $$(a,b){if(LowPro.optimize$$==false||b||a.indexOf("[")>=0) -return LowPro.$$old.apply(this,arguments);return new LowPro.SelectorLite(a.split(/\s+/)).get();} \ No newline at end of file +return LowPro.$$old.apply(this,arguments);return new LowPro.SelectorLite(a.split(/\s+/)).get();} +if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/tracks/public/stylesheets/standard.css b/tracks/public/stylesheets/standard.css index 1667b491..34c2a9f7 100644 --- a/tracks/public/stylesheets/standard.css +++ b/tracks/public/stylesheets/standard.css @@ -185,7 +185,11 @@ a.show_notes:hover, a.link_to_notes:hover {background-image: url(../images/notes width: 100%; z-index:1100; } - +body.stats #topbar { + filter: alpha(opacity=100); + -moz-opacity: 1; + opacity: 1; +} #date { float: left; width: 45%; @@ -1033,4 +1037,16 @@ button.positive, .widgets a.positive{ background-repeat:no-repeat; background-position:center center; background-color:black; +} +.stats_content .open-flash-chart, .stats_content .stats_module { + float: left; + width: 450px; + margin-right:20px; + padding-bottom:20px; +} +.stats_content h2 +{ + clear:both; + margin-top:15px; + margin-bottom:15px; } \ No newline at end of file diff --git a/tracks/public/stylesheets/tracks_567.css b/tracks/public/stylesheets/tracks_567.css index 5feace9a..2962a489 100644 --- a/tracks/public/stylesheets/tracks_567.css +++ b/tracks/public/stylesheets/tracks_567.css @@ -44,6 +44,7 @@ a.show_notes:hover, a.link_to_notes:hover {background-image: url(../images/notes #navlist a:link#current, #navlist a:visited#current, #navlist a:hover {border-bottom: 4px solid #CCC; padding-bottom: 2px; background: transparent; color: #CCC} #navlist a:hover {color: #CCC} #topbar {position: fixed; top: 0px; left: 0px; height: 68px; margin-bottom: 20px; clear: both; background-color: #000; filter: alpha(opacity=75); -moz-opacity: .75; opacity: .75; color: #eee; width: 100%; z-index:1100} +body.stats #topbar {filter: alpha(opacity=100); -moz-opacity: 1; opacity: 1} #date {float: left; width: 45%; padding-left: 15px; margin-top: 15px; margin-bottom: 5px; white-space: nowrap} #date h1 {font-size: 152%} #minilinks {text-align: right; position: fixed; right: 15px; top: 10px; font-size: 0.9em} @@ -191,6 +192,8 @@ button.positive, .widgets a.positive{ color: #498111} .bigWaiting {background-image:url('/images/bigWaiting.gif'); background-repeat:no-repeat; background-position:center 20%; background-color:white} .blackWaiting {background-image:url('/images/blackWaiting.gif'); background-repeat:no-repeat; background-position:center center; background-color:black} .bigBlackWaiting {background-image:url('/images/bigBlackWaiting.gif'); background-repeat:no-repeat; background-position:center center; background-color:black} +.stats_content .open-flash-chart, .stats_content .stats_module {float: left; width: 450px; margin-right:20px; padding-bottom:20px} +.stats_content h2 {clear:both; margin-top:15px; margin-bottom:15px} div.calendar {position: relative} .calendar, .calendar table {border: 1px solid #556; font-size: 11px; color: #000; cursor: default; background: #eef; z-index: 110; font-family: tahoma,verdana,sans-serif} .calendar .button {text-align: center; padding: 2px} diff --git a/tracks/public/open-flash-chart.swf b/tracks/public/swf/open-flash-chart.swf similarity index 100% rename from tracks/public/open-flash-chart.swf rename to tracks/public/swf/open-flash-chart.swf diff --git a/tracks/vendor/plugins/flashobject_helper/README b/tracks/vendor/plugins/flashobject_helper/README new file mode 100644 index 00000000..53d18f3e --- /dev/null +++ b/tracks/vendor/plugins/flashobject_helper/README @@ -0,0 +1,35 @@ +FlashObject v.1.0 +==================== +This FlashObject Helper is based on the flash view helper of the plugin http://laszlo-plugin.rubyforge.org/ + +It's only copy the FlashObject.js (version 1.5) on your public/javascript directory and register it in the AssetTagHelper of rails, +so for include the javascript in your page you only can add this (if you havn't yet): + +<%= javascript_include_tag :defaults %> + +or if you only need the flashobject add this: + +<%= javascript_include_tag "flashobject" %> + +The is very simple for add a Flash in your page add this: + +<%= flashobject_tag "/source/of/your/flash.swf" %> + +It's simple. + +You can add some options if you want: + +- div_id: the HTML +id+ of the +div+ element that is used to contain the Flash object; default "flashcontent" +- flash_id: the +id+ of the Flash object itself. +- background_color: the background color of the Flash object; default white +- flash_version: the version of the Flash player that is required; default "7" +- size: the size of the Flash object, in the form "100x100". Defaults to "100%x100%" +- variables: a Hash of initialization variables that are passed to the object; default {:lzproxied => false} +- parameters: a Hash of parameters that configure the display of the object; default {:scale => 'noscale'} +- fallback_html: HTML text that is displayed when the Flash player is not available. + +Example: +<%= flashobject_tag "/source/of/your/flash.swf", :size => "350x320" %> + + +Vist my website: http://blog.lipsiasoft.com \ No newline at end of file diff --git a/tracks/vendor/plugins/flashobject_helper/init.rb b/tracks/vendor/plugins/flashobject_helper/init.rb new file mode 100644 index 00000000..68711685 --- /dev/null +++ b/tracks/vendor/plugins/flashobject_helper/init.rb @@ -0,0 +1,4 @@ +# Author:: Davide D'Agostino Aka DAddYE +# WebSite:: http://www.lipsiasoft.com + +require 'flashobject_view_helper' \ No newline at end of file diff --git a/tracks/vendor/plugins/flashobject_helper/install.rb b/tracks/vendor/plugins/flashobject_helper/install.rb new file mode 100644 index 00000000..3771c200 --- /dev/null +++ b/tracks/vendor/plugins/flashobject_helper/install.rb @@ -0,0 +1,5 @@ +require 'fileutils' + +flashobject = File.dirname(__FILE__) + '/../../../public/javascripts/flashobject.js' +FileUtils.cp File.dirname(__FILE__) + '/javascripts/flashobject.js', flashobject unless File.exist?(flashobject) +puts IO.read(File.join(File.dirname(__FILE__), 'README')) \ No newline at end of file diff --git a/tracks/vendor/plugins/flashobject_helper/javascripts/flashobject.js b/tracks/vendor/plugins/flashobject_helper/javascripts/flashobject.js new file mode 100644 index 00000000..e7edd42c --- /dev/null +++ b/tracks/vendor/plugins/flashobject_helper/javascripts/flashobject.js @@ -0,0 +1,8 @@ +/** + * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ +if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/tracks/vendor/plugins/flashobject_helper/lib/flashobject_view_helper.rb b/tracks/vendor/plugins/flashobject_helper/lib/flashobject_view_helper.rb new file mode 100644 index 00000000..0bd1fb3e --- /dev/null +++ b/tracks/vendor/plugins/flashobject_helper/lib/flashobject_view_helper.rb @@ -0,0 +1,85 @@ +# Author:: Davide D'Agostino aka DAddYE +# WebSite:: http://www.lipsiasoft.com +require 'action_view' + +module ActionView #:nodoc: + module Helpers # :nodoc: + module FlashObjectHelper # :nodoc: + def self.included(base) + base.class_eval do + include InstanceMethods + end + end + module InstanceMethods + # Returns a set of tags that display a Flash object within an + # HTML page. + # + # Options: + # * :div_id - the HTML +id+ of the +div+ element that is used to contain the Flash object; default "flashcontent" + # * :flash_id - the +id+ of the Flash object itself. + # * :background_color - the background color of the Flash object; default white + # * :flash_version - the version of the Flash player that is required; default "7" + # * :size - the size of the Flash object, in the form "100x100". Defaults to "100%x100%" + # * :variables - a Hash of initialization variables that are passed to the object; default {:lzproxied => false} + # * :parameters - a Hash of parameters that configure the display of the object; default {:scale => 'noscale'} + # * :fallback_html - HTML text that is displayed when the Flash player is not available. + # + # The following options are for developers. They default to true in + # development mode, and false otherwise. + # * :check_for_javascript_include - if true, the return value will cause the browser to display a diagnostic message if the FlashObject JavaScript was not included. + # * :verify_file_exists - if true, the return value will cause the browser to display a diagnostic message if the Flash object does not exist. + # + # (This method is called flashobject_tag instead of flashobject_tag + # because it returns a *sequence* of HTML tags: a +div+, followed by + # a +script+.) + def flashobject_tag source, options={} + source = flash_path(source) + query_params = '?' + options[:query_params].map{ |key, value| "#{key}=#{value}" }.join('&') if options[:query_params] + div_id = options[:div_id] || "flashcontent_#{rand(1_100)}" + flash_id = options[:flash_id] || File.basename(source, '.swf') + "_#{rand(1_100)}" + width, height = (options[:size]||'100%x100%').scan(/^(\d*%?)x(\d*%?)$/).first + background_color = options[:background_color] || '#ffffff' + flash_version = options[:flash_version] || 7 + class_name = options[:class_name] || 'flash' + variables = options.fetch(:variables, {}) + parameters = options.fetch(:parameters, {:scale => 'noscale'}) + fallback_html = options[:fallback_html] || %q{

Requires the Flash plugin. If the plugin is already installed, click here.

} + if options.fetch(:check_for_javascript_include, ENV['RAILS_ENV'] == 'development') + check_for_javascript ="if (typeof FlashObject == 'undefined') document.getElementById('#{div_id}').innerHTML = 'Warning: FlashObject is undefined. Did you forget to execute rake update_javascripts, or to include <%= javascript_include_tag :defaults %> in your view file?';" + end + return <<-"EOF" +
+ #{fallback_html} +
+ +EOF + end + + # Computes the path to a flash asset in the public swf directory. + # If the +source+ filename has no extension, .swf will be appended. + # Full paths from the document root will be passed through. + # + # flash_path "movie" # => /swf/movie.swf + # flash_path "dir/movie.swf" # => /swf/dir/movie.swf + # flash_path "/dir/movie" # => /dir/movie.swf + def flash_path(source) + compute_public_path(source, 'swf', 'swf', false) + end + + end + end + end +end + +ActionView::Base.class_eval do + include ActionView::Helpers::FlashObjectHelper +end + +ActionView::Helpers::AssetTagHelper.register_javascript_include_default 'flashobject' \ No newline at end of file