danieldkim-evergreen 0.4.0.5 → 0.4.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/evergreen/version.rb +1 -1
- data/lib/evergreen/version.rb~ +1 -1
- data/lib/jasmine/Gemfile +6 -0
- data/lib/jasmine/MIT.LICENSE +20 -0
- data/lib/jasmine/README.markdown +28 -0
- data/lib/jasmine/Rakefile +182 -0
- data/lib/jasmine/cruise_config.rb +21 -0
- data/lib/jasmine/example/SpecRunner.html +27 -0
- data/lib/jasmine/example/spec/PlayerSpec.js +58 -0
- data/lib/jasmine/example/spec/SpecHelper.js +9 -0
- data/lib/jasmine/example/src/Player.js +22 -0
- data/lib/jasmine/example/src/Song.js +7 -0
- data/lib/jasmine/images/fail-16.png +0 -0
- data/lib/jasmine/images/fail.png +0 -0
- data/lib/jasmine/images/go-16.png +0 -0
- data/lib/jasmine/images/go.png +0 -0
- data/lib/jasmine/images/pending-16.png +0 -0
- data/lib/jasmine/images/pending.png +0 -0
- data/lib/jasmine/images/question-bk.png +0 -0
- data/lib/jasmine/images/questionbk-16.png +0 -0
- data/lib/jasmine/images/spinner.gif +0 -0
- data/lib/jasmine/jsdoc-template/allclasses.tmpl +17 -0
- data/lib/jasmine/jsdoc-template/allfiles.tmpl +56 -0
- data/lib/jasmine/jsdoc-template/class.tmpl +646 -0
- data/lib/jasmine/jsdoc-template/index.tmpl +39 -0
- data/lib/jasmine/jsdoc-template/publish.js +184 -0
- data/lib/jasmine/jsdoc-template/static/default.css +162 -0
- data/lib/jasmine/jsdoc-template/static/header.html +2 -0
- data/lib/jasmine/jsdoc-template/static/index.html +19 -0
- data/lib/jasmine/jsdoc-template/symbol.tmpl +35 -0
- data/lib/jasmine/lib/jasmine-html.js +188 -0
- data/lib/jasmine/lib/jasmine.css +166 -0
- data/lib/jasmine/lib/jasmine.js +2421 -0
- data/lib/jasmine/lib/json2.js +478 -0
- data/lib/jasmine/spec/runner.html +80 -0
- data/lib/jasmine/spec/suites/BaseSpec.js +27 -0
- data/lib/jasmine/spec/suites/CustomMatchersSpec.js +97 -0
- data/lib/jasmine/spec/suites/EnvSpec.js +158 -0
- data/lib/jasmine/spec/suites/ExceptionsSpec.js +107 -0
- data/lib/jasmine/spec/suites/JsApiReporterSpec.js +103 -0
- data/lib/jasmine/spec/suites/MatchersSpec.js +795 -0
- data/lib/jasmine/spec/suites/MockClockSpec.js +38 -0
- data/lib/jasmine/spec/suites/MultiReporterSpec.js +45 -0
- data/lib/jasmine/spec/suites/NestedResultsSpec.js +54 -0
- data/lib/jasmine/spec/suites/PrettyPrintSpec.js +93 -0
- data/lib/jasmine/spec/suites/QueueSpec.js +23 -0
- data/lib/jasmine/spec/suites/ReporterSpec.js +56 -0
- data/lib/jasmine/spec/suites/RunnerSpec.js +267 -0
- data/lib/jasmine/spec/suites/SpecRunningSpec.js +1253 -0
- data/lib/jasmine/spec/suites/SpecSpec.js +124 -0
- data/lib/jasmine/spec/suites/SpySpec.js +201 -0
- data/lib/jasmine/spec/suites/SuiteSpec.js +120 -0
- data/lib/jasmine/spec/suites/TrivialReporterSpec.js +238 -0
- data/lib/jasmine/spec/suites/UtilSpec.js +40 -0
- data/lib/jasmine/spec/suites/WaitsForBlockSpec.js +87 -0
- data/lib/jasmine/src/Block.js +22 -0
- data/lib/jasmine/src/Env.js +264 -0
- data/lib/jasmine/src/JsApiReporter.js +102 -0
- data/lib/jasmine/src/Matchers.js +354 -0
- data/lib/jasmine/src/MultiReporter.js +35 -0
- data/lib/jasmine/src/NestedResults.js +80 -0
- data/lib/jasmine/src/PrettyPrinter.js +122 -0
- data/lib/jasmine/src/Queue.js +99 -0
- data/lib/jasmine/src/Reporter.js +31 -0
- data/lib/jasmine/src/Runner.js +77 -0
- data/lib/jasmine/src/Spec.js +242 -0
- data/lib/jasmine/src/Suite.js +82 -0
- data/lib/jasmine/src/WaitsBlock.js +13 -0
- data/lib/jasmine/src/WaitsForBlock.js +52 -0
- data/lib/jasmine/src/base.js +589 -0
- data/lib/jasmine/src/html/TrivialReporter.js +188 -0
- data/lib/jasmine/src/html/jasmine.css +166 -0
- data/lib/jasmine/src/mock-timeout.js +183 -0
- data/lib/jasmine/src/util.js +67 -0
- data/lib/jasmine/src/version.json +5 -0
- metadata +76 -3
data/lib/evergreen/version.rb
CHANGED
data/lib/evergreen/version.rb~
CHANGED
data/lib/jasmine/Gemfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008-2010 Pivotal Labs
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<a name="README">[Jasmine](http://pivotal.github.com/jasmine/)</a>
|
2
|
+
=======
|
3
|
+
**A JavaScript Testing Framework**
|
4
|
+
|
5
|
+
Want to use Jasmine in a project? Go HERE: [http://pivotal.github.com/jasmine/](http://pivotal.github.com/jasmine/)
|
6
|
+
|
7
|
+
Want to contribute to Jasmine? Read on...
|
8
|
+
|
9
|
+
<i>(More developer docs to come...)</i>
|
10
|
+
|
11
|
+
## Support
|
12
|
+
We now have a Google Group for support & discussion.
|
13
|
+
|
14
|
+
* Discussion: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js)
|
15
|
+
* Group email: [jasmine-js@googlegroups.com](jasmine-js@googlegroups.com)
|
16
|
+
* Current build status of Jasmine is visible at [ci.pivotallabs.com](http://ci.pivotallabs.com)
|
17
|
+
* Pivotal Tracker project: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606)
|
18
|
+
* Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD)
|
19
|
+
|
20
|
+
## Maintainers
|
21
|
+
* [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs
|
22
|
+
* [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs
|
23
|
+
* [Christian Williams](mailto:xian@pivotallabs.com), Pivotal Labs
|
24
|
+
|
25
|
+
## Developers
|
26
|
+
We welcome your contributions! Jasmine is currently maintained by Davis Frank ([infews](http://github.com/infews)), Rajan Agaskar ([ragaskar](http://github.com/ragaskar)), and Christian Williams ([Xian](http://github.com/Xian)). You can help us by removing all other recipients from your pull request.
|
27
|
+
|
28
|
+
Copyright (c) 2008-2010 Pivotal Labs. This software is licensed under the MIT License.
|
@@ -0,0 +1,182 @@
|
|
1
|
+
def jasmine_sources
|
2
|
+
sources = ["src/base.js", "src/util.js", "src/Env.js", "src/Reporter.js", "src/Block.js"]
|
3
|
+
sources += Dir.glob('src/*.js').reject { |f| f == 'src/base.js' || sources.include?(f) }.sort
|
4
|
+
sources
|
5
|
+
end
|
6
|
+
|
7
|
+
def jasmine_html_sources
|
8
|
+
["src/html/TrivialReporter.js"]
|
9
|
+
end
|
10
|
+
|
11
|
+
def jasmine_version
|
12
|
+
"#{version_hash['major']}.#{version_hash['minor']}.#{version_hash['build']}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def version_hash
|
16
|
+
require 'json'
|
17
|
+
@version ||= JSON.parse(File.new("src/version.json").read);
|
18
|
+
end
|
19
|
+
|
20
|
+
task :default => 'jasmine:dist'
|
21
|
+
|
22
|
+
def substitute_jasmine_version(filename)
|
23
|
+
contents = File.read(filename)
|
24
|
+
contents = contents.gsub(/##JASMINE_VERSION##/, (jasmine_version))
|
25
|
+
contents = contents.gsub(/[^\n]*REMOVE_THIS_LINE_FROM_BUILD[^\n]*/, '')
|
26
|
+
File.open(filename, 'w') { |f| f.write(contents) }
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :jasmine do
|
30
|
+
|
31
|
+
desc 'Prepares for distribution'
|
32
|
+
task :dist => ['jasmine:build', 'jasmine:doc', 'jasmine:build_example_project', 'jasmine:fill_index_downloads']
|
33
|
+
|
34
|
+
desc 'Check jasmine sources for coding problems'
|
35
|
+
task :lint do
|
36
|
+
passed = true
|
37
|
+
jasmine_sources.each do |src|
|
38
|
+
lines = File.read(src).split(/\n/)
|
39
|
+
lines.each_index do |i|
|
40
|
+
line = lines[i]
|
41
|
+
undefineds = line.scan(/.?undefined/)
|
42
|
+
if undefineds.include?(" undefined") || undefineds.include?("\tundefined")
|
43
|
+
puts "Dangerous undefined at #{src}:#{i}:\n > #{line}"
|
44
|
+
passed = false
|
45
|
+
end
|
46
|
+
|
47
|
+
if line.scan(/window/).length > 0
|
48
|
+
puts "Dangerous window at #{src}:#{i}:\n > #{line}"
|
49
|
+
passed = false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
unless passed
|
55
|
+
puts "Lint failed!"
|
56
|
+
exit 1
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
desc 'Builds lib/jasmine from source'
|
61
|
+
task :build => :lint do
|
62
|
+
puts 'Building Jasmine from source'
|
63
|
+
|
64
|
+
sources = jasmine_sources
|
65
|
+
version = version_hash
|
66
|
+
|
67
|
+
old_jasmine_files = Dir.glob('lib/jasmine*.js')
|
68
|
+
old_jasmine_files.each { |file| File.delete(file) }
|
69
|
+
|
70
|
+
File.open("lib/jasmine.js", 'w') do |jasmine|
|
71
|
+
sources.each do |source_filename|
|
72
|
+
jasmine.puts(File.read(source_filename))
|
73
|
+
end
|
74
|
+
|
75
|
+
jasmine.puts %{
|
76
|
+
jasmine.version_= {
|
77
|
+
"major": #{version['major'].to_json},
|
78
|
+
"minor": #{version['minor'].to_json},
|
79
|
+
"build": #{version['build'].to_json},
|
80
|
+
"revision": #{Time.now.to_i}
|
81
|
+
};
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
File.open("lib/jasmine-html.js", 'w') do |jasmine_html|
|
86
|
+
jasmine_html_sources.each do |source_filename|
|
87
|
+
jasmine_html.puts(File.read(source_filename))
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
FileUtils.cp("src/html/jasmine.css", "lib/jasmine.css")
|
92
|
+
end
|
93
|
+
|
94
|
+
downloads_file = 'pages/download.html.md'
|
95
|
+
task :need_pages_submodule do
|
96
|
+
unless File.exists?(downloads_file)
|
97
|
+
raise "Jasmine pages submodule isn't present. Run git submodule update --init"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
desc "Build jasmine documentation"
|
102
|
+
task :doc => :need_pages_submodule do
|
103
|
+
puts 'Creating Jasmine Documentation'
|
104
|
+
require 'rubygems'
|
105
|
+
require 'jsdoc_helper'
|
106
|
+
|
107
|
+
FileUtils.rm_r "pages/jsdoc", :force => true
|
108
|
+
|
109
|
+
JsdocHelper::Rake::Task.new(:lambda_jsdoc) do |t|
|
110
|
+
t[:files] = jasmine_sources << jasmine_html_sources
|
111
|
+
t[:options] = "-a"
|
112
|
+
t[:out] = "pages/jsdoc"
|
113
|
+
# JsdocHelper bug: template must be relative to the JsdocHelper gem, ick
|
114
|
+
t[:template] = File.join("../".*(100), Dir::getwd, "jsdoc-template")
|
115
|
+
end
|
116
|
+
Rake::Task[:lambda_jsdoc].invoke
|
117
|
+
end
|
118
|
+
|
119
|
+
desc "Build example project"
|
120
|
+
task :build_example_project => :need_pages_submodule do
|
121
|
+
require 'tmpdir'
|
122
|
+
|
123
|
+
temp_dir = File.join(Dir.tmpdir, 'jasmine-standalone-project')
|
124
|
+
puts "Building Example Project in #{temp_dir}"
|
125
|
+
FileUtils.rm_r temp_dir if File.exists?(temp_dir)
|
126
|
+
Dir.mkdir(temp_dir)
|
127
|
+
|
128
|
+
root = File.expand_path(File.dirname(__FILE__))
|
129
|
+
FileUtils.cp_r File.join(root, 'example/.'), File.join(temp_dir)
|
130
|
+
substitute_jasmine_version(File.join(temp_dir, "SpecRunner.html"))
|
131
|
+
|
132
|
+
lib_dir = File.join(temp_dir, "lib/jasmine-#{jasmine_version}")
|
133
|
+
FileUtils.mkdir_p(lib_dir)
|
134
|
+
{
|
135
|
+
"lib/jasmine.js" => "jasmine.js",
|
136
|
+
"lib/jasmine-html.js" => "jasmine-html.js",
|
137
|
+
"src/html/jasmine.css" => "jasmine.css",
|
138
|
+
"MIT.LICENSE" => "MIT.LICENSE"
|
139
|
+
}.each_pair do |src, dest|
|
140
|
+
FileUtils.cp(File.join(root, src), File.join(lib_dir, dest))
|
141
|
+
end
|
142
|
+
|
143
|
+
dist_dir = File.join(root, 'pages/downloads')
|
144
|
+
zip_file_name = File.join(dist_dir, "jasmine-standalone-#{jasmine_version}.zip")
|
145
|
+
puts "Zipping Example Project and moving to #{zip_file_name}"
|
146
|
+
FileUtils.mkdir(dist_dir) unless File.exist?(dist_dir)
|
147
|
+
if File.exist?(zip_file_name)
|
148
|
+
puts "WARNING!!! #{zip_file_name} already exists!"
|
149
|
+
FileUtils.rm(zip_file_name)
|
150
|
+
end
|
151
|
+
exec "cd #{temp_dir} && zip -r #{zip_file_name} . -x .[a-zA-Z0-9]*"
|
152
|
+
end
|
153
|
+
|
154
|
+
task :fill_index_downloads do
|
155
|
+
require 'digest/sha1'
|
156
|
+
|
157
|
+
download_html = "<!-- START_DOWNLOADS -->\n"
|
158
|
+
Dir.glob('pages/downloads/*.zip').sort.reverse.each do |f|
|
159
|
+
sha1 = Digest::SHA1.hexdigest File.read(f)
|
160
|
+
|
161
|
+
fn = f.sub(/^pages\//, '')
|
162
|
+
version = /jasmine-standalone-(.*).zip/.match(f)[1]
|
163
|
+
prerelease = /\.rc/.match(f)
|
164
|
+
download_html += prerelease ? "<tr class=\"rc\">\n" : "<tr>\n"
|
165
|
+
download_html += " <td class=\"link\"><a href=\"#{fn}\">#{fn.sub(/downloads\//, '')}</a></td>\n"
|
166
|
+
download_html += " <td class=\"version\">#{version}</td>\n"
|
167
|
+
download_html += " <td class=\"size\">#{File.size(f) / 1024}k</td>\n"
|
168
|
+
download_html += " <td class=\"date\">#{File.mtime(f).strftime("%Y/%m/%d %H:%M:%S %Z")}</td>\n"
|
169
|
+
download_html += " <td class=\"sha\">#{sha1}</td>\n"
|
170
|
+
download_html += "</tr>\n"
|
171
|
+
end
|
172
|
+
download_html += "<!-- END_DOWNLOADS -->"
|
173
|
+
|
174
|
+
downloads_page = File.read(downloads_file)
|
175
|
+
matcher = /<!-- START_DOWNLOADS -->.*<!-- END_DOWNLOADS -->/m
|
176
|
+
downloads_page = downloads_page.sub(matcher, download_html)
|
177
|
+
File.open(downloads_file, 'w') {|f| f.write(downloads_page)}
|
178
|
+
puts "rewrote that file"
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
task :jasmine => ['jasmine:dist']
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Project-specific configuration for CruiseControl.rb
|
2
|
+
Project.configure do |project|
|
3
|
+
|
4
|
+
# Send email notifications about broken and fixed builds to email1@your.site, email2@your.site (default: send to nobody)
|
5
|
+
# project.email_notifier.emails = ['email1@your.site', 'email2@your.site']
|
6
|
+
|
7
|
+
# Set email 'from' field to john@doe.com:
|
8
|
+
# project.email_notifier.from = 'john@doe.com'
|
9
|
+
|
10
|
+
# Build the project by invoking rake task 'custom'
|
11
|
+
project.rake_task = 'jasmine:test:ci:saucelabs'
|
12
|
+
|
13
|
+
# Build the project by invoking shell script "build_my_app.sh". Keep in mind that when the script is invoked,
|
14
|
+
# current working directory is <em>[cruise data]</em>/projects/your_project/work, so if you do not keep build_my_app.sh
|
15
|
+
# in version control, it should be '../build_my_app.sh' instead
|
16
|
+
#project.build_command = 'cp ../saucelabs.yml .'
|
17
|
+
|
18
|
+
# Ping Subversion for new revisions every 5 minutes (default: 30 seconds)
|
19
|
+
# project.scheduler.polling_interval = 5.minutes
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/html4/loose.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>Jasmine Test Runner</title>
|
6
|
+
<link rel="stylesheet" type="text/css" href="lib/jasmine-##JASMINE_VERSION##/jasmine.css">
|
7
|
+
<script type="text/javascript" src="lib/jasmine-##JASMINE_VERSION##/jasmine.js"></script>
|
8
|
+
<script type="text/javascript" src="lib/jasmine-##JASMINE_VERSION##/jasmine-html.js"></script>
|
9
|
+
|
10
|
+
<!-- include source files here... -->
|
11
|
+
<script type="text/javascript" src="src/Player.js"></script>
|
12
|
+
<script type="text/javascript" src="src/Song.js"></script>
|
13
|
+
|
14
|
+
<!-- include spec files here... -->
|
15
|
+
<script type="text/javascript" src="spec/SpecHelper.js"></script>
|
16
|
+
<script type="text/javascript" src="spec/PlayerSpec.js"></script>
|
17
|
+
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
<div id="REMOVE_THIS_LINE_FROM_BUILD"><p>You must be trying to look at examples in the Jasmine source tree.</p><p>Please download a distribution version of Jasmine at <a href="http://pivotal.github.com/jasmine/">http://pivotal.github.com/jasmine/</a>.</p></div>
|
21
|
+
<script type="text/javascript">
|
22
|
+
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
|
23
|
+
jasmine.getEnv().execute();
|
24
|
+
</script>
|
25
|
+
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
describe("Player", function() {
|
2
|
+
var player;
|
3
|
+
var song;
|
4
|
+
|
5
|
+
beforeEach(function() {
|
6
|
+
player = new Player();
|
7
|
+
song = new Song();
|
8
|
+
});
|
9
|
+
|
10
|
+
it("should be able to play a Song", function() {
|
11
|
+
player.play(song);
|
12
|
+
expect(player.currentlyPlayingSong).toEqual(song);
|
13
|
+
|
14
|
+
//demonstrates use of custom matcher
|
15
|
+
expect(player).toBePlaying(song);
|
16
|
+
});
|
17
|
+
|
18
|
+
describe("when song has been paused", function() {
|
19
|
+
beforeEach(function() {
|
20
|
+
player.play(song);
|
21
|
+
player.pause();
|
22
|
+
});
|
23
|
+
|
24
|
+
it("should indicate that the song is currently paused", function() {
|
25
|
+
expect(player.isPlaying).toBeFalsy();
|
26
|
+
|
27
|
+
// demonstrates use of 'not' with a custom matcher
|
28
|
+
expect(player).not.toBePlaying(song);
|
29
|
+
});
|
30
|
+
|
31
|
+
it("should be possible to resume", function() {
|
32
|
+
player.resume();
|
33
|
+
expect(player.isPlaying).toBeTruthy();
|
34
|
+
expect(player.currentlyPlayingSong).toEqual(song);
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
// demonstrates use of spies to intercept and test method calls
|
39
|
+
it("tells the current song if the user has made it a favorite", function() {
|
40
|
+
spyOn(song, 'persistFavoriteStatus');
|
41
|
+
|
42
|
+
player.play(song);
|
43
|
+
player.makeFavorite();
|
44
|
+
|
45
|
+
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
|
46
|
+
});
|
47
|
+
|
48
|
+
//demonstrates use of expected exceptions
|
49
|
+
describe("#resume", function() {
|
50
|
+
it("should throw an exception if song is already playing", function() {
|
51
|
+
player.play(song);
|
52
|
+
|
53
|
+
expect(function() {
|
54
|
+
player.resume();
|
55
|
+
}).toThrow("song is already playing");
|
56
|
+
});
|
57
|
+
});
|
58
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
function Player() {
|
2
|
+
}
|
3
|
+
Player.prototype.play = function(song) {
|
4
|
+
this.currentlyPlayingSong = song;
|
5
|
+
this.isPlaying = true;
|
6
|
+
};
|
7
|
+
|
8
|
+
Player.prototype.pause = function() {
|
9
|
+
this.isPlaying = false;
|
10
|
+
};
|
11
|
+
|
12
|
+
Player.prototype.resume = function() {
|
13
|
+
if (this.isPlaying) {
|
14
|
+
throw new Error("song is already playing");
|
15
|
+
}
|
16
|
+
|
17
|
+
this.isPlaying = true;
|
18
|
+
};
|
19
|
+
|
20
|
+
Player.prototype.makeFavorite = function() {
|
21
|
+
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
22
|
+
};
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div align="center">{+new Link().toFile("index.html").withText("Class Index")+}
|
2
|
+
| {+new Link().toFile("files.html").withText("File Index")+}</div>
|
3
|
+
<hr />
|
4
|
+
<h2>Classes</h2>
|
5
|
+
<ul class="classList">
|
6
|
+
<for each="thisClass" in="data">
|
7
|
+
<li>{!
|
8
|
+
if (thisClass.alias == "_global_") {
|
9
|
+
output += "<i>"+new Link().toClass(thisClass.alias)+"</i>";
|
10
|
+
}
|
11
|
+
else {
|
12
|
+
output += new Link().toClass(thisClass.alias);
|
13
|
+
}
|
14
|
+
!}</li>
|
15
|
+
</for>
|
16
|
+
</ul>
|
17
|
+
<hr />
|