GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: that is plugin extracted from open_flash_chart_2 project
Clone URL: git://github.com/korin/open_flash_chart_2_plugin.git
add ofc2_inlne method which can be used to generate inline charts (whith 
data as a parameter)
korin (author)
Sat Aug 23 12:56:14 -0700 2008
commit  a983aa5812c0939b7f16e3ecad1042001e4ff837
tree    2893901c83401491dcc901e9e431f948683fbcc6
parent  a1014f1620a2eb71790020e9ceb01e2296a8499d
0
CHANGES 100644 →
...
 
 
 
1
2
3
...
1
2
3
4
5
6
0
@@ -1,3 +1,6 @@
0
+[0.4] beta-3
0
+ - add ofc2_inline method to generate graph without url
0
+ - add instance variables getters, changes proposed by __Pavlo Masko__
0
 [0.3] beta-2
0
   - changed installation instructions
0
   - add rake tasks to install/uninstall
0
MIT-LICENSE 100644 → 100755
0
README 100644 → 100755
0
Rakefile 100644 → 100755
0
TODO 100644 →
...
 
 
 
1
2
3
...
5
6
7
8
 
...
1
2
3
4
5
6
...
8
9
10
 
11
0
@@ -1,3 +1,6 @@
0
+==BUGS==
0
+ - generating more than one graph with ofc2_inline on the same page is currently impossible
0
+
0
 ==Performance==
0
   - check performance
0
 ==Clean code==
0
@@ -5,4 +8,4 @@
0
 ==Documentation==
0
   - describe class and methods
0
   - describe instance variables
0
- - present examples code in Charts section
0
+ --present examples code in Charts section--
0
init.rb 100644 → 100755
0
install.rb 100644 → 100755
...
10
11
12
13
 
14
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
17
18
19
20
 
21
22
23
...
10
11
12
 
13
14
 
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
 
 
 
53
54
55
56
0
@@ -10,14 +10,47 @@ module OFC2
0
     end
0
   end
0
   def self.included(controller)
0
- controller.helper_method(:ofc2)
0
+ controller.helper_method(:ofc2, :ofc2_inline)
0
   end
0
- def ofc2(width, height, url, base='/', id = '')
0
+
0
+ def ofc2_inline(width, height, graph, base='/', id=Time.now.usec)
0
+ # TODO: generating more than one graph with ofc2_inline on the same page is currently impossible
0
+ div_name = "flashcontent_#{id}"
0
+ out = []
0
+ out << '<div id="' + div_name.to_s + '"></div>'
0
+
0
+ out << <<-EOF
0
+ <script type="text/javascript">
0
+ #{div_name} = '#{graph.render}';
0
+
0
+ function open_flash_chart_data(){
0
+ return #{div_name};
0
+ };
0
+
0
+ // i'm not shure that is necessary
0
+ function findSWF(movieName) {
0
+ if (navigator.appName.indexOf("Microsoft")!= -1) {
0
+ return window[movieName];
0
+ } else {
0
+ return document[movieName];
0
+ }
0
+ };
0
+
0
+ swfobject.embedSWF(
0
+ '#{base}open-flash-chart.swf', '#{div_name}',
0
+ '#{width}', '#{height}','9.0.0', 'expressInstall.swf'
0
+ );
0
+ </script>
0
+ EOF
0
+
0
+
0
+ return out.join("\n")
0
+ end
0
+
0
+
0
+ def ofc2(width, height, url, base='/', id =Time.now.usec)
0
     out = []
0
- obj_id = 'chart'
0
- div_name = 'flashcontent'
0
- obj_id += id
0
- div_name += id
0
+ div_name = "flashcontent_#{id}"
0
     out << '<div id="' + div_name.to_s + '"></div>'
0
     out << '<script type="text/javascript">'
0
     out << 'swfobject.embedSWF('
0
requirements/json/json2.js 100644 → 100755
0
0
requirements/swfobject.js 100644 → 100755
0
0
test/open_flash_chart_test.rb 100644 → 100755
0
uninstall.rb 100644 → 100755

Comments

    No one has commented yet.