tidyflash 0.9.6 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Assets/TidyHome.ai +1162 -2
- data/Gemfile +4 -0
- data/Gemfile.lock +26 -0
- data/Manifest +32 -11
- data/README +27 -14
- data/Rakefile +3 -3
- data/bin/tidyflash +58 -8
- data/{lib/script/server → bin/tidyflash-server} +0 -0
- data/lib/{script → tidy}/bwlimit.rb +0 -0
- data/lib/tidy/compile.rb +9 -9
- data/lib/tidy/server.rb +11 -0
- data/lib/tidy/template_binding.rb +2 -0
- data/lib/tidy/version.rb +1 -1
- data/templates/eclipsify/eclipsify.rb +12 -0
- data/templates/project/Gemfile +3 -0
- data/templates/project/project.rb +13 -12
- data/templates/project/rakefile.rb +6 -4
- data/templates/project/src/app/helpers/Typography.as +1 -1
- data/templates/project/src/app/views/PreloaderView.as +1 -0
- data/templates/project/src/library/fonts/Fonts.as +40 -0
- data/templates/project/src/library/images/README.txt +11 -0
- data/{lib/tasks/deploy.rb → templates/project/tasks/deploy.rake} +0 -0
- data/templates/project/tasks/library.rake +33 -0
- data/templates/scaffold/scaffold.rb +1 -1
- data/templates/{swfobject → web}/bin/index.html +0 -0
- data/templates/{swfobject → web}/bin/js/swfobject.js +0 -0
- data/templates/web/web.rb +13 -0
- data/test/test_tidy_project.rb +42 -47
- data/tidyflash.gemspec +10 -20
- data/{bin/test_project.axml → tools/TidyHarness/bin/tidy_harness.axml} +8 -8
- data/tools/TidyHarness/bin/tidy_harness.swf +0 -0
- data/tools/TidyHarness/config/templates/air.axml.erb +19 -0
- data/tools/TidyHarness/rakefile.rb +37 -0
- data/tools/TidyHarness/script/fcsh/rakefile.rb +6 -0
- data/tools/TidyHarness/src/app/helpers/Colours.as +1 -0
- data/tools/TidyHarness/src/app/helpers/Debug.as +17 -0
- data/tools/TidyHarness/src/app/helpers/Style.as +20 -0
- data/tools/TidyHarness/src/app/helpers/Typography.as +71 -0
- data/tools/TidyHarness/src/app/models/App.as +21 -0
- data/tools/TidyHarness/src/app/models/FlashVars.as +1 -0
- data/tools/TidyHarness/src/app/views/MainView.as +55 -0
- data/tools/TidyHarness/src/app/views/PreloaderView.as +36 -0
- data/tools/TidyHarness/src/app/views/ViewBase.as +19 -0
- data/{templates/project → tools/TidyHarness}/src/assets/fonts/Fonts.as +1 -1
- data/{lib → tools/TidyHarness}/tasks/assets.rb +1 -1
- data/tools/TidyHarness/tasks/deploy.rb +21 -0
- metadata +60 -103
- data/lib/script/generate +0 -124
- data/lib/script/server.rb +0 -20
- data/templates/swfobject/swfobject.rb +0 -12
data/test/test_tidy_project.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "test/unit"
|
2
2
|
require "open3"
|
3
|
-
|
3
|
+
|
4
4
|
class TestTidyProject < Test::Unit::TestCase
|
5
5
|
TEST_PROJECT_NAME = "TestProject"
|
6
6
|
TEST_PROJECT_FILE_NAME = "test_project"
|
@@ -21,7 +21,7 @@ class TestTidyProject < Test::Unit::TestCase
|
|
21
21
|
def test_demo
|
22
22
|
in_project_folder do
|
23
23
|
Tidy::Compile.demo(:main=>'src/app/views/MainView.as',
|
24
|
-
|
24
|
+
:output=>TEST_PROJECT_FILE_NAME,
|
25
25
|
:version=> "0.1",
|
26
26
|
:vars=>{:isTouch=>true,
|
27
27
|
:variation=>0},
|
@@ -69,20 +69,21 @@ class TestTidyProject < Test::Unit::TestCase
|
|
69
69
|
File.delete AIR_CONFIG_FILE_PATH if File.exists? AIR_CONFIG_FILE_PATH
|
70
70
|
template_path = "config/templates/#{TEST_PROJECT_FILE_NAME}.axml.erb"
|
71
71
|
File.open(template_path, 'w') do |f|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
72
|
+
f << %{
|
73
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
74
|
+
<application xmlns="http://ns.adobe.com/air/application/1.0">
|
75
|
+
<id><%=@app_name.gsub(\" \", \"\")%></id>
|
76
|
+
<version><%=@version.chomp%></version>
|
77
|
+
<filename><%=@app_name%></filename>
|
78
|
+
<initialWindow>
|
79
|
+
<content><%=@content%></content>
|
80
|
+
<visible>true</visible>
|
81
|
+
<x>50</x><y>50</y>
|
82
|
+
<width><%=@width%></width>
|
83
|
+
<height><%=@height + 23%></height>
|
84
|
+
</initialWindow>
|
85
|
+
</application>
|
86
|
+
}
|
86
87
|
end
|
87
88
|
do_silent_rake()
|
88
89
|
assert File.exists?(AIR_CONFIG_FILE_PATH), "AXML config file should be auto-generated from custom template"
|
@@ -100,15 +101,23 @@ class TestTidyProject < Test::Unit::TestCase
|
|
100
101
|
Tidy::AirPackager.package(:id=>TEST_PROJECT_FILE_NAME, :do_not_launch=>true)
|
101
102
|
f = "config/air_cert.pfx";
|
102
103
|
assert File.exists?(f), "The certificate file should be created the first time the application is packaged"
|
103
|
-
content1 =
|
104
|
+
content1 = File.read(f)
|
104
105
|
Tidy::AirPackager.package(:id=>TEST_PROJECT_FILE_NAME, :do_not_launch=>true)
|
105
|
-
content2 =
|
106
|
+
content2 = File.read(f)
|
106
107
|
assert content1 == content2, "The certificate file shouldn't be recreated if already present"
|
107
108
|
f = "../releases/#{TEST_PROJECT_FILE_NAME}.air"
|
108
109
|
assert File.exists?(f), "The packaged file should be created in the releases folder"
|
109
110
|
end
|
110
111
|
end
|
111
112
|
|
113
|
+
def test_swf_creation
|
114
|
+
in_project_folder do
|
115
|
+
Tidy::Compile.swf(:main=>'src/app/views/MainView.as', :output=>TEST_PROJECT_FILE_NAME)
|
116
|
+
Tidy::Generate.new(:template_id=>'web', :args=>[TEST_PROJECT_FILE_NAME])
|
117
|
+
assert File.exists?("bin/#{TEST_PROJECT_FILE_NAME}.swf"), "Rake did not produce swf file"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
112
121
|
def do_silent_rake
|
113
122
|
Tidy::Compile.air(:main=>'src/app/views/MainView.as',
|
114
123
|
:output=>TEST_PROJECT_FILE_NAME,
|
@@ -117,14 +126,8 @@ class TestTidyProject < Test::Unit::TestCase
|
|
117
126
|
end
|
118
127
|
|
119
128
|
def get_file_line_from_index(file, index)
|
120
|
-
|
121
|
-
|
122
|
-
#puts "#{i}: #{line}"
|
123
|
-
if (i==index)
|
124
|
-
return line
|
125
|
-
end
|
126
|
-
i=i+1
|
127
|
-
end
|
129
|
+
|
130
|
+
File.readlines(file.path)[index].to_s
|
128
131
|
end
|
129
132
|
|
130
133
|
def file_contains_string?(file, string)
|
@@ -135,15 +138,7 @@ class TestTidyProject < Test::Unit::TestCase
|
|
135
138
|
end
|
136
139
|
return false
|
137
140
|
end
|
138
|
-
|
139
|
-
def get_file_as_string(filename)
|
140
|
-
data = ''
|
141
|
-
f = File.open(filename, "r")
|
142
|
-
f.each_line do |line|
|
143
|
-
data += line
|
144
|
-
end
|
145
|
-
return data
|
146
|
-
end
|
141
|
+
|
147
142
|
#def test_add_libs
|
148
143
|
# in_project_folder do
|
149
144
|
# assert File.exists?('script'), "No script folder"
|
@@ -177,18 +172,18 @@ class TestTidyProject < Test::Unit::TestCase
|
|
177
172
|
# assert File.exists?("bin/#{TEST_PROJECT_FILE_NAME}.swf"), "Rake did not produce swf file"
|
178
173
|
# end
|
179
174
|
#end
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
175
|
+
def test_rake
|
176
|
+
|
177
|
+
in_project_folder do
|
178
|
+
command = "rake --trace"
|
179
|
+
stdin, stdout, stderr = Open3.popen3(command)
|
180
|
+
stdout_text = stdout.read
|
181
|
+
stderr_text = stdout.read
|
182
|
+
puts "#{stdout_text}\n#{stderr_text}"
|
183
|
+
assert_no_match /rake aborted/, stderr_text
|
184
|
+
assert File.exists?("bin/#{TEST_PROJECT_FILE_NAME}.swf"), "Rake did not produce swf file"
|
185
|
+
end
|
186
|
+
end
|
192
187
|
|
193
188
|
private
|
194
189
|
def in_project_folder
|
data/tidyflash.gemspec
CHANGED
@@ -2,40 +2,30 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{tidyflash}
|
5
|
-
s.version = "0.9.
|
5
|
+
s.version = "0.9.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date = %q{2011-
|
8
|
+
s.authors = [%q{Michael Forrest}]
|
9
|
+
s.date = %q{2011-08-16}
|
10
10
|
s.description = %q{Tidy Flash - an ActionScript framework for people who love Ruby}
|
11
11
|
s.email = %q{mf@grimaceworks.com}
|
12
|
-
s.executables = [
|
13
|
-
s.extra_rdoc_files = [
|
14
|
-
s.files = [
|
12
|
+
s.executables = [%q{tidyflash}, %q{tidyflash-server}]
|
13
|
+
s.extra_rdoc_files = [%q{README}, %q{bin/tidyflash}, %q{bin/tidyflash-server}, %q{lib/tidy/air_packager.rb}, %q{lib/tidy/axml.rb}, %q{lib/tidy/bwlimit.rb}, %q{lib/tidy/compile.rb}, %q{lib/tidy/demo_config.rb}, %q{lib/tidy/generate.rb}, %q{lib/tidy/server.rb}, %q{lib/tidy/template.rb}, %q{lib/tidy/template_binding.rb}, %q{lib/tidy/templates/demo_config.as.erb}, %q{lib/tidy/version.rb}, %q{lib/tidy_project.rb}]
|
14
|
+
s.files = [%q{Assets/TidyHome.ai}, %q{Gemfile}, %q{Gemfile.lock}, %q{Manifest}, %q{README}, %q{Rakefile}, %q{bin/tidyflash}, %q{bin/tidyflash-server}, %q{lib/tidy/air_packager.rb}, %q{lib/tidy/axml.rb}, %q{lib/tidy/bwlimit.rb}, %q{lib/tidy/compile.rb}, %q{lib/tidy/demo_config.rb}, %q{lib/tidy/generate.rb}, %q{lib/tidy/server.rb}, %q{lib/tidy/template.rb}, %q{lib/tidy/template_binding.rb}, %q{lib/tidy/templates/demo_config.as.erb}, %q{lib/tidy/version.rb}, %q{lib/tidy_project.rb}, %q{templates/eclipsify/eclipsify.rb}, %q{templates/project/Gemfile}, %q{templates/project/config/templates/air.axml.erb}, %q{templates/project/project.rb}, %q{templates/project/rakefile.rb}, %q{templates/project/script/fcsh/rakefile.rb}, %q{templates/project/src/app/helpers/Colours.as}, %q{templates/project/src/app/helpers/Debug.as}, %q{templates/project/src/app/helpers/Style.as}, %q{templates/project/src/app/helpers/Typography.as}, %q{templates/project/src/app/models/App.as}, %q{templates/project/src/app/models/FlashVars.as}, %q{templates/project/src/app/views/MainView.as}, %q{templates/project/src/app/views/PreloaderView.as}, %q{templates/project/src/app/views/ViewBase.as}, %q{templates/project/src/library/fonts/Fonts.as}, %q{templates/project/src/library/images/README.txt}, %q{templates/project/tasks/deploy.rake}, %q{templates/project/tasks/library.rake}, %q{templates/scaffold/bin/xml/__model.xml}, %q{templates/scaffold/scaffold.rb}, %q{templates/scaffold/src/models/__Model.as}, %q{templates/scaffold/src/views/__model/__ModelDetailView.as}, %q{templates/scaffold/src/views/__model/__ModelListItemView.as}, %q{templates/scaffold/src/views/__model/__ModelListView.as}, %q{templates/web/bin/index.html}, %q{templates/web/bin/js/swfobject.js}, %q{templates/web/web.rb}, %q{test/test_tidy_project.rb}, %q{tools/TidyHarness/bin/tidy_harness.axml}, %q{tools/TidyHarness/bin/tidy_harness.swf}, %q{tools/TidyHarness/config/templates/air.axml.erb}, %q{tools/TidyHarness/rakefile.rb}, %q{tools/TidyHarness/script/fcsh/rakefile.rb}, %q{tools/TidyHarness/src/app/helpers/Colours.as}, %q{tools/TidyHarness/src/app/helpers/Debug.as}, %q{tools/TidyHarness/src/app/helpers/Style.as}, %q{tools/TidyHarness/src/app/helpers/Typography.as}, %q{tools/TidyHarness/src/app/models/App.as}, %q{tools/TidyHarness/src/app/models/FlashVars.as}, %q{tools/TidyHarness/src/app/views/MainView.as}, %q{tools/TidyHarness/src/app/views/PreloaderView.as}, %q{tools/TidyHarness/src/app/views/ViewBase.as}, %q{tools/TidyHarness/src/assets/fonts/Fonts.as}, %q{tools/TidyHarness/tasks/assets.rb}, %q{tools/TidyHarness/tasks/deploy.rb}, %q{tidyflash.gemspec}]
|
15
15
|
s.homepage = %q{http://github.com/michaelforrest/tidy}
|
16
|
-
s.rdoc_options = [
|
17
|
-
s.require_paths = [
|
16
|
+
s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Tidyflash}, %q{--main}, %q{README}]
|
17
|
+
s.require_paths = [%q{lib}]
|
18
18
|
s.rubyforge_project = %q{tidyflash}
|
19
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.8.6}
|
20
20
|
s.summary = %q{Tidy Flash - an ActionScript framework for people who love Ruby}
|
21
|
-
s.test_files = [
|
21
|
+
s.test_files = [%q{test/test_tidy_project.rb}]
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
24
|
s.specification_version = 3
|
26
25
|
|
27
26
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
28
|
-
s.add_runtime_dependency(%q<sprout>, [">= 0"])
|
29
|
-
s.add_runtime_dependency(%q<sprout-flex4sdk-tool>, [">= 0"])
|
30
|
-
s.add_runtime_dependency(%q<sprout-as3-bundle>, [">= 0"])
|
31
27
|
else
|
32
|
-
s.add_dependency(%q<sprout>, [">= 0"])
|
33
|
-
s.add_dependency(%q<sprout-flex4sdk-tool>, [">= 0"])
|
34
|
-
s.add_dependency(%q<sprout-as3-bundle>, [">= 0"])
|
35
28
|
end
|
36
29
|
else
|
37
|
-
s.add_dependency(%q<sprout>, [">= 0"])
|
38
|
-
s.add_dependency(%q<sprout-flex4sdk-tool>, [">= 0"])
|
39
|
-
s.add_dependency(%q<sprout-as3-bundle>, [">= 0"])
|
40
30
|
end
|
41
31
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<application xmlns="http://ns.adobe.com/air/application/1.5">
|
3
|
-
<id>
|
4
|
-
<version>1</version>
|
5
|
-
<filename>
|
3
|
+
<id>tidyharness</id>
|
4
|
+
<version>0.1</version>
|
5
|
+
<filename>tidyharness</filename>
|
6
6
|
<initialWindow>
|
7
|
-
<content>
|
7
|
+
<content>tidy_harness.swf</content>
|
8
8
|
<visible>true</visible>
|
9
|
-
<x>
|
10
|
-
|
11
|
-
<width>
|
12
|
-
<height>
|
9
|
+
<x>50</x>
|
10
|
+
<y>50</y>
|
11
|
+
<width>1024</width>
|
12
|
+
<height>791</height>
|
13
13
|
</initialWindow>
|
14
14
|
<!--
|
15
15
|
<icon>
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<application xmlns="http://ns.adobe.com/air/application/1.5">
|
3
|
+
<id><%=@app_name.gsub(" ", "")%></id>
|
4
|
+
<version><%=@version.chomp%></version>
|
5
|
+
<filename><%=@app_name%></filename>
|
6
|
+
<initialWindow>
|
7
|
+
<content><%=@content%></content>
|
8
|
+
<visible>true</visible>
|
9
|
+
<x>50</x>
|
10
|
+
<y>50</y>
|
11
|
+
<width><%=@width%></width>
|
12
|
+
<height><%=@height + 23%></height>
|
13
|
+
</initialWindow>
|
14
|
+
<!--
|
15
|
+
<icon>
|
16
|
+
<image128x128>icons/128x128/fubuntu_logo_128x128.png</image128x128>
|
17
|
+
</icon>
|
18
|
+
-->
|
19
|
+
</application>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'tidy/compile'
|
3
|
+
require 'tidy/air_packager'
|
4
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
5
|
+
#desc 'compile and run air app (needs a couple of extra files manually created so far)'
|
6
|
+
#task :air do |t|
|
7
|
+
# Compile.air :main=>"src/Fubuntu.as", :output=>"Fubuntu-air"
|
8
|
+
#end
|
9
|
+
|
10
|
+
desc 'Compile and run the test harness'
|
11
|
+
task :test do |t|
|
12
|
+
Compile.air :main=>"src/FubuntuRunner.as", :output=>"Fubuntu-test", :paths=>['test','lib/asunit3']
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Compile and run app'
|
16
|
+
task :app do
|
17
|
+
Tidy::Compile.air(:main=>'src/app/views/MainView.as',
|
18
|
+
:output=>"tidy_harness",
|
19
|
+
:version=> "0.1",
|
20
|
+
:width=>1024,
|
21
|
+
:height=>768,
|
22
|
+
:default_background_color=>"#FFFFFF")
|
23
|
+
|
24
|
+
end
|
25
|
+
task :package do
|
26
|
+
Tidy::AirPackager.package(:id=>"tidy_harness")
|
27
|
+
end
|
28
|
+
|
29
|
+
#desc "regression tester"
|
30
|
+
#regress :regress do |t|
|
31
|
+
# t.input = "features/RegressionTestView.as"
|
32
|
+
#end
|
33
|
+
|
34
|
+
|
35
|
+
# set up the default rake task
|
36
|
+
task :default => :app
|
37
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
package app.helpers{
|
@@ -0,0 +1,17 @@
|
|
1
|
+
package app.helpers {
|
2
|
+
import flash.display.Stage;
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @author michaelforrest
|
6
|
+
*/
|
7
|
+
public class Debug {
|
8
|
+
private static var show_invisible_fills : Boolean = false;
|
9
|
+
|
10
|
+
public static function init(stage : Stage) : void {
|
11
|
+
new Debug();
|
12
|
+
}
|
13
|
+
public static function showInvisibleFills() : Boolean {
|
14
|
+
return show_invisible_fills;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
package app.helpers
|
2
|
+
{
|
3
|
+
import tidy.mvc.view.PackableView;
|
4
|
+
/*
|
5
|
+
Example of some PackableView style parameters
|
6
|
+
*/
|
7
|
+
public class Style
|
8
|
+
{
|
9
|
+
public static var DEFAULT : Object = {
|
10
|
+
orientation: PackableView.VERTICAL, // elements can be stacked either horizontally or vertically
|
11
|
+
paddingLeft: 20, // appended elements will have this much space to the left
|
12
|
+
paddingTop: 20, // appended elements will have this much space above
|
13
|
+
spacing: 10, // this is the spacing between appended elements
|
14
|
+
columnWidth: 600, // this is the default text field width
|
15
|
+
maxWidth: 600, // in a horizontal layout, this is when the elements start to wrap
|
16
|
+
maxHeight: 800 // in a vertical layout, this is when the elements flow into a new column
|
17
|
+
|
18
|
+
};
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
|
2
|
+
package app.helpers {
|
3
|
+
import tidy.mvc.helper.TypographyBase;
|
4
|
+
import assets.fonts.Fonts;
|
5
|
+
// import
|
6
|
+
/**
|
7
|
+
* Generated with Tidy Flash
|
8
|
+
*/
|
9
|
+
public class Typography extends TypographyBase {
|
10
|
+
public function Typography(style:String) {
|
11
|
+
super(style);
|
12
|
+
}
|
13
|
+
public static function style( id: String) : TypographyBase{
|
14
|
+
return new Typography(id);
|
15
|
+
}
|
16
|
+
override protected function Defaults() : void {
|
17
|
+
super.Defaults();
|
18
|
+
embedFonts = false;
|
19
|
+
font = "_sans";
|
20
|
+
fontSize = 30;
|
21
|
+
/*
|
22
|
+
embedFonts = true;
|
23
|
+
font = Fonts.BITSTREAM_VERA_SANS;
|
24
|
+
verticalOffset = 0;
|
25
|
+
color = 0;
|
26
|
+
bold = false;
|
27
|
+
italic = false;
|
28
|
+
underline = false;
|
29
|
+
url = "";
|
30
|
+
target = "";
|
31
|
+
align = "left";
|
32
|
+
leftMargin = 0;
|
33
|
+
rightMargin = 0;
|
34
|
+
indent = 0;
|
35
|
+
leading = 0;
|
36
|
+
autoSize = "left";
|
37
|
+
background = false;
|
38
|
+
html = false;
|
39
|
+
wordWrap = true;
|
40
|
+
multiline = true;
|
41
|
+
condenseWhite = true;
|
42
|
+
border = false;
|
43
|
+
selectable = false;
|
44
|
+
embedFonts = true;
|
45
|
+
type = "dynamic";
|
46
|
+
antiAliasType = "normal";
|
47
|
+
gridFitType = "none";
|
48
|
+
thickness = 0;
|
49
|
+
maxChars;
|
50
|
+
sharpness = 0;
|
51
|
+
letterSpacing = 0;
|
52
|
+
kerning = false;
|
53
|
+
filters = [];
|
54
|
+
|
55
|
+
*/
|
56
|
+
}
|
57
|
+
/*
|
58
|
+
// USAGE:
|
59
|
+
// myViewBase.text("Text to show", "Heading1");
|
60
|
+
public function Heading1() : void{
|
61
|
+
|
62
|
+
}
|
63
|
+
*/
|
64
|
+
// USAGE:
|
65
|
+
// myViewBase.text("Text to show", "Paragraph");
|
66
|
+
public function Paragraph() : void{
|
67
|
+
|
68
|
+
}
|
69
|
+
|
70
|
+
}
|
71
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
package app.models {
|
2
|
+
import flash.events.Event;
|
3
|
+
|
4
|
+
import tidy.mvc.model.EventMapper;
|
5
|
+
/**
|
6
|
+
* Generated with Tidy Flash
|
7
|
+
*/
|
8
|
+
public class App extends EventMapper {
|
9
|
+
|
10
|
+
public static var READY : String = "ready";
|
11
|
+
public function dispatchReady() : void {dispatchEvent(new Event(READY));}
|
12
|
+
|
13
|
+
private static var instance : App;
|
14
|
+
public static function getInstance() : App {
|
15
|
+
if(!instance) instance = new App();
|
16
|
+
return instance;
|
17
|
+
}
|
18
|
+
public function App() {
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
package app.views {
|
2
|
+
import flash.display.StageAlign;
|
3
|
+
import flash.display.StageScaleMode;
|
4
|
+
import flash.events.Event;
|
5
|
+
import app.helpers.Style;
|
6
|
+
|
7
|
+
import flash.desktop.NativeApplication;
|
8
|
+
import flash.events.InvokeEvent;
|
9
|
+
import flash.html.HTMLLoader;
|
10
|
+
import flash.net.URLRequest;
|
11
|
+
/**
|
12
|
+
* Main Entry Point Class
|
13
|
+
* Generated with Tidy Flash
|
14
|
+
*/
|
15
|
+
[Frame(factoryClass="app.views.PreloaderView")]
|
16
|
+
public class MainView extends ViewBase {
|
17
|
+
private var htmlLoader : HTMLLoader;
|
18
|
+
|
19
|
+
public function MainView() {
|
20
|
+
super(Style.DEFAULT);
|
21
|
+
addHTML();
|
22
|
+
getCommandLineArguments();
|
23
|
+
}
|
24
|
+
|
25
|
+
private function onResize(event : Event) : void {
|
26
|
+
fitToStage();
|
27
|
+
}
|
28
|
+
|
29
|
+
private function fitToStage() : void {
|
30
|
+
htmlLoader.width = stage.stageWidth;
|
31
|
+
htmlLoader.height = stage.stageHeight;
|
32
|
+
}
|
33
|
+
|
34
|
+
override protected function onAddedToStage(event : Event) : void {
|
35
|
+
super.onAddedToStage(event);
|
36
|
+
stage.addEventListener(Event.RESIZE, onResize);
|
37
|
+
stage.scaleMode = StageScaleMode.NO_SCALE;
|
38
|
+
stage.align = StageAlign.TOP_LEFT;
|
39
|
+
fitToStage();
|
40
|
+
}
|
41
|
+
private function getCommandLineArguments() : void {
|
42
|
+
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
|
43
|
+
}
|
44
|
+
|
45
|
+
private function onInvoke(event : InvokeEvent) : void {
|
46
|
+
var url : String = event.arguments[0] || "http://google.com";
|
47
|
+
htmlLoader.load(new URLRequest(url));
|
48
|
+
}
|
49
|
+
|
50
|
+
private function addHTML() : void {
|
51
|
+
htmlLoader = new HTMLLoader();
|
52
|
+
addChild(htmlLoader);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
package app.views{
|
2
|
+
import flash.display.MovieClip;
|
3
|
+
import flash.display.DisplayObject;
|
4
|
+
import flash.events.Event;
|
5
|
+
import flash.utils.getDefinitionByName;
|
6
|
+
public class PreloaderView extends MovieClip{
|
7
|
+
|
8
|
+
public function PreloaderView() {
|
9
|
+
stop();
|
10
|
+
addEventListener(Event.ENTER_FRAME, onEnterFrame);
|
11
|
+
}
|
12
|
+
private function onEnterFrame(event : Event) : void {
|
13
|
+
showProgress();
|
14
|
+
if(framesLoaded == totalFrames) {
|
15
|
+
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
|
16
|
+
nextFrame();
|
17
|
+
init();
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
// customise this method to make your loader nicer.
|
22
|
+
private function showProgress() : void{
|
23
|
+
var percent : Number = root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal;
|
24
|
+
graphics.clear();
|
25
|
+
graphics.beginFill(0xCCCCCC);
|
26
|
+
graphics.drawRect(0,0,stage.stageWidth * percent, stage.stageHeight);
|
27
|
+
}
|
28
|
+
private function init() : void {
|
29
|
+
var mainClass : Class = Class(getDefinitionByName("app.views.MainView"));
|
30
|
+
if(mainClass) {
|
31
|
+
var app : Object = new mainClass();
|
32
|
+
addChild(app as DisplayObject);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
package app.views {
|
2
|
+
import flash.events.Event;
|
3
|
+
import tidy.mvc.view.PackableView;
|
4
|
+
import app.helpers.Typography;
|
5
|
+
/**
|
6
|
+
* @author michaelforrest
|
7
|
+
*/
|
8
|
+
public class ViewBase extends PackableView {
|
9
|
+
private static const IMPORTS : Array = [Typography];
|
10
|
+
public function ViewBase(options : Object = null) {
|
11
|
+
super(options);
|
12
|
+
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
|
13
|
+
}
|
14
|
+
|
15
|
+
protected function onAddedToStage(event : Event) : void {
|
16
|
+
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
desc "zip into ~/Public/ folder with current revision number"
|
3
|
+
task "zip" do
|
4
|
+
v = `bzr revno`.strip
|
5
|
+
cmd = "bzr export ~/Public/fubuntu-r#{v}.zip bin --root=Fubuntu-r#{v}"
|
6
|
+
puts cmd
|
7
|
+
puts exec cmd
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "package air app"
|
11
|
+
task :package do
|
12
|
+
Dir.chdir("bin") do
|
13
|
+
puts "adt -certificate -cn SelfSigned 1024-RSA air_cert.pfx password"
|
14
|
+
command = "adt -package -storetype pkcs12 -keystore ../config/air_cert.pfx Fubuntu.air air.axml Fubuntu-air.swf apps/ gadgets/ icons/ platforms/ system/"
|
15
|
+
puts command
|
16
|
+
puts `#{command}`
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
end
|