dima-ruboss4ruby 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Generators +7 -0
- data/History.txt +4 -0
- data/Manifest.txt +116 -0
- data/README.rdoc +23 -0
- data/gpl-3.0.txt +674 -0
- data/lib/ruboss4ruby.rb +84 -0
- data/lib/ruboss4ruby/active_foo.rb +221 -0
- data/lib/ruboss4ruby/active_record_tasks.rb +75 -0
- data/lib/ruboss4ruby/configuration.rb +59 -0
- data/lib/ruboss4ruby/datamapper_foo.rb +25 -0
- data/lib/ruboss4ruby/generated_attribute.rb +61 -0
- data/lib/ruboss4ruby/tasks.rb +80 -0
- data/merb_generators/ruboss_config.rb +103 -0
- data/merb_generators/ruboss_controller.rb +59 -0
- data/merb_generators/ruboss_flex_app.rb +67 -0
- data/merb_generators/ruboss_resource.rb +37 -0
- data/merb_generators/ruboss_resource_controller.rb +80 -0
- data/merb_generators/ruboss_scaffold.rb +157 -0
- data/merb_generators/templates/ruboss_config/actionscript.properties +16 -0
- data/merb_generators/templates/ruboss_config/actionscriptair.properties +16 -0
- data/merb_generators/templates/ruboss_config/expressInstall.swf +0 -0
- data/merb_generators/templates/ruboss_config/flex.properties +2 -0
- data/merb_generators/templates/ruboss_config/html-template/AC_OETags.js +276 -0
- data/merb_generators/templates/ruboss_config/html-template/history/history.css +6 -0
- data/merb_generators/templates/ruboss_config/html-template/history/history.js +645 -0
- data/merb_generators/templates/ruboss_config/html-template/history/historyFrame.html +29 -0
- data/merb_generators/templates/ruboss_config/html-template/index.template.html +121 -0
- data/merb_generators/templates/ruboss_config/html-template/playerProductInstall.swf +0 -0
- data/merb_generators/templates/ruboss_config/index.html.erb +18 -0
- data/merb_generators/templates/ruboss_config/mainair-app.xml +134 -0
- data/merb_generators/templates/ruboss_config/project.properties +18 -0
- data/merb_generators/templates/ruboss_config/projectair.properties +24 -0
- data/merb_generators/templates/ruboss_config/ruboss.yml +16 -0
- data/merb_generators/templates/ruboss_config/swfobject.js +5 -0
- data/merb_generators/templates/ruboss_controller/controller.as.erb +40 -0
- data/merb_generators/templates/ruboss_flex_app/mainapp.mxml +34 -0
- data/merb_generators/templates/ruboss_resource_controller/controller_ar.rb.erb +49 -0
- data/merb_generators/templates/ruboss_resource_controller/controller_dm.rb.erb +46 -0
- data/merb_generators/templates/ruboss_resource_controller/spec/controllers/%file_name%_spec.rb +7 -0
- data/merb_generators/templates/ruboss_resource_controller/spec/requests/%file_name%_spec.rb +1 -0
- data/merb_generators/templates/ruboss_resource_controller/test/controllers/%file_name%_test.rb +17 -0
- data/rails_generators/ruboss_config/USAGE +18 -0
- data/rails_generators/ruboss_config/ruboss_config_generator.rb +114 -0
- data/rails_generators/ruboss_config/templates/actionscript.properties +16 -0
- data/rails_generators/ruboss_config/templates/actionscriptair.properties +16 -0
- data/rails_generators/ruboss_config/templates/expressInstall.swf +0 -0
- data/rails_generators/ruboss_config/templates/flex.properties +2 -0
- data/rails_generators/ruboss_config/templates/html-template/AC_OETags.js +276 -0
- data/rails_generators/ruboss_config/templates/html-template/history/history.css +6 -0
- data/rails_generators/ruboss_config/templates/html-template/history/history.js +645 -0
- data/rails_generators/ruboss_config/templates/html-template/history/historyFrame.html +29 -0
- data/rails_generators/ruboss_config/templates/html-template/index.template.html +121 -0
- data/rails_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
- data/rails_generators/ruboss_config/templates/index.html.erb +18 -0
- data/rails_generators/ruboss_config/templates/mainair-app.xml +134 -0
- data/rails_generators/ruboss_config/templates/mainapp-config.xml +21 -0
- data/rails_generators/ruboss_config/templates/mainapp.mxml +31 -0
- data/rails_generators/ruboss_config/templates/project-textmate.erb +52 -0
- data/rails_generators/ruboss_config/templates/project.properties +18 -0
- data/rails_generators/ruboss_config/templates/projectair.properties +24 -0
- data/rails_generators/ruboss_config/templates/ruboss.yml +14 -0
- data/rails_generators/ruboss_config/templates/ruboss_tasks.rake +5 -0
- data/rails_generators/ruboss_config/templates/swfobject.js +5 -0
- data/rails_generators/ruboss_controller/USAGE +11 -0
- data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +31 -0
- data/rails_generators/ruboss_controller/templates/controller.as.erb +40 -0
- data/rails_generators/ruboss_scaffold/USAGE +35 -0
- data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +177 -0
- data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +149 -0
- data/rails_generators/ruboss_scaffold/templates/controller.rb.erb +97 -0
- data/rails_generators/ruboss_scaffold/templates/fixtures.yml.erb +35 -0
- data/rails_generators/ruboss_scaffold/templates/migration.rb.erb +19 -0
- data/rails_generators/ruboss_scaffold/templates/model.as.erb +42 -0
- data/rails_generators/ruboss_scaffold/templates/model.rb.erb +11 -0
- data/rails_generators/ruboss_yaml_scaffold/USAGE +14 -0
- data/rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +44 -0
- data/rcl-1.0.txt +0 -0
- metadata +197 -0
@@ -0,0 +1,157 @@
|
|
1
|
+
require Ruboss::LIB_DIR + 'generated_attribute'
|
2
|
+
|
3
|
+
#NOTE: this is currently (merb 0.9.9 broken and needs to be rethought anyway. This line of thinking was based
|
4
|
+
# on the kind of code generation you could do with rails, it's a different code generation paradigm with Merb anyway)
|
5
|
+
module Merb::Generators
|
6
|
+
class RubossScaffoldGenerator < NamespacedGenerator
|
7
|
+
include Ruboss::Configuration
|
8
|
+
|
9
|
+
option :flex_only, :as => :boolean, :default => false, :desc => 'Scaffold Flex code only.'
|
10
|
+
option :skip_migration, :as => :boolean, :default => false, :desc => 'Skip migration for this model.'
|
11
|
+
|
12
|
+
first_argument :name, :required => true, :desc => "model name"
|
13
|
+
second_argument :properties, :as => :hash, :required => true, :default => {}, :desc => "space separated model properties in form of name:type. Example: state:string"
|
14
|
+
|
15
|
+
def initialize(*args)
|
16
|
+
@project_name, @flex_project_name, @command_controller_name, @base_package, @base_folder = extract_names
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def table_name
|
21
|
+
file_name.pluralize
|
22
|
+
end
|
23
|
+
|
24
|
+
alias_method :resource_controller_name, :table_name
|
25
|
+
|
26
|
+
def model_name
|
27
|
+
name
|
28
|
+
end
|
29
|
+
|
30
|
+
def controller_name
|
31
|
+
name.pluralize
|
32
|
+
end
|
33
|
+
|
34
|
+
def project_name
|
35
|
+
@project_name
|
36
|
+
end
|
37
|
+
|
38
|
+
def flex_project_name
|
39
|
+
@flex_project_name
|
40
|
+
end
|
41
|
+
|
42
|
+
def base_folder
|
43
|
+
@base_folder
|
44
|
+
end
|
45
|
+
|
46
|
+
def base_package
|
47
|
+
@base_package
|
48
|
+
end
|
49
|
+
|
50
|
+
def command_controller_name
|
51
|
+
@command_controller_name
|
52
|
+
end
|
53
|
+
|
54
|
+
def belongs_tos
|
55
|
+
@belongs_tos
|
56
|
+
end
|
57
|
+
|
58
|
+
def has_manies
|
59
|
+
@has_manies
|
60
|
+
end
|
61
|
+
|
62
|
+
def has_ones
|
63
|
+
@has_ones
|
64
|
+
end
|
65
|
+
|
66
|
+
def attributes
|
67
|
+
@belongs_tos = []
|
68
|
+
@has_ones = []
|
69
|
+
@has_manies = []
|
70
|
+
# Figure out has_one, has_many and belongs_to based on args
|
71
|
+
self.properties.each do |key,value|
|
72
|
+
puts key + value
|
73
|
+
key = key.to_sym
|
74
|
+
if key == :has_one
|
75
|
+
# arg = "has_one:arg1,arg2", so all the has_one are together
|
76
|
+
@has_ones = value.split(',')
|
77
|
+
elsif key == :has_many
|
78
|
+
# arg = "has_many:arg1,arg2", so all the has_many are together
|
79
|
+
@has_manies = value.split(",")
|
80
|
+
elsif key == :belongs_to # belongs_to:arg1,arg2
|
81
|
+
@belongs_tos = value.split(',')
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
puts "does this even run?"
|
86
|
+
|
87
|
+
puts belongs_tos
|
88
|
+
puts has_manies
|
89
|
+
|
90
|
+
# Remove the has_one and has_many arguments since they are
|
91
|
+
# not for consumption by the scaffold generator, and since
|
92
|
+
# we have already used them to set the @belongs_tos, @has_ones and
|
93
|
+
# @has_manies.
|
94
|
+
self.properties.delete_if { |key, value| key =~ /^(has_one|has_many|belongs_to)/ }
|
95
|
+
|
96
|
+
@attributes ||= self.properties.collect do |key, value|
|
97
|
+
Ruboss::Generator::GeneratedAttribute.new(key, value)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.source_root
|
102
|
+
File.join(File.dirname(__FILE__), 'templates', 'ruboss_scaffold')
|
103
|
+
end
|
104
|
+
|
105
|
+
invoke :ruboss_resource_controller do |generator|
|
106
|
+
generator.new(destination_root, options, controller_name)
|
107
|
+
end
|
108
|
+
|
109
|
+
template :ar_model, :flex_only => false do |t|
|
110
|
+
t.source = 'model.rb.erb'
|
111
|
+
t.destination = File.join('app', 'models', "#{file_name}.rb")
|
112
|
+
end
|
113
|
+
|
114
|
+
empty_directory :fixtures, File.join('spec', 'fixtures')
|
115
|
+
|
116
|
+
template :fixture, :flex_only => false do |t|
|
117
|
+
t.source = 'fixtures.yml.erb'
|
118
|
+
t.destination = File.join('spec', 'fixtures', "#{table_name}.yml")
|
119
|
+
end
|
120
|
+
|
121
|
+
empty_directory :migrations, File.join('schema', 'migrations')
|
122
|
+
|
123
|
+
template :migration, :flex_only => false, :skip_migration => false do |t|
|
124
|
+
t.source = 'migration.rb.erb'
|
125
|
+
t.destination = File.join('schema', 'migrations', "#{migration_file_name}.rb")
|
126
|
+
end
|
127
|
+
|
128
|
+
template :as_model do |t|
|
129
|
+
t.source = 'model.as.erb'
|
130
|
+
t.destination = File.join('app', 'flex', base_folder, 'models', "#{class_name}.as")
|
131
|
+
end
|
132
|
+
|
133
|
+
template :flex_component do |t|
|
134
|
+
t.source = 'component.mxml.erb'
|
135
|
+
t.destination = File.join('app', 'flex', base_folder, 'components', 'generated', "#{class_name}Box.mxml")
|
136
|
+
end
|
137
|
+
|
138
|
+
invoke :ruboss_controller do |generator|
|
139
|
+
generator.new(destination_root, options)
|
140
|
+
end
|
141
|
+
|
142
|
+
def migration_file_name
|
143
|
+
current_migration_number = Dir[Dir.pwd+'/schema/migrations/*'].map{|f| File.basename(f) =~ /^(\d+)/; $1}.max
|
144
|
+
migration_file_name = format("%03d_%s", (current_migration_number.to_i+1), file_name) + "_migration"
|
145
|
+
end
|
146
|
+
|
147
|
+
def migration_name
|
148
|
+
"#{class_name}Migration"
|
149
|
+
end
|
150
|
+
|
151
|
+
desc <<-DESC
|
152
|
+
Foobar.
|
153
|
+
DESC
|
154
|
+
end
|
155
|
+
|
156
|
+
add :ruboss_scaffold, RubossScaffoldGenerator
|
157
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<actionScriptProperties mainApplicationPath="<%= project_name %>.mxml" version="3">
|
3
|
+
<compiler additionalCompilerArguments="-locale en_US -keep-as3-metadata+=Resource,HasOne,HasMany,BelongsTo,DateTime,Lazy,Ignored" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.28" htmlPlayerVersionCheck="true" outputFolderPath="public/bin" rootURL="http://localhost:4000/bin" sourceFolderPath="app/flex" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
|
4
|
+
<compilerSourcePath/>
|
5
|
+
<libraryPath defaultLinkType="1">
|
6
|
+
<libraryPathEntry kind="4" path=""/>
|
7
|
+
<libraryPathEntry kind="1" linkType="1" path="lib"/>
|
8
|
+
</libraryPath>
|
9
|
+
<sourceAttachmentPath/>
|
10
|
+
</compiler>
|
11
|
+
<applications>
|
12
|
+
<application path="<%= project_name %>.mxml"/>
|
13
|
+
</applications>
|
14
|
+
<modules/>
|
15
|
+
<buildCSSFiles/>
|
16
|
+
</actionScriptProperties>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<actionScriptProperties mainApplicationPath="<%= project_name %>.mxml" version="3">
|
3
|
+
<compiler additionalCompilerArguments="-locale en_US -keep-as3-metadata+=Resource,HasOne,HasMany,BelongsTo,DateTime,Lazy,Ignored" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.28" htmlPlayerVersionCheck="true" outputFolderPath="bin-debug" sourceFolderPath="app/flex" strict="true" useApolloConfig="true" verifyDigests="true" warn="true">
|
4
|
+
<compilerSourcePath/>
|
5
|
+
<libraryPath defaultLinkType="1">
|
6
|
+
<libraryPathEntry kind="4" path=""/>
|
7
|
+
<libraryPathEntry kind="1" linkType="1" path="lib"/>
|
8
|
+
</libraryPath>
|
9
|
+
<sourceAttachmentPath/>
|
10
|
+
</compiler>
|
11
|
+
<applications>
|
12
|
+
<application path="<%= project_name %>.mxml"/>
|
13
|
+
</applications>
|
14
|
+
<modules/>
|
15
|
+
<buildCSSFiles/>
|
16
|
+
</actionScriptProperties>
|
Binary file
|
@@ -0,0 +1,276 @@
|
|
1
|
+
// Flash Player Version Detection - Rev 1.6
|
2
|
+
// Detect Client Browser type
|
3
|
+
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
|
4
|
+
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
|
5
|
+
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
|
6
|
+
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
|
7
|
+
|
8
|
+
function ControlVersion()
|
9
|
+
{
|
10
|
+
var version;
|
11
|
+
var axo;
|
12
|
+
var e;
|
13
|
+
|
14
|
+
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
|
15
|
+
|
16
|
+
try {
|
17
|
+
// version will be set for 7.X or greater players
|
18
|
+
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
19
|
+
version = axo.GetVariable("$version");
|
20
|
+
} catch (e) {
|
21
|
+
}
|
22
|
+
|
23
|
+
if (!version)
|
24
|
+
{
|
25
|
+
try {
|
26
|
+
// version will be set for 6.X players only
|
27
|
+
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
28
|
+
|
29
|
+
// installed player is some revision of 6.0
|
30
|
+
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
|
31
|
+
// so we have to be careful.
|
32
|
+
|
33
|
+
// default to the first public version
|
34
|
+
version = "WIN 6,0,21,0";
|
35
|
+
|
36
|
+
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
|
37
|
+
axo.AllowScriptAccess = "always";
|
38
|
+
|
39
|
+
// safe to call for 6.0r47 or greater
|
40
|
+
version = axo.GetVariable("$version");
|
41
|
+
|
42
|
+
} catch (e) {
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!version)
|
47
|
+
{
|
48
|
+
try {
|
49
|
+
// version will be set for 4.X or 5.X player
|
50
|
+
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
51
|
+
version = axo.GetVariable("$version");
|
52
|
+
} catch (e) {
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
if (!version)
|
57
|
+
{
|
58
|
+
try {
|
59
|
+
// version will be set for 3.X player
|
60
|
+
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
61
|
+
version = "WIN 3,0,18,0";
|
62
|
+
} catch (e) {
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
if (!version)
|
67
|
+
{
|
68
|
+
try {
|
69
|
+
// version will be set for 2.X player
|
70
|
+
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
71
|
+
version = "WIN 2,0,0,11";
|
72
|
+
} catch (e) {
|
73
|
+
version = -1;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
return version;
|
78
|
+
}
|
79
|
+
|
80
|
+
// JavaScript helper required to detect Flash Player PlugIn version information
|
81
|
+
function GetSwfVer(){
|
82
|
+
// NS/Opera version >= 3 check for Flash plugin in plugin array
|
83
|
+
var flashVer = -1;
|
84
|
+
|
85
|
+
if (navigator.plugins != null && navigator.plugins.length > 0) {
|
86
|
+
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
|
87
|
+
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
|
88
|
+
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
|
89
|
+
var descArray = flashDescription.split(" ");
|
90
|
+
var tempArrayMajor = descArray[2].split(".");
|
91
|
+
var versionMajor = tempArrayMajor[0];
|
92
|
+
var versionMinor = tempArrayMajor[1];
|
93
|
+
var versionRevision = descArray[3];
|
94
|
+
if (versionRevision == "") {
|
95
|
+
versionRevision = descArray[4];
|
96
|
+
}
|
97
|
+
if (versionRevision[0] == "d") {
|
98
|
+
versionRevision = versionRevision.substring(1);
|
99
|
+
} else if (versionRevision[0] == "r") {
|
100
|
+
versionRevision = versionRevision.substring(1);
|
101
|
+
if (versionRevision.indexOf("d") > 0) {
|
102
|
+
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
|
103
|
+
}
|
104
|
+
}
|
105
|
+
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
// MSN/WebTV 2.6 supports Flash 4
|
109
|
+
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
|
110
|
+
// WebTV 2.5 supports Flash 3
|
111
|
+
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
|
112
|
+
// older WebTV supports Flash 2
|
113
|
+
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
|
114
|
+
else if ( isIE && isWin && !isOpera ) {
|
115
|
+
flashVer = ControlVersion();
|
116
|
+
}
|
117
|
+
return flashVer;
|
118
|
+
}
|
119
|
+
|
120
|
+
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
|
121
|
+
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
|
122
|
+
{
|
123
|
+
versionStr = GetSwfVer();
|
124
|
+
if (versionStr == -1 ) {
|
125
|
+
return false;
|
126
|
+
} else if (versionStr != 0) {
|
127
|
+
if(isIE && isWin && !isOpera) {
|
128
|
+
// Given "WIN 2,0,0,11"
|
129
|
+
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
|
130
|
+
tempString = tempArray[1]; // "2,0,0,11"
|
131
|
+
versionArray = tempString.split(","); // ['2', '0', '0', '11']
|
132
|
+
} else {
|
133
|
+
versionArray = versionStr.split(".");
|
134
|
+
}
|
135
|
+
var versionMajor = versionArray[0];
|
136
|
+
var versionMinor = versionArray[1];
|
137
|
+
var versionRevision = versionArray[2];
|
138
|
+
|
139
|
+
// is the major.revision >= requested major.revision AND the minor version >= requested minor
|
140
|
+
if (versionMajor > parseFloat(reqMajorVer)) {
|
141
|
+
return true;
|
142
|
+
} else if (versionMajor == parseFloat(reqMajorVer)) {
|
143
|
+
if (versionMinor > parseFloat(reqMinorVer))
|
144
|
+
return true;
|
145
|
+
else if (versionMinor == parseFloat(reqMinorVer)) {
|
146
|
+
if (versionRevision >= parseFloat(reqRevision))
|
147
|
+
return true;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
|
154
|
+
function AC_AddExtension(src, ext)
|
155
|
+
{
|
156
|
+
if (src.indexOf('?') != -1)
|
157
|
+
return src.replace(/\?/, ext+'?');
|
158
|
+
else
|
159
|
+
return src + ext;
|
160
|
+
}
|
161
|
+
|
162
|
+
function AC_Generateobj(objAttrs, params, embedAttrs)
|
163
|
+
{
|
164
|
+
var str = '';
|
165
|
+
if (isIE && isWin && !isOpera)
|
166
|
+
{
|
167
|
+
str += '<object ';
|
168
|
+
for (var i in objAttrs)
|
169
|
+
str += i + '="' + objAttrs[i] + '" ';
|
170
|
+
str += '>';
|
171
|
+
for (var i in params)
|
172
|
+
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
|
173
|
+
str += '</object>';
|
174
|
+
} else {
|
175
|
+
str += '<embed ';
|
176
|
+
for (var i in embedAttrs)
|
177
|
+
str += i + '="' + embedAttrs[i] + '" ';
|
178
|
+
str += '> </embed>';
|
179
|
+
}
|
180
|
+
|
181
|
+
document.write(str);
|
182
|
+
}
|
183
|
+
|
184
|
+
function AC_FL_RunContent(){
|
185
|
+
var ret =
|
186
|
+
AC_GetArgs
|
187
|
+
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
188
|
+
, "application/x-shockwave-flash"
|
189
|
+
);
|
190
|
+
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
|
191
|
+
}
|
192
|
+
|
193
|
+
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
|
194
|
+
var ret = new Object();
|
195
|
+
ret.embedAttrs = new Object();
|
196
|
+
ret.params = new Object();
|
197
|
+
ret.objAttrs = new Object();
|
198
|
+
for (var i=0; i < args.length; i=i+2){
|
199
|
+
var currArg = args[i].toLowerCase();
|
200
|
+
|
201
|
+
switch (currArg){
|
202
|
+
case "classid":
|
203
|
+
break;
|
204
|
+
case "pluginspage":
|
205
|
+
ret.embedAttrs[args[i]] = args[i+1];
|
206
|
+
break;
|
207
|
+
case "src":
|
208
|
+
case "movie":
|
209
|
+
args[i+1] = AC_AddExtension(args[i+1], ext);
|
210
|
+
ret.embedAttrs["src"] = args[i+1];
|
211
|
+
ret.params[srcParamName] = args[i+1];
|
212
|
+
break;
|
213
|
+
case "onafterupdate":
|
214
|
+
case "onbeforeupdate":
|
215
|
+
case "onblur":
|
216
|
+
case "oncellchange":
|
217
|
+
case "onclick":
|
218
|
+
case "ondblClick":
|
219
|
+
case "ondrag":
|
220
|
+
case "ondragend":
|
221
|
+
case "ondragenter":
|
222
|
+
case "ondragleave":
|
223
|
+
case "ondragover":
|
224
|
+
case "ondrop":
|
225
|
+
case "onfinish":
|
226
|
+
case "onfocus":
|
227
|
+
case "onhelp":
|
228
|
+
case "onmousedown":
|
229
|
+
case "onmouseup":
|
230
|
+
case "onmouseover":
|
231
|
+
case "onmousemove":
|
232
|
+
case "onmouseout":
|
233
|
+
case "onkeypress":
|
234
|
+
case "onkeydown":
|
235
|
+
case "onkeyup":
|
236
|
+
case "onload":
|
237
|
+
case "onlosecapture":
|
238
|
+
case "onpropertychange":
|
239
|
+
case "onreadystatechange":
|
240
|
+
case "onrowsdelete":
|
241
|
+
case "onrowenter":
|
242
|
+
case "onrowexit":
|
243
|
+
case "onrowsinserted":
|
244
|
+
case "onstart":
|
245
|
+
case "onscroll":
|
246
|
+
case "onbeforeeditfocus":
|
247
|
+
case "onactivate":
|
248
|
+
case "onbeforedeactivate":
|
249
|
+
case "ondeactivate":
|
250
|
+
case "type":
|
251
|
+
case "codebase":
|
252
|
+
ret.objAttrs[args[i]] = args[i+1];
|
253
|
+
break;
|
254
|
+
case "id":
|
255
|
+
case "width":
|
256
|
+
case "height":
|
257
|
+
case "align":
|
258
|
+
case "vspace":
|
259
|
+
case "hspace":
|
260
|
+
case "class":
|
261
|
+
case "title":
|
262
|
+
case "accesskey":
|
263
|
+
case "name":
|
264
|
+
case "tabindex":
|
265
|
+
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
|
266
|
+
break;
|
267
|
+
default:
|
268
|
+
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
|
269
|
+
}
|
270
|
+
}
|
271
|
+
ret.objAttrs["classid"] = classid;
|
272
|
+
if (mimeType) ret.embedAttrs["type"] = mimeType;
|
273
|
+
return ret;
|
274
|
+
}
|
275
|
+
|
276
|
+
|