ofc2 2.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.rdoc +47 -0
- data/Gemfile.lock +3 -1
- data/LICENSE +21 -0
- data/README.rdoc +26 -0
- data/lib/ofc2.rb +14 -13
- data/lib/ofc2/version.rb +1 -1
- data/ofc2.gemspec +2 -0
- data/vendor/assets/flash/VERSION.txt +2 -0
- data/vendor/assets/flash/expressInstall.swf +0 -0
- data/vendor/assets/flash/open-flash-chart.swf +0 -0
- data/vendor/assets/javascripts/swfobject.js +4 -0
- metadata +22 -9
- data/CHANGES +0 -44
- data/MIT-LICENSE +0 -18
- data/README +0 -23
- data/assets/VERSION.txt +0 -2
- data/assets/open-flash-chart.swf +0 -0
- data/assets/swfobject.js +0 -5
data/CHANGES.rdoc
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
[2.0.1 (23.01.2012)]
|
2
|
+
* move assets to vendor
|
3
|
+
* some docs
|
4
|
+
* use latest community released {swf}[http://openflashchart.com/]
|
5
|
+
[2.0 (23.01.2012)]
|
6
|
+
* release as a gem
|
7
|
+
[1.0 (23.01.2011)]
|
8
|
+
* moved to {open-flash-chart-2-lug-wyrm-charmer}[http://teethgrinder.co.uk/open-flash-chart-2/downloads.php]
|
9
|
+
* added animation for charts
|
10
|
+
[1.0 (rc-2 : 03.05.2009)]
|
11
|
+
* moved to {open-flash-chart-2-ichor}[http://teethgrinder.co.uk/open-flash-chart-2/downloads.php]
|
12
|
+
* initialize methods has changed !!!
|
13
|
+
now use a hash eg.
|
14
|
+
OFC2::SomeClass.new(:option => value, :option2 => other_value)
|
15
|
+
I find it more readable that old way.
|
16
|
+
* add radar {charts}[http://openflashchart2.heroku.com/chart_examples/radar]
|
17
|
+
* remove pseudo horizontal stacked bar example
|
18
|
+
[0.9 (rc-1 : 15.04.2009)]
|
19
|
+
* remove to_json method from OWJSON module
|
20
|
+
* remove remove require 'json' from plugin
|
21
|
+
* migrate sample application to rails 2.3
|
22
|
+
* remove gem 'json' from enviroment.rb
|
23
|
+
[0.8 (rc-1 : 09.01.2009)]
|
24
|
+
* add shape drawning support, example is here: http://openflashchart2.sentor.pl/chart_examples/mix_advanced_draw_shape
|
25
|
+
* add stacked bar keys support: http://openflashchart2.sentor.pl/chart_examples/stacked_bar
|
26
|
+
* pseudo horizontal stacked bar, example: http://openflashchart2.sentor.pl/chart_examples/mix_advanced_shapes
|
27
|
+
[0.7 (rc-1 : 12.12.2008)]
|
28
|
+
* add Tooltip class, example is here: http://openflashchart2.sentor.pl/chart_examples/mix_advanced_tooltip
|
29
|
+
[0.6 (rc-1 : 11.12.2008)]
|
30
|
+
* now generating many inline chart on one page is possible
|
31
|
+
* moved to open-flash-chart-2-hyperion version
|
32
|
+
* remove spelling errors
|
33
|
+
* remove set_tooltip method, use instead set_tip or tip=
|
34
|
+
[0.5 (beta-4)]
|
35
|
+
* methods are now generated by method_missing
|
36
|
+
[0.4 (beta-3)]
|
37
|
+
* add ofc2_inline method to generate graph without url
|
38
|
+
* add instance variables getters, changes proposed by __Pavlo Masko__
|
39
|
+
[0.3 (beta-2)]
|
40
|
+
* changed installation instructions
|
41
|
+
* add rake tasks to install/uninstall
|
42
|
+
[0.2 (beta-1)]
|
43
|
+
* change README - add description, install section and info about contact
|
44
|
+
* make examples with basic charts
|
45
|
+
* compare plugin with php library and add missing class/methods
|
46
|
+
[0.1 (alpha)]
|
47
|
+
* rewrite php library
|
data/Gemfile.lock
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2012 Rafał Lisowski
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
= About
|
2
|
+
|
3
|
+
open flash chart 2 gem for rails applications
|
4
|
+
|
5
|
+
This library was ported from the open flash chart project's php code to be used with Ruby on Rails.
|
6
|
+
Visit the {open flash chart community project}[http://openflashchart.com/]
|
7
|
+
|
8
|
+
== Note
|
9
|
+
|
10
|
+
This gem is using swfobject.js to include swf file, go to
|
11
|
+
{source}[https://github.com/korin/open_flash_chart_2_plugin/blob/master/lib/ofc2.rb#L82] to see how.
|
12
|
+
|
13
|
+
Lates swfobject.js can be dowloaded {here}[http://code.google.com/p/swfobject/].
|
14
|
+
|
15
|
+
= Details / Usage
|
16
|
+
Go to {project home page}[http://openflashchart2.heroku.com/] for details
|
17
|
+
|
18
|
+
= Help
|
19
|
+
Looking for help?
|
20
|
+
email to me: lisukorin [at] gmail [dot] com,
|
21
|
+
don't forget write 'open flash chart' in subject or my mail client will treat your message as spam.
|
22
|
+
|
23
|
+
= License
|
24
|
+
This project is available under MIT license, see {attached file}[https://github.com/korin/open_flash_chart_2_plugin/blob/master/LICENSE].
|
25
|
+
|
26
|
+
|
data/lib/ofc2.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
module OFC2
|
2
1
|
|
2
|
+
module OFC2
|
3
3
|
# specjal module included in each class
|
4
4
|
# with that module we add to_hash method
|
5
5
|
# there is also a method_missing which allow user to set/get any instance variable
|
@@ -39,8 +39,9 @@ module OFC2
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
class Engine < Rails::Engine
|
42
|
+
class Engine < ::Rails::Engine
|
43
43
|
initializer "ofc2" do |app|
|
44
|
+
app.config.assets.paths << File.expand_path('../vendor/assets/flash', __FILE__)
|
44
45
|
ActionController::Base.send :include, OFC2::InstanceMethods
|
45
46
|
end
|
46
47
|
end
|
@@ -50,10 +51,10 @@ module OFC2
|
|
50
51
|
# +width+ width for div
|
51
52
|
# +height+ height for div
|
52
53
|
# +graph+ a OFC2::Graph object
|
53
|
-
# +base+ uri for graph, default '/', not used in this method, go to ofc2 method for details
|
54
54
|
# +id+ id for div with graph, default Time.now.usec
|
55
|
-
# +
|
56
|
-
|
55
|
+
# +flash_attributes+ attributes for swf
|
56
|
+
# +flash_params+ params for swf
|
57
|
+
def ofc2_inline(width, height, graph, id=Time.now.usec, flash_attributes = {}, flash_params = {})
|
57
58
|
div_name = "flashcontent_#{id}"
|
58
59
|
<<-EOF
|
59
60
|
<div id="#{div_name}"></div>
|
@@ -64,8 +65,8 @@ module OFC2
|
|
64
65
|
};
|
65
66
|
|
66
67
|
swfobject.embedSWF(
|
67
|
-
'
|
68
|
-
'#{width}', '#{height}','9.0.0', 'expressInstall.swf',
|
68
|
+
'/assets/open-flash-chart.swf', '#{div_name}',
|
69
|
+
'#{width}', '#{height}','9.0.0', '/assets/expressInstall.swf',
|
69
70
|
{'get-data':'#{div_name}_data'}, #{flash_params.to_json}, #{flash_attributes.to_json} );
|
70
71
|
|
71
72
|
</script>
|
@@ -76,19 +77,19 @@ module OFC2
|
|
76
77
|
# +width+ width for div
|
77
78
|
# +height+ height for div
|
78
79
|
# +url+ an url which return data in json format, if you use url_for method to set url param the base param must be set to '' (empty string)
|
79
|
-
# +base+ uri for graph, default '/'
|
80
80
|
# +id+ id for div with graph, default Time.now.usec
|
81
|
-
# +
|
82
|
-
|
81
|
+
# +flash_attributes+ attributes for swf
|
82
|
+
# +flash_params+ params for swf
|
83
|
+
def ofc2(width, height, url, id =Time.now.usec, flash_attributes = {}, flash_params = {})
|
83
84
|
url = CGI::escape(url)
|
84
85
|
div_name = "flashcontent_#{id}"
|
85
86
|
<<-EOF
|
86
87
|
<div id='#{div_name}'></div>
|
87
88
|
<script type="text/javascript">
|
88
89
|
swfobject.embedSWF(
|
89
|
-
"
|
90
|
-
"#{width}", "#{height}", "9.0.0", "expressInstall.swf",
|
91
|
-
{"data-file":"#{
|
90
|
+
"/assets/open-flash-chart.swf","#{div_name}",
|
91
|
+
"#{width}", "#{height}", "9.0.0", "/assets/expressInstall.swf",
|
92
|
+
{"data-file":"#{url}"}, #{flash_params.to_json}, #{flash_attributes.to_json} );
|
92
93
|
|
93
94
|
</script>
|
94
95
|
EOF
|
data/lib/ofc2/version.rb
CHANGED
data/ofc2.gemspec
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2
|
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3
|
+
*/
|
4
|
+
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ofc2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,19 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
13
|
-
dependencies:
|
12
|
+
date: 2012-01-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: yard
|
16
|
+
requirement: &13845300 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *13845300
|
14
25
|
description: This library was ported from the open flash chart project's php code
|
15
26
|
to be used with Ruby on Rails.
|
16
27
|
email:
|
@@ -20,19 +31,20 @@ extensions: []
|
|
20
31
|
extra_rdoc_files: []
|
21
32
|
files:
|
22
33
|
- .gitignore
|
23
|
-
- CHANGES
|
34
|
+
- CHANGES.rdoc
|
24
35
|
- Gemfile
|
25
36
|
- Gemfile.lock
|
26
|
-
-
|
27
|
-
- README
|
37
|
+
- LICENSE
|
38
|
+
- README.rdoc
|
28
39
|
- Rakefile
|
29
40
|
- TODO
|
30
|
-
- assets/VERSION.txt
|
31
|
-
- assets/open-flash-chart.swf
|
32
|
-
- assets/swfobject.js
|
33
41
|
- lib/ofc2.rb
|
34
42
|
- lib/ofc2/version.rb
|
35
43
|
- ofc2.gemspec
|
44
|
+
- vendor/assets/flash/VERSION.txt
|
45
|
+
- vendor/assets/flash/expressInstall.swf
|
46
|
+
- vendor/assets/flash/open-flash-chart.swf
|
47
|
+
- vendor/assets/javascripts/swfobject.js
|
36
48
|
homepage: http://github.com/korin/open_flash_chart_2_plugin
|
37
49
|
licenses:
|
38
50
|
- MIT
|
@@ -59,3 +71,4 @@ signing_key:
|
|
59
71
|
specification_version: 3
|
60
72
|
summary: open flash chart 2 gem for rails applications
|
61
73
|
test_files: []
|
74
|
+
has_rdoc:
|
data/CHANGES
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
[1.0] 23.01.2011
|
2
|
-
- moved to open-flash-chart-2-lug-wyrm-charmer version (http://teethgrinder.co.uk/open-flash-chart-2/downloads.php)
|
3
|
-
- added animation for charts
|
4
|
-
[1.0] rc-2 : 03.05.2009
|
5
|
-
- moved to open-flash-chart-2-ichor version (http://teethgrinder.co.uk/open-flash-chart-2/downloads.php)
|
6
|
-
- initialize methods has changed !!!
|
7
|
-
now use a hash eg. OFC2::SomeClass.new(:option => value, :option2 => other_value)
|
8
|
-
I find it more readable that old way.
|
9
|
-
- add radar charts http://openflashchart2.sentor.pl/chart_examples/radar
|
10
|
-
- remove pseudo horizontal stacked bar example
|
11
|
-
[0.9] rc-1 : 15.04.2009
|
12
|
-
- remove to_json method from OWJSON module
|
13
|
-
- remove remove require 'json' from plugin
|
14
|
-
- migrate sample application to rails 2.3
|
15
|
-
- remove gem 'json' from enviroment.rb
|
16
|
-
[0.8] rc-1 : 09.01.2009
|
17
|
-
- add shape drawning support, example is here:
|
18
|
-
http://openflashchart2.sentor.pl/chart_examples/mix_advanced_draw_shape
|
19
|
-
- add stacked bar keys support:
|
20
|
-
http://openflashchart2.sentor.pl/chart_examples/stacked_bar
|
21
|
-
- pseudo horizontal stacked bar, example:
|
22
|
-
http://openflashchart2.sentor.pl/chart_examples/mix_advanced_shapes
|
23
|
-
[0.7] rc-1 : 12.12.2008
|
24
|
-
- add Tooltip class, example is here:
|
25
|
-
http://openflashchart2.sentor.pl/chart_examples/mix_advanced_tooltip
|
26
|
-
[0.6] rc-1 : 11.12.2008
|
27
|
-
- now generating many inline chart on one page is possible
|
28
|
-
- moved to open-flash-chart-2-hyperion version
|
29
|
-
- remove spelling errors
|
30
|
-
- remove set_tooltip method, use instead set_tip or tip=
|
31
|
-
[0.5] beta-4
|
32
|
-
- methods are now generated by method_missing
|
33
|
-
[0.4] beta-3
|
34
|
-
- add ofc2_inline method to generate graph without url
|
35
|
-
- add instance variables getters, changes proposed by __Pavlo Masko__
|
36
|
-
[0.3] beta-2
|
37
|
-
- changed installation instructions
|
38
|
-
- add rake tasks to install/uninstall
|
39
|
-
[0.2] beta-1
|
40
|
-
- change README - add description, install section and info about contact
|
41
|
-
- make examples with basic charts
|
42
|
-
- compare plugin with php library and add missing class/methods
|
43
|
-
[0.1] alpha
|
44
|
-
- rewrite php library
|
data/MIT-LICENSE
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
2
|
-
a copy of this software and associated documentation files (the
|
3
|
-
"Software"), to deal in the Software without restriction, including
|
4
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
5
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
6
|
-
permit persons to whom the Software is furnished to do so, subject to
|
7
|
-
the following conditions:
|
8
|
-
|
9
|
-
The above copyright notice and this permission notice shall be
|
10
|
-
included in all copies or substantial portions of the Software.
|
11
|
-
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
13
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
15
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
16
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
17
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
About
|
2
|
-
=====================================
|
3
|
-
open flash chart 2 gem for rails applications
|
4
|
-
|
5
|
-
This library was ported from the open flash chart project's php code to be used with Ruby on Rails.
|
6
|
-
Visit the open flash chart project here - http://teethgrinder.co.uk/open-flash-chart-2/
|
7
|
-
|
8
|
-
NOTE:
|
9
|
-
sample application is using haml
|
10
|
-
gem install haml
|
11
|
-
|
12
|
-
Details
|
13
|
-
=====================================
|
14
|
-
Go to http://openflashchart2.heroku.com/ for details
|
15
|
-
|
16
|
-
Help
|
17
|
-
=====================================
|
18
|
-
Looking for help?
|
19
|
-
try:
|
20
|
-
home page: http://openflashchart2.heroku.com/infos
|
21
|
-
or email to me: lisukorin [at] gmail [dot] com,
|
22
|
-
don't forget write 'open flash chart' in subject or my mail client will treat your message as spam.
|
23
|
-
|
data/assets/VERSION.txt
DELETED
data/assets/open-flash-chart.swf
DELETED
Binary file
|
data/assets/swfobject.js
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
|
2
|
-
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
3
|
-
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
4
|
-
*/
|
5
|
-
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
|